Re: How to store a String[] in a hidden field?

2002-01-16 Thread Christian Bouessay

Well, I've found one solution:

logic:present parameter=fields property=fields
   logic:iterate id=fieldsValue
collection=%=request.getParameterValues(fields)%

 html:hidden property=fields value=%=fieldsValue%/

   /logic:iterate
/logic:present

Is there a better way to do this?

--
C. Bouessay

Christian Bouessay wrote:

 Hi,
 I have a form with a multiple select box.
 
 class myForm1 extends ActionForm {
 String[] getFields() { ...}
 void setFields(String[] fields )
 ...
 }
 html:select property=fields multiple=1 size=3
 html:options collection=list property=value
 labelProperty=label/
 /html:select
 
 When I submit the form and validate() return null, it forwards to an 
 other view of the same form where I would like to store this property in 
 a hidden field.
 
 And HTML output is:
 
 input type=hidden name=fields value=[Ljava.lang.String;@1765ae
 
 How can I tell struts to store it in a String format?
 
 
 Thanks for help.
 -- 
 C. Bouessay
 
 
 -- 
 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: How to store a String[] in a hidden field?

2002-01-16 Thread Keith Bacon

How about putting a helper class in your session which has methods:-

String stringArrayToTokenizedString(String[] array)
   //store array elements delimted by some char that's not in the data.

String[] tokenizedStringToStringArray.
   //Use StringTokeniser to build the array again.

Then you need only store 1 big long string.
Personally that seems fairly horrible too but at least there's less JSP code.
Keith.

--- Christian Bouessay [EMAIL PROTECTED] wrote:
 Well, I've found one solution:
 
 logic:present parameter=fields property=fields
logic:iterate id=fieldsValue
 collection=%=request.getParameterValues(fields)%
 
  html:hidden property=fields value=%=fieldsValue%/
 
/logic:iterate
 /logic:present
 
 Is there a better way to do this?
 
 --
 C. Bouessay
 
 Christian Bouessay wrote:
 
  Hi,
  I have a form with a multiple select box.
  
  class myForm1 extends ActionForm {
  String[] getFields() { ...}
  void setFields(String[] fields )
  ...
  }
  html:select property=fields multiple=1 size=3
  html:options collection=list property=value
  labelProperty=label/
  /html:select
  
  When I submit the form and validate() return null, it forwards to an 
  other view of the same form where I would like to store this property in 
  a hidden field.
  
  And HTML output is:
  
  input type=hidden name=fields value=[Ljava.lang.String;@1765ae
  
  How can I tell struts to store it in a String format?
  
  
  Thanks for help.
  -- 
  C. Bouessay
  
  
  -- 
  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]
 


__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

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