This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have been bumping my head against the wall on this issue. I appreciate any insights...
I have a InputText within a DataTable. When user clicks on "Add New Row" commandButton, it calls ActionListener which calls a method in BackingBean to add a new empty row to the table. Once the new row is created on the web page, the user enters the data in the row and clicks on "Save" which triggers an action call to the backing bean, which for some reason does not retrieve the user entered data. Please see below on code and appreciate any help I can get to resolve this issue.
Thanks in advance. Looking forward to your response anxiously.
Thanks Sachin. I added binding attribute to the table and from the action method, I retrieve HTMLDataTable (using getter method corresponding to binding attribute) and get the value of the tables using getValue(). This works and all is well.
However, shouldn't value attribute in the <h:datatable> update getter/setter . Why set binding attribute and making the code little complex? Or, without binding the table, I could retrieve the Table value using facesContext, but this makes code complex too?
I thought JSF dynamically populates table values in the ArrayList(value is set to Arraylist object).
Pinal N Patel
Joined: Sep 05, 2003
One more question, I have seen many examples on the internet regarding the user of HTML Data Table with inputText and I assume they all work correctly. But for some reason, the above code does not populate instance variables in the backing bean during UPDATE MODEL VALUES Phase in JSF lifecycle. Please look at the code above and share any thoughts on resolving this issue.
I thought as long as you provide getter/setter in backing bean class, if a component is modified, then those values will be updated to the backing bean class in UPDATE MODEL VALUES. Is this not correct?
So I am curious if you have made progress since your last post here? I am having a similar issue. I render a <t:dataTable> in the page, it is populated from a collection of objects (e.g. Foo.java). One of the fields on Foo needs to be updated (e.g. Foo.updateMe is a boolean that renders itself as a radio within the <t:dataTable>). So:
In the backing bean:
When I hit the <save> button, the List<Foo> I fetch from updatedFoos.getValue() does not contain any updates (e.g. - The radios were all toggled however the member property from the collection does not reflect this).
Am I going down the wrong path? Any help would be appreciated.
I have exactly the same problem as C Porter.
The update I made in the inputtext is not represented in the List.
Another question I have:
What is the problem, when I save with the button, that my object model is not filled (by using setters) ?
In Debug mode I can see that a new instance is using my setters.
Therefore the different instances causes the problem, that I have to use the binding.
Any explaination for me?
Please start your own topic for each independent problem. Do not revive old topics for own problems where in others are more likely to respond on an aged question of the topicstarter and thus completely overlook or even ignore you.