/* * Copyright 2005 Joe Walker * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jsx3.gui; import org.directwebremoting.ScriptBuffer; import org.directwebremoting.ScriptSessions; import org.directwebremoting.io.Context; /** * The JSX version of a standard GUI select box. XML drives the contents of the select box. This class requires a CDF data source. The supported CDF attributes are: jsxid � the required unique record id. jsxtext � the text to display in the select box for the record. jsxtip � the tip to show when the mouse hovers over the record. jsxstyle � the CSS style to apply to the record. jsximg � a relative path to an image (16x16) to display to the left of @jsxtext. * @author Joe Walker [joe at getahead dot org] * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator */ public class Select extends jsx3.gui.Block { /** * All reverse ajax proxies need context to work from * @param context The script that got us to where we are now */ public Select(Context context, String extension) { super(context, extension); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, int vntLeft, int vntTop, int vntWidth, int vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, int vntLeft, int vntTop, String vntWidth, int vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, int vntLeft, String vntTop, String vntWidth, String vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, String vntLeft, String vntTop, String vntWidth, String vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, String vntLeft, int vntTop, String vntWidth, String vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, String vntLeft, int vntTop, int vntWidth, String vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, String vntLeft, String vntTop, int vntWidth, String vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, int vntLeft, String vntTop, String vntWidth, int vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, int vntLeft, String vntTop, int vntWidth, String vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, String vntLeft, int vntTop, String vntWidth, int vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, int vntLeft, int vntTop, int vntWidth, String vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, int vntLeft, int vntTop, String vntWidth, String vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, int vntLeft, String vntTop, int vntWidth, int vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, String vntLeft, String vntTop, String vntWidth, int vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, String vntLeft, String vntTop, int vntWidth, int vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The instance initializer. * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted */ public Select(String strName, String vntLeft, int vntTop, int vntWidth, int vntHeight, String strSelectedValue) { super((Context) null, (String) null); ScriptBuffer script = new ScriptBuffer(); script.appendCall("new Select", strName, vntLeft, vntTop, vntWidth, vntHeight, strSelectedValue); setInitScript(script); } /** * The URL of the default XSL template of a normal select box. */ public static final String DEFAULTXSLURL = null; /** * The URL of the arrow image. */ public static final String ARROWICON = null; /** * The URL of the mouse over background image. */ public static final String OVERIMAGE = null; /** * The URL of the selected background image. */ public static final String SELECTEDIMAGE = null; /** * Value of the type field indicating a normal select box. */ public static final int TYPESELECT = 0; /** * Value of the type field indicating a combo select box. */ public static final int TYPECOMBO = 1; /** * The number of milliseconds of delay for the combo typeahead function. */ public static final int TYPEAHEADDELAY = 250; /** * jsx30select_select */ public static final String DEFAULTCLASSNAME = "jsx30select_select"; /** * Returns the XSL appropriate to the select type (either combo or select) if no custom XSLT is specified. * @return jsx3.xml.Document instance */ public jsx3.xml.CdfDocument getXSL() { String extension = "getXSL()."; try { java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.CdfDocument.class.getName()); } } /** * Returns the XSL appropriate to the select type (either combo or select) if no custom XSLT is specified. * @param returnType The expected return type * @return jsx3.xml.Document instance */ public <T> T getXSL(Class<T> returnType) { String extension = "getXSL()."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Returns STATEVALID if this select box is not required or if it is required and its value is not empty. If this select is of type combo then any value other than an empty string is valid, otherwise only values corresponding to an actual CDF record of this select are valid. * @param callback <code>jsx3.gui.Form.STATEVALID</code> or <code>jsx3.gui.Form.STATEINVALID</code>. */ public void doValidate(org.directwebremoting.ui.Callback<Integer> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "doValidate"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, Integer.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns the type of this select box. * @param callback <code>TYPESELECT</code> or <code>TYPECOMBO</code>. */ public void getType(org.directwebremoting.ui.Callback<Integer> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getType"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, Integer.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Sets the type of this select box. * @param TYPE <code>TYPESELECT</code> or <code>TYPECOMBO</code>. * @return this object. */ public jsx3.gui.Select setType(int TYPE) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "setType", TYPE); ScriptSessions.addScript(script); return this; } /** * Returns the text to display in this select box if the value of this select box is null. If no value has been explicitly set with setDefaultText() a value appropriate to the server locale is returned. */ public void getDefaultText(org.directwebremoting.ui.Callback<String> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getDefaultText"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, String.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Sets the text to display in this select box if the value of this select box is null. * @param strDefaultText any valid string. HTML markup is allowed, but may cause unpredicatable effects. * @return this object. */ public jsx3.gui.Select setDefaultText(String strDefaultText) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "setDefaultText", strDefaultText); ScriptSessions.addScript(script); return this; } /** * Displays the list of options for this select box. */ public void show() { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "show"); ScriptSessions.addScript(script); } /** * Hides the drop-down portion of this select control. * @param bFocus if <code>true</code>, the form control will be focused after hiding the drop-down. */ public void hide(boolean bFocus) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "hide", bFocus); ScriptSessions.addScript(script); } /** * Sets the selected record of this select control. Fires the SELECT event only under the deprecated 3.0 model event protocol. * @param strRecordId id for the record that will be the selected item. * @return this object. */ public jsx3.gui.Select setValue(String strRecordId) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "setValue", strRecordId); ScriptSessions.addScript(script); return this; } /** * Returns the value of this select box. The value is the jsxid attribute of the selected CDF record. * @param callback the value or <code>null</code> if no record is selected. */ public void getValue(org.directwebremoting.ui.Callback<String> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getValue"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, String.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Redraws one record from the CDF data source of this select box. If strRecordId is equal to the selected record id, the text of this select box is set to the value of the record's jsxtext attribute. * @param strRecordId the id of the record that will be redrawn. * @param intAction <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>. * @return this object. */ public jsx3.gui.Select redrawRecord(String strRecordId, int intAction) { String extension = "redrawRecord(\"" + strRecordId + "\", \"" + intAction + "\")."; try { java.lang.reflect.Constructor<jsx3.gui.Select> ctor = jsx3.gui.Select.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.gui.Select.class.getName()); } } /** * Returns the maximum length allowed for the input field of this combo control. This setting only has meaning if this control is of type TYPECOMBO. */ public void getMaxLength(org.directwebremoting.ui.Callback<Integer> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getMaxLength"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, Integer.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Sets the maximum length allowed for the input field of this combo control. * @param intMaxLength * @return this object. */ public jsx3.gui.Select setMaxLength(int intMaxLength) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "setMaxLength", intMaxLength); ScriptSessions.addScript(script); return this; } /** * Binds the given key sequence to a callback function. Any object that has a key binding (specified with setKeyBinding()) will call this method when painted to register the key sequence with an appropriate ancestor of this form control. Any key down event that bubbles up to the ancestor without being intercepted and matches the given key sequence will invoke the given callback function. As of 3.2: The hot key will be registered with the first ancestor found that is either a jsx3.gui.Window, a jsx3.gui.Dialog, or the root block of a jsx3.app.Server. * @param fctCallback JavaScript function to execute when the given sequence is keyed by the user. * @param strKeys a plus-delimited ('+') key sequence such as <code>ctrl+s</code> or <code>ctrl+shift+alt+h</code> or <code>shift+a</code>, etc. Any combination of shift, ctrl, and alt are supported, including none. Also supported as the final token are <code>enter</code>, <code>esc</code>, <code>tab</code>, <code>del</code>, and <code>space</code>. To specify the final token as a key code, the last token can be the key code contained in brackets, <code>[13]</code>. * @return the registered hot key. */ public jsx3.gui.HotKey doKeyBinding(org.directwebremoting.ui.CodeBlock fctCallback, String strKeys) { String extension = "doKeyBinding(\"" + fctCallback + "\", \"" + strKeys + "\")."; try { java.lang.reflect.Constructor<jsx3.gui.HotKey> ctor = jsx3.gui.HotKey.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.gui.HotKey.class.getName()); } } /** * Resets the validation state of this control. * @return this object. */ public jsx3.gui.Form doReset() { String extension = "doReset()."; try { java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.gui.Form.class.getName()); } } /** * Resets the validation state of this control. * @param returnType The expected return type * @return this object. */ public <T> T doReset(Class<T> returnType) { String extension = "doReset()."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Returns the background color of this control when it is disabled. * @param callback valid CSS property value, (i.e., red, #ff0000) */ public void getDisabledBackgroundColor(org.directwebremoting.ui.Callback<String> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getDisabledBackgroundColor"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, String.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns the font color to use when this control is disabled. * @param callback valid CSS property value, (i.e., red, #ff0000) */ public void getDisabledColor(org.directwebremoting.ui.Callback<String> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getDisabledColor"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, String.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns the state for the form field control. If no enabled state is set, this method returns STATEENABLED. * @param callback <code>STATEDISABLED</code> or <code>STATEENABLED</code>. */ public void getEnabled(org.directwebremoting.ui.Callback<Integer> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getEnabled"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, Integer.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns the key binding that when keyed will fire the execute event for this control. * @param callback plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc */ public void getKeyBinding(org.directwebremoting.ui.Callback<String> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getKeyBinding"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, String.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns whether or not this control is required. If the required property has never been set, this method returns OPTIONAL. * @param callback <code>REQUIRED</code> or <code>OPTIONAL</code>. */ public void getRequired(org.directwebremoting.ui.Callback<Integer> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getRequired"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, Integer.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns the validation state of this control. If the validationState property has never been set, this method returns STATEVALID. * @param callback <code>STATEINVALID</code> or <code>STATEVALID</code>. */ public void getValidationState(org.directwebremoting.ui.Callback<Integer> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getValidationState"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, Integer.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Sets the background color of this form control when it is disabled. * @param strColor valid CSS property value, (i.e., red, #ff0000) * @return this object. */ public jsx3.gui.Form setDisabledBackgroundColor(String strColor) { String extension = "setDisabledBackgroundColor(\"" + strColor + "\")."; try { java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.gui.Form.class.getName()); } } /** * Sets the background color of this form control when it is disabled. * @param strColor valid CSS property value, (i.e., red, #ff0000) * @param returnType The expected return type * @return this object. */ public <T> T setDisabledBackgroundColor(String strColor, Class<T> returnType) { String extension = "setDisabledBackgroundColor(\"" + strColor + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Sets the font color to use when this control is disabled. * @param strColor valid CSS property value, (i.e., red, #ff0000) * @return this object. */ public jsx3.gui.Form setDisabledColor(String strColor) { String extension = "setDisabledColor(\"" + strColor + "\")."; try { java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.gui.Form.class.getName()); } } /** * Sets the font color to use when this control is disabled. * @param strColor valid CSS property value, (i.e., red, #ff0000) * @param returnType The expected return type * @return this object. */ public <T> T setDisabledColor(String strColor, Class<T> returnType) { String extension = "setDisabledColor(\"" + strColor + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Sets whether this control is enabled. Disabled controls do not respond to user interaction. * @param intEnabled <code>STATEDISABLED</code> or <code>STATEENABLED</code>. <code>null</code> is equivalent to <code>STATEENABLED</code>. * @param bRepaint if <code>true</code> this control is immediately repainted to reflect the new setting. */ public void setEnabled(int intEnabled, boolean bRepaint) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "setEnabled", intEnabled, bRepaint); ScriptSessions.addScript(script); } /** * Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE) event for this control. * @param strSequence plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc * @return this object. */ public jsx3.gui.Form setKeyBinding(String strSequence) { String extension = "setKeyBinding(\"" + strSequence + "\")."; try { java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.gui.Form.class.getName()); } } /** * Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE) event for this control. * @param strSequence plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc * @param returnType The expected return type * @return this object. */ public <T> T setKeyBinding(String strSequence, Class<T> returnType) { String extension = "setKeyBinding(\"" + strSequence + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Sets whether or not this control is required. * @param required {int} <code>REQUIRED</code> or <code>OPTIONAL</code>. * @return this object. */ public jsx3.gui.Form setRequired(int required) { String extension = "setRequired(\"" + required + "\")."; try { java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.gui.Form.class.getName()); } } /** * Sets whether or not this control is required. * @param required {int} <code>REQUIRED</code> or <code>OPTIONAL</code>. * @param returnType The expected return type * @return this object. */ public <T> T setRequired(int required, Class<T> returnType) { String extension = "setRequired(\"" + required + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Sets the validation state of this control. The validation state of a control is not serialized. * @param intState <code>STATEINVALID</code> or <code>STATEVALID</code>. * @return this object. */ public jsx3.gui.Form setValidationState(int intState) { String extension = "setValidationState(\"" + intState + "\")."; try { java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.gui.Form.class.getName()); } } /** * Sets the validation state of this control. The validation state of a control is not serialized. * @param intState <code>STATEINVALID</code> or <code>STATEVALID</code>. * @param returnType The expected return type * @return this object. */ public <T> T setValidationState(int intState, Class<T> returnType) { String extension = "setValidationState(\"" + intState + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Resets the XML source document stored in the server cache under the XML ID of this object to an empty CDF document. */ public void clearXmlData() { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "clearXmlData"); ScriptSessions.addScript(script); } /** * Returns whether this object removes its XML and XSL source documents from the cache of its server when it is destroyed. * @param callback <code>CLEANUPRESOURCES</code> or <code>SHARERESOURCES</code>. */ public void getShareResources(org.directwebremoting.ui.Callback<Integer> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getShareResources"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, Integer.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns the XML source document of this object. The XML document is determined by the following steps: If an XML document exists in the server cache under an ID equal to the XML ID of this object, that document is returned. If the XML string of this object is not empty, a new document is created by parsing this string. If the XML URL of this object is not empty, a new document is created by parsing the file at the location specified by the URL resolved against the server owning this object. Otherwise, an empty CDF document is returned. If a new document is created for this object (any of the steps listed above except for the first one), the following actions are also taken: If creating the document resulted in an error (XML parsing error, file not found error, etc) the offending document is returned immediately. Otherwise, setSourceXML is called on this object, passing in the created document. */ public jsx3.xml.CdfDocument getXML() { String extension = "getXML()."; try { java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.CdfDocument.class.getName()); } } /** * Returns the XML source document of this object. The XML document is determined by the following steps: If an XML document exists in the server cache under an ID equal to the XML ID of this object, that document is returned. If the XML string of this object is not empty, a new document is created by parsing this string. If the XML URL of this object is not empty, a new document is created by parsing the file at the location specified by the URL resolved against the server owning this object. Otherwise, an empty CDF document is returned. If a new document is created for this object (any of the steps listed above except for the first one), the following actions are also taken: If creating the document resulted in an error (XML parsing error, file not found error, etc) the offending document is returned immediately. Otherwise, setSourceXML is called on this object, passing in the created document. * @param returnType The expected return type */ public <T> T getXML(Class<T> returnType) { String extension = "getXML()."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Returns the XML ID of this object. * @param callback the XML ID. */ public void getXMLId(org.directwebremoting.ui.Callback<String> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getXMLId"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, String.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns the XML string of this object. */ public void getXMLString(org.directwebremoting.ui.Callback<String> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getXMLString"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, String.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns the list of XML transformers of this object. */ public void getXMLTransformers(org.directwebremoting.ui.Callback<Object[]> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getXMLTransformers"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, Object[].class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns the XML URL of this object. */ public void getXMLURL(org.directwebremoting.ui.Callback<String> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getXMLURL"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, String.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns the XSL ID of this object. */ public void getXSLId(org.directwebremoting.ui.Callback<String> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getXSLId"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, String.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns a map containing all the parameters to pass to the XSL stylesheet during transformation. */ public jsx3.lang.Object getXSLParams() { String extension = "getXSLParams()."; try { java.lang.reflect.Constructor<jsx3.lang.Object> ctor = jsx3.lang.Object.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.lang.Object.class.getName()); } } /** * Returns a map containing all the parameters to pass to the XSL stylesheet during transformation. * @param returnType The expected return type */ public <T> T getXSLParams(Class<T> returnType) { String extension = "getXSLParams()."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Returns whether the XML data source of this object is loaded asynchronously. * @param callback <code>0</code> or <code>1</code>. */ public void getXmlAsync(org.directwebremoting.ui.Callback<Integer> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getXmlAsync"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, Integer.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Returns whether this object is bound to the XML document stored in the data cache. * @param callback <code>0</code> or <code>1</code>. */ public void getXmlBind(org.directwebremoting.ui.Callback<Integer> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "getXmlBind"); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, Integer.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * This method is called in two situations: When the datasource of this object finishes loading (success, error, or timeout), if the xmlAsync property of this object is true, its datasource is specified as an XML URL, and the first time doTransform() was called the datasource was still loading. Any time the value stored in the server XML cache under the key equal to the XML Id of this object changes, if the xmlBind property of this object is true. Any methods overriding this method should begin with a call to jsxsupermix(). * @param objEvent the event published by the cache. */ public void onXmlBinding(jsx3.lang.Object objEvent) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "onXmlBinding", objEvent); ScriptSessions.addScript(script); } /** * Removes a parameter from the list of parameters to pass to the XSL stylesheet during transformation. * @param strName the name of the XSL parameter to remove. * @return this object. */ public jsx3.xml.Cacheable removeXSLParam(String strName) { String extension = "removeXSLParam(\"" + strName + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Cacheable.class.getName()); } } /** * Removes a parameter from the list of parameters to pass to the XSL stylesheet during transformation. * @param strName the name of the XSL parameter to remove. * @param returnType The expected return type * @return this object. */ public <T> T removeXSLParam(String strName, Class<T> returnType) { String extension = "removeXSLParam(\"" + strName + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Removes all parameters from the list of parameters to pass to the XSL stylesheet during transformation. * @return this object. */ public jsx3.xml.Cacheable removeXSLParams() { String extension = "removeXSLParams()."; try { java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Cacheable.class.getName()); } } /** * Removes all parameters from the list of parameters to pass to the XSL stylesheet during transformation. * @param returnType The expected return type * @return this object. */ public <T> T removeXSLParams(Class<T> returnType) { String extension = "removeXSLParams()."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Removes the XML and XSL source documents from the server cache. * @param objServer the server owning the cache to modify. This is a required argument only if <code>this.getServer()</code> does not returns a server instance. */ public void resetCacheData(jsx3.app.Server objServer) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "resetCacheData", objServer); ScriptSessions.addScript(script); } /** * Removes the XML source document stored under the XML ID of this object from the server cache. * @param objServer the server owning the cache to modify. This is a required argument only if <code>this.getServer()</code> does not returns a server instance. */ public void resetXmlCacheData(jsx3.app.Server objServer) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "resetXmlCacheData", objServer); ScriptSessions.addScript(script); } /** * Sets whether this object removes its XML and XSL source documents from the cache of its server when it is destroyed. * @param intShare <code>CLEANUPRESOURCES</code> or <code>SHARERESOURCES</code>. <code>CLEANUPRESOURCES</code> is the default value if the property is <code>null</code>. * @return this object. */ public jsx3.xml.Cacheable setShareResources(int intShare) { String extension = "setShareResources(\"" + intShare + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Cacheable.class.getName()); } } /** * Sets whether this object removes its XML and XSL source documents from the cache of its server when it is destroyed. * @param intShare <code>CLEANUPRESOURCES</code> or <code>SHARERESOURCES</code>. <code>CLEANUPRESOURCES</code> is the default value if the property is <code>null</code>. * @param returnType The expected return type * @return this object. */ public <T> T setShareResources(int intShare, Class<T> returnType) { String extension = "setShareResources(\"" + intShare + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Sets the source document of this object as though objDoc were retrieved from the XML URL or XML string of this object. This method executes the following steps: The document is transformed serially by each XML transformers of this object. The XML document is saved in the server cache under the XML ID of this object. If this object is an instance of jsx3.xml.CDF and the root node is a <data> element and its jsxassignids attribute is equal to 1, all <record> elements without a jsxid attribute are assigned a unique jsxid. If this object is an instance of jsx3.xml.CDF, convertProperties() is called on this object. * @param objDoc * @param objCache * @return the document stored in the server cache as the data source of this object. If transformers were run, this value will not be equal to the <code>objDoc</code> parameter. */ public jsx3.xml.CdfDocument setSourceXML(jsx3.xml.CdfDocument objDoc, jsx3.app.Cache objCache) { String extension = "setSourceXML(\"" + objDoc + "\", \"" + objCache + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.CdfDocument.class.getName()); } } /** * Sets the source document of this object as though objDoc were retrieved from the XML URL or XML string of this object. This method executes the following steps: The document is transformed serially by each XML transformers of this object. The XML document is saved in the server cache under the XML ID of this object. If this object is an instance of jsx3.xml.CDF and the root node is a <data> element and its jsxassignids attribute is equal to 1, all <record> elements without a jsxid attribute are assigned a unique jsxid. If this object is an instance of jsx3.xml.CDF, convertProperties() is called on this object. * @param objDoc * @param objCache * @param returnType The expected return type * @return the document stored in the server cache as the data source of this object. If transformers were run, this value will not be equal to the <code>objDoc</code> parameter. */ public <T> T setSourceXML(jsx3.xml.CdfDocument objDoc, jsx3.app.Cache objCache, Class<T> returnType) { String extension = "setSourceXML(\"" + objDoc + "\", \"" + objCache + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Sets the XML ID of this object. This value is the key under which the XML source document of this object is saved in the cache of the server owning this object. The developer may specify either a unique or shared value. If no value is specified, a unique id is generated. * @param strXMLId * @return this object. */ public jsx3.xml.Cacheable setXMLId(String strXMLId) { String extension = "setXMLId(\"" + strXMLId + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Cacheable.class.getName()); } } /** * Sets the XML ID of this object. This value is the key under which the XML source document of this object is saved in the cache of the server owning this object. The developer may specify either a unique or shared value. If no value is specified, a unique id is generated. * @param strXMLId * @param returnType The expected return type * @return this object. */ public <T> T setXMLId(String strXMLId, Class<T> returnType) { String extension = "setXMLId(\"" + strXMLId + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Sets the XML string of this object. Setting this value to the string serialization of an XML document is one way of specifying the source XML document of this object. * @param strXML <code>null</code> or a well-formed serialized XML element. * @return this object. */ public jsx3.xml.Cacheable setXMLString(String strXML) { String extension = "setXMLString(\"" + strXML + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Cacheable.class.getName()); } } /** * Sets the XML string of this object. Setting this value to the string serialization of an XML document is one way of specifying the source XML document of this object. * @param strXML <code>null</code> or a well-formed serialized XML element. * @param returnType The expected return type * @return this object. */ public <T> T setXMLString(String strXML, Class<T> returnType) { String extension = "setXMLString(\"" + strXML + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Sets the list of XML transformers of this object. The XML source document of this object is transformed serially by each of these transformers before it is placed in the XML cache. Each transformer is either the URI of an XSLT document (which will be resolved against the the server of this object) or the cache id of a XSLT document in the XML cache of the server of this object. When any transformer is loaded from a URI it is placed in the server cache under the id equal to its resolved URI. Any transformer that does not correspond to a valid XSLT document will be skipped without throwing an error. * @param arrTrans */ public void setXMLTransformers(Object[] arrTrans) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "setXMLTransformers", arrTrans); ScriptSessions.addScript(script); } /** * Sets the XML URL of this object. Settings this value to the URI of an XML document is one way of specifying the source XML document of this object. * @param strXMLURL <code>null</code> or a URI that when resolved against the server owning this object specifies a valid XML document. * @return this object. */ public jsx3.xml.Cacheable setXMLURL(String strXMLURL) { String extension = "setXMLURL(\"" + strXMLURL + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Cacheable.class.getName()); } } /** * Sets the XML URL of this object. Settings this value to the URI of an XML document is one way of specifying the source XML document of this object. * @param strXMLURL <code>null</code> or a URI that when resolved against the server owning this object specifies a valid XML document. * @param returnType The expected return type * @return this object. */ public <T> T setXMLURL(String strXMLURL, Class<T> returnType) { String extension = "setXMLURL(\"" + strXMLURL + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Adds a name/value pair to the list of parameters to pass to the XSL stylesheet during transformation. If strValue is null the parameter is removed. * @param strName the name of the XSL parameter to add. * @param strValue the value of the XSL parameter to add. * @return this object. */ public jsx3.xml.Cacheable setXSLParam(String strName, String strValue) { String extension = "setXSLParam(\"" + strName + "\", \"" + strValue + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Cacheable.class.getName()); } } /** * Adds a name/value pair to the list of parameters to pass to the XSL stylesheet during transformation. If strValue is null the parameter is removed. * @param strName the name of the XSL parameter to add. * @param strValue the value of the XSL parameter to add. * @param returnType The expected return type * @return this object. */ public <T> T setXSLParam(String strName, String strValue, Class<T> returnType) { String extension = "setXSLParam(\"" + strName + "\", \"" + strValue + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Sets whether the XML data source of this object is loaded asynchronously. This setting only applies to data sources loaded from an XML URL. * @param bAsync * @return this object. */ public jsx3.xml.Cacheable setXmlAsync(boolean bAsync) { String extension = "setXmlAsync(\"" + bAsync + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Cacheable.class.getName()); } } /** * Sets whether the XML data source of this object is loaded asynchronously. This setting only applies to data sources loaded from an XML URL. * @param bAsync * @param returnType The expected return type * @return this object. */ public <T> T setXmlAsync(boolean bAsync, Class<T> returnType) { String extension = "setXmlAsync(\"" + bAsync + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Sets whether this object is bound to the XML document stored in the data cache. If this object is bound to the cache, then the onXmlBinding() method of this object is called any time the document stored in the cache under the XML Id of this object changes. * @param bBind * @param callback <code>0</code> or <code>1</code>. */ public void setXmlBind(boolean bBind, org.directwebremoting.ui.Callback<Integer> callback) { ScriptBuffer script = new ScriptBuffer(); String callbackPrefix = ""; if (callback != null) { callbackPrefix = "var reply = "; } script.appendCall(callbackPrefix + getContextPath() + "setXmlBind", bBind); if (callback != null) { String key = org.directwebremoting.extend.CallbackHelperFactory.get().saveCallback(callback, Integer.class); script.appendCall("__System.activateCallback", key, "reply"); } ScriptSessions.addScript(script); } /** * Transfers a CDF record from another object to this object. If no XML data source exists yet for this object, an empty one is created before adding the new record. This method always updates the on-screen view of both the source and destination objects. This method fails quietly if any of the following conditions apply: there is no object with id equal to strSourceId there is no record in the source object with jsxid equal to strRecordId strParentRecordId is specified and there is no record in this object with jsxid equal to strParentRecordId the this object already has a record with jsxid equal to the record to adopt * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself. * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer. * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter is provided, the adopted record will be added as a child of this record. Otherwise, the adopted record will be added to the root <code>data</code> element. * @param bRedraw forces suppression of the insert event * @return the adopted record. */ public jsx3.xml.Node adoptRecord(jsx3.xml.CdfDocument strSourceId, String strRecordId, String strParentRecordId, boolean bRedraw) { String extension = "adoptRecord(\"" + strSourceId + "\", \"" + strRecordId + "\", \"" + strParentRecordId + "\", \"" + bRedraw + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Node.class.getName()); } } /** * Transfers a CDF record from another object to this object. If no XML data source exists yet for this object, an empty one is created before adding the new record. This method always updates the on-screen view of both the source and destination objects. This method fails quietly if any of the following conditions apply: there is no object with id equal to strSourceId there is no record in the source object with jsxid equal to strRecordId strParentRecordId is specified and there is no record in this object with jsxid equal to strParentRecordId the this object already has a record with jsxid equal to the record to adopt * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself. * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer. * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter is provided, the adopted record will be added as a child of this record. Otherwise, the adopted record will be added to the root <code>data</code> element. * @param bRedraw forces suppression of the insert event * @return the adopted record. */ public jsx3.xml.Node adoptRecord(String strSourceId, String strRecordId, String strParentRecordId, boolean bRedraw) { String extension = "adoptRecord(\"" + strSourceId + "\", \"" + strRecordId + "\", \"" + strParentRecordId + "\", \"" + bRedraw + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Node.class.getName()); } } /** * Equivalent to adoptRecord, except that the to-be relationship is as a previousSibling to the CDF record identified by the parameter, strSiblingRecordId This method fails quietly if any of the following conditions apply: there is no record with a jsxid equal to strSourceId there is no record in the source object with a jsxid equal to strRecordId strSiblingRecordId is specified and there is no record in this object with a jsxid equal to strParentRecordId this object already has a record with jsxid equal to the record to adopt * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself. * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer. * @param strSiblingRecordId the unique <code>jsxid</code> of an existing record in front of which the record identified by strSourceId will be placed * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is immediately updated to reflect the deleted record. * @return the adopted record. */ public jsx3.xml.Node adoptRecordBefore(jsx3.xml.CdfDocument strSourceId, String strRecordId, String strSiblingRecordId, boolean bRedraw) { String extension = "adoptRecordBefore(\"" + strSourceId + "\", \"" + strRecordId + "\", \"" + strSiblingRecordId + "\", \"" + bRedraw + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Node.class.getName()); } } /** * Equivalent to adoptRecord, except that the to-be relationship is as a previousSibling to the CDF record identified by the parameter, strSiblingRecordId This method fails quietly if any of the following conditions apply: there is no record with a jsxid equal to strSourceId there is no record in the source object with a jsxid equal to strRecordId strSiblingRecordId is specified and there is no record in this object with a jsxid equal to strParentRecordId this object already has a record with jsxid equal to the record to adopt * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself. * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer. * @param strSiblingRecordId the unique <code>jsxid</code> of an existing record in front of which the record identified by strSourceId will be placed * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is immediately updated to reflect the deleted record. * @return the adopted record. */ public jsx3.xml.Node adoptRecordBefore(String strSourceId, String strRecordId, String strSiblingRecordId, boolean bRedraw) { String extension = "adoptRecordBefore(\"" + strSourceId + "\", \"" + strRecordId + "\", \"" + strSiblingRecordId + "\", \"" + bRedraw + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Node.class.getName()); } } /** * Converts all attributes in this CDF document that are property keys of the form {key} to the value of the property. * @param objProps the properties repository to query. * @param arrProps if provided, these attributes are converted rather than the default set of attributes. * @param bUnion if <code>true</code>, <code>arrProps</code> is combined with the default set of attributes and those attributes are converted. */ public void convertProperties(java.util.Properties objProps, Object[] arrProps, boolean bUnion) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "convertProperties", objProps, arrProps, bUnion); ScriptSessions.addScript(script); } /** * Removes a record from the XML data source of this object. * @param strRecordId the <code>jsxid</code> attribute of the data record to remove. * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is immediately updated to reflect the deleted record. * @return the record removed from the data source or <code>null</code> if no such record found. */ public jsx3.xml.Node deleteRecord(String strRecordId, boolean bRedraw) { String extension = "deleteRecord(\"" + strRecordId + "\", \"" + bRedraw + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Node.class.getName()); } } /** * Removes a specific property from a record. If no such record exists in the XML document, this method fails quietly. * @param strRecordId the <code>jsxid</code> attribute of the data record to modify. * @param strPropName the name of the property to remove from the record. * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is immediately updated to reflect the deleted property. */ public void deleteRecordProperty(String strRecordId, String strPropName, boolean bRedraw) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "deleteRecordProperty", strRecordId, strPropName, bRedraw); ScriptSessions.addScript(script); } /** * Returns an object containing the attributes of a particular CDF record as property/value pairs. The object returned by this method is a copy of the underlying data. Therefore, updates to this object will not affect the underlying data. The following two lines of code evaluate to the same value: objCDF.getRecord(strId).propName; objCDF.getRecordNode(strId).getAttribute("propName"); * @param strRecordId the <code>jsxid</code> attribute of the data record to return. * @return the object representation of a CDF node or <code>null</code> if no such record found. */ public jsx3.lang.Object getRecord(String strRecordId) { String extension = "getRecord(\"" + strRecordId + "\")."; try { java.lang.reflect.Constructor<jsx3.lang.Object> ctor = jsx3.lang.Object.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.lang.Object.class.getName()); } } /** * Returns an object containing the attributes of a particular CDF record as property/value pairs. The object returned by this method is a copy of the underlying data. Therefore, updates to this object will not affect the underlying data. The following two lines of code evaluate to the same value: objCDF.getRecord(strId).propName; objCDF.getRecordNode(strId).getAttribute("propName"); * @param strRecordId the <code>jsxid</code> attribute of the data record to return. * @param returnType The expected return type * @return the object representation of a CDF node or <code>null</code> if no such record found. */ public <T> T getRecord(String strRecordId, Class<T> returnType) { String extension = "getRecord(\"" + strRecordId + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } /** * Returns a record from the XML data source of this object. This returned value is a handle to the record and not a clone. Therefore, any updates made to the returned value with update the XML document of this object. To reflect such changes in the on-screen view of this object, call redrawRecord(strRecordId, jsx3.xml.CDF.UPDATE); on this object. * @param strRecordId the <code>jsxid</code> attribute of the data record to return. * @return the record node or <code>null</code> if none exists with a <code>jsxid</code> attribute equal to <code>strRecordId</code>. */ public jsx3.xml.Node getRecordNode(String strRecordId) { String extension = "getRecordNode(\"" + strRecordId + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Node.class.getName()); } } /** * Inserts a new record into the XML data source of this object. If no XML data source exists yet for this object, an empty one is created before adding the new record. If a record already exists with an id equal to the jsxid property of objRecord, the operation is treated as an update, meaning the existing record is completely removed and a new record with the given jsxid is inserted. * @param objRecord a JavaScript object containing property/value pairs that define the attributes of the XML entity to create. Note that most classes that implement this interface require that all records have an attribute named <code>jsxid</code> that is unique across all records in the XML document. All property values will be treated as strings. Additionally, the following 3 characters are escaped: <code>" > <</code>. * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter is provided and a record exists with a matching <code>jsxid</code> attribute, the new record will be added as a child of this record. Otherwise, the new record will be added to the root <code>data</code> element. However, if a record already exists with a <code>jsxid</code> attribute equal to the <code>jsxid</code> property of <code>objRecord</code>, this parameter will be ignored. In this case <code>adoptRecord()</code> must be called to change the parent of the record. * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is immediately updated to reflect the additional record. * @return the newly created or updated entity. */ public jsx3.xml.Node insertRecord(jsx3.lang.Object objRecord, String strParentRecordId, boolean bRedraw) { String extension = "insertRecord(\"" + objRecord + "\", \"" + strParentRecordId + "\", \"" + bRedraw + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Node.class.getName()); } } /** * Creates a new CDF record and inserts it into the CDF data source of this object, before the record identified by strSiblingRecordId. This method fails quietly if any of the following conditions apply: there is no existing record with a jsxid equal to strSiblingRecordId there is an existing record with jsxid equal to objRecord.jsxid * @param objRecord a JavaScript object containing property/value pairs that define the attributes of the XML entity to create. Note that most classes that implement this interface require that all records have an attribute named <code>jsxid</code> that is unique across all records in the XML document. All property values will be treated as strings. Additionally, the following 3 characters are escaped: <code>" > <</code>. * @param strSiblingRecordId the unique <code>jsxid</code> of an existing record before which the new record will be inserted. * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is immediately updated to reflect the additional record. * @return the newly created entity. */ public jsx3.xml.Node insertRecordBefore(jsx3.lang.Object objRecord, String strSiblingRecordId, boolean bRedraw) { String extension = "insertRecordBefore(\"" + objRecord + "\", \"" + strSiblingRecordId + "\", \"" + bRedraw + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.Node.class.getName()); } } /** * Inserts a new record into the XML data source of this object. This method is the same as insertRecord() except that its first parameter is of type jsx3.xml.Entity rather than Object. * @param objRecordNode an XML element of name <code>record</code>. Note that most classes that implement this interface require that all records have an attribute named <code>jsxid</code> that is unique across all records in the XML document. * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter is provided and a record exists with a matching <code>jsxid</code> attribute, the new record will be added as a child of this record. Otherwise, the new record will be added to the root <code>data</code> element. * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is immediately updated to reflect the additional record. */ public void insertRecordNode(jsx3.xml.Node objRecordNode, String strParentRecordId, boolean bRedraw) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "insertRecordNode", objRecordNode, strParentRecordId, bRedraw); ScriptSessions.addScript(script); } /** * Inserts a new property into an existing record with jsxid equal to strRecordId. If the property already exists, the existing property value will be updated. If no such record exists in the XML document, this method fails quietly. * @param strRecordId the <code>jsxid</code> attribute of the data record to modify. * @param strPropName the name of the property to insert into the record. * @param strPropValue the value of the property to insert. * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is immediately updated to reflect the inserted property. * @return this object. */ public jsx3.xml.CdfDocument insertRecordProperty(String strRecordId, String strPropName, String strPropValue, boolean bRedraw) { String extension = "insertRecordProperty(\"" + strRecordId + "\", \"" + strPropName + "\", \"" + strPropValue + "\", \"" + bRedraw + "\")."; try { java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported type: " + jsx3.xml.CdfDocument.class.getName()); } } /** * Inserts a new property into an existing record with jsxid equal to strRecordId. If the property already exists, the existing property value will be updated. If no such record exists in the XML document, this method fails quietly. * @param strRecordId the <code>jsxid</code> attribute of the data record to modify. * @param strPropName the name of the property to insert into the record. * @param strPropValue the value of the property to insert. * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is immediately updated to reflect the inserted property. * @param returnType The expected return type * @return this object. */ public <T> T insertRecordProperty(String strRecordId, String strPropName, String strPropValue, boolean bRedraw, Class<T> returnType) { String extension = "insertRecordProperty(\"" + strRecordId + "\", \"" + strPropName + "\", \"" + strPropValue + "\", \"" + bRedraw + "\")."; try { java.lang.reflect.Constructor<T> ctor = returnType.getConstructor(Context.class, String.class); return ctor.newInstance(this, extension); } catch (Exception ex) { throw new IllegalArgumentException("Unsupported return type: " + returnType.getName()); } } }