Skip to main content

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

    

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


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

    

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


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


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

    

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


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



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

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


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


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