[Lift] Re: Todays questions
I guess you could disable the submit button on first submit? ... on server side you could get rid of the processing function from the cache that is associated with that specific thing. However this kind of seems unnecessary for your use-case ... maybe. Br's, Marius On Oct 3, 3:55 am, Oliver [EMAIL PROTECTED] wrote: Thanks for the answers Another related question - Is there any functionality in lift to prevent multiple submits (e.g. the browser is slow for whatever reason and the user presses the submit button multiple times)? cheers Oliver On Fri, Oct 3, 2008 at 10:15 AM, David Pollak [EMAIL PROTECTED] wrote: On Thu, Oct 2, 2008 at 5:13 PM, Oliver [EMAIL PROTECTED] wrote: I'm writing a wizard-like process, where when they have finished the set of forms and press submit I don't want the back button to take them back. Is there any way I can clear out the history? This is JavaScript magic and I'm not sure how to disable it. I guess a related question is, Lift is holding references to objects in its history that I would like to be made available to garbage collection. For instance, I have a table of html links - once one is selected, I can set the holding collection to null, but lift is still holding a reference for its history. I have a number of GC methodologies that I'm working one. Basically, Lift will hold certain references for a period of time (right now that period is the session, but it will get shorter). Thanks, David cheers Oliver -- Lift, the simply functional web frameworkhttp://liftweb.net Collaborative Task Managementhttp://much4.us Follow me:http://twitter.com/dpp Git some:http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Todays questions
I guess you could disable the submit button on first submit? ... on server side you could get rid of the processing function from the cache that is associated with that specific thing. However this kind of seems unnecessary for your use-case ... maybe. Its funny you mention that Marius - not only 2 days ago was I trying to do something like this... I tried adding a onsubmit=submitonce(this); (where submitonce is a function to disable the button) type javascript call into my markup but still, even with the previous change to allow custom snippet attributes, it was removed? So that didn't work, next I thought, ok no problem, i'll just use a jquery event handler! Whilst I could make it disable the button with something like: $(document).ready(function(event) { $(form#delegateform).submit(function(event){ var elements = $ (form#delegateform).children(div).children(input) for(i=0;ielements.length;i++){ var tempobj = elements[i] if(tempobj.type.toLowerCase()==submit){ tempobj.disabled=true } } return true; }) }); Which has the desired effect of disabling the form submit button, but it appears to screw with the actual data being posted. I didnt have enough time to explore what was happening :-( One would have thought this should be a fairly simple thing to want to do - and again, something front end designers should be able to do without needed to do anything server side as its a usability issue IMO. Thoughts? Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Todays questions
On Oct 3, 2:11 pm, Tim Perrett [EMAIL PROTECTED] wrote: I guess you could disable the submit button on first submit? ... on server side you could get rid of the processing function from the cache that is associated with that specific thing. However this kind of seems unnecessary for your use-case ... maybe. Its funny you mention that Marius - not only 2 days ago was I trying to do something like this... I tried adding a onsubmit=submitonce(this); (where submitonce is a function to disable the button) type javascript call into my markup but still, even with the previous change to allow custom snippet attributes, it was removed? No, it is still there. But form snippet care about class and id attributes not quite any custom attributes. So that didn't work, next I thought, ok no problem, i'll just use a jquery event handler! Whilst I could make it disable the button with something like: $(document).ready(function(event) { $(form#delegateform).submit(function(event){ var elements = $ (form#delegateform).children(div).children(input) for(i=0;ielements.length;i++){ var tempobj = elements[i] if(tempobj.type.toLowerCase()==submit){ tempobj.disabled=true } } return true; }) }); Which has the desired effect of disabling the form submit button, but it appears to screw with the actual data being posted. I didnt have enough time to explore what was happening :-( I wonder if it works to disable the button asynchronously into a setTimeout call so th form would be submitted and browser sould execute th disable code after half of second ... haven't tried it so maybe it is a long shot. One would have thought this should be a fairly simple thing to want to do - and again, something front end designers should be able to do without needed to do anything server side as its a usability issue IMO. I tend to agree that this case should be done from client side (mostly). How about not disabling the button but make it invisible? ... would that make a difference? Thoughts? Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Todays questions
On Thu, Oct 2, 2008 at 5:55 PM, Oliver [EMAIL PROTECTED] wrote: Thanks for the answers Another related question - Is there any functionality in lift to prevent multiple submits (e.g. the browser is slow for whatever reason and the user presses the submit button multiple times)? I'll add this kind of functionality. I think the functions that Lift keeps track of will fall into one of the follow categories: - Fire-once... once the function has been called, it's removed from Lift. The use case is just as you've described... and we need to make sure we've got UI support (e.g., disabling submit buttons). - GC'ed... These will stay around for a period of time and a certain number of page requests. - Long-lived... JSON related and Comet related. cheers Oliver On Fri, Oct 3, 2008 at 10:15 AM, David Pollak [EMAIL PROTECTED] wrote: On Thu, Oct 2, 2008 at 5:13 PM, Oliver [EMAIL PROTECTED] wrote: I'm writing a wizard-like process, where when they have finished the set of forms and press submit I don't want the back button to take them back. Is there any way I can clear out the history? This is JavaScript magic and I'm not sure how to disable it. I guess a related question is, Lift is holding references to objects in its history that I would like to be made available to garbage collection. For instance, I have a table of html links - once one is selected, I can set the holding collection to null, but lift is still holding a reference for its history. I have a number of GC methodologies that I'm working one. Basically, Lift will hold certain references for a period of time (right now that period is the session, but it will get shorter). Thanks, David cheers Oliver -- Lift, the simply functional web framework http://liftweb.net Collaborative Task Management http://much4.us Follow me: http://twitter.com/dpp Git some: http://github.com/dpp -- Lift, the simply functional web framework http://liftweb.net Collaborative Task Management http://much4.us Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Todays questions
On Thu, Oct 2, 2008 at 5:13 PM, Oliver [EMAIL PROTECTED] wrote: I'm writing a wizard-like process, where when they have finished the set of forms and press submit I don't want the back button to take them back. Is there any way I can clear out the history? This is JavaScript magic and I'm not sure how to disable it. I guess a related question is, Lift is holding references to objects in its history that I would like to be made available to garbage collection. For instance, I have a table of html links - once one is selected, I can set the holding collection to null, but lift is still holding a reference for its history. I have a number of GC methodologies that I'm working one. Basically, Lift will hold certain references for a period of time (right now that period is the session, but it will get shorter). Thanks, David cheers Oliver -- Lift, the simply functional web framework http://liftweb.net Collaborative Task Management http://much4.us Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Todays questions
Thanks for the answers Another related question - Is there any functionality in lift to prevent multiple submits (e.g. the browser is slow for whatever reason and the user presses the submit button multiple times)? cheers Oliver On Fri, Oct 3, 2008 at 10:15 AM, David Pollak [EMAIL PROTECTED] wrote: On Thu, Oct 2, 2008 at 5:13 PM, Oliver [EMAIL PROTECTED] wrote: I'm writing a wizard-like process, where when they have finished the set of forms and press submit I don't want the back button to take them back. Is there any way I can clear out the history? This is JavaScript magic and I'm not sure how to disable it. I guess a related question is, Lift is holding references to objects in its history that I would like to be made available to garbage collection. For instance, I have a table of html links - once one is selected, I can set the holding collection to null, but lift is still holding a reference for its history. I have a number of GC methodologies that I'm working one. Basically, Lift will hold certain references for a period of time (right now that period is the session, but it will get shorter). Thanks, David cheers Oliver -- Lift, the simply functional web framework http://liftweb.net Collaborative Task Management http://much4.us Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---