I'm trying to use the onsubmit attribute in the s:submit tag but it fails. The exception is saying that the attribute onsubmit is not correct according to submit TLD. Can someone tell what I've done wrong. here is my jsp:
<%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <title> Media - Tags - UI Tags - Optiontransferselect</title> <script language="JavaScript" type="text/javascript"> function doSubmitSelect() { var selectObj = document.getElementById('leftId' );selectAllOptionsExceptSome(selectObj, 'key', ''); selectObj = document.getElementById('rightId' );selectAllOptionsExceptSome(selectObj, 'key', '');" } </script> <s:head theme="ajax" /> </head> <body> <center> <s:form action="optiontfSubmit" method="post"> <table width="50%" border="0" align="center" cellpadding="0" cellspacing= "0"> <TR> <TD width="15%" height="25" align="left"> </TD> <TD align="left"> <s:optiontransferselect tooltip="Selectionner vos support favoris" headerKey="-1" headerValue="--- Selectionnez ---" doubleHeaderKey="-1" id="leftId" doubleId="rightId" doubleHeaderValue="--- Selectionnez ---" emptyOption="true" doubleEmptyOption="true" label="Support favoris" leftTitle="Supports favoris" rightTitle="support favoris Choisis" name="supportsFavoris" list="#application.supports" listKey="codeSupport" listValue="libelle" doubleName="supportsFavorisChoisis" doubleList="defaultListSupport" /> </TD> </TR> <tr> <td></td> <td align="left" colspan="2"> <s:submit value="Valider" onsubmit="javascript:doSubmitSelect();"/></td> </tr> </TABLE> </s:form> </center> </body> </html> Jeromy Evans <[EMAIL PROTECTED]> 06/07/2007 09:49 Veuillez répondre à "Struts Users Mailing List" <user@struts.apache.org> A Struts Users Mailing List <user@struts.apache.org> cc Objet Re: optionstransferselect tag You can work-around this bug in 2.0.6 by adding the following javascript to the onsubmit attribute of optionstransferselect: 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 is an exact copy of the javascript included in <script> by the tag, but adding it to onsubmit guarantees it executes. I can't comment on whether the problem was fixed in 2.0.8, or if the exact cause of the intermittent problem was ever identified as a bug. More details in this thread: http://www.nabble.com/-S2--Optiontransfertselect-tag-t3827911.html regards, Jeromy Evans [EMAIL PROTECTED] wrote: > There is bug in optionstransferselect tag in struts 2.0.6. When the form > is submitted,nothing > is selected. > Can someone tells me if this has been fixed in struts 2.0.8. > > thanks in advance. > Meissa > > > > [EMAIL PROTECTED] > 06/07/2007 09:25 > Veuillez répondre à > "Struts Users Mailing List" <user@struts.apache.org> > > > A > "Struts Users Mailing List" <user@struts.apache.org> > cc > > Objet > Re: optionstransferselect tag > > > > > > > > but the showcase sample example is working correctly. > That's why I'm troubledshooted not to have my example working. > Meissa > > > > Bill Johnson <[EMAIL PROTECTED]> > 05/07/2007 17:56 > Veuillez répondre à > "Struts Users Mailing List" <user@struts.apache.org> > > > A > Struts Users Mailing List <user@struts.apache.org> > cc > > Objet > Re: optionstransferselect tag > > > > > > > I'm having the same problem and it appears to be > because the default theme is requiring DOJO to > automatically select all the select options before > submitting the form. I'm not sure if there is a JIRA > bug opened for this or not, but there probably should > be. The default (non-ajax) theme should not require > DOJO for the optionstransferselect tag to work. > > I think the way to fix this is to have the default > theme use plain JavaScript to do the "select all" > functionality and not DOJO. > > -Bill > > > --- [EMAIL PROTECTED] wrote: > > >> Hi all, >> I have a problem with the optiontransferselect tag. >> When I click on the submit button,nothing is set on >> the listeSelectedKeys >> attribute of my updateActionClass. >> Can someone tells me what i've missed. >> here is an extract of my jsp. >> >> >> >> >> >> >> <s:form action="updateExtraction" > >> <s:optiontransferselect >> >> >> headerValue="--- >> Veuillez selectionner un compartiments ---" >> >> headerKey="-1" >> emptyOption="false" >> list="#application.vlisteCompartiments" >> listValue="libelleCompartiment" >> >> listKey="id" >> buttonCssClass="bouton" >> >> cssStyle="width: >> 350px;" >> allowSelectAll="false" >> >> >> doubleList="listeCompartiments" >> >> >> doubleName="listSelectedKeys" >> doubleHeaderValue="--- Veuillez selectionner un >> compartiments ---" >> doubleHeaderKey="-1" >> doubleEmptyOption="false" >> buttonCssStyle="bouton" >> doubleCssStyle="width: 350px;" >> >> /> >> >> <s:submit >> cssClass="bouton" type="submit" value="Modifier" >> /> >> >> </s:form> >> >> >> thank in advance. >> >> meissa. >> >> L'integrite de ce message n'etant pas assuree sur >> internet, Natixis ne peut etre tenu responsable de >> son contenu. Toute utilisation ou diffusion non >> autorisee est interdite. Si vous n'etes pas >> destinataire de ce message, merci de le detruire et >> d'avertir l'expediteur. >> Ensemble, faisons un geste pour l'environnement : >> n'imprimons nos mails que si necessaire >> >> The integrity of this message cannot be guaranteed >> on the Internet. Natixis can not therefore be >> considered responsible for the contents. Any >> unauthorized use or dissemination is prohibited. If >> you are not the intended recipient of this message, >> then please delete it and notify the sender. >> Let us mind the environment : let's print our mails >> only when necessary. >> >> > > > > > ____________________________________________________________________________________ > Get the Yahoo! toolbar and be alerted to new email wherever you're > surfing. > http://new.toolbar.yahoo.com/toolbar/features/mail/index.php > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > L'integrite de ce message n'etant pas assuree sur internet, Natixis ne > peut etre tenu responsable de son contenu. Toute utilisation ou diffusion > non autorisee est interdite. Si vous n'etes pas destinataire de ce > message, merci de le detruire et d'avertir l'expediteur. > Ensemble, faisons un geste pour l'environnement : n'imprimons nos mails > que si necessaire > > The integrity of this message cannot be guaranteed on the Internet. > Natixis can not therefore be considered responsible for the contents. Any > unauthorized use or dissemination is prohibited. If you are not the > intended recipient of this message, then please delete it and notify the > sender. > > > > L'integrite de ce message n'etant pas assuree sur internet, Natixis ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. > Ensemble, faisons un geste pour l'environnement : n'imprimons nos mails que si necessaire > > The integrity of this message cannot be guaranteed on the Internet. Natixis can not therefore be considered responsible for the contents. Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender. > Let us mind the environment : let's print our mails only when necessary. > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.476 / Virus Database: 269.10.0/887 - Release Date: 5/07/2007 1:55 PM > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] L'integrite de ce message n'etant pas assuree sur internet, Natixis ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. Ensemble, faisons un geste pour l'environnement : n'imprimons nos mails que si necessaire The integrity of this message cannot be guaranteed on the Internet. Natixis can not therefore be considered responsible for the contents. Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender. Let us mind the environment : let's print our mails only when necessary.