struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "CRANFORD, CHRIS" <Chris.Cranf...@setech.com>
Subject Re: class has set member, how s:iterator to access it?
Date Wed, 03 Jul 2013 00:24:49 GMT
In your example, make sure you have an exposed getter for partxrefs in the action.  
-chris
Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: john lee <sh_thorn_bird@yahoo.com>
Date: Tue, 2 Jul 2013 15:39:05 
To: Struts Users Mailing List<user@struts.apache.org>
Reply-To: Struts Users Mailing List <user@struts.apache.org>, john lee
	<sh_thorn_bird@yahoo.com>
Subject: Re: class has set member,  how s:iterator to access it?



I use Lucas's suggestion, but still can not get value out

please advise how to get list member of an class from stack.

thanks in advance

john

    <s:iterator id="partxref" value="partxrefs">
                          <s:property value="xref_type_code"/>
     </s:iterator>



________________________________
 From: john lee <sh_thorn_bird@yahoo.com>
To: struts support <user@struts.apache.org> 
Sent: Friday, June 28, 2013 11:15 PM
Subject: class has set member,  how s:iterator to access it?
 

i have an the following 2 class

Part is just parts itself
Partxref is the accesary(component) of part.

    class Part {
                    String  manufacture;
                    String  pid;
                    private Set<Partxref> partxrefs=new HashSet<Partxref>();
                    /* set, get .....here */        
            }
   
   Class Partxref {
                          Part  part;
                          int xref_type_code;
                          /* set, get....here */
                          }

  public class PartsearchAction  ...... {
              ArrayList<Part> parts;
              public void setParts(ArrayList<Part> parts) { this.parts=parts;
}
              public ArrayList<Part> getParts() { return parts; } 
               ....
   }

in my jsp,  the following works

              <s:iterator id="part" value="parts" status="st">
                 
                 <s:property value="pid"/>

                 <s:property value="manufacture.manu_name"/>
              </s:iterator>

but, i try to access partxref  {component(subset) } of parts,  failed.
              <s:iterator id="part" value="parts" status="st">
                 <s:property value="pid"/>

                 <s:property value="manufacture.manu_name"/>

                          <s:iterator id="partxref" value="#part.partxrefs">
                                  <s:property value="#partxref.xref_type_code"/>
                          </s:iterator>

              </s:iterator>
                
Please advise how to make  set member (partxref) of Part  works, thanks in advance

john


Email secured by Check Point




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message