Hi:
I am having some problems with a complex input page. I use this page to
create an object which has many "belongs_to" dependencies. The choice of
one dependency affects other dependencies. I use the <hot-input> tag to
narrow down selection option options as the user moves down the page. I
think that I am missing something very basic, but I'm not sure what it is.
Hopefully someone can point me in the right direction.
I am using hobo 2.2.6 under rails 4.2.6.
In order to avoid conflicts between multiple <hot-input> tags, I broke the
page down into parts. Here is a simplified version of what I created:
<extend tag="form" for="InputTest">
<old-form merge>
<field-list: replace>
<do part="InputTest-1">
<field-list fields="input_one">
<input_one-view:>
<hot-input update="InputTest-2">
<select-one options="&InputOne.user_view(...)"
include-none="&true" blank-message="..."/>
</hot-input>
</input_one-view:>
</field-list>
</do>
<do part="InputTest-2">
<field-list fields="input_two">
<input_two-view:>
<if test="&this_parent.input_one">
<hot-input update="InputTest-3">
<select-one options="&this_parent.input_one.input_two"
sort="true" include-none="&true" blank-message="..."/>
</hot-input>
</if>
<else>
<select disabled><option>First select
input_one</option></select>
</else>
</input_two-view:>
</field-list>
</do>
<do part="InputTest-3">
<field-list fields="input_three">
<input_three-view:>
.........
</input_three-view:>
</field-list>
</do>
.....
</field-list:>
</old-form>
</extend>
This works fine if the user fills everything out as intended. That is if
the user selects input_one, the options for input_two are present. If the
user then selects input_two, the options for input_three are present, and
so on down the list.
If however, the user doesn't enter everything perfectly, the page won't
work:
1. If the user makes the input_one selection, and then decides to
re-select for input_one, the change isn't picked up immediately by the
input_two selection list. I need to select input_one a third time, and then
the input_two selection list reflects my second input_one selection. In
other words, I have a lag.
2. If I avoid entering any fields at all and simply hit the create
button at the bottom of the page, the field validations that I have in the
model prevent the object from being saved (just as intended), but the page
stops functioning. I can still select input_one, but the input_two
selection no longer adjusts to reflect the input_one selection. The log
file shows "NoMethodError (undefined method `input_one' for
#<InputTest::ActiveRecord_Relation:0x404c140e>)".
Any help would be appreciated.
Thx,
Ed
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.