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

Scripting events calling my PortalComponent?

Hi,

Is it possible to have the Scripting Events call into my PortalComponent?

I want to get notified when a row in a table is clicked.

The table doesn't have a Click event or equivalent

but there is a SAPTABLECLICK scripting event which sounds promising (depending on the info it gives me)

There is also an event mentioned in the help called SAPTABLECELLCLICK which sounds perfect but I amn't even sure how to put a handler under that since it doesn't appear in the properties of the table

The examples I have seen all use the events to comunicate between iViews but nothing to talk to the component

Vin

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 17, 2004 at 07:57 PM

    Hi,

    1. In the properties editor, when the table is selected, choose ItemTemplate > Cells > [<i>The name of the column you want to add the event to</i>] > TableCellContent.

    2. Add event handler to TEXTVIEWCLICK (e.g. <i>onCellClick</i>)

    3. Add the script to the ascx file:

    <i><script>

    function onCellClick(id, event)

    {

    alert(event.srcElement.innerText);

    }

    </script></i>

    I hope that this is what you are looking for.

    Yossi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Great question! since I know a good answer.... 😉

      I recommend that you put 2 hidden controls on the page where you want to get the event: a button and a input field.

      in the EPCM event handler script function put the param in the input field and then call a the button's click. In the server code (the button action event handler) you can access the inputfield.

      Here is the script example:

      <script language="javascript">

      EPCM.subscribeEvent("urn:SAP.PDK.Samples.Search", "xSearch", searchFunction);

      function searchFunction(eventObj)

      {

      var custName = eventObj.dataObject;

      <%= Form.ID + "." + txtCustName.ClientID %>.value =custName;

      <%= btnSubmit.ClientID %>.click();

      }

      </script>

      Good luck,

      Ofer

      P.S: Please next time post new questions in new threads (makes it easier for others to search)

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.