This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

update vizu on object vselect update
#1
I have a situation where the custom values of an object change 'continuously'.

We can reload the vizu page by F5 to have this reflected in the vizu dropdown lists, but that's not what a user wants from the GUI

How can we make sure that the vizu gets to use the updated custom values list, without having to reload the entire vizu?

Can we for instance have a custom js that reloads that info for objects marked with a certain css tag, let's say every minute?

Cheers,
C.
Don't ask what we can do in KNX but wonder what we can't - www.KNXlogic.eu
Reply
#2
You can override the getEnums function so it returns custom value mapping for certain objects:
Code:
var oldfn = getEnums;

getEnums = function(object) {
  if (object.address == '1/1/3') {
    return { 0: 'aaa', 1: 'bbb', 2: 'ccc', default: 'default' };
  }
  else {
    return oldfn(object);
  }
};
Reply
#3
Thx for this clarification.
Is this function called at the moment the vizu-object is clicked? Or is it only called once at load of the visualization?
Because I need to force that this enum list updates after loading. In the LM, the custom values configured in the object are always kept up to date from our resident script. So it's only a matter of forcing the getEnums to update
Don't ask what we can do in KNX but wonder what we can't - www.KNXlogic.eu
Reply
#4
That's something that you can test yourself Smile
It is called each time a custom value select control is shown.
Reply
#5
true, and that's what I understood. So I did test, only to find out .. that it'snot like you say. Hence my question.

You say 'each time the control is shown'.
So what I try:
1) vizu open on a page. I select a control that opens a widget popup. on that widget (which is now shown) I select to control which shows the list of custom values of the object.
2) I modify the custom values of the object in the LM
3) I close the widget, I click the control to open the widget and again select the control: list of custom values not updated to the modified ones.

So even is the widget with the custom value control is redrawn, the value list remains

Looking in the browser console: I see no activiy at all when the control is clicked to open the widget (and show the custom value control)
Don't ask what we can do in KNX but wonder what we can't - www.KNXlogic.eu
Reply
#6
It won't load custom values from LM. You need to define your own logic in getEnums to provide custom values based on other object values etc.
Reply
#7
OK,

I think I get it.

I have tried a couple of things with linsteners and setInterval which works well as such.

But the thing missing is the ability to read/receive the updated enums form the LM
The grp.enums doesn't update. Also tried objectStore. and startObjectUpdate to force objectStore update. But no succes till now.
Searched the object model for 'update' and some other terms, but can't find the suited call/property.

In my case, only the LM knowns the current enums (and hence stores them in the object custom values). The GUI has no way to know them tself
Don't ask what we can do in KNX but wonder what we can't - www.KNXlogic.eu
Reply
#8
As with most other object properties enumsare loaded only once when visualization page is opened. So there's no direct way of updating enums. But you can use .lp server-side scripting together with Custom JS to update enums either periodically or based on some object change.
Reply


Forum Jump: