on 04-24-2006 6:00 AM
Hi all,
I have two input fields. The first input field gets its values from fixed domain values. According to that, the results should be displayed in the second input field in a dropdown form. I'm not sure how to write the code for that. Any ideas appreciated. Thanks.
Hi Lathika,
create a value node and a attribute of the type u want to store data in it like string and assign the node to the dropdown UI element ...
bind the first inputfield to the context attribute of required type ...in some event like button press ...
create a elemnt of the value node of the dropdown and set the attribute by copying the data of first inputfield and then bind the created element to the context.....
hope it will help u......
Regards,
Yash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lathika,
1) create a context attribute and specify the type as a local dictionary type.
The dictionary type can contain an enumeration of values.
2) Attach the first input field(say id :InputField1) to this context attribute.
3) To the second input field (id : InputField2)you can attach a simple context attribute of type string.
4) Put the below mentioned code in wdModifyView.
=========================================================
IWDInputField secondinput = (IWDInputField)view.getElement("InputField2");
secondinput .setValue(wdContext.currentContextElement().getProducts());
=========================================================
So every time when the input filed selects a value the corressponding value gets displayed in the second.
Case 2:
In case you want some other values to be shown ion second input field in a drop down form .Say for example.
Input filed1 allows you to select a product.
Input filed displays the brands for the selcted product.
1) In this case you can create a context say product which is attached to dictionary type created by you.
2)Create dictionary types for the brands for the products say sopa,pencil etc.Create context attributes for the brands and attach them to tehese dictinary types.
Then in modify view put the following code.
productbrands = (IWDInputField)view.getElement("InputField1_0");
if (wdContext.currentContextElement().getProducts().equalsIgnoreCase("soap"))
{
productbrands.bindValue(wdContext.currentContextElement().node().getNodeInfo().getAttribute("soap"));
}
else
{
productbrands.bindValue(wdContext.currentContextElement().node().getNodeInfo().getAttribute("pencil"));
}
regards
aarthi mathivanan
Message was edited by: aarthi mathivanan
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.