Re: How to get each CheckBox value inside a WORepetition Bind to the same variable
Re: How to get each CheckBox value inside a WORepetition Bind to the same variable
- Subject: Re: How to get each CheckBox value inside a WORepetition Bind to the same variable
- From: Mark Morris <email@hidden>
- Date: Thu, 16 Jun 2011 10:21:01 -0500
Hi,
[snip]
masterCheck : WOCheckBox { class = "texte"; name = "master"; selection = selectedMaster; ----->Variable bind to check box value value = master.diplSpecAbr; --->CheckBox value ;----> JS function wo call a java method to get checkbox value
The only binding you need to get the checkbox value is the "value" binding. This is two-way, just like a WOString. When the page is displayed, it will try to evaluate diplSpecAbr or getDiplSpecAbr. When the form is submitted, it will call setDiplSpecAbr. (Or it will try to read and set the variable, if that's what it is vs. accessor methods.) You don't need the "selection" or "onclick" to get the values back. master.diplSpecAbr, for each item, will just be set to the value automatically when the form is submitted.
For checkboxes, it's often useful to have accessor methods in the page's java that explicitly translates between the checkbox's boolean and the meaning in the object. You would have access to the "master" item from the repetition there, so implementation is straightforward.
Hope this helps!
Regards, Mark |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden