on 07-18-2006 4:55 PM
Hi
I have mapped my model node onto my view controller. When I trying to set the values in the attribute of the model node I am not able to do it.
My model node context is like this:
NodeA
|-NodeB
|-NodeC
|-Item1
|-Item2
|-Item3
The properties for Context Node A are:
Cardinality : 0...n
Collection Type: list
initialleadselection:true
selection:0..1
singleton: true
typedaccessrequired: true
The properties of Node B are:
Cardinality : 0...1
Collection Type: list
initialleadselection:true
singleton: true
selection:0..1
typedaccessrequired: true
The properties of Node C are:
Cardinality : 0...n
Collection Type: list
initialleadselection:true
singleton: true
selection:0..1
typedaccessrequired: true
This is the code I am using in my View controller to set the attribute for the model node.
IPrivate<name>View.I<nodeC>Element element = wdContext.create<nodeC)Element(new ComplexType_nodeB());
element.setItem1("test");
element.setItem2("0001");
wdContext.node<nodeC>().addElement(element);
Can any body please let me know where I am going wrong ? Its kind of urgent!!!
Thanks & Regards
--Vishal
I am having the same problem. The web service I am calling is the BI Query webservice
http://<bisystem>/sap/bw/xml/soap/queryview?wsdl
The web service returns complex types. I have confirmed that the data is successfully returned in the SOAP message, but the 6th node deep in the structure has a size of 0, but it should have a size>0. (This context node is mapped to the Item Model (class RrwsSxTuple).)
I have tried instantiating all of the classes in the hierarchy, but I still see that the size of the Item node (6 levels deep) is 0.
I have tried:
-Instantiating the classes
-Setting the child class to the parent class
Questions:
1. Should I ever have to bind a lower level model object to the context node (or is the bind of the request object sufficient)?
2. Should I ever have to invalidate at a lower level than the Response?
3. Do you have any other suggestions for troubleshooting?
Thanks!
Deb Kreider
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Follow Maksim Rashchynski's suggestion.
this problem usually comes when we have nested nodes with complex types.
With out instantiating the parent nodes u cannot set value of thier child nodes.
i,e if u want to set values to node B, first instantiate node A.
Regards,
Satya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishal,
As per my understanding you are trying to populate values for attributes under your model node.
Vishal, can you try this simple code for me in your view's wdDoInit() method?. I am sure it works.
String[] sport = new String[]{"Atheletics", "Marathon", "Hockey", "Cricket"};
List sports = new ArrayList();
for(int i = 0; i < sport.length; ++i) {
IPrivate<<ViewName>>.INodeAElement nodeA = wdContext.createNodeAlement();
nodeA.setItem1(sport<i>);
sports.add(nodeA);
}
wdContext.nodeNodeA().bind(sports);
Hope this helps.
Regards,
Rekha Malavathu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All
Can any one , tell me wats the final conclusion for the above discussed issue,
Since , currently iam facing the similar problem , where from WSDL i mapped the context element.....
as my inner node cardinality is on 0...N , i am not able to set the value to attributes
the ERRROR, i get on setting the Value attribute was :java.lang.NullPointerException
it would be really great ,if some one can point out the conclusion of the above discussion.
My Node Struture
CONTEXT
--Request__SubmitRequest
-
===RequestDetails [modelnode]
-
===Roles [modelnode] cardinality : 0..n
-
===+++++ RoleId [Model Attribute]
-
===+++++ SysId [Model Attribute]
i tried following ways to set the value:
wdContext.nodeRequest__SubmitRequest().nodeRequestDetails().nodeRoles().
currentRolesElement().setRoleId("BASIC");
wdContext.nodeRequest__SubmitRequest().nodeRequestDetails().nodeRoles().
currentRolesElement().setSysId("R3_220");
Hi Vishal,
The Cardinality for the input Field is 1..1 or 0..1. Please make the change and bind the values like
wdContext.currentNodeCElement.setItem1("test");
wdContext.currentNodeCElement.setItem2("0001");
//execute
kind Regards
Mukehs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The context node of the view controller is a model node. It has been mapped from the model to the view controller.
I really don't know whether we change the cardinality of a model node because that comes from the Web services.
If there is a way can anybody please let me know how to do it?
--Vishal
Hi,
You shouldn't change the cardinality of the model node(from WebService). you have to change the node which is mapped to the model node during the template selection process (Relate Context Attributes).
set cardinality :1..1
but using this value you cannot set values for atributes like,
IPrivate<name>View.I<nodeC>Element element = wdContext.create<nodeC>Element(new ComplexType_nodeB());
element.setItem1("test");
element.setItem2("0001");
you can use the following,
wdContext.current<nodeC>Element.setItem1("test");
wdContext.current<nodeC>Element.setItem2("0001");
Best regards,
Hi Vishal,
As you said, you have mapped the model to your model node context
NodeA
|-NodeB
|-NodeC
|-Item1
|-Item2
|-Item3
So, you have model class for NodeA (lets say ClassA), for NodeB (ClassB), for NodeC (ClassC).
So, you have to do following:
ClassA classa = new ClassA();
ClassB classb = new ClassB();
ClassC classc = new ClassC();
classa.setClassB(classb);
classa.setClassC(classc);
wdContext.nodeNodeA().bind(classa);
Best regards, Maksim Rashchynski.
Hai ,
Try to change the property of node b and node c , singleton=false;
regards,
naga raju
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishal,
set the properties of Node C like
Cardinality : 1..1
selection:0..1
Hope this will help you.
regards
karthik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishal,
You should do following:
1) create instance of model wuch is bound to NodeA
2) create instance of model wuch is bound to NodeC and add it to first created instance
3) call wdContext.node<nodeA>().bind(instance from p.1)
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.