new to using these in place editors, so please forgive my ignorance I''m making use of InPlaceCollectionEditor, but it does not selected the correct element. I''m using the array of arrays, as in... [[1,''option 1''], [2, ''option 2'']] but the first option is always selected. I tried using the ''value'' option in the InPlaceCollectionEditor declaration, and it worked but only on the page load. If I then changed the value, and then edited again it selected the original value. But, I read in the Proto/Script book that the ''value'' option is deprecated - so I''m thinking there must be a better way. Can anybody offer insight? Thank You, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Andy Koch a écrit :> But, I read in the Proto/Script book that the ''value'' option is > deprecated - so I''m thinking there must be a better way.Yes, I do say on p369 that the option has been deprecated, as it makes no sense (and I explain why). However, it''s still there, but indeed, it would only work the first time around, as it isn''t updated by later uses of the control. The issue you''re having here is that your control''s text, post-edition, is a "label" (plain text), while the matching to determine the selected option is against the "value" (in your case, IDs). So you need to use the same feature you would if you were displaying HTML but editing, say, Textile: alternate text loading. You need to provide a loadTextURL (and possibly customize loadingText) that will return the proper currently-selected ID. If you handle multiple IPCE''s, use the built-in editorId parameter that will be sent to determine which one is calling you, and return just the corresponding current "value" as a response: that is what will be matched against the collection''s values (i.e. IDs in your situation). ''HTH -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Is it possible to do the loadTextURL business without hitting the server? My options list is a javascript variable (array) on the client. If I could just reference that it would avoid an unnecessary trip to my server. Perhaps just a "loadText" option? On Dec 13, 11:50 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Andy Koch a écrit : > > > But, I read in the Proto/Script book that the ''value'' option is > > deprecated - so I''m thinking there must be a better way. > > Yes, I do say on p369 that the option has been deprecated, as it makes > no sense (and I explain why). However, it''s still there, but indeed, it > would only work the first time around, as it isn''t updated by later uses > of the control. > > The issue you''re having here is that your control''s text, post-edition, > is a "label" (plain text), while the matching to determine the selected > option is against the "value" (in your case, IDs). So you need to use > the same feature you would if you were displaying HTML but editing, say, > Textile: alternate text loading. > > You need to provide a loadTextURL (and possibly customize loadingText) > that will return the proper currently-selected ID. If you handle > multiple IPCE''s, use the built-in editorId parameter that will be sent > to determine which one is calling you, and return just the corresponding > current "value" as a response: that is what will be matched against the > collection''s values (i.e. IDs in your situation). > > ''HTH > > -- > Christophe Porteneuve aka TDD > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Andy Koch a écrit :> Is it possible to do the loadTextURL business without hitting the > server?You would need to override the getText method instead: it is used by both IPE and IPCE to grab the default text for editing, and relies on innerHTML originally. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---