RE: Select multiple values from a dropdown

2015-02-22 Thread Martin Gainty

> Date: Sun, 22 Feb 2015 09:11:58 -0500
> Subject: RE: Select multiple values from a dropdown
> From: lilylove2s...@yahoo.com.INVALID
> To: user@struts.apache.org
> 
> Our application has a form on the right pane where user can create a request 
> and submit it.  After the request is submitted, it will be displayed on the 
> left pane.  The left pane lists all the submitted requests in the system.
> 
> When user selects one of the requests on the left pane, the data will be 
> populated in the form on the right pane.  These data will be displayed in 
> uneditable mode until user selects the 'OPEN' request button.
> 
> The issue we have is that the values in the dropdown box display the whole 
> list, instead of highlighting the selected values which user has chosen.
> 
> Regards, 
MG>straight from the doc located at
http://struts.apache.org/maven/struts2-core/apidocs/org/apache/struts2/components/Select.html
 

 

 // The month id (01, 02, ...) returned by the getSelectedMonth() call
 // against the stack will be auto-selected
MG>so in first case execute() would call the value getId()
MG>in the second case value is selectedMonth so execute() would call 
getSelectedMonth() 


 

 

 Note: For any of the tags that use lists (select probably being the most 
ubiquitous), which uses the OGNL list
 notation (see the "months" example above), it should be noted that the map key 
created (in the months example,
 the '01', '02', etc.) is typed. 

'1' is a char, 

'01' is a String, 

"1" is a String. 

This is important since if
 the value returned by your "value" attribute is NOT the same type as the key 
in the "list" attribute, they
 WILL NOT MATCH, even though their String values may be equivalent. If they 
don't match, nothing in your list
 will be auto-selected.
MG>


> 
> 
> > Date: Sat, 21 Feb 2015 04:50:33 +
> > From: lilylove2s...@yahoo.com.INVALID
> > To: user@struts.apache.org
> > Subject: Re: Select multiple values from a dropdown
> > 
> > Thanks Muralidhar.  I was able to do that.  The dropdown is a part of the 
> > request form.  Another question is how do I keep the selected values 
> > displayed in the dropdown when the user views the saved request? 
> > 
> >  On Friday, February 20, 2015 11:21 PM, Yaragalla Muralidhar 
> >  wrote:
> >
> > 
> >  the below is the select tag where you can choose multiple values
> > 
> >  >   name="petIds"
> >   list="petDao.pets"
> >   listKey="id"
> >   listValue="name"
> >   multiple="true"
> >   size="3"
> >   required="true"
> >   value="%{petDao.pets.{id}}"
> > />
> > 
> > *Thanks and Regards,*
> > Muralidhar Yaragalla.
> > 
> > *http://yaragalla.blogspot.in/ *
> > 
> > On Sat, Feb 21, 2015 at 2:44 AM, lilylove2shop <
> > lilylove2s...@yahoo.com.invalid> wrote:
> > 
> > > Hi all,
> > >
> > > How do I select and display more than one value from a dropdown and
> > > display them in jsp using struts2?
> > >
> > > Thanks
> > >
> > >
> > >
> > >
> > 
> > 
> >
> 
  

Overwrite a TypeConverter for a Map with Generics

2015-02-22 Thread Andreas Sachs
Hello,
how can i overwrite a TypeConverter for a Map?
 
I defined the following global TypeConverter:
java.lang.String=de..converter.StringTrimConverter
(the converter removes blanks from the string)
 
This converter is used for every String, even inside maps. That's fine.
 
In one action i use the following map:
Map textfield = ...
How can i use the default/another String converter for this property?
Using a properties file for the action doesn't work. The Entry 
"Element_textfield" is not used because i use Generics.
 
Thanks
Andreas

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Select multiple values from a dropdown

2015-02-22 Thread lilylove2shop
Our application has a form on the right pane where user can create a request 
and submit it.  After the request is submitted, it will be displayed on the 
left pane.  The left pane lists all the submitted requests in the system.

When user selects one of the requests on the left pane, the data will be 
populated in the form on the right pane.  These data will be displayed in 
uneditable mode until user selects the 'OPEN' request button.

The issue we have is that the values in the dropdown box display the whole 
list, instead of highlighting the selected values which user has chosen.

Regards, 

 Original message From: Martin Gainty 
 Date:02/21/2015  7:35 PM  (GMT-05:00) 
To: Struts Users Mailing List  
Cc:  Subject: RE: Select multiple values from a dropdown 

MG>the dropdown list is populated from pets collection located inside the 
petDao class
MG>each value presented is based on unique id value of %{petDao.pets.{id}}

MG>*if* you want the dropdown to dropdown you can hang a click handler for 
dropdown on your submit button
MG>I have trouble understanding why you would want to dropdown the selected 
values upon saving
MG>could you explain this strategy?


> Date: Sat, 21 Feb 2015 04:50:33 +
> From: lilylove2s...@yahoo.com.INVALID
> To: user@struts.apache.org
> Subject: Re: Select multiple values from a dropdown
> 
> Thanks Muralidhar.  I was able to do that.  The dropdown is a part of the 
> request form.  Another question is how do I keep the selected values 
> displayed in the dropdown when the user views the saved request? 
> 
>  On Friday, February 20, 2015 11:21 PM, Yaragalla Muralidhar 
>  wrote:
>
> 
>  the below is the select tag where you can choose multiple values
> 
>name="petIds"
>   list="petDao.pets"
>   listKey="id"
>   listValue="name"
>   multiple="true"
>   size="3"
>   required="true"
>   value="%{petDao.pets.{id}}"
> />
> 
> *Thanks and Regards,*
> Muralidhar Yaragalla.
> 
> *http://yaragalla.blogspot.in/ *
> 
> On Sat, Feb 21, 2015 at 2:44 AM, lilylove2shop <
> lilylove2s...@yahoo.com.invalid> wrote:
> 
> > Hi all,
> >
> > How do I select and display more than one value from a dropdown and
> > display them in jsp using struts2?
> >
> > Thanks
> >
> >
> >
> >
> 
> 
>