JSF Event
When a link or button is clicked by a user, values present in a field get changed or a selection is made in list so that the application might react. Interface components of JSF User would signal certain user action when an event is fired that is being handled by the code. Event listeners that are very commonly used are value change and action. Others like phase or data model would not be discussed over here. In separate listener or managed bean, it is possible to declare the listeners. ...
For UI Command objects, emission of the action events takes place. When Command button is pressed by a user or a hyper link is clicked, generation of such events take place. Number of listeners could be attached to the source. For instance, let us consider the given code: Java Code: <h:commandButton value = "Test Action Listener" actionListener = "#{testActionListener.doSomeAction}" /> An attribute known as actionListener is defined ...
<h:commandButton value = "Test Action Listener" actionListener = "#{testActionListener.doSomeAction}" />
Interfaces which are related with JSF events are present in package'javax.faces.event'. All Events present in JSF shall be extending the javax.faces.event.FacesEvent. This class’s constructor has argument UIComponent that would be making it specific that this Event is for which UI component. Java Code: UIComponent someComponent = new UIComponent(); MyFacesEvent event = new MyFacesEvent(someComponent); UIComponent sourceCompoenent = event.getComponent(); ...
UIComponent someComponent = new UIComponent(); MyFacesEvent event = new MyFacesEvent(someComponent); UIComponent sourceCompoenent = event.getComponent();
JSF event model is basically based upon the Event driven programming of Java that is available typically just along with the GUI applications. In case you have familiarity to the swing programming, this could be understood easily the event handling models present in JSF framework. Concept present behind this event model is that user interfaced objects have a listerner’s list. Such listeners get notified when an event is generated by the user interface objects. This shows that when a component is ...
JSF components trigger events and these events are process by the JSF application. User generates these events by interacting with the application. For example, Click a button event is generated and triggered by the user. Programmer is responsible to handle all such events in code. You can write event listeners for this purpose. Following JSF code is written to create a button. Java Code: This is example of a JSF Button <h:commandButton value="Login“ actionListener=“#{customer.loginActionListener}” ...
<h:commandButton value="Login“ actionListener=“#{customer.loginActionListener}”
Updated 01-14-2012 at 06:28 PM by JSF
thanks...
sorry for all the questions
thanks...
06-14-2013, 02:22 PM in gbonecapone