Re: Adding Objects to an ArrayList (Checkboxes)
Re: Adding Objects to an ArrayList (Checkboxes)
- Subject: Re: Adding Objects to an ArrayList (Checkboxes)
- From: David LeBer <email@hidden>
- Date: Mon, 10 Oct 2005 19:26:36 -0400
On 10-Oct-05, at 7:07 PM, Janice Cheung wrote:
Hi Ken,
Here are the bindings for my repetition on the first page,
UserHome.wo:
Repetition 2:WORepetition{
item=server;
list=m_ServersA;
}
CheckBox2: WOCheckBox{
checked=objectSelected;
}
Here are my bindings for my next page, EmailServerContacts.wo:
Repetition1:WORepetition{
item= server;
list=selectedObjects;
}
I called the method, nextPage.setSelectedObjects(selectedObjects
()); as you suggested, but it still isn't working.
When I do setAllServersTrue, my servers are being passed
correctly over:
public WOComponent setServersTrue(){
UserHome nextPage=(UserHome)pageWithName(UserHome);
nextPage.fetchByDnsName();
nextPage.setSelectedObjects(m_ServersA);
return nextPage;
}
When you do this, do all of the checkboxes appear "checked"?
If so that is good, it means that the bindings are correct.
Also, I notice there is a bug in the code that I wrote (damn typing
off the top of my head!). This is wrong:
public boolean setObjectSelected(boolean value) {
<snip>
It should be:
public void setObjectSelected(boolean value) {
^^^^
Setter methods shouldn't have a return type (oops).
Since things are still not working, I recommend you follow Ken's
advice and add some kind of log statement to that method to track
down where it is breaking. ie:
public void setObjectSelected(boolean value) {
System.out.println("Now in setObjectsSelected with value: " +
value + " and server: " + server);
if (value) {
---etc---
--
;david
--
David LeBer
"I am codeferous!"
Codeferous Software
site: http://www.codeferous.com
blog: http://david.codeferous.com
_______________________________________________
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