Clarity Service Management

Expand all | Collapse all

Arguments with no value in js function (list_***.htmpl form)

  • 1.  Arguments with no value in js function (list_***.htmpl form)

    Posted 11-16-2018 04:26 PM

    I have this function in a zlist_***.htmpl form:

     

    function CallsSYS (value) {
    rs.data("<a href=\"#\" onclick=\"popupWithURL('http://1.1.1.1/SYS/Web/load.aspx?user=$args.cr.customer.userid&tkt=$args.ticket', '1', '1', '1');\">" + value + "</a>");
    }

     

    I'm calling this function from a "lsCol" in the same zlist_obj1.htmpl form:

     

    <PDM_MACRO name=lsStart>
    <PDM_MACRO name=lsCol hdr="ticket" attr=ticket exportFmt="ShowLink" fmtfunc="CallsSYS">
    <PDM_MACRO name=lsEnd>

     

    This zlist_obj1.htmpl form is shown in a tab form inside detail_cr.htmpl form.

     

    The situation is, I can't get the values of the args inside the js function: $args.cr.customer.userid  and tkt=$args.ticket

    I.ve tried with an alert and those variables are empty.

     

    Thanks for any suggestion.

     

    Ana KBS



  • 2.  Re: Arguments with no value in js function (list_***.htmpl form)

    Posted 12-10-2018 03:50 AM

    hi,

     

    a list form isn't based on a single object, so there is no $args.x. all shown datasets are only "existent" between the lsStart and the lsEnd. Inbetween these both, it's a PDM_LIST with prefix "list". you can do something like :

     

    function CallsSYS (value) {
    rs.data("<a href=\"#\" onclick=\"popupWithURL('http://1.1.1.1/SYS/Web/load.aspx?user=" + fmt_usr + "&tkt=" + value + ", '1', '1', '1');\">" + value + "</a>");
    }

    ...

    ...

    ...

     

    var fmt_usr = "";

    <PDM_MACRO name=lsStart>

    <PDM_MACRO name=lsWrite text="fmt_usr = '@{list.cr.customer.userid}';">

    <PDM_MACRO name=lsCol hdr="ticket" attr=ticket exportFmt="ShowLink" fmtfunc="CallsSYS">
    <PDM_MACRO name=lsEnd>

     

    regards,

    pacy