on 11-11-2008 3:30 PM
Hi experts,
I have created a simple project and the Component Controller Context is like the following:
Test // node
Sub // sub node, singleton and declared suply function
SubValue // attribute of SubTest, type is string
TestValue1 // attribute of Test, type is integer
TestValue 2 // attribute of Test, type is integer
I then mapped the context to View Context and defined two TextViews to display TestValue1 and TestValue2 in the View Layout.
I then defined another Textview to display the SubValue.
In the Component Controller Java Editor:
I set the TestValue1 and TestValue2 in wdDoInIt() mehtod.
I set the SubValue in SupplySub() method as follow:
//@@begin supplySub(IWDNode,IWDNodeElement)
ISubElement thisEl = node.createSubElement();
thisEl.setSub1("Test");
node.addElement(thisEl);
//@@end
When I deploy and run it, it displays TestValue1, TestValue2, and SubValue at once.
What I want is that it displays TestValue1 and TestValue2 first. After I click on TestValue1 or TestValue2, it then displays SubValue.
Am I missing something in this simply program.
Thanks for your help.
AnnaS
Hi Anna,
The code inside component controller is the first one to be executed. What is happening is, As soon as your component controller is initialized, you set the 3 values (in the init method of comp controller). Now since these values of the comp controller context are mapped to view context, and the view elements must be in turn bound to this view context, these values are instantly displayed.
What you want to do is, in the comp controller init method, set only the two values TestValue1 and TestValue2. Then in the view, create an OnActionSelect() event handler which should execute when you click any of the two TestValues.
In this method, You should get the comp controller reference and set 'subValue' in its context.
It should be then displayed in the third text field on your view.
In case my understanding of what you require is wrong, kindly revert.
Regards,
Anagha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Never mind about this question.
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.