You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Session A Mwamufiya <sm...@andrew.cmu.edu> on 2007/08/13 11:47:42 UTC

getting user selection from a object

Hi,

I've been stuck trying to capture, in my action, the set of elements placed in one of the lists of an <s:optiontransferselect> tag.  I can refer to the selected element in the list by using the name of the list, but how do I access all of the elements in the list?  (they were obtained by shifting items from the other list)

Thanks,
Session


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


Re: getting user selection from a object

Posted by Dale Newfield <Da...@Newfield.org>.
Laurie Harper wrote:
> According to the documentation [1], the items in the list should get 
> selected automatically when the form is submitted -- i.e. the desired 
> behaviour / workaround is how the component is meant to work out of the 
> box. So, it sounds like a JIRA issue should be filed, but as a bug 
> report rather than a feature request.

There already is a bug related to this.

http://issues.apache.org/struts/browse/WW-1972

I couldn't find it in nabble, but I believe this is a known bug that's 
fixed in 2.1

In the couple places I have these controls I have this text:

"There's a bug in Struts2.0.8 that doesn't automatically select 
everything in the left list before submitting.  It'll be fixed in 2.1, 
but in the meantime, please select everything in this left list before 
submitting."

Which is fine for me, since I'm the only one using this as it's still in 
development.  Not a reasonable solution for something that currently 
needs to work in production.

-Dale

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


Re: getting user selection from a object

Posted by Laurie Harper <la...@holoweb.net>.
According to the documentation [1], the items in the list should get 
selected automatically when the form is submitted -- i.e. the desired 
behaviour / workaround is how the component is meant to work out of the 
box. So, it sounds like a JIRA issue should be filed, but as a bug 
report rather than a feature request.

L.

http://struts.apache.org/2.x/docs/optiontransferselect.html

Dave Newton wrote:
> Oh; I misunderstood what you wanted--sorry.
> 
> OTOH this is probably an enhancement that people might
> want (kind of makes sense you'd want to be able to
> retrieve all the items from the right-hand list); if
> you're feeling saucy maybe add a feature request JIRA.
> 
> --- Session A Mwamufiya <sm...@andrew.cmu.edu>
> wrote:
> 
>> Actually, giving the lists a name and providing
>> getters and setters just allows us to get the
>> selected element within the respective list.  I was
>> able to find a suitable workaround by selecting all
>> the elements in the list on an onclick event, then I
>> can get everything that I want.
>>
>> Thanks,
>> Session
>>
>>
>>> Give it an id (or name? I forget) and supply
>> set/get methods in the
>>> action?
>>>
>>> Isn't it just two select boxes (for all intents
>> and purposes, at least
>>> regarding what you're doing)?
>>>
>>> --- Session A Mwamufiya <sm...@andrew.cmu.edu>
>> wrote:
>>>> Expert struts programmers, please take a look at
>> this thread.  I believe
>>>> it should be a straight forward answer, but I
>> haven't received any
>>>> replies since I launched the thread.  I don't
>> mean to pester you, but I'm
>>>> really trying to get over this hurdle.
>>>>
>>>> Thanks,
>>>>
>>>>> Anyone familiar with the way the
>>>> <s:optiontransferselect> tag works?  I'm
>>>>> looking to retrieve the content of the entire
>>>> right-hand list (not just a
>>>>> selected item in it).  I would assume that
>> there's
>>>> a way to do that, but
>>>>> I'm not sure how.  Any ideas?
>>>>>
>>>>> Thanks,
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I've been stuck trying to capture, in my
>> action,
>>>> the set of elements
>>>>>> placed in one of the lists of an
>>>> <s:optiontransferselect> tag.  I can
>>>>>> refer to the selected element in the list by
>>>> using the name of the
>>>>>> list, but how do I access all of the elements
>> in
>>>> the list?  (they were
>>>>>> obtained by shifting items from the other list)
>>>>>>
>>>>>> Thanks, Session
>>>>>>
>>>>>>
>>>>>>
> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org For
>>>>>> additional commands, e-mail:
>>>> user-help@struts.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
> ---------------------------------------------------------------------
>>>> To
>>>>> unsubscribe, e-mail:
>>>> user-unsubscribe@struts.apache.org For additional
>>>>> commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>>
> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org For additional
>>>> commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>>
> _________________________________________________________________________
>>> ___________ Choose the right car based on your
>> needs.  Check out Yahoo!
>>> Autos new Car Finder tool.
>> http://autos.yahoo.com/carfinder/
>>>
> ---------------------------------------------------------------------
>> To
>>> unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org For additional
>>> commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
>>
>>
> 
> 
> 
>        
> ____________________________________________________________________________________
> Got a little couch potato? 
> Check out fun summer activities for kids.
> http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz 


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


Re: getting user selection from a object

Posted by Dave Newton <ne...@yahoo.com>.
Oh; I misunderstood what you wanted--sorry.

OTOH this is probably an enhancement that people might
want (kind of makes sense you'd want to be able to
retrieve all the items from the right-hand list); if
you're feeling saucy maybe add a feature request JIRA.

--- Session A Mwamufiya <sm...@andrew.cmu.edu>
wrote:

> Actually, giving the lists a name and providing
> getters and setters just allows us to get the
> selected element within the respective list.  I was
> able to find a suitable workaround by selecting all
> the elements in the list on an onclick event, then I
> can get everything that I want.
> 
> Thanks,
> Session
> 
> 
> > Give it an id (or name? I forget) and supply
> set/get methods in the
> > action?
> > 
> > Isn't it just two select boxes (for all intents
> and purposes, at least
> > regarding what you're doing)?
> > 
> > --- Session A Mwamufiya <sm...@andrew.cmu.edu>
> wrote:
> > 
> >> Expert struts programmers, please take a look at
> this thread.  I believe
> >> it should be a straight forward answer, but I
> haven't received any
> >> replies since I launched the thread.  I don't
> mean to pester you, but I'm
> >> really trying to get over this hurdle.
> >> 
> >> Thanks,
> >> 
> >>> Anyone familiar with the way the
> >> <s:optiontransferselect> tag works?  I'm
> >>> looking to retrieve the content of the entire
> >> right-hand list (not just a
> >>> selected item in it).  I would assume that
> there's
> >> a way to do that, but
> >>> I'm not sure how.  Any ideas?
> >>> 
> >>> Thanks,
> >>> 
> >>> 
> >>>> Hi,
> >>>> 
> >>>> I've been stuck trying to capture, in my
> action,
> >> the set of elements
> >>>> placed in one of the lists of an
> >> <s:optiontransferselect> tag.  I can
> >>>> refer to the selected element in the list by
> >> using the name of the
> >>>> list, but how do I access all of the elements
> in
> >> the list?  (they were
> >>>> obtained by shifting items from the other list)
> >>>> 
> >>>> Thanks, Session
> >>>> 
> >>>> 
> >>>> 
> >> 
> >
>
---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail:
> >> user-unsubscribe@struts.apache.org For
> >>>> additional commands, e-mail:
> >> user-help@struts.apache.org
> >>>> 
> >>>> 
> >>>> 
> >>> 
> >>> 
> >>> 
> >> 
> >
>
---------------------------------------------------------------------
> >> To
> >>> unsubscribe, e-mail:
> >> user-unsubscribe@struts.apache.org For additional
> >>> commands, e-mail: user-help@struts.apache.org
> >>> 
> >>> 
> >>> 
> >> 
> >> 
> >> 
> >
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org For additional
> >> commands, e-mail: user-help@struts.apache.org
> >> 
> >> 
> > 
> > 
> > 
> > 
> >
>
_________________________________________________________________________
> > ___________ Choose the right car based on your
> needs.  Check out Yahoo!
> > Autos new Car Finder tool.
> http://autos.yahoo.com/carfinder/
> > 
> >
>
---------------------------------------------------------------------
> To
> > unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org For additional
> > commands, e-mail: user-help@struts.apache.org
> > 
> > 
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



       
____________________________________________________________________________________
Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz 

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


Re: getting user selection from a object

Posted by Session A Mwamufiya <sm...@andrew.cmu.edu>.
Actually, giving the lists a name and providing getters and setters just allows us to get the selected element within the respective list.  I was able to find a suitable workaround by selecting all the elements in the list on an onclick event, then I can get everything that I want.

Thanks,
Session


> Give it an id (or name? I forget) and supply set/get methods in the
> action?
> 
> Isn't it just two select boxes (for all intents and purposes, at least
> regarding what you're doing)?
> 
> --- Session A Mwamufiya <sm...@andrew.cmu.edu> wrote:
> 
>> Expert struts programmers, please take a look at this thread.  I believe
>> it should be a straight forward answer, but I haven't received any
>> replies since I launched the thread.  I don't mean to pester you, but I'm
>> really trying to get over this hurdle.
>> 
>> Thanks,
>> 
>>> Anyone familiar with the way the
>> <s:optiontransferselect> tag works?  I'm
>>> looking to retrieve the content of the entire
>> right-hand list (not just a
>>> selected item in it).  I would assume that there's
>> a way to do that, but
>>> I'm not sure how.  Any ideas?
>>> 
>>> Thanks,
>>> 
>>> 
>>>> Hi,
>>>> 
>>>> I've been stuck trying to capture, in my action,
>> the set of elements
>>>> placed in one of the lists of an
>> <s:optiontransferselect> tag.  I can
>>>> refer to the selected element in the list by
>> using the name of the
>>>> list, but how do I access all of the elements in
>> the list?  (they were
>>>> obtained by shifting items from the other list)
>>>> 
>>>> Thanks, Session
>>>> 
>>>> 
>>>> 
>> 
> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org For
>>>> additional commands, e-mail:
>> user-help@struts.apache.org
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>>> 
>> 
> ---------------------------------------------------------------------
>> To
>>> unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org For additional
>>> commands, e-mail: user-help@struts.apache.org
>>> 
>>> 
>>> 
>> 
>> 
>> 
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional
>> commands, e-mail: user-help@struts.apache.org
>> 
>> 
> 
> 
> 
> 
> _________________________________________________________________________
> ___________ Choose the right car based on your needs.  Check out Yahoo!
> Autos new Car Finder tool. http://autos.yahoo.com/carfinder/
> 
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional
> commands, e-mail: user-help@struts.apache.org
> 
> 
> 


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


Re: getting user selection from a object

Posted by Dave Newton <ne...@yahoo.com>.
Give it an id (or name? I forget) and supply set/get
methods in the action?

Isn't it just two select boxes (for all intents and
purposes, at least regarding what you're doing)?

--- Session A Mwamufiya <sm...@andrew.cmu.edu>
wrote:

> Expert struts programmers, please take a look at
> this thread.  I believe it should be a straight
> forward answer, but I haven't received any replies
> since I launched the thread.  I don't mean to pester
> you, but I'm really trying to get over this hurdle.
> 
> Thanks,
> 
> > Anyone familiar with the way the
> <s:optiontransferselect> tag works?  I'm
> > looking to retrieve the content of the entire
> right-hand list (not just a
> > selected item in it).  I would assume that there's
> a way to do that, but
> > I'm not sure how.  Any ideas?
> > 
> > Thanks,
> > 
> > 
> >> Hi,
> >> 
> >> I've been stuck trying to capture, in my action,
> the set of elements 
> >> placed in one of the lists of an
> <s:optiontransferselect> tag.  I can 
> >> refer to the selected element in the list by
> using the name of the
> >> list, but how do I access all of the elements in
> the list?  (they were
> >> obtained by shifting items from the other list)
> >> 
> >> Thanks, Session
> >> 
> >> 
> >>
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org For
> >> additional commands, e-mail:
> user-help@struts.apache.org
> >> 
> >> 
> >> 
> > 
> > 
> >
>
---------------------------------------------------------------------
> To
> > unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org For additional
> > commands, e-mail: user-help@struts.apache.org
> > 
> > 
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



       
____________________________________________________________________________________
Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.
http://autos.yahoo.com/carfinder/

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


Re: getting user selection from a object

Posted by Session A Mwamufiya <sm...@andrew.cmu.edu>.
Expert struts programmers, please take a look at this thread.  I believe it should be a straight forward answer, but I haven't received any replies since I launched the thread.  I don't mean to pester you, but I'm really trying to get over this hurdle.

Thanks,

> Anyone familiar with the way the <s:optiontransferselect> tag works?  I'm
> looking to retrieve the content of the entire right-hand list (not just a
> selected item in it).  I would assume that there's a way to do that, but
> I'm not sure how.  Any ideas?
> 
> Thanks,
> 
> 
>> Hi,
>> 
>> I've been stuck trying to capture, in my action, the set of elements 
>> placed in one of the lists of an <s:optiontransferselect> tag.  I can 
>> refer to the selected element in the list by using the name of the
>> list, but how do I access all of the elements in the list?  (they were
>> obtained by shifting items from the other list)
>> 
>> Thanks, Session
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For
>> additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
> 
> 
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional
> commands, e-mail: user-help@struts.apache.org
> 
> 
> 


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


Re: getting user selection from a object

Posted by Session A Mwamufiya <sm...@andrew.cmu.edu>.
Anyone familiar with the way the <s:optiontransferselect> tag works?  I'm looking to retrieve the content of the entire right-hand list (not just a selected item in it).  I would assume that there's a way to do that, but I'm not sure how.  Any ideas?

Thanks,


> Hi,
> 
> I've been stuck trying to capture, in my action, the set of elements
> placed in one of the lists of an <s:optiontransferselect> tag.  I can
> refer to the selected element in the list by using the name of the list,
> but how do I access all of the elements in the list?  (they were obtained
> by shifting items from the other list)
> 
> Thanks, Session
> 
> 
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional
> commands, e-mail: user-help@struts.apache.org
> 
> 
> 


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