This might be a suggested enhancement ala propertyValue="../foo" for the
nested:equal and all like comparative tags. Post it on the dev board.  I
could see where it would be useful for sure.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


> -----Original Message-----
> From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 02, 2002 7:52 AM
> To: Struts-User
> Subject: [Nested] Getting value from parent during iteration
>
>
> Using Struts 1.0.2 and Nested extension
>
> The value attribute doesn't support the nested syntax of walking
> up a tree a la "../foo".  How is this result achieved?
>
> In my JSP I have the following
>
> <nested:root name="dependencies">
>   <nested:iterate property="types">
>     <nested:equal property="name" value="../currentType">
>         Do stuff
>     </nested:equal>
>   </nested:iterate>
> </nested:root>
>
> class DepBean {  // available with session key 'dependencies'
>   private String currentType;
>   private Collection types;
>   public String getCurrentType() { return currentType; }
>   public Collection getTypes() { return types; }
>   ...
> }
>
> public class DepType {
>   private String name;
>   public String getName() { return name; }
>   ...
> }
>
> Even if I resort to specifying the value using a scriptlet, how
> can I get at the DepBean without having
>
> <%
>   DepBean foo = (DepBean)session.getAttribute("dependencies");
>   String currentType = foo.getCurrentType();
> %>
>
> and changing the <nested:equal> to
>
>     <nested:equal property="name" value="<%=currentType%>">
>
> Is this my only option?
>
> Sri
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to