RE: [Nested Tags] Frustration..Should this work?

2002-11-28 Thread Arron Bates
A really subtle problem. Remind me to make this advice available some
place else when I'm done (like a mail archive?)... :)


Trap one: It sounds like the bean reference is a collection itself.

A little more background clarity... The nested tags never actually
define references, they simply construct the nested property property
for when a tag really needs it, like a nested text tag or whatever.

So, with this root tag being the collection, it will actually try and
make a property that looks like [0] rather than myProperty[0].
Basically, when BeanUtils tries to apply the property it's having
issues.

To get around this, have the collection one level down in a really
simple bean, and make the bean reference to that. This will kick
everything off with a proper name in front of that index value,
eg: listProperty[5]


All in all, nested properties must have at least one substantial named
property. They can't just go this/ against the root bean, as there's
no name for BeanUtils to play with, even for children as their
evaluation will be .something, the dot on the front assumes a nesting
level and it all falls down.


Trap two: This is actually because of the first problem. When the child
tags are trying to do their thing, they're simply appending to the
index. From above you can see that the follow-on for a child will be
[5].somethingProperty. Once again, the property is just BeanUtils
having an issue.


Summary:
Just keep in mind that the nested tags are all about managing the
property property so BeanUtils can do its thing. We need that meaningful
property to start off with.

nested:iterate property=somethingMeaningful

I'm quite sure that putting a bean around that top collection will make
things easier.

Using this/ and such is really just a helper for when you need the the
object itself in a collection. Without a properly set up parent, it all
falls down.


On a completely different note...
I just want to thank Sri for really putting in some effort to help
people get around the nature of the nested tags. When all the list comes
down into my email client and there's a nested problem, one from Sri
usually follows smartly.

The nested tags have an esoteric following (that I know of), no-one on
this list goes out the their way to recommend them outside of the old
list in lists problem, whatever (I'm curious to see if they even get a
mention in any of these spiffy new books... :). They mostly snag new
users who haven't had an old die-hard bend their ear about best (not
necessarily pragmatic) practices :) It is a fact however, that they can
truly make life easier.

I can't watch the list as often as I'd like, and it's been a big
reassurance than the users have somewhere to turn with issues. Sri's one
of the peoples that make this list a great [ot] Impact with wall
resource.

How many people apologise for a not leading to the answer?...

Thanks again Sri.


Arron.



On Thu, 2002-11-28 at 03:07, [EMAIL PROTECTED] wrote:
 
 Thank you for reminding me of that link.  I tried ./value and this/value
 without success.
 
 Even though I use the nested:form as the root..for this iterate tag I
 want to tell it to look to
 an object in page scope instead of the form bean. That is what I thought
 the combinations of name and property were all
 about.From docs:
 
 **
 The collection to be iterated over must be specified in one of the following ways:
 As a runtime expression specified as the value of the collection attribute.
 As a JSP bean specified by the name attribute.
 As the property, specified by the property, of the JSP bean specified by the name 
attribute.
 
 
 I understand that the name is not needed by the nested tags (thats why I
 use them so much :-) ), but
 the nested docs simply point to the docs for the standard logic tags.
 
 The nested:iterate seems to work as expected, but the nested equal and
 write either do not see the current object exposed by nested:iterate OR the
 nested:iterate is not exposing the current object.
 
 I guess my original question still is: should this code work?
 
 nested:define id=collectionCode name=%=
 WebConstants.COLLECTIONCODE_KEY % property=list/
 nested:define id=col  property=collectionCode type
 =java.lang.String/
 
 nested:iterate   name=collectionCode 
 nested:equal  property=value value=%= col %
nested:write  property=label/
 /nested:equal
 /nested:iterate
 
 Thanks for the help..
 
 
 
 
 Sri Sankaran [EMAIL PROTECTED] on 11/27/2002 09:09:59 AM
 
 Please respond to Struts Users Mailing List
[EMAIL PROTECTED]
 
 To:Struts Users Mailing List [EMAIL PROTECTED]
 cc:
 
 Subject:RE: [Nested Tags] Frustration..Should this work?
 
 
 I suspected a problem to be with the iterate since that's what your stack
 trace suggests.
 
 Also, look at Arron's reply to an earlier post (by you, in fact!)
 http://marc.theaimsgroup.com/?l=struts-userm=103584892423199w=2.  He
 states that the name attribute is ignored.
 
 Given that I don't know how

RE: [Nested Tags] Frustration..Should this work? - Future?

2002-11-28 Thread Jeff_Mychasiw

Thank you, that makes things clearer.


Arron Bates wrote:
The nested tags have an esoteric following (that I know of), no-one on
this list goes out the their way to recommend them outside of the old
list in lists problem, whatever (I'm curious to see if they even get a
mention in any of these spiffy new books... :).


It is true that I started using them because of lists in lists thing.
I used them in combination with ListUtils.LazyList in commons collections
and they worked well.


One of the biggest things I like about them is that I can replace the
countless
bean:write name=formBeanName property=xyz/ with
nested:write property=xyz /

It always seemed odd to me that the html:text was nested but the bean:write
needed the name of the form bean..

They make things so easy that I just use them everywhere without even
thinking about some of the issues.


I have one big question:
I seems that everyone is talking JSTL, struts-EL ect..

How does the nested library fit into this?

Does JSTL have the power of nested tags? Will there be nested-EL...?

Thanks again.



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




RE: [Nested Tags] Frustration..Should this work?

2002-11-27 Thread Sri Sankaran
I wonder if this would work

nested:root name=pageList
  nested:iterate property=this/
%-- etc --%
  /nested:iterate
/nested:root

Sri

-Original Message-
From: Sri Sankaran 
Sent: Wednesday, November 27, 2002 9:13 AM
To: Struts Users Mailing List
Subject: RE: [Nested Tags] Frustration..Should this work?


Is this happening inside a nested:form?  If so, I am fairly certain that 
nested:iterate ignores the value of its name attribute.  That would explain why your

nested:iterate name=pageList

isn't working.  Also, you probably recognize the problem with changing it to

nested:iterate property=pageList

That wont work since pageList isn't a property of your form bean.  So you'll have to 
specify a nested:root to tell the nested structure the root node.  However, I see that 
pageList isn't contained within another bean either.  There is a way around this 
situation; it just isn't coming to meI'll keep looking.

Anyway hope this gets your started.

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, November 26, 2002 4:48 PM
To: [EMAIL PROTECTED]
Subject: [Nested Tags] Frustration..Should this work?


Greetings:
All I am trying to do is display a a selected item form a list.

 - pageList is standard java.util.List of LabelValueBeans set in page scope.
 - cc is a String pulled out of the form bean and set to page scope.

Using the nested tags my first approach was this:

 nested:iterate  name=pageList 
  nested:equal  property=value value=%= cc %
nested:write   property=label/
  /nested:equal
  /nested:iterate


But to get it working I am forced to  redo it like this:
nested:iterate   id=it name=pageList type=org...LabelValueBean
 logic:equal  name=it property=value value=%= cc %
bean:write  name=it property=label/
 /logic:equal
/nested:iterate

Before I report this to bugzilla, I would like it  if someone could tell me if I am 
doing something wrong.

The error I get is:
2002-11-26 15:32:23 ApplicationDispatcher[/ar] Servlet.service() for servlet jsp threw 
exception java.lang.NullPointerException
  at java.util.Hashtable.put(Hashtable.java:394)
  at 
org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:229)
  at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:390)
  at 
org.apache.struts.taglib.nested.logic.NestedIterateTag.doStartTag(NestedIterateTag.java:121)
  at 
org.apache.jsp.DetailedProfileReadOnlyForm$jsp._jspService(DetailedProfileReadOnlyForm$jsp.java:336)
  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)



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


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


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




RE: [Nested Tags] Frustration..Should this work?

2002-11-27 Thread Jeff_Mychasiw

Thanks for the reply:
It is inside a nested form but I am getting these values by setting to page
scope.

The nested iterate has no problem reading the collection. The problem is
the equal and write tag *inside* the iterate.  They only work
if I change them to their non nested versions and explicitly set an id to
read by the *inner* tags.

** Summary  of code below **
The first define tag grabs a wrapper object from application scope and gets
the internal List and sets it to page scope - This works.
The second define tag gets a value from the form bean (using a nested form)
and set it to page scope. - This works.
The nested:iterate tag gets the  collectionCode from page scope. - This
Works.
The nested:equal tag *should* use property=value from each LabelValueBean
in the List - This does not work.

* This code works 
nested:define id=collectionCode name=%= WebConstants.COLLECTIONCODE_KEY % 
property=list/
nested:define id=col  property=collectionCode type=java.lang.String/

nested:iterate id=item  name=collectionCode 
type=com.nlg.ar.common.datatransfer.vo.LabelValueBean
logic:equal name=item property=value value=%= col %
   bean:write name=item property=label/
/logic:equal
/nested:iterate

* This code does NOT work - but I think that it should ***
nested:define id=collectionCode name=%= 
WebConstants.STATICLIST_COLLECTIONCODE_KEY % property=list/
nested:define id=col  property=collectionCode type=java.lang.String/

nested:iterate   name=collectionCode 
nested:equal  property=value value=%= col %
   nested:write  property=label/
/nested:equal
/nested:iterate








Sri Sankaran [EMAIL PROTECTED] on 11/27/2002 08:16:06 AM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:Struts Users Mailing List [EMAIL PROTECTED]
cc:

Subject:RE: [Nested Tags] Frustration..Should this work?


I wonder if this would work

nested:root name=pageList
  nested:iterate property=this/
%-- etc --%
  /nested:iterate
/nested:root

Sri

-Original Message-
From: Sri Sankaran
Sent: Wednesday, November 27, 2002 9:13 AM
To: Struts Users Mailing List
Subject: RE: [Nested Tags] Frustration..Should this work?


Is this happening inside a nested:form?  If so, I am fairly certain that
nested:iterate ignores the value of its name attribute.  That would explain
why your

nested:iterate name=pageList

isn't working.  Also, you probably recognize the problem with changing it
to

nested:iterate property=pageList

That wont work since pageList isn't a property of your form bean.  So
you'll have to specify a nested:root to tell the nested structure the root
node.  However, I see that pageList isn't contained within another bean
either.  There is a way around this situation; it just isn't coming to
meI'll keep looking.

Anyway hope this gets your started.

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 4:48 PM
To: [EMAIL PROTECTED]
Subject: [Nested Tags] Frustration..Should this work?


Greetings:
All I am trying to do is display a a selected item form a list.

 - pageList is standard java.util.List of LabelValueBeans set in page
 scope.
 - cc is a String pulled out of the form bean and set to page scope.

Using the nested tags my first approach was this:

 nested:iterate  name=pageList 
  nested:equal  property=value value=%= cc %
nested:write   property=label/
  /nested:equal
  /nested:iterate


But to get it working I am forced to  redo it like this:
nested:iterate   id=it name=pageList type=org...LabelValueBean
 logic:equal  name=it property=value value=%= cc %
bean:write  name=it property=label/
 /logic:equal
/nested:iterate

Before I report this to bugzilla, I would like it  if someone could tell me
if I am doing something wrong.

The error I get is:
2002-11-26 15:32:23 ApplicationDispatcher[/ar] Servlet.service() for
servlet jsp threw exception java.lang.NullPointerException
  at java.util.Hashtable.put(Hashtable.java:394)
  at
  org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:229)

  at
  org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:390)

  at
  
org.apache.struts.taglib.nested.logic.NestedIterateTag.doStartTag(NestedIterateTag.java:121)

  at org.apache.jsp.DetailedProfileReadOnlyForm$jsp.
  _jspService(DetailedProfileReadOnlyForm$jsp.java:336)
  at
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)



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


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


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

RE: [Nested Tags] Frustration..Should this work?

2002-11-27 Thread Sri Sankaran
I suspected a problem to be with the iterate since that's what your stack trace 
suggests.  

Also, look at Arron's reply to an earlier post (by you, in fact!) 
http://marc.theaimsgroup.com/?l=struts-userm=103584892423199w=2.  He states that the 
name attribute is ignored.

Given that I don't know how the working version works.  I trust by works you mean 
that you are able to display a collection of label values.

Have you tried looking at what's going on at line 121 of NestedIterateTag?

Sorry I don't have any answers.

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, November 27, 2002 9:49 AM
To: Struts Users Mailing List
Subject: RE: [Nested Tags] Frustration..Should this work?



Thanks for the reply:
It is inside a nested form but I am getting these values by setting to page scope.

The nested iterate has no problem reading the collection. The problem is the equal and 
write tag *inside* the iterate.  They only work if I change them to their non nested 
versions and explicitly set an id to read by the *inner* tags.

** Summary  of code below **
The first define tag grabs a wrapper object from application scope and gets the 
internal List and sets it to page scope - This works. The second define tag gets a 
value from the form bean (using a nested form) and set it to page scope. - This works. 
The nested:iterate tag gets the  collectionCode from page scope. - This Works. The 
nested:equal tag *should* use property=value from each LabelValueBean in the List - 
This does not work.

* This code works  nested:define id=collectionCode 
name=%= WebConstants.COLLECTIONCODE_KEY % property=list/ nested:define 
id=col  property=collectionCode type=java.lang.String/

nested:iterate id=item  name=collectionCode 
type=com.nlg.ar.common.datatransfer.vo.LabelValueBean
logic:equal name=item property=value value=%= col %
   bean:write name=item property=label/
/logic:equal
/nested:iterate

* This code does NOT work - but I think that it should *** 
nested:define id=collectionCode name=%= 
WebConstants.STATICLIST_COLLECTIONCODE_KEY % property=list/ nested:define 
id=col  property=collectionCode type=java.lang.String/

nested:iterate   name=collectionCode 
nested:equal  property=value value=%= col %
   nested:write  property=label/
/nested:equal
/nested:iterate








Sri Sankaran [EMAIL PROTECTED] on 11/27/2002 08:16:06 AM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:Struts Users Mailing List [EMAIL PROTECTED]
cc:

Subject:RE: [Nested Tags] Frustration..Should this work?


I wonder if this would work

nested:root name=pageList
  nested:iterate property=this/
%-- etc --%
  /nested:iterate
/nested:root

Sri

-Original Message-
From: Sri Sankaran
Sent: Wednesday, November 27, 2002 9:13 AM
To: Struts Users Mailing List
Subject: RE: [Nested Tags] Frustration..Should this work?


Is this happening inside a nested:form?  If so, I am fairly certain that 
nested:iterate ignores the value of its name attribute.  That would explain why your

nested:iterate name=pageList

isn't working.  Also, you probably recognize the problem with changing it to

nested:iterate property=pageList

That wont work since pageList isn't a property of your form bean.  So you'll have to 
specify a nested:root to tell the nested structure the root node.  However, I see that 
pageList isn't contained within another bean either.  There is a way around this 
situation; it just isn't coming to meI'll keep looking.

Anyway hope this gets your started.

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 4:48 PM
To: [EMAIL PROTECTED]
Subject: [Nested Tags] Frustration..Should this work?


Greetings:
All I am trying to do is display a a selected item form a list.

 - pageList is standard java.util.List of LabelValueBeans set in page  scope.
 - cc is a String pulled out of the form bean and set to page scope.

Using the nested tags my first approach was this:

 nested:iterate  name=pageList 
  nested:equal  property=value value=%= cc %
nested:write   property=label/
  /nested:equal
  /nested:iterate


But to get it working I am forced to  redo it like this:
nested:iterate   id=it name=pageList type=org...LabelValueBean
 logic:equal  name=it property=value value=%= cc %
bean:write  name=it property=label/
 /logic:equal
/nested:iterate

Before I report this to bugzilla, I would like it  if someone could tell me if I am 
doing something wrong.

The error I get is:
2002-11-26 15:32:23 ApplicationDispatcher[/ar] Servlet.service() for servlet jsp threw 
exception java.lang.NullPointerException
  at java.util.Hashtable.put(Hashtable.java:394)
  at
  org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:229

RE: [Nested Tags] Frustration..Should this work?

2002-11-27 Thread Jeff_Mychasiw

Thank you for reminding me of that link.  I tried ./value and this/value
without success.

Even though I use the nested:form as the root..for this iterate tag I
want to tell it to look to
an object in page scope instead of the form bean. That is what I thought
the combinations of name and property were all
about.From docs:

**
The collection to be iterated over must be specified in one of the following ways:
As a runtime expression specified as the value of the collection attribute.
As a JSP bean specified by the name attribute.
As the property, specified by the property, of the JSP bean specified by the name 
attribute.


I understand that the name is not needed by the nested tags (thats why I
use them so much :-) ), but
the nested docs simply point to the docs for the standard logic tags.

The nested:iterate seems to work as expected, but the nested equal and
write either do not see the current object exposed by nested:iterate OR the
nested:iterate is not exposing the current object.

I guess my original question still is: should this code work?

nested:define id=collectionCode name=%=
WebConstants.COLLECTIONCODE_KEY % property=list/
nested:define id=col  property=collectionCode type
=java.lang.String/

nested:iterate   name=collectionCode 
nested:equal  property=value value=%= col %
   nested:write  property=label/
/nested:equal
/nested:iterate

Thanks for the help..




Sri Sankaran [EMAIL PROTECTED] on 11/27/2002 09:09:59 AM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:Struts Users Mailing List [EMAIL PROTECTED]
cc:

Subject:RE: [Nested Tags] Frustration..Should this work?


I suspected a problem to be with the iterate since that's what your stack
trace suggests.

Also, look at Arron's reply to an earlier post (by you, in fact!)
http://marc.theaimsgroup.com/?l=struts-userm=103584892423199w=2.  He
states that the name attribute is ignored.

Given that I don't know how the working version works.  I trust by works
you mean that you are able to display a collection of label values.

Have you tried looking at what's going on at line 121 of NestedIterateTag?

Sorry I don't have any answers.

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 9:49 AM
To: Struts Users Mailing List
Subject: RE: [Nested Tags] Frustration..Should this work?



Thanks for the reply:
It is inside a nested form but I am getting these values by setting to page
scope.

The nested iterate has no problem reading the collection. The problem is
the equal and write tag *inside* the iterate.  They only work if I change
them to their non nested versions and explicitly set an id to read by the
*inner* tags.

** Summary  of code below **
The first define tag grabs a wrapper object from application scope and gets
the internal List and sets it to page scope - This works. The second define
tag gets a value from the form bean (using a nested form) and set it to
page scope. - This works. The nested:iterate tag gets the  collectionCode
from page scope. - This Works. The nested:equal tag *should* use property
=value from each LabelValueBean in the List - This does not work.

* This code works  nested:define id
=collectionCode name=%= WebConstants.COLLECTIONCODE_KEY % property
=list/ nested:define id=col  property=collectionCode type
=java.lang.String/

nested:iterate id=item  name=collectionCode type
=com.nlg.ar.common.datatransfer.vo.LabelValueBean
logic:equal name=item property=value value=%= col %
   bean:write name=item property=label/
/logic:equal
/nested:iterate

* This code does NOT work - but I think that it should ***
nested:define id=collectionCode name=%=
WebConstants.STATICLIST_COLLECTIONCODE_KEY % property=list/
nested:define id=col  property=collectionCode type
=java.lang.String/

nested:iterate   name=collectionCode 
nested:equal  property=value value=%= col %
   nested:write  property=label/
/nested:equal
/nested:iterate








Sri Sankaran [EMAIL PROTECTED] on 11/27/2002 08:16:06 AM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:Struts Users Mailing List [EMAIL PROTECTED]
cc:

Subject:RE: [Nested Tags] Frustration..Should this work?


I wonder if this would work

nested:root name=pageList
  nested:iterate property=this/
%-- etc --%
  /nested:iterate
/nested:root

Sri

-Original Message-
From: Sri Sankaran
Sent: Wednesday, November 27, 2002 9:13 AM
To: Struts Users Mailing List
Subject: RE: [Nested Tags] Frustration..Should this work?


Is this happening inside a nested:form?  If so, I am fairly certain that
nested:iterate ignores the value of its name attribute.  That would explain
why your

nested:iterate name=pageList

isn't working.  Also, you probably recognize the problem with changing it
to

nested:iterate property=pageList

That wont work since pageList isn't

RE: [Nested Tags] Frustration..Should this work?

2002-11-27 Thread Sri Sankaran
I don't have an answer to your question, should this code work -- since I've never 
used the name attribute in any nested tag other than nested:root.

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, November 27, 2002 11:08 AM
To: Struts Users Mailing List
Subject: RE: [Nested Tags] Frustration..Should this work?



Thank you for reminding me of that link.  I tried ./value and this/value without 
success.

Even though I use the nested:form as the root..for this iterate tag I want to 
tell it to look to an object in page scope instead of the form bean. That is what I 
thought the combinations of name and property were all about.From docs:

**
The collection to be iterated over must be specified in one of the following ways: As 
a runtime expression specified as the value of the collection attribute. As a JSP bean 
specified by the name attribute. As the property, specified by the property, of the 
JSP bean specified by the name attribute.


I understand that the name is not needed by the nested tags (thats why I use them so 
much :-) ), but the nested docs simply point to the docs for the standard logic tags.

The nested:iterate seems to work as expected, but the nested equal and write either do 
not see the current object exposed by nested:iterate OR the nested:iterate is not 
exposing the current object.

I guess my original question still is: should this code work?

nested:define id=collectionCode name=%= WebConstants.COLLECTIONCODE_KEY % 
property=list/ nested:define id=col  property=collectionCode type 
=java.lang.String/

nested:iterate   name=collectionCode 
nested:equal  property=value value=%= col %
   nested:write  property=label/
/nested:equal
/nested:iterate

Thanks for the help..




Sri Sankaran [EMAIL PROTECTED] on 11/27/2002 09:09:59 AM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:Struts Users Mailing List [EMAIL PROTECTED]
cc:

Subject:RE: [Nested Tags] Frustration..Should this work?


I suspected a problem to be with the iterate since that's what your stack trace 
suggests.

Also, look at Arron's reply to an earlier post (by you, in fact!) 
http://marc.theaimsgroup.com/?l=struts-userm=103584892423199w=2.  He states that the 
name attribute is ignored.

Given that I don't know how the working version works.  I trust by works you mean 
that you are able to display a collection of label values.

Have you tried looking at what's going on at line 121 of NestedIterateTag?

Sorry I don't have any answers.

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 9:49 AM
To: Struts Users Mailing List
Subject: RE: [Nested Tags] Frustration..Should this work?



Thanks for the reply:
It is inside a nested form but I am getting these values by setting to page scope.

The nested iterate has no problem reading the collection. The problem is the equal and 
write tag *inside* the iterate.  They only work if I change them to their non nested 
versions and explicitly set an id to read by the
*inner* tags.

** Summary  of code below **
The first define tag grabs a wrapper object from application scope and gets the 
internal List and sets it to page scope - This works. The second define tag gets a 
value from the form bean (using a nested form) and set it to page scope. - This works. 
The nested:iterate tag gets the  collectionCode from page scope. - This Works. The 
nested:equal tag *should* use property =value from each LabelValueBean in the List - 
This does not work.

* This code works  nested:define id =collectionCode 
name=%= WebConstants.COLLECTIONCODE_KEY % property =list/ nested:define 
id=col  property=collectionCode type =java.lang.String/

nested:iterate id=item  name=collectionCode type
=com.nlg.ar.common.datatransfer.vo.LabelValueBean
logic:equal name=item property=value value=%= col %
   bean:write name=item property=label/
/logic:equal
/nested:iterate

* This code does NOT work - but I think that it should *** 
nested:define id=collectionCode name=%= 
WebConstants.STATICLIST_COLLECTIONCODE_KEY % property=list/ nested:define 
id=col  property=collectionCode type =java.lang.String/

nested:iterate   name=collectionCode 
nested:equal  property=value value=%= col %
   nested:write  property=label/
/nested:equal
/nested:iterate








Sri Sankaran [EMAIL PROTECTED] on 11/27/2002 08:16:06 AM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:Struts Users Mailing List [EMAIL PROTECTED]
cc:

Subject:RE: [Nested Tags] Frustration..Should this work?


I wonder if this would work

nested:root name=pageList
  nested:iterate property=this/
%-- etc --%
  /nested:iterate
/nested:root

Sri

-Original Message-
From: Sri Sankaran
Sent: Wednesday, November 27, 2002 9:13 AM
To: Struts Users Mailing List
Subject: RE

RE: [Nested Tags] Frustration..Should this work?

2002-11-27 Thread Jeff_Mychasiw

Thanks again for all the help.

I guess I need to take a step back,
because we are in active development, I will go with what works, even
though I do not fully understand why :-)




Sri Sankaran [EMAIL PROTECTED] on 11/27/2002 10:43:44 AM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:Struts Users Mailing List [EMAIL PROTECTED]
cc:

Subject:RE: [Nested Tags] Frustration..Should this work?


I don't have an answer to your question, should this code work -- since
I've never used the name attribute in any nested tag other than
nested:root.

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 11:08 AM
To: Struts Users Mailing List
Subject: RE: [Nested Tags] Frustration..Should this work?



Thank you for reminding me of that link.  I tried ./value and this/value
without success.

Even though I use the nested:form as the root..for this iterate tag I
want to tell it to look to an object in page scope instead of the form
bean. That is what I thought the combinations of name and property were all
about.From docs:

**
The collection to be iterated over must be specified in one of the
following ways: As a runtime expression specified as the value of the
collection attribute. As a JSP bean specified by the name attribute. As the
property, specified by the property, of the JSP bean specified by the name
attribute.


I understand that the name is not needed by the nested tags (thats why I
use them so much :-) ), but the nested docs simply point to the docs for
the standard logic tags.

The nested:iterate seems to work as expected, but the nested equal and
write either do not see the current object exposed by nested:iterate OR the
nested:iterate is not exposing the current object.

I guess my original question still is: should this code work?

nested:define id=collectionCode name=%=
WebConstants.COLLECTIONCODE_KEY % property=list/ nested:define id
=col  property=collectionCode type =java.lang.String/

nested:iterate   name=collectionCode 
nested:equal  property=value value=%= col %
   nested:write  property=label/
/nested:equal
/nested:iterate

Thanks for the help..




Sri Sankaran [EMAIL PROTECTED] on 11/27/2002 09:09:59 AM

Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

To:Struts Users Mailing List [EMAIL PROTECTED]
cc:

Subject:RE: [Nested Tags] Frustration..Should this work?


I suspected a problem to be with the iterate since that's what your stack
trace suggests.

Also, look at Arron's reply to an earlier post (by you, in fact!)
http://marc.theaimsgroup.com/?l=struts-userm=103584892423199w=2.  He
states that the name attribute is ignored.

Given that I don't know how the working version works.  I trust by works
you mean that you are able to display a collection of label values.

Have you tried looking at what's going on at line 121 of NestedIterateTag?

Sorry I don't have any answers.

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 9:49 AM
To: Struts Users Mailing List
Subject: RE: [Nested Tags] Frustration..Should this work?



Thanks for the reply:
It is inside a nested form but I am getting these values by setting to page
scope.

The nested iterate has no problem reading the collection. The problem is
the equal and write tag *inside* the iterate.  They only work if I change
them to their non nested versions and explicitly set an id to read by the
*inner* tags.

** Summary  of code below **
The first define tag grabs a wrapper object from application scope and gets
the internal List and sets it to page scope - This works. The second define
tag gets a value from the form bean (using a nested form) and set it to
page scope. - This works. The nested:iterate tag gets the  collectionCode
from page scope. - This Works. The nested:equal tag *should* use property
=value from each LabelValueBean in the List - This does not work.

* This code works  nested:define id
=collectionCode name=%= WebConstants.COLLECTIONCODE_KEY % property
=list/ nested:define id=col  property=collectionCode type
=java.lang.String/

nested:iterate id=item  name=collectionCode type
=com.nlg.ar.common.datatransfer.vo.LabelValueBean
logic:equal name=item property=value value=%= col %
   bean:write name=item property=label/
/logic:equal
/nested:iterate

* This code does NOT work - but I think that it should ***
nested:define id=collectionCode name=%=
WebConstants.STATICLIST_COLLECTIONCODE_KEY % property=list/
nested:define id=col  property=collectionCode type
=java.lang.String/

nested:iterate   name=collectionCode 
nested:equal  property=value value=%= col %
   nested:write  property=label/
/nested:equal
/nested:iterate








Sri Sankaran [EMAIL PROTECTED] on 11/27/2002 08:16:06 AM

Please respond to Struts Users Mailing List