cancel
Showing results for 
Search instead for 
Did you mean: 

Creating dynamic node properties

Former Member
0 Kudos

Hi,

For the dropdown by Index in the table, there are two scenarios. in one scenario, i shouldnt defalt the dropdown value, in another case I should. So I want to set the properties initializeLeadSelection, and Selection properties dynamically in this following code:


int batchNodeSize = wdContext.nodeT_Inv_Batches().size();
ITable1_ResbElement row           =wdContext.nodeTable1_Resb().getTable1_ResbElementAt(i);
				   
 for(int j=0;j<batchNodeSize;j++){
IBatchElement e = row.nodeBatch().createBatchElement();	e.setCharg(wdContext.nodeT_Inv_Batches() 
.getT_Inv_BatchesElementAt(j).getCharg());
 row.nodeBatch().addElement(e);					}

Batch is the node for dropdown, to which I need to set the properties dynamically.

Thanks for help,

Raj.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Raj,

It will be quite problematic.

Actually, you have to create node Batch dynamically and specify its initializeLeadSelection property at this time. Next, you have to bind UI controls to it dynamically (in wdDoModifyView). Finally, you may access its elements only in generic way (no typed interface).

When you need to change its initializeLeadSelection property you must first call wdContext.getContext().reset() then re-create node again. Then populate it again and (probably) re-bind UI controls.

Unfortunately, it's impossible to easly switch initializeLeadSelection property

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hi Valery,

Thanks for prompt help. Let me ask you the question the other way, I want to display the dropdown with defalut value if batch field has a value(single record). If its null, I m executing RFC, and shouldnt display default value. In this case I need to let users select the value.

If I add blank value in one of drop-down by index table, will it solve my problem?. Do you have any other ideas. I appreciate your help.

Thanks,

Raj.

Former Member
0 Kudos

Raj,

Not sure I understand your question correctly (or completely but anyway...

1. Create DropDownByIndex that is bound to node (either model or value node) with initializeLeadSelection set to false.

2. Afterwards, execute RFC call. If you are using value node, copy returned entries. If single entry is returned, execute wdContext.node<NodeName>().setLeadSelection(0); If there are more then one entry, execute wdContext.node<NodeName>().setLeadSelection(IWDNode.NO_SELECTION).

Should work

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

HI Valery,

Thanks-a-lot for your reply. I solved it by assigning one extra space initially for the node whose values are coming from R/3. As I was doing it manually, it was simple and working.

Thanks for help.

/Raj.