Re: Indexed Deep Properties

2003-05-29 Thread Jordan Reed
Working... And here's a little note:

html:form action=registrationWizardStep2
nested:nest property=user
  nested:iterate property=addresses
nested:text property=street1 /
nested:text property=street1 indexed=true/
  /nested:iterate
/nested:nest
/html:form

The line without the index produces: user.addresses[0].street1
The line with the index produces:
registrationWizardForm[0].user.addresses[0].zip


I find that a little unexpected and bizarre.  I'm not sure if it's an issue
with the nested:iterate or nested:text tag... Or whether it's just expected
functionality that I wasn't expecting.  Any opinions on that?

Still, it's working, so thanks for the help.

-jdr  


On 5/22/03 4:26 PM, Arron Bates [EMAIL PROTECTED] wrote:

 I have no idea why you're not getting an indexed property for the user part
 of that nested property. The only nested tag which has logic to assemble an
 indexed property is the iterate tag, and this is coming out of the root tag.
 
 There is a minor thing though, here you're trying to use a nested:root like
 a nested:nest. Easy mistake. The difference is that the root tag is there to
 provide the reference to the bean, where as the nested:nest tag is there to
 allow for a simple property nest down one level.
 
 For your markup, try this...
 
 html:form action=registrationWizardStep2
 nested:nest property=user
   nested:iterate property=addresses
 nested:text property=street1 /
   /nested:iterate
 /nested:nest
 /html:form
 
 ...you also had the indexed=true set for the text tag. such things aren't
 needed for the nested tags, as they sort out all the business with the
 specifics of where to get down to the bean they're at.
 
 In the above code, they'll use whatever bean is set for the name formbean
 attribute in your Struts-config.xml file.
 
 Give that a bash, hopefully it'll get you going.
 
 Arron.
 
 
 I'm starting to think this may be a bug with the nested tags and indexed
 properties.
 
 I tried:
 html:form action=registrationWizardStep2
   c:set var=user value=${registrationWizardForm.user}/
   nested:root name=user
 nested:iterate id=address indexId=addressStatus
 property=addresses
   nested:text property=street1 indexed=true/
 /nested:iterate
   /nested:root
 /html:form
 
 And now get:
 input type=text name=user[0].addresses[0].street1 value=100 My
 Street
 
 Anyone know why it's trying to index my parent bean (user) ?  Anyone know
 how I can make it stop?
 
 -jdr
 
 On 5/22/03 12:14 PM, Jordan Reed [EMAIL PROTECTED] wrote:
 
 Better!
 
 Okay I've got:
 html:form action=registrationWizardStep2
 nested:nest property=user
   nested:iterate id=address indexId=addressStatus
 property=addresses
 nested:text property=street1 indexed=true/
   /nested:iterate
 /nested:nest
 /html:form
 
 But the HTML it's generating looks like:
 input type=text
 name=registrationWizardForm[0].user.addresses[0].street1 value=100 My
 Street
 
 Still wrong... It should the name needs to be: user.addresses[0].street1.
 Suggestions?
 
 -jdr
 
 
 On 5/21/03 10:25 PM, Arron Bates [EMAIL PROTECTED] wrote:
 
 
 -
 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]
 
 


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



Re: Indexed Deep Properties

2003-05-29 Thread Arron Bates
 Working... And here's a little note:
 
 html:form action=registrationWizardStep2
 nested:nest property=user
   nested:iterate property=addresses
 nested:text property=street1 /
 nested:text property=street1 indexed=true/
   /nested:iterate
 /nested:nest
 /html:form
 
 The line without the index produces: user.addresses[0].street1
 The line with the index produces:
 registrationWizardForm[0].user.addresses[0].zip
 
 I find that a little unexpected and bizarre.  I'm not sure if it's an issue
 with the nested:iterate or nested:text tag... Or whether it's just expected
 functionality that I wasn't expecting.  Any opinions on that?

Like I said, remove the  indexed=true  part. It doesn't keep everything in
order, and would only confuse things internally. The nested tags take care of
all that stuff for you. It's transparent. You only have to supply the property
and things like the text fields maxlength etc etc.

It's working now, which is sweet.

All the best,


Arron.



 
 Still, it's working, so thanks for the help.
 
 -jdr  
 
 On 5/22/03 4:26 PM, Arron Bates [EMAIL PROTECTED] wrote:
 
  I have no idea why you're not getting an indexed property for the user part
  of that nested property. The only nested tag which has logic to assemble an
  indexed property is the iterate tag, and this is coming out of the root tag.
  
  There is a minor thing though, here you're trying to use a nested:root like
  a nested:nest. Easy mistake. The difference is that the root tag is there to
  provide the reference to the bean, where as the nested:nest tag is there to
  allow for a simple property nest down one level.
  
  For your markup, try this...
  
  html:form action=registrationWizardStep2
  nested:nest property=user
nested:iterate property=addresses
  nested:text property=street1 /
/nested:iterate
  /nested:nest
  /html:form
  
  ...you also had the indexed=true set for the text tag. such things aren't
  needed for the nested tags, as they sort out all the business with the
  specifics of where to get down to the bean they're at.
  
  In the above code, they'll use whatever bean is set for the name formbean
  attribute in your Struts-config.xml file.
  
  Give that a bash, hopefully it'll get you going.
  
  Arron.
  
  
  I'm starting to think this may be a bug with the nested tags and indexed
  properties.
  
  I tried:
  html:form action=registrationWizardStep2
c:set var=user value=${registrationWizardForm.user}/
nested:root name=user
  nested:iterate id=address indexId=addressStatus
  property=addresses
nested:text property=street1 indexed=true/
  /nested:iterate
/nested:root
  /html:form
  
  And now get:
  input type=text name=user[0].addresses[0].street1 value=100 My
  Street
  
  Anyone know why it's trying to index my parent bean (user) ?  Anyone know
  how I can make it stop?
  
  -jdr
  
  On 5/22/03 12:14 PM, Jordan Reed [EMAIL PROTECTED] wrote:
  
  Better!
  
  Okay I've got:
  html:form action=registrationWizardStep2
  nested:nest property=user
nested:iterate id=address indexId=addressStatus
  property=addresses
  nested:text property=street1 indexed=true/
/nested:iterate
  /nested:nest
  /html:form
  
  But the HTML it's generating looks like:
  input type=text
  name=registrationWizardForm[0].user.addresses[0].street1 value=100 My
  Street
  
  Still wrong... It should the name needs to be: user.addresses[0].street1.
  Suggestions?
  
  -jdr

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