on 10-29-2007 6:00 AM
Hi
My requirement is that I want to populate one dropdown on selection of some value in other drop down.The two dropdown are present in two columns of a Table.
Can any body help for the same.
Regards
Nitin
Hi,
If your table source node is 'FirstColumnNode' and the contents of 'FirstColumnNode' is as follows:
FirstColumnNode(0..n)
|_SecondColumnNode(0..n)
And your table's first column (drop down) should be mapped to FirstColumnNode , second column (dropdown) should be mapped to SecondColumnNode.
Now when you select a value from the FirstColumn Node (in dropdown), corresponding current element's SecondColumnNode will be populated in the second column(dropdown).
Just check this and let me know ..No coding needed..
Thank you,
Divya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try This
Bind "enable" properties of Both DD1 and DD2 to
context attributes of type boolean. DD1Enable,DD2Enable
1: set their value to false intially
wdContext.currentContextElement.setDD1Enable(false);
wdContext.currentContextElement.setDD2Enable(false);
Bind the selected property of the table to a
Context attribute of type boolean(Initially false), say "selected"
2: Then use check box in the table to get current lead selection
write in "onToggle" action of checkBox
int len=wdContext.nodeTable().size();
for(int i=0;i<len;i++)
{
if(wdContext.currentTableElement().getSelected()==true)
{
wdContext.currentDD1Element().setDD1Enabled(true);
wdContext.currentDD2Element().setDD2Enabled(true);
}else
{
wdContext.currentDD1Element().setCountryEnabled(false);
wdContext.currentDD2Element().setStateEnabled(false);
}
}
This is how u get leadselection and able to change particular row in the table
Regards
Lakshmi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lakshmi
Thanks for the reply.But what I exactly need is coding idea for population of the dropdown on select of another dropdown .Both the dropdown are in the table.They form the two columns of the table. Also the population should happen within the row.
eg if i select A Column(Dropdown A) in row 1 then it should populate column B(Dropdown B) in row 1
Context:
Rows (node)
-- ItemsA (node, singleton=false)
---- text (string)
-- ItemsB (node, singleton=false)
---- text(string)
DropDownByIndex editorA;
editorA.texts -> Rows.ItemsA.text
editorA.onSelect -> ItemASelected (action)
editorA.mappingOfOnSelect: nodeElement -> row : IRowsElement (action parameter)
DropDownByIndex editorB;
editorB.texts -> Rows.ItemsB.text
Action handler:
onActionItemASelected(..., IRowsElement row)
{
IItemsAElement selectedItemA = row.nodeItemsA().currentItemsAElement();
row.nodeItemsB().invalidate();
{
IItemsBElement item = row.nodeItemsB().createAndAddItemsBElement();
item.setText("Item #1 in dropdown B");
}
{
IItemsBElement item = row.nodeItemsB().createAndAddItemsBElement();
item.setText("Item #2 in dropdown B");
}
/* etc */
}
Armin
Hi Nitin,
make the 2nd attribute as calculated.It will generate the getter & setter method.u can populate the 2nd dropdown in setter method according to the value selected in 1st drop down.
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Assume you need to get the DD2 populated on some value of DD1.
To get the current element of DD1.
wdContext.node<nodename binded to DD1>().current<nodename binded to DD1>Element().get<attributename>();
You can check for the returned value and use it in the if else clause to suffice your need.
To polulate new values in DD2.
IPrivate<viewname>.I<nodename binded to DD2>Element ele = wdContext.node<nodename binded to DD2>().create<nodename binded to DD2>Element();
ele.set<attributename>(<value>);
wdContext.node<nodename binded to DD2>().addElement(ele);
Repeat the above step for the number of elements that you want to add to your DD2.
Warm Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Murtuza,
Thanks for the reply. my problem is that this should happen in the table.
The senario is that I have a table with two columns.Each columns have dropdown by index.The table has 10 rows. now when I select dropdown(of first column) in a particular row (say 1st row)then I need to populate the drop down(in second column) of the same row(i.e 1st row) ,leaving other rows unaltered
Can u guide me for the same
regards
nitin
Hi,
You might be having both the nodes binded to your drop down within you table node.
Just get the selected row and read the value of the dd1 and set the value of dd2 for the same row.
Rest procedure remains the same. Only you will need to get the currently selected row and based on that update the nodes of the current index.
Warm Regards,
Murtuza
Hi,
Do
Use the (implicit) event parameter "nodeElement" to identify the row where the action was triggered. Either define a parameter mapping using the view designer tool (Outline view, right-click on InputField -> Parameter Mapping), or with a line of code like
wdDoModifyView(...)
{
if (firstTime)
{
IWDInputField editor = (IWDInputField) view.getElement("inputfield_ID");
editor.mappingOfOnAction().addSourceMapping("nodeElement", "row");
}
}
"row" must be an action parameter of type I<DataSourceNode>Element or IWDNodeElement.
Sorry for the missing url
Regards
Ayyapparaj
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.