aspose file tools*
The moose likes JSF and the fly likes Problems with Editable Datatable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Problems with Editable Datatable" Watch "Problems with Editable Datatable" New topic
Author

Problems with Editable Datatable

Phoenix Kilimba
Ranch Hand

Joined: Oct 10, 2006
Posts: 64
Dear Sirs et Madames,
I have an application where an editable datatable displays attributes names (eg HOUSEHOLD ID) and values (eg K001). The first column of the datatable is a checkbox which when clicked renders the value column editable (by displaying an inputText component). When I perform the editing on the value comumn and I click on submit, sometimes the corresponding value objects value attribute is changed and most times it isn't. This is very strange as java code shouldn't choose when to work and when not to work. Furthermore as you can see from the backing bean, the first line of the code block the submit button goes into when clicked is a print statement saying "AM PRESSED". However on the server log, it shows this print statement comes AFTER a hibernate SELECT call is executed, ie the JSP page is being reloaded even BEFORE geting to the "return null" statement at the end ot the submit buttons code block. This seems counter-intuitive to how java works as code is gone through sequentially is it not? The "return null" statement should be the last statement executed yet it seems to be the first, otherwise why else would the page reload before the "AM PRESSED print statement? Here is the JSP code for the datatable:



Here is the backing bean:

Here is a GroupAttribute class:

The server log output:

What could possibly be the reason why changes on the user interface inputText component do not change the state of the corresponding value object (or more accurately why does it pick and choose WHEN to do so and when not to?)

Please help.
Thanks in advance

PS I have made a further discovery. Editing does work, but not at the first time of asking. I always have to press F5 (refresh my browser) for the changes to actually take effect. I still dont know what the problem is but am hoping this narrows down the issue maybe?... Help


You are what you know
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems with Editable Datatable