I dont believe that is not necessary for V1
ashttp://struts.apache.org/1.x/struts-taglib/tagreference.html#select suggests
'value' as the name to compare for marking the option as *selected*
If the preselection has not changed for V2..then I would suggest using the
value attribute as preselected
Martin______________________________________________Disclaimer and
confidentiality noteEverything in this e-mail and any attachments relates to
the official business of Sender. This transmission is of a confidential nature
and Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within this
transmission.> > > Hi,> > I am using Struts 2.0.11.> > I am running into an
issue when using type converters and pre-populating> corresponding select
boxes. I defined a type converter in> xwork-conversion.properties and
everything works for normal text fields> (converter is called perfectly). The
problem I have occurs when> pre-populating select boxes. > > Let's assume that
I have a class Foo that has a field 'id'. In my converter> method
'convertToString' will return a String representation of the id field>
(integer) and method 'convertFromString' will set the 'id' field of Foo.> >
This works fine for text fields (I know the setup may not make perfect>
business sense but I hope it illustrates the problem)> > Let's further assume
that I have a select box with a list of Foos. > > <s:select list="foos"
name="foo">> > To illustrate my propblem I left off the attributes 'listValue'
and> 'listKey'. In this particuliar case shouldn't the type converter>
(implicitly) be called for both value and key?> > Unfortunately the converter
is only called for the 'labels'. The 'values'> are retrieved by calling
toString() on the Foo class which I did not> anticipate to happen.> > As
another work-around I tried this: > > <s:select list="foos" name="foo"
listKey="id">> > Now my list of foos is populated correctly BUT no value in the
select box is> pre-selected, although the field 'foo' has a matching entry in
'foos'. I am> assuming that the problem might be that name="foo" is using the
converter> and the key is populated by calling foo.getId() and therefore
returning an> integer?> > Is this possibly an issue and worth opening a Jira
ticket or do I miss> something here in my setup?> > Thanks a lot in advance!> >
Regards,> > Gunnar Hillert> > > > > > > > > > > > -- > View this message in
context:
http://www.nabble.com/Issue-with-Type-Conversion-and-Select-Boxes-tf4864875.html#a13921943>
Sent from the Struts - User mailing list archive at Nabble.com.> > >
---------------------------------------------------------------------> To
unsubscribe, e-mail: [EMAIL PROTECTED]> For additional commands, e-mail: [EMAIL
PROTECTED]>
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/connect.html?ocid=TXT_TAGLM_Wave2_newways_112007