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.

HTML Code to get the data-object an data-object-name
#1
Hello,

Is there e way to get the data-object (for example group adress 1/1/6) and the data-object-name once a button is pushed?

I have a user/customapp.lp with html code and want to extract this data of once a button is pushed (so there will be multiple on the visu).
Kind Regards
Giel

picture: https://ibb.co/ccRM9rQK
Reply
#2
Add an Additional class (my-element) to the element then add this to Custom JavaScript.
Code:
$(function(){
  $('.my-element').click(function() {
    var data = this.dataset;
    var message = {
        object: data.object,
      objectName: data.objectName,
    }
    
    window.parent.postMessage(message);
  });
});

In .lp document which includes the visualization via iframe use this code to get the message:
Code:
window.addEventListener('message', function(event) {
  console.log('event data', event.data)
}, false);
Reply
#3
Morning everybody

I'm a beginner on wiser for knx. I want to read data sent from smartmeter and then send instructions to an actuator depending on what i received from smartmeter
Reply
#4
(13.02.2025, 09:02)Fistel Wrote: Morning everybody

I'm a beginner on wiser for knx. I want to read data sent from smartmeter and then send instructions to an actuator depending on what i received from smartmeter

Create a new thread and describe with more details what meter is it and what interface it has.
This topic is about something totally different.
------------------------------
Ctrl+F5
Reply
#5
(13.02.2025, 08:55)admin Wrote: Add an Additional class (my-element) to the element then add this to Custom JavaScript.
Code:
$(function(){
  $('.my-element').click(function() {
    var data = this.dataset;
    var message = {
        object: data.object,
      objectName: data.objectName,
    }
   
    window.parent.postMessage(message);
  });
});

In .lp document which includes the visualization via iframe use this code to get the message:
Code:
window.addEventListener('message', function(event) {
  console.log('event data', event.data)
}, false);

Hello, it works thanks for the help!
Reply


Forum Jump: