on 06-07-2006 5:30 AM
Hi everyone,
I am facing a problem about DropDownByKey,when it bind to a nested context node it can't work, by these codes :
IPrivateOnePageView.IInvoiceQtyElement iiqe=wdContext.createInvoiceQtyElement();
wdContext.nodeInvoiceQty().addElement(iiqe);
ISimpleTypeModifiable myType=
wdThis.wdGetAPI().getContext().getModifiableTypeOf("DealDetail.InvoiceQty.value");
IModifiableSimpleValueSet values =
myType.getSVServices().getModifiableSimpleValueSet();
String[] strInvoiceQty={"LOAD","FORMULA"};
for (int j=0;j<strInvoiceQty.length;j++){
values.put(strInvoiceQty[j],strInvoiceQty[j]);
}
it worked correctly by these codes:
IPrivateOnePageView.ITestElement it=wdContext.createTestElement();
wdContext.nodeTest().addElement(it);
ISimpleTypeModifiable myType=
wdThis.wdGetAPI().getContext().getModifiableTypeOf("Test.value");
IModifiableSimpleValueSet values =
myType.getSVServices().getModifiableSimpleValueSet();
String[] strInvoiceQty={"LOAD","FORMULA"};
for (int j=0;j<strInvoiceQty.length;i++){
values.put(strInvoiceQty[j],strInvoiceQty[j]);
}
Hello Ree,
Then I feel the problem for binding is because the node InvoiceQty has no valid parent.
Try out the following code:
IWDNode node = wdContext.nodeDealDetail();
IWDNodeElement ne = node.createAndAddElement();
IWDNode nodeb = node.getChildNode("InvoiceQty",ne.index());
nodeb.createAndAddElement();
IWDAttributeInfo info = nodeb.getNodeInfo().getAttribute("value");
ISimpleTypeModifiable myType = info.getModifiableSimpleType();
IModifiableSimpleValueSet values = myType.getSVServices().getModifiableSimpleValueSet();
String[] strInvoiceQty={"LOAD","FORMULA"};
for (int j=0;j<strInvoiceQty.length;j++){
values.put(strInvoiceQty[j],strInvoiceQty[j]);
}
Hope this solves your problem.
Regards,
Sudeep.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sudeep,
I try out your code.
IWDNode can't resolve the createAndAddElement() method.
I try out this code:
IWDNode node = wdContext.nodeDealDetail();
IWDNodeElement ne = node.createElement();
node.addElement(ne);
//IWDNodeElement ne = node.createAndAddElement();
IWDNode nodeb = node.getChildNode("InvoiceQty",ne.index());
IWDNodeElement nbe=nodeb.createElement();
nodeb.addElement(nbe);
//nodeb.createAndAddElement();
IWDAttributeInfo info = nodeb.getNodeInfo().getAttribute("value");
ISimpleTypeModifiable myType = info.getModifiableSimpleType();
IModifiableSimpleValueSet values = myType.getSVServices().getModifiableSimpleValueSet();
String[] strInvoiceQty={"LOAD","FORMULA"};
for (int j=0;j<strInvoiceQty.length;j++)
{
values.put(strInvoiceQty[j],strInvoiceQty[j]);
}
it throws this Exception:
Node(OnePageView.DealDetail): you can access the singleton child node 'InvoiceQty' only via lead selection
then i change the singleton property of node :DealDetail.InvoiceQty to false,my DropDownByKey is still disable.
Regards,
ree
Message was edited by: ree fish
Message was edited by: ree fish
Hello Ree,
Don't change the singleton property of the node..
try this instead..
IWDNode node = wdContext.nodeDealDetail();
IWDNodeElement ne = node.createElement();
node.setLeadSelection(ne.index); //add this line
node.addElement(ne);
IWDNode nodeb = node.getChildNode("InvoiceQty",node.LEAD_SELECTION); //code changed
IWDNodeElement nbe=nodeb.createElement();
nodeb.addElement(nbe);
IWDAttributeInfo info = nodeb.getNodeInfo().getAttribute("value");
ISimpleTypeModifiable myType = info.getModifiableSimpleType();
IModifiableSimpleValueSet values = myType.getSVServices().getModifiableSimpleValueSet();
String[] strInvoiceQty={"LOAD","FORMULA"};
for (int j=0;j<strInvoiceQty.length;j++)
{
values.put(strInvoiceQty[j],strInvoiceQty[j]);
}
Regards,
Sudeep.
Hello Ree,
I just tried the same in my system and it worked fine.
This is how my context hierarchy looks like.
Context (Web Dynpro Context)
|
|-DealDetail (IWDNode)
|
|-InvoiceQty (IWDNode)
|
|-value (IWDAttribute)
For DealDetail, Collection cardinality is 0:n
Selection cardinality is 0:1
For InvoiceQty, Collection cardinality is 0:n
Selection cardinality is 0:1
And attribute 'value' is of type 'string'
"DropDownByKey" UI element's "selectedKey" property is bind to "DealDetail.InvoiceQty.value" and "enabled" property is set to "true".
The applications works as expected.
Is there some other dependencies in your application?
Regards,
Sudeep.
Hi,
It works fine if u change the cardinality of inner node test1 to 1:n and singneton false.
and the code is create an element to the parent node and bind it.
IPrivateTestAppView.ITestElement it=wdContext.createTestElement();
wdContext.nodeTest().addElement(it);
ISimpleTypeModifiable myType=
wdThis.wdGetAPI().getContext().getModifiableTypeOf("test.test1.value1");
IModifiableSimpleValueSet values =
myType.getSVServices().getModifiableSimpleValueSet();
String[] strInvoiceQty={"LOAD","FORMULA"};
for (int j=0;j<strInvoiceQty.length;j++){
values.put(strInvoiceQty[j],strInvoiceQty[j]);
}
Regards,
Vijay
Message was edited by: Vijayakhanna Raman
Hi everyone,
I found the maybe reason,My DealDetail node is created with structure binding and node InvoiceQty is created myself.And I create all the two nodes it work fine.
Whether i still can use DropDownByKey case when node DealDetail is created with structure?
Regards,
reefish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Add this line in wdDoInit method.
wdContext.nodeDealDetail().nodeInvoiceQty().createAndAddInvoiceQtyElement();
and make Collection Cardinality of DealDetail to 1..1
I hope it will work.
Regards,
Rajeev
Message was edited by: Rajeev Ranjan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ree,
Try this out
Replace the code
ISimpleTypeModifiable myType = wdThis.wdGetAPI().getContext().getModifiableTypeOf("DealDetail.InvoiceQty.value");
with
IWDAttributeInfo Info = wdContext.nodeDealDetail().nodeInvoiceQty().getNodeInfo().getAttribute("value");
ISimpleTypeModifiable myType = info.getModifiableSimpleType();
Regards,
Sudeep.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ree,
What exactly is your problem? "can't work" can mean a lot of things. Please give some more detail.
Did you check the type you assigned in your context for DealDetail.InvoiceQty.value ?
Regards
Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi markus,
I'm sorry that my describe is too shotness,
"Can't work" mean the DropDownByKey is disable after run,can't drop down and has none list item.
It can dropdown and has correct list items when use second code.
I've checked the type of DealDetail.InvoiceQty.value .It is String ,and the value i assigned in it is Sring(See the java code).
Regard.
ree
Message was edited by: ree fish
Hai,
Try by change the Property Singleton as false for the node InvoiceQty.
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.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.