Parts need to be able to exist independently. Hobo does some "magic" to ensure that the context gets resurrected correctly, but most other dependencies need to be handled by your code.
In your case, you could serialize `attributes` by adding them to the part-locals for your part. Then, you can use merge-attrs rather than merge, and it should work. Rather than using merge-attrs inside a part, I prefer to deal with each possible attr separately. So rather than <input merge-attrs/> I would use <input value="&foo"> and ensure that foo is either defined inside the controller, the part or in the part-locals. Bryan On Wed, Nov 14, 2012 at 5:13 AM, tonym <[email protected]> wrote: > Thanks for the quick response Vivek, > but it isn't the jquery that's causing the problem. A little testing and I > found that this fails: <input merge /> > and the ones that work are outside the ajax <do part> so it looks like <do > part> causes some sort of conflict with the input merge. Good news for me > is that I'm planning to replace the ajax parts with jquery. Something to > keep in mind though if you're using ajax. > > Regards, Anthony. > > > On Wednesday, November 14, 2012 7:14:46 AM UTC, Vivek Sampara wrote: >> >> Anthony , >> >> Try >> >> <q-18s-view:><input merge onclick="if (jQuery(this).attr('checked')) { >> jQuery('#time-18s-disp').fadeIn(); } else { >> jQuery('#time-18s-disp').fadeOut(); }"/></q-18s-view:> >> >> Vivek >> >> >> On Wed, Nov 14, 2012 at 4:22 AM, tonym <[email protected]> wrote: >>> >>> Hi All, >>> I've been getting on well with Hobo, and close to completing my first >>> project... but stuck with ajax and javascript issue. Hope someone can >>> help. >>> >>> I can't figure out how, (or if it is possible) to redirect after an ajax >>> create (and ideally update too). I've tried what I can find in the >>> documentation, but nothing seems to work. >>> >>> I'd like to avoid using ajax forms, but I've used hot-input due to the >>> complexity of the form and changing prompts. >>> I've tried using javascript instead to modify the form live, which works >>> well to some extent, but oddly I'm getting this error on some check boxes >>> (but not all of them??)... >>> >>> This works: >>> >>> <field-list: fields="standard_ticket, q_concessions"> >>> <q-concessions-view> >>> <input merge onclick="if ($(this).attr('checked')) { >>> $('#q-concessions-desc').fadeIn(); } else { >>> $('#q-concessions-desc').fadeOut(); }"/> >>> </q-concessions-view:> >>> </field-list:> >>> <div id="q-concessions-desc"><field-list: >>> fields="concessions_desc"/></div> >>> >>> This fails with the error 'undefined method `attributes' for >>> #<#<Class:0x3391a2c>:0x3396ae0>' : >>> >>> <field-list: fields="q_18s"> >>> <q-18s-view:><input merge onclick="if ($(this).attr('checked')) { >>> $('#time-18s-disp').fadeIn(); } else { $('#time-18s-disp').fadeOut(); >>> }"/></q-18s-view:> >>> </field-list> >>> <div id="time-18s-disp"> >>> <field-list fields="time_18s" /> >>> </div> >>> >>> >>> Both are check boxes, defined the same, I can't see how anything can be >>> different: >>> >>> q_concessions :boolean >>> q_18s :boolean >>> >>> Cheers, Anthony. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Hobo Users" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/hobousers/-/gW0vL8urc68J. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> >>> For more options, visit this group at >>> http://groups.google.com/group/hobousers?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Hobo Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/hobousers/-/9rm3tqRGId8J. > > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/hobousers?hl=en. -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
