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 06:15:58 UTC

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

Re: class has set member, how s:iterator to access it?

Posted by Lukasz Lenart <lu...@apache.org>.
2013/6/29 john lee <sh...@yahoo.com>:
> 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>

Have you tried to use <s:iterator id="partxref" value="partxrefs"> and
<s:property value="xref_type_code"/> ?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: class has set member, how s:iterator to access it?

Posted by Lukasz Lenart <lu...@apache.org>.
2013/7/3 john lee <sh...@yahoo.com>:
> 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>

The problem can be with the name of property, try to rename it to
xrefTypeCode with getter getXrefTypeCode or at least create getter
getXrefTypeCode and then use it

<s:property value="xrefTypeCode"/>


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: class has set member, how s:iterator to access it?

Posted by "CRANFORD, CHRIS" <Ch...@setech.com>.
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...@yahoo.com>
Date: Tue, 2 Jul 2013 15:39:05 
To: Struts Users Mailing List<us...@struts.apache.org>
Reply-To: Struts Users Mailing List <us...@struts.apache.org>, john lee
	<sh...@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...@yahoo.com>
To: struts support <us...@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


Re: class has set member, how s:iterator to access it?

Posted by john lee <sh...@yahoo.com>.

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...@yahoo.com>
To: struts support <us...@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