1
0
-1

I've got a DSP where there's a list of items, Defined as a table. 

    <tr id="uocc:SUE_SUPPCALL.DUMMY" style="vertical-align:top" onmouseover="uniface.getInstance('SUD_CALL_LIST').activate('opShowNotes',this.id)" >

In the operation, I've been pulling the number off the end of the ID and assuming it was the occurrence number in the entity. However, it appears this is not (always) the case. 

Practically I've got a single field to the right of the table I want populated with data based on the mouseover occurrence. So, first question, how can I work out an occurrence number (or find the web ID from inside proc?)? 

Second question, is there a better/faster trick for copying the data from a field in the occurrence (not displayed in the html layout) to a field in the page (fixed name, only one occurrence of this field)? 


Regards, 

Iain


    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Hi Iain,

      You could also consider setting a custom attribute on the Occurrence

      putitem/id $occproperties("myentity"), "html:data-occ", "%%($curocc("myentity") - 1)"

      or

      putitem/id $occproperties("myentity"), "html:data-hovertext", hoverovertext.myentity

      With one of the above, you should see the property set on the occurrence's HTML element and be able to get the value from javascript.

      Kind regards,

      Mike


      1. Iain Sharp

        So, this turns out to be the best solution for my problem, and the second one allows me to populate the field in javascript without a round trip to the server, so that's even better. 

        Thanks. 

        Iain

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Hi Iain,

      To answer your first question, you should try using this.getIndex() on the activate which is a function of the Ocurrence object.

      Keep in mind that you may need to use this.getIndex() + 1 if you're using setocc on the server side.

      Regards

      1. Iain Sharp

        I had tried a couple of other things presuming this was a Uniface.occurrence, and they hadn't worked, but I tried with this one and it also returns that this.getIndex is not a function. 

        Regards, 

        Iain

      CommentAdd your comment...