on 09-05-2007 8:09 AM
Hi WD Gurus,
Well I am very much new to WD and I am stuck with a issue. I hope you guys can hep me out. This is the scenario
I have two windows, Window A (having iViewA) and Window B (having iViewB).
iViewA calls a popup iViewB. I do some search within iViewB which returns me a integer value. I select a value from table. I need to pass this value of iViewB to iViewA and populate input field in iViewA.
Can someone guide me as how can I achive this? Any pointers/sample code would be very handy.
Thanks and Regards,
Vivek
Hello Vivek,
1. In your controller(custom/Component) create a value attribute of type integer.
2. You need to map this attribute to your Views namely A and B. In the view A map this attribute to your Input field directly or you can SET that value explicitly in the view A.
3. Since there is a mapping between all the views and the controller, the value flows automatically between them. So when you set value either in View A,B or the controller, the same value is available across them.
4. So now in your view B you need to set the value for the attribute that you have created and then destroy the window B.
5. Once you destroy the window, you will be able to see your View A and the value will be available in the input field in View A.
Regards,
Aditya
Message was edited by:
Armin Reichert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vivek,
Please follow the steps given below.
1. Open the component controller and in the context create a value attribute of type integer.
2. In the diagram view map this value attribute to both the views.
3. Now in view 2 set the value which is selected to this value attribute.
wdContext.currentContextElement.setXXX(value you want to return);
4. Since it is mapped to view1 also we can directly access the value from view1.
wdContext.currentContextElement.getXXX();
Thanks,
Suvarna
Message was edited by:
suvarna chittoor
Message was edited by:
Armin Reichert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vivek,
Assume you have created a value attribute of type integer name value in your Controller.
Bind this same attribute to both view1 as well as view2.
In view2 set it value as wdContext.currentContextElement90.setValue(<value that you want to return>);
Now in view1 you can get this value as wdContext.currentContextElement().getValue();
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 Vivek
As you are opening a popup window
1) Create a Value Attribute of Type <i>Integer</i> and pass your return value to that like
int i = .. //your return value
wdContext.currentXXElement.setXX(i)
2) copy this iViewB's context value attribute to the iViewA's context
3) you can use the iViewB's values directly using
int k;
k=wdContext.current<>B<>Element.getB() //return value of iviewb
4) you can use the <i>k</i> value direclty in view A
Regards
Chaitanya.A
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 | |
7 | |
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.