need help for dynamic valuelist

A place for users and developers of the Xataface to discuss and receive support.

need help for dynamic valuelist

Postby md9 » Sat Dec 29, 2007 11:13 pm

I am stuck for last few days to implement dataface forms with dynamic valuelist. I know that currently it is not possible to do so. Perhaps javascript or action route might help. I read the posts on forum discussing javascript, but no success still.
http://xataface.com/forum/viewtopic.php?t=4050#20316
I am newbie and any help is sure appreciated.

Thank you.
md9
 
Posts: 9
Joined: Sat Dec 29, 2007 11:04 pm
Location: India

Postby shannah » Sun Dec 30, 2007 12:43 am

"Dynamic" can have quite a few different meanings. Can you elaborate on what you are trying to achieve?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby md9 » Sun Dec 30, 2007 1:40 am

[quote="shannah"]"Dynamic" can have quite a few different meanings. Can you elaborate on what you are trying to achieve?[/quote]
Thanks shannah for your quick reply. I have two existing tables:
system (id, name)
parts(id, systemid, name)
each part belongs to some system. I am trying to populate these values in third table where some part development activities are to be filled up. There are roughly 20 system and roughly 300 parts. In my third form, user should first select the system, which is being populated as selectlist from system table(from part table too I can do it). Now I want the second selectlist which currently holds all parts, only to show partlist related to user specified/selected system in first select list.
I know this dynamic updation is not possible directly, and javascript or action route has to be used. As a newbie I am struggling to get that done.
Thank you.
md9
 
Posts: 9
Joined: Sat Dec 29, 2007 11:04 pm
Location: India

Postby shannah » Mon Dec 31, 2007 1:33 pm

OK.. the easiest way to do this is to use some javascript to respond to the onchange event in the first select list which filters the options in the second select list.

The thread that you already found is a good place to start with examples. Unfortunately I'm too swamped right now to go through a full example for your case.

The thread that you found (if I recall) involved a little bit of ajax too, which makes things a little more complicated.

Sorry couldn't be of more help right now...

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby md9 » Wed Jan 02, 2008 4:35 am

I searched further in forum and found the solution which works for me.

http://xataface.com/forum/viewtopic.php?t=4150#20865

I lately discovered that the ajax type solution mentioned in last post was not working due to the fact that, I did not had JSON services in dataface.
md9
 
Posts: 9
Joined: Sat Dec 29, 2007 11:04 pm
Location: India

Postby shannah » Wed Jan 02, 2008 1:25 pm

Glad to hear you got it sorted out.

Best

steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby md9 » Tue Mar 11, 2008 11:28 pm

I am just posting here the code that I used in delegate class, to get the dynamic value list working for my purpose.This works for both new and edit recod.
Code: Select all
function block__after_new_record_form(){
echo <<
END;
}
function block__after_edit_record_form(){
return $this->block__after_new_record_form();
}
md9
 
Posts: 9
Joined: Sat Dec 29, 2007 11:04 pm
Location: India


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 6 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved