cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a "selected" Model Attribute for retrieved table

Former Member
0 Kudos

Hi,

I've retrieved records from a BAPI into a table and want to be able to add a checkbox column to the result set. I want to be able to loop through the table to get the selected rows for deletion.

How do I do this? I tried just to insert a column into the table but it was not bound to anything and I got an error.

When I try to add a Model Attribute to the Controller's context variable, it says it's not supported if the node has a dictionary structure binding.

Thanks,

Andrew

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You should use value node for the structure type and map this to your table. to get each row you should use loop

the following code may help you

or(int i=0 ; i< No_Of_Rows ; i++)

{

POAsASNType.LineItemsType.ItemType item = (POAsASNType.LineItemsType.ItemType)l.get(i);

IPrivateAdvanceShipView.ILine_ItemsElement table = wdContext.createLine_ItemsElement();

table.setItemCode(item.getItemCode().intValue());

table.setItemDescription(item.getItemDescription());

table.setMaterialNo(item.getMaterialNo());

table.setQuantityRequired(item.getQuantityRequired());

table.setSerialNo(item.getSerialNo().intValue());

wdContext.nodeLine_Items().addElement(table);

}

above code is keyed in wdInit method above mentioned code is directly will not applicable to you but u have to do modification according to ur requirement

hope it helped you

Regards

RK

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Andrew,

You can replicate the model node with a value node and add a boolean attribute in it.

This new node can be bound to the table. The new node can be populated by taking the size of the model node.

Hope this would help.

Regards

Noufal

Former Member
0 Kudos

Andrew,

1. You may use 0..n cardinality for selection and track node.isMultiSelected(idx)

2. You may add right under your model node sub-node with the following properties: non-singleton, 1..1 cardinality, initializeLeadSelection=true, selection 0..1/1..1; add your boolean attribute <i>selected</i> to this sub-node and bind CheckBox table cell editor to it.

VS