I want to set the default value for a Textfield dynamically. like for example i select particular device in dashboard1, this device has some 8 parameters so when i select a particular device and click "view parameter details" button, i want it to send default values for those parameters to dashboard2. And these default values should get changed on different device selection.
How can i do this? any idea?
Probably the best way is to use the ValueSetter module's conditional abilities. This stuff is deliberately limited but it comes in handy often.
So right now you have a TextField on dashboard2. Let's say its name param is "myTextField". You want to pass the default value based on the upstream value of $myPulldown$. Last but not least you have a Redirector on dashboard1. and say that Redirector looks like this:
So you can sneak a ValueSetter into this picture like so. Again the logic is very limited and here because you're setting multiple cases you have to give each one a priority flag. But still... it does what you need with no custom code.
3) Last but not least you could use some custom code. I always see this as a last resort, but you can use a CustomBehavior module and implement the getModifiedContext method. In that method look at the upstream value of the pulldown key, set whatever keys you need, then return the modified context instance.