RE: logic:iterate and html:text indexed='true'/

2003-06-11 Thread Nadja Senoucci
Thanks for all the info! I'll look into it all and see if I can't get my
little form working one way or the other. :)

Greetings,
Nadja



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



logic:iterate and html:text indexed=true/

2003-06-10 Thread Nadja Senoucci
Hello again,

I am currently testing around with the above named tags (in order to get
around my earlier discribed problem sooner or later) and I don't think I
quite understand what happens when you set indexed=true for text fields.

I have this little bit of code in my .jsp:

logic:present name=cntarr
bean:define name=cntarr scope=session id=cntarr
type=java.util.Collection/
logic:iterate id=element name=cntarr 
tr bgcolor=#FF
td colspan=2html:text property=searchfield indexed=true//td
td colspan=2html:text property=searchparam indexed=true//td
/tr
/logic:iterate
/logic:present

And it seems that this results in the following bit of HTML:

tr bgcolor=#FF
td colspan=2input type=text
name=org.apache.struts.taglib.html.BEAN[0].searchfield value=/td
td colspan=2input type=text
name=org.apache.struts.taglib.html.BEAN[0].searchparam value=/td
/tr

Why is it saying org.apache.struts.taglib.html.BEAN[0].searchfield? I
would have thought it would be element[0].searchfield... And what do I need
 to do in my form bean to create set-methods for this? Meaning: What does
Struts expect to find in my form bean if I am using an indexed field as
shown above?

At the moment, I keep getting an index out of bounds-exception which is
quite natural, I think, since there is no array that could be set with
something like this org.apache.struts.taglib.html.BEAN[0].searchfield. So
I know, I am using these tags wrong. I just can't find out how to use them
correctly...

Greetings,
Nadja



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



RE: logic:iterate and html:text indexed=true/

2003-06-10 Thread shirishchandra.sakhare
Try using name=element in html:text along with indexed tag..

I think you have to make available the element bean to html:text tag...

-Original Message-
From: Nadja Senoucci [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 1:23 PM
To: [EMAIL PROTECTED]
Subject: logic:iterate and html:text indexed=true/


Hello again,

I am currently testing around with the above named tags (in order to get
around my earlier discribed problem sooner or later) and I don't think I
quite understand what happens when you set indexed=true for text fields.

I have this little bit of code in my .jsp:

logic:present name=cntarr
bean:define name=cntarr scope=session id=cntarr
type=java.util.Collection/
logic:iterate id=element name=cntarr 
tr bgcolor=#FF
td colspan=2html:text property=searchfield indexed=true//td
td colspan=2html:text property=searchparam indexed=true//td
/tr
/logic:iterate
/logic:present

And it seems that this results in the following bit of HTML:

tr bgcolor=#FF
td colspan=2input type=text
name=org.apache.struts.taglib.html.BEAN[0].searchfield value=/td
td colspan=2input type=text
name=org.apache.struts.taglib.html.BEAN[0].searchparam value=/td
/tr

Why is it saying org.apache.struts.taglib.html.BEAN[0].searchfield? I
would have thought it would be element[0].searchfield... And what do I need
 to do in my form bean to create set-methods for this? Meaning: What does
Struts expect to find in my form bean if I am using an indexed field as
shown above?

At the moment, I keep getting an index out of bounds-exception which is
quite natural, I think, since there is no array that could be set with
something like this org.apache.struts.taglib.html.BEAN[0].searchfield. So
I know, I am using these tags wrong. I just can't find out how to use them
correctly...

Greetings,
Nadja



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


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



RE: logic:iterate and html:text indexed='true'/

2003-06-10 Thread Nadja Senoucci
 Try using name=element in html:text along with indexed tag..

 I think you have to make available the element bean to html:text tag...

If I do that (tried it out) I will have to create a whole bean around this
because it is asking for get-/set-methods in that bean now. And I still
don't know what those methods would have to look like, that is what struts
is expecting... Does anyone know of a good (online) resource exlaining the
use of these tags or some example code? I am pretty much at a loss...

Greetings,
Nadja



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



Re: logic:iterate and html:text indexed=true/

2003-06-10 Thread Sandeep Takhar
my small understanding on how to use this is as
follows:

logic:iterate name=form_name
property=property_name id=property_name

html:text property=some_property indexed=true

ok -- 

1. form_name is the name of the form
2. property_name is the name of the property and for
some reason the id= also has to have the same name
3. indexed=true indicates that property is coming
from what we are iterating over.
4. I have only got this to work with forms.

So I don't know if it works for session scoped beans
and it means that when you submit it will populate the
bean.

sandeep
--- Nadja Senoucci [EMAIL PROTECTED] wrote:
 Hello again,
 
 I am currently testing around with the above named
 tags (in order to get
 around my earlier discribed problem sooner or later)
 and I don't think I
 quite understand what happens when you set
 indexed=true for text fields.
 
 I have this little bit of code in my .jsp:
 
 logic:present name=cntarr
 bean:define name=cntarr scope=session
 id=cntarr
 type=java.util.Collection/
 logic:iterate id=element name=cntarr 
 tr bgcolor=#FF
 td colspan=2html:text property=searchfield
 indexed=true//td
 td colspan=2html:text property=searchparam
 indexed=true//td
 /tr
 /logic:iterate
 /logic:present
 
 And it seems that this results in the following bit
 of HTML:
 
 tr bgcolor=#FF
 td colspan=2input type=text

name=org.apache.struts.taglib.html.BEAN[0].searchfield
 value=/td
 td colspan=2input type=text

name=org.apache.struts.taglib.html.BEAN[0].searchparam
 value=/td
 /tr
 
 Why is it saying
 org.apache.struts.taglib.html.BEAN[0].searchfield?
 I
 would have thought it would be
 element[0].searchfield... And what do I need
  to do in my form bean to create set-methods for
 this? Meaning: What does
 Struts expect to find in my form bean if I am using
 an indexed field as
 shown above?
 
 At the moment, I keep getting an index out of
 bounds-exception which is
 quite natural, I think, since there is no array that
 could be set with
 something like this
 org.apache.struts.taglib.html.BEAN[0].searchfield.
 So
 I know, I am using these tags wrong. I just can't
 find out how to use them
 correctly...
 
 Greetings,
 Nadja
 
 
 

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


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



RE: logic:iterate and html:text indexed=true/

2003-06-10 Thread Mark Galbreath
Of course it works with session-scoped beans; that's what an
ActionForn/DynaActionForm is by default.  second, id is complete arbitrary
- you can call any page object anything you want.

Mark

-Original Message-
From: Sandeep Takhar [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 10, 2003 2:41 PM
To: Struts Users Mailing List
Subject: Re: logic:iterate and html:text indexed=true/


my small understanding on how to use this is as
follows:

logic:iterate name=form_name
property=property_name id=property_name

html:text property=some_property indexed=true

ok -- 

1. form_name is the name of the form
2. property_name is the name of the property and for
some reason the id= also has to have the same name
3. indexed=true indicates that property is coming
from what we are iterating over.
4. I have only got this to work with forms.

So I don't know if it works for session scoped beans
and it means that when you submit it will populate the
bean.

sandeep
--- Nadja Senoucci [EMAIL PROTECTED] wrote:
 Hello again,
 
 I am currently testing around with the above named
 tags (in order to get
 around my earlier discribed problem sooner or later)
 and I don't think I
 quite understand what happens when you set
 indexed=true for text fields.
 
 I have this little bit of code in my .jsp:
 
 logic:present name=cntarr
 bean:define name=cntarr scope=session
 id=cntarr
 type=java.util.Collection/
 logic:iterate id=element name=cntarr 
 tr bgcolor=#FF
 td colspan=2html:text property=searchfield 
 indexed=true//td td colspan=2html:text 
 property=searchparam indexed=true//td
 /tr
 /logic:iterate
 /logic:present
 
 And it seems that this results in the following bit
 of HTML:
 
 tr bgcolor=#FF
 td colspan=2input type=text

name=org.apache.struts.taglib.html.BEAN[0].searchfield
 value=/td
 td colspan=2input type=text

name=org.apache.struts.taglib.html.BEAN[0].searchparam
 value=/td
 /tr
 
 Why is it saying org.apache.struts.taglib.html.BEAN[0].searchfield?
 I
 would have thought it would be
 element[0].searchfield... And what do I need
  to do in my form bean to create set-methods for
 this? Meaning: What does
 Struts expect to find in my form bean if I am using
 an indexed field as
 shown above?
 
 At the moment, I keep getting an index out of bounds-exception which 
 is quite natural, I think, since there is no array that
 could be set with
 something like this
 org.apache.struts.taglib.html.BEAN[0].searchfield.
 So
 I know, I am using these tags wrong. I just can't
 find out how to use them
 correctly...
 
 Greetings,
 Nadja
 
 
 

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


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



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



RE: logic:iterate and html:text indexed=true/

2003-06-10 Thread Sandeep Takhar
of course -I'm being stupid about the session scoped
beans,

however I haven't looked at the code and I don't know
how the indexed property works with the iterate
tag and I cannot extrapolate at the current moment
either about what the code might look like.  What I
mean to say is: I don't know if indexed=true works
for anything other than forms.  Should I guess, maybe
you know.

Are you sure you can name the id anything you want? 
It didn't seem to work for me until I named it the
same as the property for whatever reason.  Do you have
a working sample?  I suppose I should just try it.

Also: if you are using the nested:iterate, can you
include a jsp and have it used indexed=true I
wonder?

sandeep


--- Mark Galbreath [EMAIL PROTECTED] wrote:
 Of course it works with session-scoped beans; that's
 what an
 ActionForn/DynaActionForm is by default.  second,
 id is complete arbitrary
 - you can call any page object anything you want.
 
 Mark
 
 -Original Message-
 From: Sandeep Takhar
 [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, June 10, 2003 2:41 PM
 To: Struts Users Mailing List
 Subject: Re: logic:iterate and html:text
 indexed=true/
 
 
 my small understanding on how to use this is as
 follows:
 
 logic:iterate name=form_name
 property=property_name id=property_name
 
 html:text property=some_property indexed=true
 
 ok -- 
 
 1. form_name is the name of the form
 2. property_name is the name of the property and for
 some reason the id= also has to have the same name
 3. indexed=true indicates that property is coming
 from what we are iterating over.
 4. I have only got this to work with forms.
 
 So I don't know if it works for session scoped beans
 and it means that when you submit it will populate
 the
 bean.
 
 sandeep
 --- Nadja Senoucci [EMAIL PROTECTED] wrote:
  Hello again,
  
  I am currently testing around with the above named
  tags (in order to get
  around my earlier discribed problem sooner or
 later)
  and I don't think I
  quite understand what happens when you set
  indexed=true for text fields.
  
  I have this little bit of code in my .jsp:
  
  logic:present name=cntarr
  bean:define name=cntarr scope=session
  id=cntarr
  type=java.util.Collection/
  logic:iterate id=element name=cntarr 
  tr bgcolor=#FF
  td colspan=2html:text property=searchfield 
  indexed=true//td td colspan=2html:text 
  property=searchparam indexed=true//td
  /tr
  /logic:iterate
  /logic:present
  
  And it seems that this results in the following
 bit
  of HTML:
  
  tr bgcolor=#FF
  td colspan=2input type=text
 

name=org.apache.struts.taglib.html.BEAN[0].searchfield
  value=/td
  td colspan=2input type=text
 

name=org.apache.struts.taglib.html.BEAN[0].searchparam
  value=/td
  /tr
  
  Why is it saying
 org.apache.struts.taglib.html.BEAN[0].searchfield?
  I
  would have thought it would be
  element[0].searchfield... And what do I need
   to do in my form bean to create set-methods for
  this? Meaning: What does
  Struts expect to find in my form bean if I am
 using
  an indexed field as
  shown above?
  
  At the moment, I keep getting an index out of
 bounds-exception which 
  is quite natural, I think, since there is no array
 that
  could be set with
  something like this
 
 org.apache.struts.taglib.html.BEAN[0].searchfield.
  So
  I know, I am using these tags wrong. I just can't
  find out how to use them
  correctly...
  
  Greetings,
  Nadja
  
  
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 Yahoo! Calendar - Free online calendar with sync to
 Outlook(TM).
 http://calendar.yahoo.com
 

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

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


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



RE: logic:iterate and html:text indexed=true/

2003-06-10 Thread Sashi Ravipati
There is good example demonstrating this 

http://www.scioworks.net/devnews/strutsDistilled/updates/update-030401/indexedAttr.html


It is not very clear on how to declare an Action Form, so if some body
can show an example of how to use ArrayList etc it will be og great
help.

Thanks




 [EMAIL PROTECTED] 06/10/03 02:59PM 
of course -I'm being stupid about the session scoped
beans,

however I haven't looked at the code and I don't know
how the indexed property works with the iterate
tag and I cannot extrapolate at the current moment
either about what the code might look like.  What I
mean to say is: I don't know if indexed=true works
for anything other than forms.  Should I guess, maybe
you know.

Are you sure you can name the id anything you want? 
It didn't seem to work for me until I named it the
same as the property for whatever reason.  Do you have
a working sample?  I suppose I should just try it.

Also: if you are using the nested:iterate, can you
include a jsp and have it used indexed=true I
wonder?

sandeep


--- Mark Galbreath [EMAIL PROTECTED] wrote:
 Of course it works with session-scoped beans; that's
 what an
 ActionForn/DynaActionForm is by default.  second,
 id is complete arbitrary
 - you can call any page object anything you want.
 
 Mark
 
 -Original Message-
 From: Sandeep Takhar
 [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, June 10, 2003 2:41 PM
 To: Struts Users Mailing List
 Subject: Re: logic:iterate and html:text
 indexed=true/
 
 
 my small understanding on how to use this is as
 follows:
 
 logic:iterate name=form_name
 property=property_name id=property_name
 
 html:text property=some_property indexed=true
 
 ok -- 
 
 1. form_name is the name of the form
 2. property_name is the name of the property and for
 some reason the id= also has to have the same name
 3. indexed=true indicates that property is coming
 from what we are iterating over.
 4. I have only got this to work with forms.
 
 So I don't know if it works for session scoped beans
 and it means that when you submit it will populate
 the
 bean.
 
 sandeep
 --- Nadja Senoucci [EMAIL PROTECTED] wrote:
  Hello again,
  
  I am currently testing around with the above named
  tags (in order to get
  around my earlier discribed problem sooner or
 later)
  and I don't think I
  quite understand what happens when you set
  indexed=true for text fields.
  
  I have this little bit of code in my .jsp:
  
  logic:present name=cntarr
  bean:define name=cntarr scope=session
  id=cntarr
  type=java.util.Collection/
  logic:iterate id=element name=cntarr 
  tr bgcolor=#FF
  td colspan=2html:text property=searchfield 
  indexed=true//td td colspan=2html:text 
  property=searchparam indexed=true//td
  /tr
  /logic:iterate
  /logic:present
  
  And it seems that this results in the following
 bit
  of HTML:
  
  tr bgcolor=#FF
  td colspan=2input type=text
 

name=org.apache.struts.taglib.html.BEAN[0].searchfield
  value=/td
  td colspan=2input type=text
 

name=org.apache.struts.taglib.html.BEAN[0].searchparam
  value=/td
  /tr
  
  Why is it saying
 org.apache.struts.taglib.html.BEAN[0].searchfield?
  I
  would have thought it would be
  element[0].searchfield... And what do I need
   to do in my form bean to create set-methods for
  this? Meaning: What does
  Struts expect to find in my form bean if I am
 using
  an indexed field as
  shown above?
  
  At the moment, I keep getting an index out of
 bounds-exception which 
  is quite natural, I think, since there is no array
 that
  could be set with
  something like this
 
 org.apache.struts.taglib.html.BEAN[0].searchfield.
  So
  I know, I am using these tags wrong. I just can't
  find out how to use them
  correctly...
  
  Greetings,
  Nadja
  
  
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 Yahoo! Calendar - Free online calendar with sync to
 Outlook(TM).
 http://calendar.yahoo.com
 

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

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


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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


RE: logic:iterate and html:text indexed=true/

2003-06-10 Thread John Greenhill
Hi,

While normally the id can be anything you want, in the case of indexing
you are correct that it must be the same as the property.

The 'index out of bounds' is one of those classic problems with indexed
properties since the list that holds the objects must be pre-initialized
to hold them. If you search the archive you'll find a variety of
solutions, one being using a hidden field and the size of the list to
initialize in the reset method. The cooler (dare I say preferred? sure,
except I haven't tried it) solution was posted a couple times by Aaron
Bates which initializes on the fly.

-john

-Original Message-
From: Sandeep Takhar [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 11:59 AM
To: Struts Users Mailing List
Subject: RE: logic:iterate and html:text indexed=true/


of course -I'm being stupid about the session scoped
beans,

however I haven't looked at the code and I don't know
how the indexed property works with the iterate
tag and I cannot extrapolate at the current moment
either about what the code might look like.  What I
mean to say is: I don't know if indexed=true works
for anything other than forms.  Should I guess, maybe
you know.

Are you sure you can name the id anything you want? 
It didn't seem to work for me until I named it the
same as the property for whatever reason.  Do you have
a working sample?  I suppose I should just try it.

Also: if you are using the nested:iterate, can you
include a jsp and have it used indexed=true I
wonder?

sandeep


--- Mark Galbreath [EMAIL PROTECTED] wrote:
 Of course it works with session-scoped beans; that's
 what an
 ActionForn/DynaActionForm is by default.  second,
 id is complete arbitrary
 - you can call any page object anything you want.
 
 Mark
 
 -Original Message-
 From: Sandeep Takhar
 [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, June 10, 2003 2:41 PM
 To: Struts Users Mailing List
 Subject: Re: logic:iterate and html:text
 indexed=true/
 
 
 my small understanding on how to use this is as
 follows:
 
 logic:iterate name=form_name
 property=property_name id=property_name
 
 html:text property=some_property indexed=true
 
 ok -- 
 
 1. form_name is the name of the form
 2. property_name is the name of the property and for
 some reason the id= also has to have the same name
 3. indexed=true indicates that property is coming
 from what we are iterating over.
 4. I have only got this to work with forms.
 
 So I don't know if it works for session scoped beans
 and it means that when you submit it will populate
 the
 bean.
 
 sandeep
 --- Nadja Senoucci [EMAIL PROTECTED] wrote:
  Hello again,
  
  I am currently testing around with the above named
  tags (in order to get
  around my earlier discribed problem sooner or
 later)
  and I don't think I
  quite understand what happens when you set
  indexed=true for text fields.
  
  I have this little bit of code in my .jsp:
  
  logic:present name=cntarr
  bean:define name=cntarr scope=session
  id=cntarr
  type=java.util.Collection/
  logic:iterate id=element name=cntarr 
  tr bgcolor=#FF
  td colspan=2html:text property=searchfield 
  indexed=true//td td colspan=2html:text 
  property=searchparam indexed=true//td
  /tr
  /logic:iterate
  /logic:present
  
  And it seems that this results in the following
 bit
  of HTML:
  
  tr bgcolor=#FF
  td colspan=2input type=text
 

name=org.apache.struts.taglib.html.BEAN[0].searchfield
  value=/td
  td colspan=2input type=text
 

name=org.apache.struts.taglib.html.BEAN[0].searchparam
  value=/td
  /tr
  
  Why is it saying
 org.apache.struts.taglib.html.BEAN[0].searchfield?
  I
  would have thought it would be
  element[0].searchfield... And what do I need
   to do in my form bean to create set-methods for
  this? Meaning: What does
  Struts expect to find in my form bean if I am
 using
  an indexed field as
  shown above?
  
  At the moment, I keep getting an index out of
 bounds-exception which 
  is quite natural, I think, since there is no array
 that
  could be set with
  something like this
 
 org.apache.struts.taglib.html.BEAN[0].searchfield.
  So
  I know, I am using these tags wrong. I just can't
  find out how to use them
  correctly...
  
  Greetings,
  Nadja
  
  
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 Yahoo! Calendar - Free online calendar with sync to
 Outlook(TM).
 http://calendar.yahoo.com
 

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

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


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar

RE: logic:iterate and html:text indexed=true/

2003-06-10 Thread Mark Galbreath
From the docs:

html indexed/
Valid only inside of logic:iterate tag. If true then name of the html tag
will be rendered as id[34].propertyName. Number in brackets will be
generated for every iteration and taken from ancestor logic:iterate tag. (RT
EXPR)

I remember using this is some complext multi-page logic a year ago - I'll
see if I can find the source.  It seems to be, though, that using this
attribute would be useless without some additional logic in either a
scriptlet 
% if( id[i].equals(propertyName) {} % or some maifestation of the
comparators of the logic tag.  Otherwise, you are only going to get the
last property in the array.

Nevertheless, I do remember that I did not use the construct with the
ActionForm, but with a Map from an entity EJB.

Mark

-Original Message-
From: Sandeep Takhar [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 10, 2003 2:59 PM
To: Struts Users Mailing List
Subject: RE: logic:iterate and html:text indexed=true/


of course -I'm being stupid about the session scoped
beans,

however I haven't looked at the code and I don't know
how the indexed property works with the iterate
tag and I cannot extrapolate at the current moment
either about what the code might look like.  What I
mean to say is: I don't know if indexed=true works
for anything other than forms.  Should I guess, maybe
you know.

Are you sure you can name the id anything you want? 
It didn't seem to work for me until I named it the
same as the property for whatever reason.  Do you have
a working sample?  I suppose I should just try it.

Also: if you are using the nested:iterate, can you
include a jsp and have it used indexed=true I
wonder?

sandeep


--- Mark Galbreath [EMAIL PROTECTED] wrote:
 Of course it works with session-scoped beans; that's
 what an
 ActionForn/DynaActionForm is by default.  second,
 id is complete arbitrary
 - you can call any page object anything you want.
 
 Mark
 
 -Original Message-
 From: Sandeep Takhar
 [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 10, 2003 2:41 PM
 To: Struts Users Mailing List
 Subject: Re: logic:iterate and html:text
 indexed=true/
 
 
 my small understanding on how to use this is as
 follows:
 
 logic:iterate name=form_name
 property=property_name id=property_name
 
 html:text property=some_property indexed=true
 
 ok --
 
 1. form_name is the name of the form
 2. property_name is the name of the property and for
 some reason the id= also has to have the same name
 3. indexed=true indicates that property is coming
 from what we are iterating over.
 4. I have only got this to work with forms.
 
 So I don't know if it works for session scoped beans
 and it means that when you submit it will populate
 the
 bean.
 
 sandeep
 --- Nadja Senoucci [EMAIL PROTECTED] wrote:
  Hello again,
  
  I am currently testing around with the above named
  tags (in order to get
  around my earlier discribed problem sooner or
 later)
  and I don't think I
  quite understand what happens when you set
  indexed=true for text fields.
  
  I have this little bit of code in my .jsp:
  
  logic:present name=cntarr
  bean:define name=cntarr scope=session
  id=cntarr
  type=java.util.Collection/
  logic:iterate id=element name=cntarr 
  tr bgcolor=#FF
  td colspan=2html:text property=searchfield
  indexed=true//td td colspan=2html:text 
  property=searchparam indexed=true//td
  /tr
  /logic:iterate
  /logic:present
  
  And it seems that this results in the following
 bit
  of HTML:
  
  tr bgcolor=#FF
  td colspan=2input type=text
 

name=org.apache.struts.taglib.html.BEAN[0].searchfield
  value=/td
  td colspan=2input type=text
 

name=org.apache.struts.taglib.html.BEAN[0].searchparam
  value=/td
  /tr
  
  Why is it saying
 org.apache.struts.taglib.html.BEAN[0].searchfield?
  I
  would have thought it would be
  element[0].searchfield... And what do I need
   to do in my form bean to create set-methods for
  this? Meaning: What does
  Struts expect to find in my form bean if I am
 using
  an indexed field as
  shown above?
  
  At the moment, I keep getting an index out of
 bounds-exception which
  is quite natural, I think, since there is no array
 that
  could be set with
  something like this
 
 org.apache.struts.taglib.html.BEAN[0].searchfield.
  So
  I know, I am using these tags wrong. I just can't
  find out how to use them
  correctly...
  
  Greetings,
  Nadja
  
  
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
 http://calendar.yahoo.com
 

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

-
 To unsubscribe, e-mail