on 03-28-2005 3:45 PM
Hello,
I have one view that contains a combo box with a list of values. I would like to map ONLY the value the user selected to the Component Context in order for a second view to use this value. How do I do that?
Hi Roy,
I assume you have bound the selected key attribute to the context attribute.Then create a context attribute of same type in the context of both controller and the second view.Then using context mapping you can directly pass the value from first view to controller and then from controller to second view.
Regards
Geogi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Geogi,
At the iView Cntext I have unit Node and inside an attribute called unitName. The context mapping desn't allow me to map the unitName attribute into an attribute of the component context unless it is sitting in a node as well. why is that? Doesn't it mean that like this I will map the whole node with all it's attributes created on runtime when all I want is to map just the selected attribute from this node?
Hi Roy,
I would like to know as to why do you use a node for the dropdownkey. Instead create a simpletype and map it to an attribute. Map the same attribute to an attribute in the context.
From your earlier query map the attribute dest to the attribute destInComp attribute created at the component controller.
You cannot map an attribute to another attribute in a node because that would have conflict in the cardinality.
Do post your valuable feedbacks
Regards
Noufal
Hi,
I would like to explain with the help of the example I used in your earlier post.
Let's take that you are using the dropdownkey with the attribute dept mapped to your dropdown(You have also created the simple type in the local dictionary).
Now you can create a similar attribute in the component controller and map both the attribute.
When the user selects a value in the dropdown the value would be reflected in the component controller also.
Then there on you can easily map it to the second screen.
The dept is just a context attribute not a context node attribute.
I'm not sure however about the purpose for which you are using the node in this case. I might be able to tell you more only if I get to know that. You would not need a node to create a dropdown.
I hope this would clarify.
Hi ,
Check the below code snippet to create enumeration at the run time for an atrribute
IWDAttributeInfo attrInfo = wdContext.node<<ValuerNode>>().getNodeInfo().getAttribute(IPrivate<<ViewName>>.I<<Node Name>>Element.<<Attribute Name>>);
IModifiableSimpleValueSet valueSet = attrInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
valueSet.clear();
for (int i = 0;i < wdContext.nodeE_Company_List().size();i++) {
valueSet.put(wdContext.nodeE_Company_List().getE_Company_ListElementAt(i).getCompany(),
wdContext.nodeE_Company_List().getE_Company_ListElementAt(i).getName1());
}
Hope this answers ur question.
Hi, Roy
1. If you are using DropDownByKey then value is automatially selected, just create the following mapping:
ViewA.MyNode.MyAttr -> CustomController.MyNode.MyAttr
ViewB.MyNode.MyAttr -> CustomController.MyNode.MyAttr
2. If you are using DropDownByIndex then before invoking second view pick value from first view context attribute and supply as parameter of navigation plug to second view. This way you can avoid intermediate custom controller and mapping. Alternatively you can also use mapping of nodes / attributes through custom controller and get necessary behavior automatically.
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
One alternative way is create another context attribute and assign the selected value to the value attribute.
Map this value attribute to the component controller.
Ex:
wdContext.currentContextElement.setSelectedValue(wdContext.currentComboElement().getValue());
Now map the contextattribute "SelectedValue" to the componentController.
2. Normal way :
At the component cotroller you can always say
wdContext.currentComboElement().getValue() to get the selected one !!
Regards,
Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.