on 02-21-2007 9:08 AM
Hi.
Im unable to pass data from one view to another.
Scenario.
I have a view1 and view2 with attribute isTrue in each of the view.
I mapped the attributes of both the view to component controller (comp1).
view1->comp1<-view2
I have a button in my view1. In the button event, I'm writting the following code.
wdContext.currentContextElement().setisTrue(true);
Obvioulsy Im firing the plug to show the view2, In view 2 Im doing some calculation by checking a condition if the attribute isTrue value is true.
But only default value come as false always.
When I debug the component I noticed that the value is not passed to component controller itself.
I was doing the sameway coding for many components and its working, Im puzzled why this simple task is not working for me.
Note: I tried with changing attributes type as string and passed the values, then too this is not working. I tried in CustomController too, then also the same problem occurs.
Can anyone give me suggestions?
Regards
Bala
Message was edited by:
Balachandar P
Hi,
Define the VA in Comp1 and register the Comp1 to View1 and View2 and context mapping Add it to View1 and View2.
In the first view Init method that VA set to True then it will be coming to View2
WdContext.currentContextElement().SetVA(True);
U can display the this attribute in second View like this.
wdThis.GetcomponentAPI().getMessageManager().reportSuccesss(VA);
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Balachandar,
Check the value that you are setting in the View1 itself.
wdContext.currentContextElement().setisTrue(true);
Now print the value and check it in the same view.
wdComponentAPI.getMessageManager().reportSuccess(""+wdContext.currentContextElement().getisTrue());
If you are still facing the same pblm then close the project or close the studio and then try it out.Final option is to restart the server.
Regards,
Jhansi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One more option is to set value directly using reference of component controller in view1 and in the same way access value in view2.
wdThis.wdGet<Controller Name>Controller().wdGetContext().currentContextElement().set<attribute>();
If it works that means there is some error in context mapping.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bala,
I suggest you to check the mapping once again.
View1 context mapped to ComponentController.
ComponentController to View2.
Check the readonly property of the attribute "isTrue" once.
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 |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.