dynamic forms

0 views
Skip to first unread message

Justin Richter

unread,
Jun 16, 2009, 4:05:52 PM6/16/09
to tul...@googlegroups.com
Hey all,

I am having a problem I can't quite get my brain around.

I have a form that allows a user to create a person, then a visit for the person, then a study for the visit.  

So a user starts typing the persons account number, and auto complete finds it and fills in the persons fields.  Then the user moves down to the visit fields and starts typing in the visit id number, this is limited to searching for visits that the person has actually had instead of all visits.  Simple enough.  My problem comes when I try to dynamically load all the studies associated to a visit if it is found and selected.  It sounds simple, but I just can't seem to get it.  Any ideas?

Thanks,

Justin

Justin Richter

unread,
Jun 16, 2009, 4:09:02 PM6/16/09
to tul...@googlegroups.com
Nevermind, I just need to call a remote function after update element... 

Thomas Mancino

unread,
Jun 16, 2009, 4:20:01 PM6/16/09
to tul...@googlegroups.com
Ok let me get back with you on Wed and make sure I and he can attend
for sure. I will let you know.
Sincerely,
Tommy Mancino

blog - http://www.wannabvc.com/
twitter - http://twitter.com/tommy_mancino
friendfeed - http://friendfeed.com/tmancino

(c) 918-671-2673 - text enabled





Brandon Pollet

unread,
Jun 16, 2009, 4:16:51 PM6/16/09
to tul...@googlegroups.com
What is happening with your code now? Is it pulling back all visits, no visits, or is it blowing up? 

I would think that with an observer on the form you could pull the correct person, then get person.visits. Then pull the selected visit and get visit.studies. 

- Brandon

Justin Richter

unread,
Jun 16, 2009, 4:49:53 PM6/16/09
to tul...@googlegroups.com
I was using an observer, but it was firing to soon, before I selected the correct visit.  So i ended up doing this.
In the Ajax call I am using afterUpdateElement and calling a function with this in it:
#{remote_function(:url => return_case_num_orders_path, :with  =>"Form.Element.serialize('visit_case_num')", :update => 'tabbed_studies', :method => 'get')}

which passes the visits id number and returns my partial with that stuff in it...
Reply all
Reply to author
Forward
0 new messages