You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Julien Leonard <jl...@gmail.com> on 2007/05/28 15:05:39 UTC

[S2] Optiontransfertselect tag

Hello all,

I have a problem on the optiontransfertselect Tag.
I success to display the optiontransfert but when i try to transfet an
option, I have this in my javascript error console :

Erreur : moveSelectedOptions is not defined
Fichier source : http://localhost:9090/listProduct.action
Ligne : 1

I have put <s:head theme="ajax" /> in the parent page (the
optiontransfertselect Tag is displayed in an ajax result).

Did I had to include optiontransfertselect.js myself because of the ajax
result?


Julien

Re: [S2] Optiontransfertselect tag

Posted by Julien Leonard <jl...@gmail.com>.
Thanks for the help :)
Now it works, it stay a little issue on the layout but I will reslolve this
:)

Julien


2007/5/29, Jeromy Evans <je...@blueskyminds.com.au>:
>
> > When I submit my form nothing in the optiontransfertselect is selected.
> > How can I solve the problem?
>
> I work-around this bug but adding the following onsubmit attribute to
> the s:form:
>
> onsubmit="var selectObj =
> document.getElementById('leftId');selectAllOptionsExceptSome(selectObj,
> 'key', '');selectObj =
> document.getElementById('rightId');selectAllOptionsExceptSome(selectObj,
> 'key', '');"
>
> where:
> leftId is the id of the first select (id value)
> rightId is the id of the second select (doubleId value)
>
> That code forces the selection of the elements prior to submit and it
> works reliably.  It's actually the exact code from the
> optiontransferselect template, but by adding it to the form we ensure
> it's always executed even if the is form loaded via ajax with the
> javascript removed.
>
> See also http://www.mail-archive.com/user@struts.apache.org/msg60673.html
>
> Julien Leonard wrote:
> > Thanks for the information.
> > But I have another problem...
> > In fact I think that is due to the non including of the js because of
> the
> > ajax result.
> > When I submit my form nothing in the optiontransfertselect is selected.
> > How can I solve the problem?
> >
> > Julien
> >
> > 2007/5/28, Musachy Barroso <mu...@gmail.com>:
> >>
> >> Just to confirm what you said, in 2.0.x javascript files referenced on
> >> pages
> >> loaded using the ajax tags are not loaded. This will be fixed on 2.1
> >>
> >> musachy
> >>
> >> On 5/28/07, Julien Leonard <jl...@gmail.com> wrote:
> >> >
> >> > Sorry for the mail.
> >> > It work.
> >> > My solution :
> >> > -inclide optiontransfertselect.js in the parent page.
> >> > -set the attributes id and doubleId
> >> >
> >> > Julien
> >> >
> >> >
> >> > 2007/5/28, Julien Leonard <jl...@gmail.com>:
> >> > >
> >> > > Hello all,
> >> > >
> >> > > I have a problem on the optiontransfertselect Tag.
> >> > > I success to display the optiontransfert but when i try to
> >> transfet an
> >> > > option, I have this in my javascript error console :
> >> > >
> >> > > Erreur : moveSelectedOptions is not defined
> >> > > Fichier source : http://localhost:9090/listProduct.action
> >> > > Ligne : 1
> >> > >
> >> > > I have put <s:head theme="ajax" /> in the parent page (the
> >> > > optiontransfertselect Tag is displayed in an ajax result).
> >> > >
> >> > > Did I had to include optiontransfertselect.js myself because of the
> >> ajax
> >> > > result?
> >> > >
> >> > >
> >> > > Julien
> >> > >
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> "Hey you! Would you help me to carry the stone?" Pink Floyd
> >>
> >
> > ------------------------------------------------------------------------
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.472 / Virus Database: 269.8.1/822 - Release Date:
> 28/05/2007 11:40 AM
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: [S2] Optiontransfertselect tag

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
 > When I submit my form nothing in the optiontransfertselect is selected.
 > How can I solve the problem?

I work-around this bug but adding the following onsubmit attribute to 
the s:form:

onsubmit="var selectObj = 
document.getElementById('leftId');selectAllOptionsExceptSome(selectObj, 
'key', '');selectObj = 
document.getElementById('rightId');selectAllOptionsExceptSome(selectObj, 
'key', '');"

where:
leftId is the id of the first select (id value)
rightId is the id of the second select (doubleId value)

That code forces the selection of the elements prior to submit and it 
works reliably.  It's actually the exact code from the 
optiontransferselect template, but by adding it to the form we ensure 
it's always executed even if the is form loaded via ajax with the 
javascript removed.

See also http://www.mail-archive.com/user@struts.apache.org/msg60673.html

Julien Leonard wrote:
> Thanks for the information.
> But I have another problem...
> In fact I think that is due to the non including of the js because of the
> ajax result.
> When I submit my form nothing in the optiontransfertselect is selected.
> How can I solve the problem?
>
> Julien
>
> 2007/5/28, Musachy Barroso <mu...@gmail.com>:
>>
>> Just to confirm what you said, in 2.0.x javascript files referenced on
>> pages
>> loaded using the ajax tags are not loaded. This will be fixed on 2.1
>>
>> musachy
>>
>> On 5/28/07, Julien Leonard <jl...@gmail.com> wrote:
>> >
>> > Sorry for the mail.
>> > It work.
>> > My solution :
>> > -inclide optiontransfertselect.js in the parent page.
>> > -set the attributes id and doubleId
>> >
>> > Julien
>> >
>> >
>> > 2007/5/28, Julien Leonard <jl...@gmail.com>:
>> > >
>> > > Hello all,
>> > >
>> > > I have a problem on the optiontransfertselect Tag.
>> > > I success to display the optiontransfert but when i try to 
>> transfet an
>> > > option, I have this in my javascript error console :
>> > >
>> > > Erreur : moveSelectedOptions is not defined
>> > > Fichier source : http://localhost:9090/listProduct.action
>> > > Ligne : 1
>> > >
>> > > I have put <s:head theme="ajax" /> in the parent page (the
>> > > optiontransfertselect Tag is displayed in an ajax result).
>> > >
>> > > Did I had to include optiontransfertselect.js myself because of the
>> ajax
>> > > result?
>> > >
>> > >
>> > > Julien
>> > >
>> > >
>> >
>>
>>
>>
>> -- 
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.472 / Virus Database: 269.8.1/822 - Release Date: 28/05/2007 11:40 AM
>   


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


Re: [S2] Optiontransfertselect tag

Posted by Julien Leonard <jl...@gmail.com>.
Thanks for the information.
But I have another problem...
In fact I think that is due to the non including of the js because of the
ajax result.
When I submit my form nothing in the optiontransfertselect is selected.
How can I solve the problem?

Julien

2007/5/28, Musachy Barroso <mu...@gmail.com>:
>
> Just to confirm what you said, in 2.0.x javascript files referenced on
> pages
> loaded using the ajax tags are not loaded. This will be fixed on 2.1
>
> musachy
>
> On 5/28/07, Julien Leonard <jl...@gmail.com> wrote:
> >
> > Sorry for the mail.
> > It work.
> > My solution :
> > -inclide optiontransfertselect.js in the parent page.
> > -set the attributes id and doubleId
> >
> > Julien
> >
> >
> > 2007/5/28, Julien Leonard <jl...@gmail.com>:
> > >
> > > Hello all,
> > >
> > > I have a problem on the optiontransfertselect Tag.
> > > I success to display the optiontransfert but when i try to transfet an
> > > option, I have this in my javascript error console :
> > >
> > > Erreur : moveSelectedOptions is not defined
> > > Fichier source : http://localhost:9090/listProduct.action
> > > Ligne : 1
> > >
> > > I have put <s:head theme="ajax" /> in the parent page (the
> > > optiontransfertselect Tag is displayed in an ajax result).
> > >
> > > Did I had to include optiontransfertselect.js myself because of the
> ajax
> > > result?
> > >
> > >
> > > Julien
> > >
> > >
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>

Re: [S2] Optiontransfertselect tag

Posted by Musachy Barroso <mu...@gmail.com>.
Just to confirm what you said, in 2.0.x javascript files referenced on pages
loaded using the ajax tags are not loaded. This will be fixed on 2.1

musachy

On 5/28/07, Julien Leonard <jl...@gmail.com> wrote:
>
> Sorry for the mail.
> It work.
> My solution :
> -inclide optiontransfertselect.js in the parent page.
> -set the attributes id and doubleId
>
> Julien
>
>
> 2007/5/28, Julien Leonard <jl...@gmail.com>:
> >
> > Hello all,
> >
> > I have a problem on the optiontransfertselect Tag.
> > I success to display the optiontransfert but when i try to transfet an
> > option, I have this in my javascript error console :
> >
> > Erreur : moveSelectedOptions is not defined
> > Fichier source : http://localhost:9090/listProduct.action
> > Ligne : 1
> >
> > I have put <s:head theme="ajax" /> in the parent page (the
> > optiontransfertselect Tag is displayed in an ajax result).
> >
> > Did I had to include optiontransfertselect.js myself because of the ajax
> > result?
> >
> >
> > Julien
> >
> >
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: [S2] Optiontransfertselect tag

Posted by Julien Leonard <jl...@gmail.com>.
Sorry for the mail.
It work.
My solution :
-inclide optiontransfertselect.js in the parent page.
-set the attributes id and doubleId

Julien


2007/5/28, Julien Leonard <jl...@gmail.com>:
>
> Hello all,
>
> I have a problem on the optiontransfertselect Tag.
> I success to display the optiontransfert but when i try to transfet an
> option, I have this in my javascript error console :
>
> Erreur : moveSelectedOptions is not defined
> Fichier source : http://localhost:9090/listProduct.action
> Ligne : 1
>
> I have put <s:head theme="ajax" /> in the parent page (the
> optiontransfertselect Tag is displayed in an ajax result).
>
> Did I had to include optiontransfertselect.js myself because of the ajax
> result?
>
>
> Julien
>
>