• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems with Editable Datatable

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic