You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by RogerV <ro...@googlemail.com> on 2011/02/24 14:54:46 UTC

Problem with when used with Jquery plugin

Hi

I've got a problem with the <s:optiontransferselect> tag. 

<s:head/>
<s:form>

<s:optiontransferselect
....
 />
  <s:submit type="button"
 
</s:form>

If I process the wrapping form using the <s:submit> tag then I see the two
columns auto-selected and the populated arrays are submitted back to my
action - as I would expect. However, if I replace the <s:submit> tag with
the JQuery plugin <sj:submit> tag then the auto-selection doesn't happen and
the arrays returned to my action are empty.

Now, the reason I need to use the <sj:submit> is that the form in which the
<s:optiontransferselect> sits is, itself, sitting inside a <sj:tab> tag in a
<sj:tabbedPanel> and I need the response page from the posting to also
appear inside the <sj:tab> and the only way I've found to be able to that is
to use the <sj:submit> with the target attribute, otherwise Struts replaces
my page entirely with the response page from the posting.

So could someone explain either how to make the <s:optiontransferselect>
work with the <sj:submit> tag or suggest a way that I can post a form from
within a <sj:tab> tag and have the response page display within the confines
of the same <sj:tab>

Regards
-- 
View this message in context: http://old.nabble.com/Problem-with-%3Cs%3Aselectoptiontransfer%3E-when-used-with-Jquery-plugin-%3Csj%3Asubmit%3E-tp31003927p31003927.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Problem with when used with Jquery plugin

Posted by RogerV <ro...@googlemail.com>.

RogerV wrote:
> 
> So could someone explain either how to make the <s:optiontransferselect>
> work with the <sj:submit> tag or suggest a way that I can post a form from
> within a <sj:tab> tag and have the response page display within the
> confines of the same <sj:tab>
> 

Firstly the javascript used by the optiontransferselect tag attaches an
onSubmit handler to the form that wraps the select options. When making an
Ajax submit request the onSubmit event is not fired by the form so the call
to the auto select script has to come from the sj:submit tag.

Placing the call in the  onBeforeTopics of the sj:submit tag doesn't work.
Although the elements in the optiontransferselect appear visually to be
selected, they are not returned to the underlying action. You have to make
the call in the onClickTopics of the sj:submit tag.

Regards
-- 
View this message in context: http://old.nabble.com/Problem-with-%3Cs%3Aselectoptiontransfer%3E-when-used-with-Jquery-plugin-%3Csj%3Asubmit%3E-tp31003927p31038647.html
Sent from the Struts - User mailing list archive at Nabble.com.


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