RE: CachedRowSet for html:options

2002-03-10 Thread Adam Hardy

http://jakarta.apache.org/struts/doc-1.0.2/struts-html.html#options

* If the labelProperty attribute is not specified, the property named by the 
property attribute will be used to select both the value returned to the server and 
the label displayed to the user for this option.




On Sat, 09 March 2002, Sunder R Somasundaram wrote:

 
 Thanks for your reply; it is a select box with single or multiple
 options. Do I have to put in both the values and the labels even if both
 are the same?
 
 
 -Original Message-
 From: Adam Hardy [mailto:[EMAIL PROTECTED]] 
 Sent: Saturday, March 09, 2002 5:03 AM
 To: [EMAIL PROTECTED]
 Subject: Re: CachedRowSet for html:options
 
 You mean you're displaying a list in a table or you are displaying a
 select drop-down box?
 
 The html:options tag works great with forms, it'll initialize the select
 box to what's in the form object, and it'll display appropriate labels
 and set up the appropriate values on each option.
 
 You can quite easily use the CachedRowSet.toCollection(column) to return
 any column of the rowset as a collection. Instead of putting the whole
 rowset in the session, you'll have to put a collection for the values
 and a collection for the labels. A few more lines of code, yes, but not
 exactly difficult.
 
 If your lists are just lists and not select boxes (it's not clear from
 your message), use a logic:iterate tag.
 
 
 
 On Fri, 08 March 2002, Sunder wrote:
 
  
  Hi,
  I am currently retrieving a cachedRowSet from a session bean and
  displaying lists using the rowset. I would like to use the struts
  html:options tag to do the same, From the documentation, it looks like
 I
  have to put this rowset into a collection and use the same. Is there a
  better way to do this?
  
  Thanks,
  Sunder
  
  
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 Find the best deals on the web at AltaVista Shopping!
 http://www.shopping.altavista.com
 
 --
 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]


Find the best deals on the web at AltaVista Shopping!
http://www.shopping.altavista.com

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




RE: CachedRowSet for html:options

2002-03-09 Thread Sunder R Somasundaram

Thanks for your reply; it is a select box with single or multiple
options. Do I have to put in both the values and the labels even if both
are the same?


-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, March 09, 2002 5:03 AM
To: [EMAIL PROTECTED]
Subject: Re: CachedRowSet for html:options

You mean you're displaying a list in a table or you are displaying a
select drop-down box?

The html:options tag works great with forms, it'll initialize the select
box to what's in the form object, and it'll display appropriate labels
and set up the appropriate values on each option.

You can quite easily use the CachedRowSet.toCollection(column) to return
any column of the rowset as a collection. Instead of putting the whole
rowset in the session, you'll have to put a collection for the values
and a collection for the labels. A few more lines of code, yes, but not
exactly difficult.

If your lists are just lists and not select boxes (it's not clear from
your message), use a logic:iterate tag.



On Fri, 08 March 2002, Sunder wrote:

 
 Hi,
 I am currently retrieving a cachedRowSet from a session bean and
 displaying lists using the rowset. I would like to use the struts
 html:options tag to do the same, From the documentation, it looks like
I
 have to put this rowset into a collection and use the same. Is there a
 better way to do this?
 
 Thanks,
 Sunder
 
 
 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


Find the best deals on the web at AltaVista Shopping!
http://www.shopping.altavista.com

--
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]