cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByKey can't display values?

Former Member
0 Kudos

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]);
}

Accepted Solutions (1)

Accepted Solutions (1)

former_member286976
Active Participant
0 Kudos

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.

Former Member
0 Kudos

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

former_member286976
Active Participant
0 Kudos

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.

Former Member
0 Kudos

Hello Sudeep,

I try out your new code,the dropdownbykey still has none list item too.

Regards,

reefish

former_member286976
Active Participant
0 Kudos

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.

Former Member
0 Kudos

Hi Sudeep Sukumar,

My project is web dynpro (java) and what is your project.

Maybe some reasone other make it can't work.I'll create a new project and try it again.

Regards,

reefish.

vijayakhanna_raman
Active Contributor
0 Kudos

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

vijayakhanna_raman
Active Contributor
0 Kudos

Hi ,

Check it i have edited.

Regards,

Vijay

Answers (5)

Answers (5)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

former_member286976
Active Participant
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Sudeep,

I try the code you offer,the DropDownByKey still disable.

My guess is DropDownByKey can't binding to the second tier subnode if anyone approve.

Message was edited by: ree fish

Former Member
0 Kudos

Hai,

Try by change the Property Singleton as false for the node InvoiceQty.

regards,

naga raju

Former Member
0 Kudos

HI Naga,

I try your method,but it cat't work too.

Regards

ree