on 04-05-2005 1:36 PM
Hi There,
I am using an interfaceControler to passthru some parameters from a componentControler X to a componentControler Y. Inside this interfaceControler I defined a contextnode (cardinality 1:1) like this:
|selectedValues
|--value 1
|--value 2
|--value 3
Within the context of componentControler Y I defined contextmapping for the node selectedvalues and the interfaceControler, and I defined a View Z to show the values in a WebDynpro view, so I also defined contextmapping between the componentControler Y and viewControler Z
When I run the application I can see the values nicely on the view
I am having a problem when within the viewControler Z I call a method ABC which is part of componentControler Y. In this method ABC I call a getter method for the nodeElement selectedValues.value2. If I call this method ABC the first time before the view is displayed I get a null pointer exception, if I call this method after displaying the view everything works fine.
What did i forgot!
regards
Bertil
Hi There,
The problem is solved.
I defined a method inside the interfaceControler. This method is called by the first ComponentControler. In this method i get the context i need from the calling ComponentControler and after that i call some methods which are defined inside the second ComponentControler. From this second ComponentControler i have contextmapping to the viewControler.
In this view i also added a calculated value attribute with its own getterMethod.
Don't know if this is the best approach but it seems to be working
Bertil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
I dont understand your problem fully.
But i can suggest u something.
A view has to be active when u perform any function in relation to it. The life cycle can be frame work controlled or active when visible.
Since you havenot called the view before,the view does not exist... so i guess u cant access functions or context variables in it,unless u use the view.
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bertil
i am sending you the flow sequence for me it got executed
this is interface init where i am setting value for the value Attribute (Interface Controller init where i am setting value "World"
this is Component init (Component Controller init)
this is View init (View Contoller init)
this is Component method (Component Controler method)
this is Component after concatinating hello Worldhello (hello is concatenated to the String World)
value in init view after calling methodWorldhello (in view Controller after execution of method
Krishna kanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bertil
i tried the similar situation it is working fine for me
can u explain little bit further what is your problem
Krishna kanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna,
I will try to explain a little bit further,
The view I am using has a context element to hold a string made up with some of the values that are delivered by the interface controler. To fill this string I created a method inside the componentControler and therefor I created a contextmapping between the interfaceController and the ComponentControler.
This method does something like this:
if (wdContext.nodeSelectedValues().currentSelectedValuesElement().getValue1() != null) {
String aString = "A PieceOfText ";
aString = aString.concat(wdContext.currentSelectedValuesElement().getValue1());
}
else {
aString = "Context ComponentControler not there yet!";
};
wdContext.currentContextElement().setTitle(aString);
If I call this method during the DoInit of the ViewControler I get the text "Context ComponentControler not there yet!". If I call this method as part of handling of an action handled by the view than I get the text "A PieceOfText <value1>".
so why is the context the first time the view is called not there yet?
maybe this helps
Bye
Bertil
Hi Bertil
see i shall explain what i have done
in the interface Controller i have a value node and Attribute. Cardinality 1-1
in the Component Controller i have same value node and Attribute mapped to interface and a method which writes the getter method of the node in the component Controller.
In the view i have the same node with Attrib
and in init i am calling the method of component controller and displaying the value. i have even concated some value too.
hope i am understanding you correctly
Krishna Kanth
Hi Bertil,
Are you using wdContext.currentNODEElement().getATTRIBUTEVALUE() in the second component to display the values ??
If so it will give null pointer exception because intialization is happening in the first component controller.I feel This could be a problem with intialization .
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 |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.