On Mon, Sep 19, 2011 at 5:14 AM, Wayne W <[email protected]> wrote: > The thing is I'm not doing anything special here, just straight wicket > form stuff AFAIK. > > Here is what is generated from wicket for the form and the link: > > <form id="userForm4e" > action="../../?wicket:interface=:2:users:addPersonContainer:addPersonPanel:userForm::IFormSubmitListener::" > method="post"> The form id is different. Here is "userForm4e". Below is 'userForm1f' (wcall=wicketSubmitFormById('userForm1f' ) > ... > > <a onclick="if (document.getElementById('spinnerContainer23')) > (document.getElementById('spinnerContainer23')).style.display = > 'inline';if (document.getElementById('submitLink22')) > (document.getElementById('submitLink22')).disabled = true;var > wcall=wicketSubmitFormById('userForm1f', > '../../?wicket:interface=:1:users:addPersonContainer:addPersonPanel:userForm:submitLink::IActivePageBehaviorListener:0:2&wicket:ignoreIfNotActive=true', > 'submitLink' ,function() { if > (document.getElementById('spinnerContainer23')) { > (document.getElementById('spinnerContainer23')).style.display = > 'none';}if (document.getElementById('submitLink22')) > (document.getElementById('submitLink22')).disabled = > false;}.bind(this),function() { alert('There was a communication > problem. Please try refreshing your browser');if > (document.getElementById('spinnerContainer23')) { > (document.getElementById('spinnerContainer23')).style.display = > 'none';}if (document.getElementById('submitLink22')) > (document.getElementById('submitLink22')).disabled = > false;}.bind(this), function() {return > Wicket.$$(this)&&Wicket.$$('userForm1f')}.bind(this));;; > return false;" href="#" id="submitLink22" > > <span>Add this person or > group</span> > <span class="left"></span> > <span class="right"></span> > <span id="spinnerContainer23" > style="display:none"> <img > src="../../images/icons/spinnerflat.gif"></span> > </a> > > > As you may see we have an ajax call decorator as well. > > > > > > On Sat, Sep 17, 2011 at 3:59 AM, Igor Vaynberg <[email protected]> > wrote: >> no. i thikn it should be >> >> if (typeof(retVal)=="undefined") retVal=true; >> >> -igor >> >> On Fri, Sep 16, 2011 at 10:58 AM, Martin Grigorov <[email protected]> >> wrote: >>> return (typeOf retVal === "undefined" || retVal === true) >>> >>> in all other cases stop the submit >>> >>> looks OK ? >>> >>> On Fri, Sep 16, 2011 at 8:57 PM, Martin Grigorov <[email protected]> >>> wrote: >>>> Yes, sounds like a good idea. >>>> What if the user code returns an object ? >>>> >>>> On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg <[email protected]> >>>> wrote: >>>>> i think in this case we should define the undefined to be true... >>>>> >>>>> -igor >>>>> >>>>> On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov <[email protected]> >>>>> wrote: >>>>>> it seems in your code you have <form onsubmit="something();"> without >>>>>> returning anything. Since 'if (undefined)' is 'false' the call stops >>>>>> there. >>>>>> >>>>>> On Fri, Sep 16, 2011 at 3:25 PM, Wayne W <[email protected]> >>>>>> wrote: >>>>>>> and in what case does it not return anything? >>>>>>> >>>>>>> >>>>>>> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov <[email protected]> >>>>>>> wrote: >>>>>>>> It should return true or false. >>>>>>>> False if there is some reason to not submit the form, for example >>>>>>>> client side validation failed. >>>>>>>> True if everything is OK and the submit can proceed. >>>>>>>> >>>>>>>> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W <[email protected]> >>>>>>>> wrote: >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that >>>>>>>>> AjaxSubmitLink is not working (at least with one form). >>>>>>>>> >>>>>>>>> The form doesn't get submitted - the problem in wicket-ajax.js is >>>>>>>>> (~line 1120): >>>>>>>>> >>>>>>>>> // Submits a form using ajax. >>>>>>>>> // This method serializes a form and sends it as POST body. >>>>>>>>> submitForm: function(form, submitButton) { >>>>>>>>> var submittingAttribute = 'data-wicket-submitting'; >>>>>>>>> if (form.onsubmit && >>>>>>>>> !form.getAttribute(submittingAttribute)) { >>>>>>>>> form.setAttribute(submittingAttribute, >>>>>>>>> submittingAttribute); >>>>>>>>> var retValue = form.onsubmit(); >>>>>>>>> form.removeAttribute(submittingAttribute); >>>>>>>>> if (!retValue) return; >>>>>>>>> } >>>>>>>>> >>>>>>>>> >>>>>>>>> The problem is var retValue = form.onsubmit(); does not return any >>>>>>>>> value (retValue remains undefined) and hence it returns and doesn't do >>>>>>>>> the submit. I don't know enough about javascript to really understand >>>>>>>>> whats happening here. The form is fairly unremarkable. >>>>>>>>> >>>>>>>>> For now I've patch the wicket-ajax.js code and comment out the return, >>>>>>>>> and it works fine again. I notice this code here was not in 1.4.8. But >>>>>>>>> obviously this is not the solution. >>>>>>>>> >>>>>>>>> So I imagine it something to do with the form, but I don't know where >>>>>>>>> to start and look - what is normally returned by form.onsubmit();? >>>>>>>>> what can I look for? >>>>>>>>> >>>>>>>>> many thanks >>>>>>>>> >>>>>>>>> --------------------------------------------------------------------- >>>>>>>>> To unsubscribe, e-mail: [email protected] >>>>>>>>> For additional commands, e-mail: [email protected] >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Martin Grigorov >>>>>>>> jWeekend >>>>>>>> Training, Consulting, Development >>>>>>>> http://jWeekend.com >>>>>>>> >>>>>>>> --------------------------------------------------------------------- >>>>>>>> To unsubscribe, e-mail: [email protected] >>>>>>>> For additional commands, e-mail: [email protected] >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> --------------------------------------------------------------------- >>>>>>> To unsubscribe, e-mail: [email protected] >>>>>>> For additional commands, e-mail: [email protected] >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Martin Grigorov >>>>>> jWeekend >>>>>> Training, Consulting, Development >>>>>> http://jWeekend.com >>>>>> >>>>>> --------------------------------------------------------------------- >>>>>> To unsubscribe, e-mail: [email protected] >>>>>> For additional commands, e-mail: [email protected] >>>>>> >>>>>> >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: [email protected] >>>>> For additional commands, e-mail: [email protected] >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Martin Grigorov >>>> jWeekend >>>> Training, Consulting, Development >>>> http://jWeekend.com >>>> >>> >>> >>> >>> -- >>> Martin Grigorov >>> jWeekend >>> Training, Consulting, Development >>> http://jWeekend.com >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
-- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
