You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by john lee <sh...@yahoo.com> on 2013/06/29 05:23:27 UTC

how to acess sublist of list from s:iterator


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:subset source="parts">
                                   <s:iterator id="partxref" value="partxrefs">
                                   <s:property  value="part.pid"/>
                                  </s:iterator>
                          </s:subset>

              </s:iterator>
                
Please advise how to make <s:set> section works, thanks in advance

john