on 08-28-2008 5:13 AM
Hi All,
I have a requirement in my project where i need to assign different OVS controllers to a single field depending on a value selected from another field. There will be a table which has 5 or 6 columns. The first field is a dropdown and depending on the value selected in column 1 i need assign a different OVS controller to the input field in column2. Is it possible to do this?
Regards
Prakash
Yes, we can do this.
1. Create the required no.of OVS Custom controllers
2. Create a common method (ex: bindOVSController() ) in View controller
In this method follow the below steps
a.Get the current drop down value from your first column
b.Get the attribute info, which bind to inputput field in your second column
ex: IWDAttributeInfo[] orgAttrInfoArr = {wdContext.nodeEmpData().getNodeInfo().getAttribute("Role")};
c. Check your drop down value and add the OVS extension to the attribute
ex: swith(selectedIndex) {
case 0 :
IWDOVSContextNotificationListener listener = wdThis.wdGetOVSCustControllerController().getOVSListener(); WDValueServices.addOVSExtension("Select Role from 1",orgAttrInfoArr, wdThis.wdGetOVSCustControllerController().getOVSInputNode(), wdThis.wdGetOVSCustControllerController().getOVSOutputNode(), listener);
break;
case 1 :
IWDOVSContextNotificationListener listener = wdThis.wdGetOVSCustControllerController2().getOVSListener(); WDValueServices.addOVSExtension("Select Role from 2",orgAttrInfoArr, wdThis.wdGetOVSCustControllerController2().getOVSInputNode(), wdThis.wdGetOVSCustControllerController2().getOVSOutputNode(), listener);
break;
}
Based on your selected drop down index it will assign the corresponding OVS controller and fetch the data.
I could solve this problem in my example. Let me know if you have any clarification.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tatayya,
Thanks for the response. I had a question.
For e.g in my first row i select value 1 from the first cell and i get ovs1 in my second column. Wht will happen when in my second row when i select value2. I assume i will get ovs2 in the second column. Wht will happen when i go back to row one second column and click the OVS there. will i get OVS1 there or OVS2.
Regards
Prakash
Hi,
You can probably have more than one OVS listeners implemented within the same controller class and similarly different context input and output nodes. Then based on the value selected from the dropdown you can set the OVS listener for the attribute bound to the inputfield in the second column. Something like this:
//In the onchange event handler of the dropdown
IWDAttributeInfo[] ovsStartUpAttributes = {wdContext.node<Name>().getNodeInfo().getAttribute("<attribute name>")}; //attribute bound to the input field
switch(selectedValue){
case 1: IWDOVSContextNotificationListener listener = wdThis.wdGetOVSCustController().getOVSListener1();
WDValueServices.addOVSExtension("First Selection",
// fields bound to startup attributes will be ovs-enabled
ovsStartUpAttributes,
wdThis.wdGetOVSCustController().getOVSInputNode(),
wdThis.wdGetOVSCustController().getOVSOutputNode(),
listener);
break;
case 2: IWDOVSContextNotificationListener listener = wdThis.wdGetOVSCustController().getOVSListener2(); //returns the second OVS listener
//etc...
}
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.