Adding Objects to an ArrayList (Checkboxes)
Adding Objects to an ArrayList (Checkboxes)
- Subject: Adding Objects to an ArrayList (Checkboxes)
- From: Janice Cheung <email@hidden>
- Date: Fri, 07 Oct 2005 16:52:58 -0400
Greetings,
I am using an ArrayList to add server items for all servers that
have a boolean isChecked value equal to true.
I am using a WORepetition to display a list of "m_Servers", with
"server" object items.
I added the following to my Server class:
public boolean isChecked;
public boolean isChecked(){
return isChecked;
}
I use a fetch specification to populate the WORepetition with an
"m_Servers" list binding and a "server" item binding.
Repetition1:WORepetition{
item=server;
list=m_Servers;
}
CheckBox1: WOCheckBox{
checked=server.isChecked;
}
I am aiming to provide the functionality where, when a Server item
in the WORepetition is checked, it is added to
a ArrayList named "serverIsCheckedList". This ArrayList will
enable me to retrieve all the server attributes for
all servers checked. However, my ArrayList is showing null and no
items are being added to my ArrayList. What
am I doing wrong?
This is my addServer function:
public void
addServer(){
for (Iterator it=m_Servers().iterator();it.hasNext();)
{
Server s=(Server)it.next();
if((s.isChecked==true))
{
serverIsCheckedList.add(s);
NSLog.out.appendln("=========here is my
serverIsCheckedList=========="+serverIsCheckedList);
}
}
}
What am I doing
incorrectly? Am I iterating through the m_Servers array properly? No
servers are being added to my
serverIsCheckedList and no items are being printed out from my
NSLog.out.appendln.
I would really appreciate any advice or guidance. I am tearing my
hair out. Thanks for helping me.
Best regards,
Janice
|
_______________________________________________
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