• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Adding Objects to an ArrayList (Checkboxes)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding Objects to an ArrayList (Checkboxes)


  • Subject: Re: Adding Objects to an ArrayList (Checkboxes)
  • From: Janice Cheung <email@hidden>
  • Date: Fri, 07 Oct 2005 17:14:42 -0400

    Ken,

    I call addServer() when I click on an "EmailServerContacts" button, to bring all the servers clicked to the next page.
    I will also have it to set the ArrayList for downloadable reports (a collection of server data for all server checkboxes clicked).
    Basically the nextPage contains all the server contact information for all the servers clicked (basically for Server Broadcast emails).
   
    Here is my EmailServerContacts() function (I just wanted to confirm that serverIsCheckedList was retrieving data):

    public WOComponent EmailServerContacts(){
       EmailServerContacts nextPage=(EmailServerContacts)pageWithName("EmailServerContacts");
       addServer();
       return nextPage;
    }
   

    Prior to the checkbox functionality request, my EmailServerContacts() function basically just set one Server object
    for the next page.

    public WOComponent EmailServerContacts(){
        EmailServerContacts nextPage=(EmailServerContacts)pageWithName("EmailServerContacts");
        nextPage.setServerGroup(serverDisplayGroup);
        nextPage.setServer(server);
        return nextPage;
    }

   
I do not quite know how I'll extract the server attributes from the ArrayList yet ... (probably set an array to the arraylist?)
    but I figured I would think about that after making sure my "serverIsChecked" ArrayList contained some data.

    What do you think I am doing wrong?

    Thanks for responding to me.. I really appreciate it.

    Best regards,
    Janice
   


Ken Anderson wrote:
Janice,

What are you trying to do exactly?  I understand you have a page, and it seems like you have a list of servers on the page with checkboxes next to them.  Is that correct?

Is addServer an action?  At what point are you trying to get the list of checked servers?

Ken

On Oct 7, 2005, at 4:52 PM, Janice Cheung wrote:

    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

 _______________________________________________
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

  • Follow-Ups:
    • Re: Adding Objects to an ArrayList (Checkboxes)
      • From: David LeBer <email@hidden>
References: 
 >Re: Wanting to return an .XML document for a direct action (From: WebObjects <email@hidden>)
 >Adding Objects to an ArrayList (Checkboxes) (From: Janice Cheung <email@hidden>)
 >Re: Adding Objects to an ArrayList (Checkboxes) (From: Ken Anderson <email@hidden>)

  • Prev by Date: Re: Adding Objects to an ArrayList (Checkboxes)
  • Next by Date: Re: Adding Objects to an ArrayList (Checkboxes)
  • Previous by thread: Re: Adding Objects to an ArrayList (Checkboxes)
  • Next by thread: Re: Adding Objects to an ArrayList (Checkboxes)
  • Index(es):
    • Date
    • Thread