cancel
Showing results for 
Search instead for 
Did you mean: 

Returning the selected row value on Click - SAP Sample SDK

Former Member
0 Kudos

Hi all,

I am working on "Simple Table", one of the sample SDK components provided by SAP.

I need to extend the solution with "Row Selections" and returning the selected row values to BIAL script. I have added properties in Contribution.xml file for "OnClick" event and added functions in component.js to respond to "Click" event.

However I am not able to get this working , I always get the return values as "Undefined".

Any advise on methodology to achieve this with sample SDK implementation code /references would be of great help.

Regards,

Anil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I finally got this working using following code snippets,

This was added in component.js to respond to clicking event.

this.jqTable.on("click", "tr", function showText (evt) {

//alert($(this).text());

rowSelected = $(this).text();

that.firePropertiesChanged(["rowClicked"]);

that.fireEvent("onclick");   

});

This was added subsequently to return the selected row,

this.rowClicked = function(value) {

if (value === undefined) {

return rowSelected;

else {

return this;

}

};

This was added in contribution.ztl to link to BIAL script function

/* Use to get Text of selected row  */

String getRowClicked() {* 

return this.rowClicked;

*}

Following entries are made in contribution.xml

<property id="onclick" type="ScriptText" title="On Click" group="Events" />

<property id="rowClicked" type="String" title="Row Clicked" visible="false" />

You can modify the return values based on your requirements. This will help you to return values to BIAL script function and further use them in DS environment.

post helped me to achieve this. Thanks Michael.

Regards,

Answers (0)