/** * The rich:findComponent('id') function returns the a UIComponent instance of the passed component identifier. If the * specified component identifier is not found, null is returned instead. */ @Function public static UIComponent findComponent(String id) { return findComponent(FacesContext.getCurrentInstance(), id); }
/** * The rich:findComponent('id') function returns the a UIComponent instance of the passed component identifier. If the * specified component identifier is not found, null is returned instead. */ @Function public static UIComponent findComponent(String id) { return findComponent(FacesContext.getCurrentInstance(), id); }
/** * The rich:findComponent('id') function returns the a UIComponent instance of the passed component identifier. If the * specified component identifier is not found, null is returned instead. */ @Function public static UIComponent findComponent(String id) { return findComponent(FacesContext.getCurrentInstance(), id); }
/** * The rich:findComponent('id') function returns the a UIComponent instance of the passed component identifier. If the * specified component identifier is not found, null is returned instead. */ @Function public static UIComponent findComponent(String id) { return findComponent(FacesContext.getCurrentInstance(), id); }
/** * <p>The rich:element('id') function is a shortcut for the equivalent document.getElementById(#{rich:clientId('id')}) code. It * returns the element from the client, based on the passed server-side component identifier. If the specified component * identifier is not found, null is returned instead.</p> */ @Function public static String element(String id) { String clientId = clientId(id); if (clientId != null) { return "document.getElementById('" + clientId + "')"; } return null; }
/** * <p>The rich:element('id') function is a shortcut for the equivalent document.getElementById(#{rich:clientId('id')}) code. It * returns the element from the client, based on the passed server-side component identifier. If the specified component * identifier is not found, null is returned instead.</p> */ @Function public static String element(String id) { String clientId = clientId(id); if (clientId != null) { return "document.getElementById('" + clientId + "')"; } return null; }
/** * <p>The rich:element('id') function is a shortcut for the equivalent document.getElementById(#{rich:clientId('id')}) code. It * returns the element from the client, based on the passed server-side component identifier. If the specified component * identifier is not found, null is returned instead.</p> */ @Function public static String element(String id) { String clientId = clientId(id); if (clientId != null) { return "document.getElementById('" + clientId + "')"; } return null; }
/** * <p>The rich:element('id') function is a shortcut for the equivalent document.getElementById(#{rich:clientId('id')}) code. It * returns the element from the client, based on the passed server-side component identifier. If the specified component * identifier is not found, null is returned instead.</p> */ @Function public static String element(String id) { String clientId = clientId(id); if (clientId != null) { return "document.getElementById('" + clientId + "')"; } return null; }
/** * The rich:component('id') function is equivalent to the RichFaces.component('clientId') code. It returns the client object * instance based on the passed server-side component identifier ('id'). If the specified component identifier is not found, * null is returned instead. The function can be used to get an object from a component to call a JavaScript API function * without using the <rich:componentControl> component. */ @Function public static String component(String id) { String clientId = clientId(id); if (clientId != null) { // TODO nick - what if jQuery.RichFaces doesn't exist? return "RichFaces.component('" + clientId + "')"; } return null; }
/** * The rich:component('id') function is equivalent to the RichFaces.$('clientId') code. It returns the client object * instance based on the passed server-side component identifier ('id'). If the specified component identifier is not found, * null is returned instead. The function can be used to get an object from a component to call a JavaScript API function * without using the <rich:componentControl> component. */ @Function public static String component(String id) { String clientId = clientId(id); if (clientId != null) { // TODO nick - what if jQuery.RichFaces doesn't exist? return "RichFaces.$('" + clientId + "')"; } return null; }
/** * The rich:component('id') function is equivalent to the RichFaces.$('clientId') code. It returns the client object * instance based on the passed server-side component identifier ('id'). If the specified component identifier is not found, * null is returned instead. The function can be used to get an object from a component to call a JavaScript API function * without using the <rich:componentControl> component. */ @Function public static String component(String id) { String clientId = clientId(id); if (clientId != null) { // TODO nick - what if jQuery.RichFaces doesn't exist? return "RichFaces.$('" + clientId + "')"; } return null; }
/** * The rich:component('id') function is equivalent to the RichFaces.component('clientId') code. It returns the client object * instance based on the passed server-side component identifier ('id'). If the specified component identifier is not found, * null is returned instead. The function can be used to get an object from a component to call a JavaScript API function * without using the <rich:componentControl> component. */ @Function public static String component(String id) { String clientId = clientId(id); if (clientId != null) { // TODO nick - what if jQuery.RichFaces doesn't exist? return "RichFaces.component('" + clientId + "')"; } return null; }
/** * <p>The rich:jQuery('id') function is a shortcut for the equivalent jQuery(#{rich:element('id')}) code. It returns the * jQuery object from the client, based on the passed server-side component identifier. If the specified component * identifier is not found, empty jQuery object is returned instead.</p> * * <p>This function is for use in EL. Refer to the <rich:jQuery> component for access to the jQuery library as a * facelet tag.</p> */ @Function public static String jQuery(String id) { String element = element(id); if (element != null) { return "jQuery(" + element + ")"; } return "jQuery()"; }
/** * <p>The rich:jQuery('id') function is a shortcut for the equivalent jQuery(#{rich:element('id')}) code. It returns the * jQuery object from the client, based on the passed server-side component identifier. If the specified component * identifier is not found, empty jQuery object is returned instead.</p> * * <p>This function is for use in EL. Refer to the <rich:jQuery> component for access to the jQuery library as a * facelet tag.</p> */ @Function public static String jQuery(String id) { String element = element(id); if (element != null) { return "jQuery(" + element + ")"; } return "jQuery()"; }
/** * <p>The rich:jQuery('id') function is a shortcut for the equivalent jQuery(#{rich:element('id')}) code. It returns the * jQuery object from the client, based on the passed server-side component identifier. If the specified component * identifier is not found, empty jQuery object is returned instead.</p> * * <p>This function is for use in EL. Refer to the <rich:jQuery> component for access to the jQuery library as a * facelet tag.</p> */ @Function public static String jQuery(String id) { String element = element(id); if (element != null) { return "RichFaces.jQuery(" + element + ")"; } return "RichFaces.jQuery()"; }
/** * <p>The rich:jQuery('id') function is a shortcut for the equivalent jQuery(#{rich:element('id')}) code. It returns the * jQuery object from the client, based on the passed server-side component identifier. If the specified component * identifier is not found, empty jQuery object is returned instead.</p> * * <p>This function is for use in EL. Refer to the <rich:jQuery> component for access to the jQuery library as a * facelet tag.</p> */ @Function public static String jQuery(String id) { String element = element(id); if (element != null) { return "RichFaces.jQuery(" + element + ")"; } return "RichFaces.jQuery()"; }
/** * The rich:clientId('id') function returns the client identifier related to the passed component identifier ('id'). If the * specified component identifier is not found, null is returned instead. */ @Function public static String clientId(String id) { FacesContext context = FacesContext.getCurrentInstance(); UIComponent component = findComponent(context, id); return component != null ? component.getClientId(context) : null; }
/** * The rich:clientId('id') function returns the client identifier related to the passed component identifier ('id'). If the * specified component identifier is not found, null is returned instead. */ @Function public static String clientId(String id) { FacesContext context = FacesContext.getCurrentInstance(); UIComponent component = findComponent(context, id); return component != null ? component.getClientId(context) : null; }
/** * The rich:clientId('id') function returns the client identifier related to the passed component identifier ('id'). If the * specified component identifier is not found, null is returned instead. */ @Function public static String clientId(String id) { FacesContext context = FacesContext.getCurrentInstance(); UIComponent component = findComponent(context, id); return component != null ? component.getClientId(context) : null; }
/** * Convert any Java Object to JavaScript representation, converting types properly, e.g.: * * <ul> * <li><tt>Java primitives</tt></li> * <li><tt>Arrays: toScript(new int[] { 1, 2, 3 }) -> [1, 2, 3]</tt></li> * <li><tt>Collections (sets, lists): toScript(Arrays.asList(new int[] { 1, 2, 3 })) -> [1, 2, 3]</tt></li> * <li><tt>Maps: toScript((Map<String, String>)map) -> {\"a\":\"foo\",\"b\":\"bar\",\"c\":\"baz\"}</tt></li> * <li> * <tt>Beans / Objects: toScript(new Bean[] { new Bean(1, true, "bar") }) -> [{\"bool\":true,\"foo\":\"bar\",\"integer\":1}]</tt> * </li> * * <li><tt>Dates and Timezones</tt></li> * * <li><tt>Combinations of above</tt></li> * </ul> * * This function delegates to org.ajax4jsf.javascript.ScriptUtils#toScript(Object) */ @Function public static String toScript(Object o) { return ScriptUtils.toScript(o); } }