-
1. Re: inputText inside a datatable does not get re-rendered
sergeysmirnov Apr 12, 2007 2:45 PM (in response to rooky)Does #{myBean} has a request scope? If so, that the value of selectedUser by default (i.e at the moment myBean is just created)?
-
2. Re: inputText inside a datatable does not get re-rendered
rooky Apr 12, 2007 10:34 PM (in response to rooky)Yes, myBean has a request scope. All the values of my table are being updated correctly every 30 seconds, except for the inputText. It seems like the inputText is NOT being reRendered.
-
3. Re: inputText inside a datatable does not get re-rendered
sergeysmirnov Apr 12, 2007 11:00 PM (in response to rooky)My guess is compliantly opposite right now.
let's find the source of the problem step-by-step. On the first step, surround a4j:poll with a4j:region. I.e.:<a4j:region> <a4j:poll interval="30000" reRender="userList" actionListener="#{myBean.pollAction}" /> </a4j:region>
Does it change something? -
4. Re: inputText inside a datatable does not get re-rendered
rooky Apr 13, 2007 8:28 AM (in response to rooky)Sergey,
Adding the <a4j:region> tags around the <a4j:poll> works!. I still don't understand why though.
Thanks a lot! -
5. Re: inputText inside a datatable does not get re-rendered
ilya_shaikovsky Apr 13, 2007 8:42 AM (in response to rooky)the behaviour changed because only the components inside region (poll in your case) was decoded on server in this case. Before you wrap it all the tree was decoded and values applied.
-
6. Re: inputText inside a datatable does not get re-rendered
sergeysmirnov Apr 13, 2007 11:18 AM (in response to rooky)"jorgecar" wrote:
Sergey,
Adding the <a4j:region> tags around the <a4j:poll> works!. I still don't understand why though.
Thanks a lot!
This is like a JSF works. It works the same way with Ajax or without Ajax. If the component tree is not replaced with brand new one (this happens during Ajax request or if action method returns null or validation failed etc), the value of the input component takes from the component tree node, but not from the property of the backing bean as you are expecting. Therefore, when you change the value of the property of the backing bean, it just does make any sense for JSF.
This behavior always was a headache for developers. Look at almost three year old post, for example:
http://forum.java.sun.com/thread.jspa?forumID=427&threadID=528778
So, when you used to believe that input field is NOT re-rendered, it actually re-rendered not with the value you expected, but with the value input field holds. It looks like nothing happens.
When the region added, the input component is not processed on the server (as far as it is outside the region) and it takes the new value from the backing bean when it rerendered.