select-many ajax

58 views
Skip to first unread message

Jim Harvey

unread,
May 9, 2012, 5:45:04 PM5/9/12
to hobo...@googlegroups.com
Hi, I have new and edit forms where a portion of the form is updated via ajax based on selections by the user. Specifically, the user must select a State/Province for the District <select-many> to populate, and then select one or more districts for a School <select-many> to show up. I have it working on the EDIT form only because the <select-many> inputs rely on saving the current user and populating the dropdowns based on the "parent" selection (ie. province -> district). So, in the case of a New user, I can't save the user without having all other required fields filled out. 

Really, I don't want to be saving anything at all, and if the request is an ajax request I'd like to store the selections for Province/District in the controller in some instance variable and use that to inform the <select-many>, which would then only save to the User instance in the database when the form is submitted. Is there any way this can be done? Let me know if what I want to do is not clear or if you want to see my code so far. Also, I'm on Rails 3.0.12 and Hobo 1.3.0 if it matters. Thanks! 

Bryan Larsen

unread,
May 9, 2012, 7:44:15 PM5/9/12
to hobo...@googlegroups.com
Is http://cookbook-1.4.hobocentral.net/tagdef/hobo_rapid/inputs/hot-input
what you're looking for? It's only available on Hobo 1.4 though.

Bryan
> --
> 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/-/PeH8nKjfjAsJ.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
> hobousers+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.

Jim Harvey

unread,
May 10, 2012, 3:05:02 PM5/10/12
to hobo...@googlegroups.com
The <hot-input> may be pretty close to what I'm looking for. It seems from this line: 

<region-label:><%= this_parent.country._?.region_label %><region-label:>

that the <hot-input> is saving the record then updating the region label based the record's new country. Is that right? If so, how does it work for a new record when the country may be selected first and the record can't be saved yet? Or is there something about all this I'm not understanding? 

Bryan Larsen

unread,
May 10, 2012, 3:17:36 PM5/10/12
to hobo...@googlegroups.com
hot-input doesn't save the form, it just refreshes the form. It sends
the form back to the server, and the server creates or updates the
object based on the form just like a normal create or update.
However, the object isn't saved, it's just used as the context to
refresh the page.

Bryan
>> > hobousers+...@googlegroups.com.
>> > 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/-/dSobjeUWDRkJ.
>
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
> hobousers+...@googlegroups.com.

Jim Harvey

unread,
May 14, 2012, 1:42:23 PM5/14/12
to hobo...@googlegroups.com
Thanks Bryan, that makes sense. This tag does appear to be what we're looking for, the concern now is upgrading to 1.4 and how that will affect our application. We'll obviously create another branch to build the 1.4 version and test it. I've seen the documentation on the cookbook site about the changes from 1.3 to 1.4. How "stable" is 1.4 for a production application? What are the major issues currently holding it back from official release? Any estimate on timing for the release?



>> > 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/-/dSobjeUWDRkJ.
>
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to

Bryan Larsen

unread,
May 15, 2012, 9:02:24 AM5/15/12
to hobo...@googlegroups.com
We're developing an application based on Hobo 1.4, and so are at least
a couple of other people. Bug reports are rare, so I would think
that it's fairly close to production level stability. I know that I
wouldn't hesitate to put up a website built on Hobo 1.4

Here's the TODO list:

https://github.com/tablatom/hobo/blob/master/hobo/TODO-1.4.txt

As far as timeline goes, that's harder to call. There's probably a
couple of solid weeks worth of work on that list. Unfortunately, our
products come first on my priority list, so I have to squeeze time in
wherever I can.

Note that you will likely require the "create_response: mirror
update_response" item from the todo list to get hot-input working the
way you want it to. I will move that todo item to the top of my
priority list, although it might be a week before I can complete that
for you.

cheers,
Bryan
>> >> > hobousers+...@googlegroups.com.
>> >> > 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/-/dSobjeUWDRkJ.
>> >
>> > To post to this group, send email to hobo...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > hobousers+...@googlegroups.com.
>> > 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/-/CsmWt0xVfJEJ.
>
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
> hobousers+...@googlegroups.com.

Jim Harvey

unread,
May 21, 2012, 2:42:28 PM5/21/12
to hobo...@googlegroups.com
Awesome. I created a new branch of our app to run 1.4 and am just in the process of fixing everything that broke in the upgrade. It'll probably take awhile so don't worry too much about revising your priorities, although I do appreciate it! I was asking about a timeline more out of curiosity than anything else. The TODO list gives me a great idea of where we're at. Thanks!
>> >> > 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/-/dSobjeUWDRkJ.
>> >
>> > To post to this group, send email to hobo...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > 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/-/CsmWt0xVfJEJ.
>
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to

Bryan Larsen

unread,
Jun 1, 2012, 4:22:02 PM6/1/12
to hobo...@googlegroups.com
After investigation, it appears that my "create_response mirror
update_response" TODO item has to do with AJAX file uploads, not with
hot-input: you should be able to use hot-input on items that aren't
saved in the database.

Bryan
>> >> >> > hobousers+...@googlegroups.com.
>> >> >> > 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/-/dSobjeUWDRkJ.
>> >> >
>> >> > To post to this group, send email to hobo...@googlegroups.com.
>> >> > To unsubscribe from this group, send email to
>> >> > hobousers+...@googlegroups.com.
>> >> > 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/-/CsmWt0xVfJEJ.
>> >
>> > To post to this group, send email to hobo...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > hobousers+...@googlegroups.com.
>> > 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/-/mmwwlQn747cJ.
>
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
> hobousers+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages