on 09-26-2007 10:51 PM
Hello:
The text fields of my Web Dynpro App are disabled when I run the app. Im trying to change the Collection Cardinality in the context to 1...1 but I cant, it seems to be disable too.
Can anyone help me? How can I change the cardinality?
Best Regards
Thanks
Mario G
Hi
You need to add the following code in your WdDoInit()
//create a new model instance
model = new <name_of_your_model>();
//create model objects
<name_of_your_request_model_class> requestMO = new <name_of_your_request_model_class>(model);
<name_of_your_send_model_class> sendMO = new <name_of_your_send_model_class>(model);
//associate model objects
requestMO.set< name_of_your_send_model_class>(sendMO);
//bind exacutable model object to context node
wdContext.node<name_of_your_context_node_for_ws>().bind(requestMO);
Regards,
Edzon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mario,
If you are not able to change the cardinality of the node then you can create an element of that node in wdDoInit() method.
IPrivate<viewname>.I<nodename>Element ele = wdContext.node<nodename>().create<nodename>Element();
wdContext.node<nodename>().addElement(ele);
Warm Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Murtuza:
Controller Structure:
Request_CreateProduct<Collection=1...1, Selection=1...1>
CreateProduct<Collection=0...1 (read-only), Selection=1...1>
Code
Name
How can I enable the Collection cardinality of the child, I think If we could enable this our problem is solved!!!
Kind Regards
Thanks!!
Mario G
Hi Mario,
Yes, now the only solution is to enter the values programatically.
you can create a node called table with attributes code and name and set the values from that table to your createProduct node.
try
{
Request_CreateProduct input = new Request_CreateProduct();
for(int i=0; i<nodeTable().size();i++)
{
CreateProduct ele = new CreateProduct();
ele.setCode(wdContext.nodeTable().getTableElementAt(i).getCode());
ele.setName(wdContext.nodeTable().getTableElementAt(i).getValue());
input.addElement(ele);
}
wdContext.nodeRequest_CreateProduct().bind(input);
wdContext.nodeRequest_CreateProduct().currentRequest_CreateProductElement().modelObject().execute();
}
catch(Exception e)
{
//handle exception
}
Warm Regards,
Murtuza
Hello Murtuza:
Thanks, I try to write the line:
Request_CreateProduct input = new Request_CreateProduct();
But I dont have the constructor, It ask me for a model (its mandatory)
Request_CreateProduct input = new Request_CreateProduct(ProductModel m);
That takes the cardinality of the model that is in 0...1 for default.
I dont know if the CE 7.1 in Wed Dynpro is more limited. I remember that in a previous version I could do that!!
Thanks
Regards
Mario G
Hi
if you are using a node in your context
do the following in your WdDoint()
I<YourNode>Element node=wdContext.create<YourNodeElement>
node.setYourElement(); // set all your values
node.setYourElement();
//finally add the element to your node
wdContext.node<YourNode>.addElement(node);
Regards
Abhijith YS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To zoom in the problem I cant change the collection cardinality of the subnodes in the context. It stay 0..1, Thats why all the text Fields are disable. I need to put it in 1...n or 1 ... 1.
Any clue?
Thanks
Mario G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mario
Depending upon your requirement you need to change your Cardinality
if you have only one element in your node then make it as 1..1
if you have more than one element then make it as 1..n
1..n represents (min..max)
For your clear understanding follow this <a href="https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=4139915">Thread</a>
Regards
Chaitanya.A
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.