Make selection in a table and transfer selected data without using Boolean checkbox component of VBCS.
Introduction:
Generally, to transfer the selected data
from one variable to another over selection we will be using Boolean check box.
Can we achieve it without that? Let’s see.
Main
Article:
Lets drop a table component
to the designer section and assign an SDP to the table.
In this case the SDP I’ve
used is from the Business object.
Make the selection
mode as multiple as below:
Now let’s create
another table in the same page of type ADP which holds the data that is
selected from the previous table and let’s have a button action which refresh the ADP table on click action performed over it.
Now the web page will
look something like this.
Logic:
Click on the SDP table
and select On ‘select Multiple rows event’ and follow the below steps:
· Call the REST connection using which the data had been populated in the SDP table
· On success, reset the ADP variable of below table
· Drop a for each action and iterate over the keys.
· Inside the loop use firedataprovider action with add action.
·
Now
set the mapping as below
{
"data": "{{
$chain.results.callRestGetallTest.body.items[$current.data] }}",
"keys": [
"{{ $current.data
}}"
]
}
·
Map
the ADP variable in the target section
·
Now
refresh the ADP using the fire data provider on Button click event.
That’s it the logic is
now complete.
Lets test the web app:
As you could see the
selected ones from the SDP got successfully inserted to ADP table.
-Preetham Konjeti
Comments
Post a Comment