All, The Ajax.InPlaceEditor control is nice but I''d like the ability to read the changed value. Basically, I''m creating a form with editable elements but it''s only when I do the submit that the form elements are submitted. I''d still like to allow in-place editing but what I''d like to do is get the new value and throw that in a hidden form variable Is this possible? I couldn''t really see a way to short circuit the logic so the ajax communication is bypassed. Perhaps this would work: new Ajax.InPlaceEditor(''editme'', '''', {variable:''somevar''}); When the user presses "save" then "somevar"''s value is updated. Thanks, --Bill
Hi Bill. There should be a getText-value on the editor. var field=new Ajax.InPlaceEditor(''editme'', '''', {onComplete:readValue}); function readValue(){ alert(field.getText()); } Bill Lynch wrote:>All, > >The Ajax.InPlaceEditor control is nice but I''d like the ability to >read the changed value. Basically, I''m creating a form with editable >elements but it''s only when I do the submit that the form elements are >submitted. I''d still like to allow in-place editing but what I''d like >to do is get the new value and throw that in a hidden form variable > >Is this possible? I couldn''t really see a way to short circuit the >logic so the ajax communication is bypassed. Perhaps this would work: > >new Ajax.InPlaceEditor(''editme'', '''', {variable:''somevar''}); > >When the user presses "save" then "somevar"''s value is updated. > >Thanks, >--Bill >_______________________________________________ >Rails-spinoffs mailing list >Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > >
Michael, Thanks, but that''s not quite what I was looking for. I want a way do zero ajax calls -- basically, edit the field and get the new value in a variable without hitting the server (I have a blank URL parameter). Is that possible? Thanks, --Bill On 10/27/05, Michael Krog <mic-njz39FWuq6g@public.gmane.org> wrote:> Hi Bill. > There should be a getText-value on the editor. > > var field=new Ajax.InPlaceEditor(''editme'', '''', {onComplete:readValue}); > > function readValue(){ > alert(field.getText()); > } > > > > Bill Lynch wrote: > > >All, > > > >The Ajax.InPlaceEditor control is nice but I''d like the ability to > >read the changed value. Basically, I''m creating a form with editable > >elements but it''s only when I do the submit that the form elements are > >submitted. I''d still like to allow in-place editing but what I''d like > >to do is get the new value and throw that in a hidden form variable > > > >Is this possible? I couldn''t really see a way to short circuit the > >logic so the ajax communication is bypassed. Perhaps this would work: > > > >new Ajax.InPlaceEditor(''editme'', '''', {variable:''somevar''}); > > > >When the user presses "save" then "somevar"''s value is updated. > > > >Thanks, > >--Bill
This should be possible to do with some heavy hacking of the InPlaceEditor. Essentially just strip out the Ajax calls from it and instead save the new value in a field. This is a pretty special requirement so I don''t think we''ll at this stage try to support it in the standard implementation. On 10/28/05, Bill Lynch <billjive-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Michael, > > Thanks, but that''s not quite what I was looking for. I want a way do > zero ajax calls -- basically, edit the field and get the new value in > a variable without hitting the server (I have a blank URL parameter). > Is that possible? > > Thanks, > --Bill > > On 10/27/05, Michael Krog <mic-njz39FWuq6g@public.gmane.org> wrote: > > Hi Bill. > > There should be a getText-value on the editor. > > > > var field=new Ajax.InPlaceEditor(''editme'', '''', {onComplete:readValue}); > > > > function readValue(){ > > alert(field.getText()); > > } > > > > > > > > Bill Lynch wrote: > > > > >All, > > > > > >The Ajax.InPlaceEditor control is nice but I''d like the ability to > > >read the changed value. Basically, I''m creating a form with editable > > >elements but it''s only when I do the submit that the form elements are > > >submitted. I''d still like to allow in-place editing but what I''d like > > >to do is get the new value and throw that in a hidden form variable > > > > > >Is this possible? I couldn''t really see a way to short circuit the > > >logic so the ajax communication is bypassed. Perhaps this would work: > > > > > >new Ajax.InPlaceEditor(''editme'', '''', {variable:''somevar''}); > > > > > >When the user presses "save" then "somevar"''s value is updated. > > > > > >Thanks, > > >--Bill > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
On 10/27/05, Jon Tirsen <jon-fQK1VBTDpnXQT0dZR+AlfA@public.gmane.org> wrote:> This should be possible to do with some heavy hacking of the > InPlaceEditor. Essentially just strip out the Ajax calls from it and > instead save the new value in a field.I''ll try that.> This is a pretty special requirement so I don''t think we''ll at this > stage try to support it in the standard implementation.Really? The use case might not be common but it seems like it should be easy to design the code so it''s supportable. I assume after the user types something in you''ll have that in a variable then execute the Ajax stuff. Wouldn''t it be simple to just short circuit the ajax call and return the value? Just make it configurable with another option called "ajax=true" (default mode) .. I''d use that by just passing in "ajax=false". Thanks, --Bill> On 10/28/05, Bill Lynch <billjive-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Michael, > > > > Thanks, but that''s not quite what I was looking for. I want a way do > > zero ajax calls -- basically, edit the field and get the new value in > > a variable without hitting the server (I have a blank URL parameter). > > Is that possible? > > > > Thanks, > > --Bill > > > > On 10/27/05, Michael Krog <mic-njz39FWuq6g@public.gmane.org> wrote: > > > Hi Bill. > > > There should be a getText-value on the editor. > > > > > > var field=new Ajax.InPlaceEditor(''editme'', '''', {onComplete:readValue}); > > > > > > function readValue(){ > > > alert(field.getText()); > > > } > > > > > > > > > > > > Bill Lynch wrote: > > > > > > >All, > > > > > > > >The Ajax.InPlaceEditor control is nice but I''d like the ability to > > > >read the changed value. Basically, I''m creating a form with editable > > > >elements but it''s only when I do the submit that the form elements are > > > >submitted. I''d still like to allow in-place editing but what I''d like > > > >to do is get the new value and throw that in a hidden form variable > > > > > > > >Is this possible? I couldn''t really see a way to short circuit the > > > >logic so the ajax communication is bypassed. Perhaps this would work: > > > > > > > >new Ajax.InPlaceEditor(''editme'', '''', {variable:''somevar''}); > > > > > > > >When the user presses "save" then "somevar"''s value is updated. > > > > > > > >Thanks, > > > >--Bill > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
> Really? The use case might not be common but it seems like it should > be easy to design the code so it''s supportable. I assume after the > user types something in you''ll have that in a variable then execute > the Ajax stuff. Wouldn''t it be simple to just short circuit the ajax > call and return the value? Just make it configurable with another > option called "ajax=true" (default mode) .. I''d use that by just > passing in "ajax=false".Yes, that might be possible. If you can find a clean way to do it then please do submit a patch and I''m sure Thomas will commit it.