All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.bootsfaces.component.remoteCommand.RemoteCommandCore Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
/**
 *  Copyright 2014-2019 Riccardo Massera (TheCoder4.Eu) and Stephan Rauh (http://www.beyondjava.net).
 *
 *  This file is part of BootsFaces.
 *
* 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 net.bootsfaces.component.remoteCommand;

import jakarta.faces.component.UICommand;

/** This class holds the attributes of <b:remoteCommand />. */
public abstract class RemoteCommandCore extends UICommand {

	protected enum PropertyKeys {
		ajax, binding, delay, disabled, name, onclick, oncomplete, onerror, onsuccess, parameters, process, update;
		String toString;

		PropertyKeys(String toString) {
			this.toString = toString;
		}

		PropertyKeys() {
		}

		public String toString() {
			return ((this.toString != null) ? this.toString : super.toString());
		}
	}

	/**
	 * Whether the Button submits the form with AJAX. 

* @return Returns the value of the attribute, or , false, if it hasn't been set by the JSF file. */ public boolean isAjax() { return (boolean) (Boolean) getStateHelper().eval(PropertyKeys.ajax, false); } /** * Whether the Button submits the form with AJAX.

* Usually this method is called internally by the JSF engine. */ public void setAjax(boolean _ajax) { getStateHelper().put(PropertyKeys.ajax, _ajax); } /** * An EL expression referring to a server side UIComponent instance in a backing bean.

* @return Returns the value of the attribute, or null, if it hasn't been set by the JSF file. */ public jakarta.faces.component.UIComponent getBinding() { return (jakarta.faces.component.UIComponent) getStateHelper().eval(PropertyKeys.binding); } /** * An EL expression referring to a server side UIComponent instance in a backing bean.

* Usually this method is called internally by the JSF engine. */ public void setBinding(jakarta.faces.component.UIComponent _binding) { getStateHelper().put(PropertyKeys.binding, _binding); } /** * Delays the AJAX request.

* @return Returns the value of the attribute, or null, if it hasn't been set by the JSF file. */ public String getDelay() { return (String) getStateHelper().eval(PropertyKeys.delay); } /** * Delays the AJAX request.

* Usually this method is called internally by the JSF engine. */ public void setDelay(String _delay) { getStateHelper().put(PropertyKeys.delay, _delay); } /** * Boolean value to specify if the button is disabled.

* @return Returns the value of the attribute, or , false, if it hasn't been set by the JSF file. */ public boolean isDisabled() { return (boolean) (Boolean) getStateHelper().eval(PropertyKeys.disabled, false); } /** * Boolean value to specify if the button is disabled.

* Usually this method is called internally by the JSF engine. */ public void setDisabled(boolean _disabled) { getStateHelper().put(PropertyKeys.disabled, _disabled); } /** * Name of the JavaScript function.

* @return Returns the value of the attribute, or null, if it hasn't been set by the JSF file. */ public String getName() { return (String) getStateHelper().eval(PropertyKeys.name); } /** * Name of the JavaScript function.

* Usually this method is called internally by the JSF engine. */ public void setName(String _name) { getStateHelper().put(PropertyKeys.name, _name); } /** * The onclick attribute.

* @return Returns the value of the attribute, or null, if it hasn't been set by the JSF file. */ public String getOnclick() { return (String) getStateHelper().eval(PropertyKeys.onclick); } /** * The onclick attribute.

* Usually this method is called internally by the JSF engine. */ public void setOnclick(String _onclick) { getStateHelper().put(PropertyKeys.onclick, _onclick); } /** * JavaScript to be executed when ajax completes.

* @return Returns the value of the attribute, or null, if it hasn't been set by the JSF file. */ public String getOncomplete() { return (String) getStateHelper().eval(PropertyKeys.oncomplete); } /** * JavaScript to be executed when ajax completes.

* Usually this method is called internally by the JSF engine. */ public void setOncomplete(String _oncomplete) { getStateHelper().put(PropertyKeys.oncomplete, _oncomplete); } /** * JavaScript to be executed when ajax results on an error (including both network errors and Java exceptions).

* @return Returns the value of the attribute, or null, if it hasn't been set by the JSF file. */ public String getOnerror() { return (String) getStateHelper().eval(PropertyKeys.onerror); } /** * JavaScript to be executed when ajax results on an error (including both network errors and Java exceptions).

* Usually this method is called internally by the JSF engine. */ public void setOnerror(String _onerror) { getStateHelper().put(PropertyKeys.onerror, _onerror); } /** * JavaScript to be executed when ajax completes with success (i.e. there's neither a network error nor a Java exception).

* @return Returns the value of the attribute, or null, if it hasn't been set by the JSF file. */ public String getOnsuccess() { return (String) getStateHelper().eval(PropertyKeys.onsuccess); } /** * JavaScript to be executed when ajax completes with success (i.e. there's neither a network error nor a Java exception).

* Usually this method is called internally by the JSF engine. */ public void setOnsuccess(String _onsuccess) { getStateHelper().put(PropertyKeys.onsuccess, _onsuccess); } /** * Optional list of parameters to be added to the parameter list of the JavaScript function. The JSF bean can read these parameters from the request parameters (FacesContext.getCurrentContext.getRequestParameter('name1')). If you need more than one parameter, separate them with commas. Don't add a type because this is the signature of the JavaScript function.

* @return Returns the value of the attribute, or null, if it hasn't been set by the JSF file. */ public String getParameters() { return (String) getStateHelper().eval(PropertyKeys.parameters); } /** * Optional list of parameters to be added to the parameter list of the JavaScript function. The JSF bean can read these parameters from the request parameters (FacesContext.getCurrentContext.getRequestParameter('name1')). If you need more than one parameter, separate them with commas. Don't add a type because this is the signature of the JavaScript function.

* Usually this method is called internally by the JSF engine. */ public void setParameters(String _parameters) { getStateHelper().put(PropertyKeys.parameters, _parameters); } /** * Comma or space separated list of ids or search expressions denoting which values are to be sent to the server.

* @return Returns the value of the attribute, or null, if it hasn't been set by the JSF file. */ public String getProcess() { return (String) getStateHelper().eval(PropertyKeys.process); } /** * Comma or space separated list of ids or search expressions denoting which values are to be sent to the server.

* Usually this method is called internally by the JSF engine. */ public void setProcess(String _process) { getStateHelper().put(PropertyKeys.process, _process); } /** * Component(s) to be updated with ajax.

* @return Returns the value of the attribute, or null, if it hasn't been set by the JSF file. */ public String getUpdate() { return (String) getStateHelper().eval(PropertyKeys.update); } /** * Component(s) to be updated with ajax.

* Usually this method is called internally by the JSF engine. */ public void setUpdate(String _update) { getStateHelper().put(PropertyKeys.update, _update); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy