Skip to Content
author's profile photo Former Member
Former Member

Returning the selected row value on Click - SAP Sample SDK

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 15, 2014 at 10:13 AM

    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.

    @Michael Howles post Design Studio 1.2 SDK - Enhancing the 'Simple Table' SDK Component helped me to achieve this. Thanks Michael.

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.