cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer of items from ItemListBox to Table

Former Member
0 Kudos

Hi All,

I am developing a Purchase Request form.

I am fetching Material Number and Material Desc in an ItemListBox. In the form, there is an DropDownBox for Quantity.

The user can select an item (Material Desc eg. Computer Notebook) and also select the Quantity. There is a Table in the form, in which the User can add Material and Qty.

Now the task for me is to transfer the selected Item and Qty from ItemListBox to Table. Also, whenever a selected item is transferred to Table that item should be removed from the ItemListBox.

I do need some inputs.

Please help.

Regards

Nikhil Bansal

Accepted Solutions (1)

Accepted Solutions (1)

sid_sunny
Contributor
0 Kudos

Hi Nikhil,

Add this code to your onButtonAction

IPrivateTestingPurposeProjectCompView.ITablesourceElement tableElement = wdContext.nodeTablesource().createTablesourceElement();

tableElement.setTableDescriptiveText(wdContext.currentItemListBoxSourceElement().getItemListBoxDescriptiveText());

tableElement.setTabletext(wdContext.currentItemListBoxSourceElement().getItemListBoxText());

wdContext.nodeTablesource().addElement(tableElement);

<b>XXXXXXXXXXXXXXXXXXXXX</b>

Regards

Sid

Message was edited by:

Armin Reichert

Former Member
0 Kudos

Hi Siddharth,

Thanks for the reply.

Foll is my code.

IPrivateAssetMgmtView.ITableNodeElement tableElement = wdContext.nodeTableNode().createTableNodeElement();

tableElement.setMatQty(itemQty);

tableElement.setMatDesc(selectedMaterialNumber);

tableElement.setMatDesc(selectedMaterialItem);

I don't see any data being populated in the Table after executing this code.

I have created a Table and specified the datasource as TableNode which contains 3 attribute

1. Material Qty

2. Material Num

3. Material Desc

Let me know what am I missing.

Regards

Nikhil

sid_sunny
Contributor
0 Kudos

Hi Nikhil,

can you please tell me what are these itemQty, selectedMaterialNumber, selectedMaterialItem and all. One more thing if they are not null then I think you are forgetting to add the newly made element to the tablesource value node so just check whether you have mentioned this or not.

wdContext.nodeTablesource().addElement(tableElement);

<b>XXXXXXXXXXXXXXXXXXXXXXX</b>

Regards

Sid

Message was edited by:

Armin Reichert

Former Member
0 Kudos

Hi Siddharth,

Thanks for the reply.

Full points to you.

Regards

Nikhil Bansal

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Nikhil,

For fetching the record, I believe you will be using some push button. This push button will be in the view. In the implementation tab of view, you can add following code

wdContext.currentContextElement().setOutput(wdContext.currentContextElement().getInput());

wdContext.currentContextElement().setInput("");

This is based on the assumption that you have stored you have initally stored the data in input. After pushing the button, data of input will be transferred to Output. At the same time, above code will set the input as null.

Regards,

Gaurav