I am having some troubles with JSF. I have a page that has a selectOneListbox in it. What I want to have happen is that when the user picks an item in the listbox, the page will execute a method in our listener class. What is happening is that the page gets reloaded, but the listener method is not being fired off. My JSF code is:
I dont see anything obviously wrong with the given code. Can you elaborate on how do you determine that the valueChangeListener is not notified or the method in your backing bean in not getting called..? Are you getting any error message or you cant see the expected behaviour in your page while you submit - please explain or if required provide backing bean code as well.
I put in some displays in the method I am invoking and I do not see it when I look at my console in Eclipse. I see displays that are in other methods, but not that one. I am not at work and can't put up that code at the moment.
And there is the rub. We are not getting any error messages at all. I even misspelled the name of the invoked method on purpose to get an error. Nothing. The page does reload, but none of the displays we put in are showing up. We are newbs and at a loss as to what we may be missing.
It is the f:verbatim tag that's causing the problem. I tested your code after removing that tag and it worked fine for me. Try not to include your component under that. f:verbatim's purpose is different...see the documentation.
And you were right that value attribute is not needed just to call the valueChangeListener. However if you want to capture the selected value, you do need it. [ September 14, 2007: Message edited by: A. Dusi ]
If you are only looking to capture your listbox selection, you dont need the valueChangeListener. Simply provide the value attribute mapping to a backing bean's property of String type(your itemValues are Strings). On form submission(by a click of a button or onchange=submit), the selection will automatically be posted to your backing bean's property.
Funny, I just did this last week. OK, so if you want a valueChangeListener to say change the values in a DataTable or in another combobox, there are a couple of things that you will need.
1. There are two ways to declare your valueChangeListener. One is the a <valueChangeListener> tag which requires a fully qualified class name, and that Class must implement the ValueChangeListener interface. The other, which is what I am going to talk about is the valueChangeListener attribute for any UIInput tag, which has the EL link to a method in a backing bean.
OK, so for the attribute.
set the EL to the method. Also set an onChange attribute to == "submit()" you most likely will want immediate="true" also in that tag.
In your method code, at the end of the code you will want to do the method call to go directly to the renderPhase, so something like FacesContext.getInstance.renderPhase() I forgot the last method name, but it should be easy enough to find.
Hi everyone! im new around here, and as i was looking for a solution to the problem im facing during my jsf development, i've found this post. Almost explained what should i do to solve it. Im facing the same problem, my valueChangeListener is not called any time! i wrote some sysout line codes to catch it on eclipse console, but nothing happens .
Im trying to find out what is the difference
the structure is showed below:
## newBridgeInputForm.jsp ##
## managedBean ##
As you can see, the XinputForm.jsp is loaded based on the item chosen in the first <h:selectOneMenu>. In this case im not using any <f:verbatim> tag, and it just refuse to work properly