Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem using html:checkbox in logic:iterate

 
Philipp Moisel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

i would appreciate you could help me with my problem.
I've got a page showing some infos, buttons and a table with more infos in an iframe.
the infos and buttons at the "outer" page are backed by a bean. this bean has a collection of beans for each table-row in the iframe. each row got 4 checkboxes.
my code works as follows:
the page shows some boxes checked, some not. showing the information from the bean to the html-form works. by submitting the form the boolean members in the bean backing the checkboxes are always false. i did overwrite the reset() method for clearing the values.
so everytime i submit the form the boolean values are false. i didn't manage to get a "true" by checking one of the boxes.

my code:

html-page (outer):


html-page (iframe):


the Action-Class:

logging everytime "false", i didn't manage to get one damn "true".


Please give me some advice to find and eliminate my mistake!
Thanks in advance,
Philipp
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any error shown in logs file ?
Also, I want you to change the name of logic:iterate id from "rows" to "row", and re run if that make any sense. This is my guess, because the property and id attribute pointing to same thing "rows".
 
Philipp Moisel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sagar Rohankar wrote:Is there any error shown in logs file ?
Also, I want you to change the name of logic:iterate id from "rows" to "row", and re run if that make any sense. This is my guess, because the property and id attribute pointing to same thing "rows".


Did the suggested Change, no impact

New Codesnippets:

 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Philipp Moisel wrote: i did overwrite the reset() method for clearing the values.

Post your Action Form(bean).
 
Philipp Moisel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, got the solution!

There were two Problems, one easy and one tricky:
First:
In the iframe there was a second form, i had to submit this. Bad mistake, but easy to find.

Second:
In the jsp i had to define an bean and use other name / property values for the html:checkbox


The Code that made it work:



I don't exactly know _why_ it works, but now it does.
If anyone can explain this to me i would appreciate.

Thanks alot guys, i spent too much time on this.
Cheers
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Philipp Moisel wrote:

I don't exactly know _why_ it works, but now it does.

If the above code works for you, thats means you have a 'faelleForm' with array of 'rows' attribute which contains 'inBearbeitung' attribute. Am I correct, lets check by posting your action form.
 
Philipp Moisel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I sure got such an object. but as I understood the taglibs my first try with

should generate the same output.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic