• header.categories
    • header.recent
    • header.tags
    • header.popular
    • register
    • login

    Simple custom button

    scheduled pinned locked moved Scripts
    5 posts 2 posters 1.8k views 1 watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • H offline
      heyjay
      global:last-edited-by,

      Hi,
      I would like to make a simple button to switch on/off a light integrated in a custom widget with some others information which I want to customize with some css.
      I found how to display easily temperature / humidity / text for example from uid tags but I can't find any equivalent example for creating this button with java.
      Is that possible?
      Thanks.

      jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
      • jkandasaJ offline
        jkandasa @heyjay
        global:last-edited-by,

        @heyjay does this example fulfill your requirement?

        H one-reply-to-this-post last-reply-time reply quote 0
        • H offline
          heyjay @jkandasa
          global:last-edited-by,

          @jkandasa
          Actually I already know this example and I implemented this for other stuff. But this time, I would like to make a widget with mixed output text and buttons from html template. This button can looks like the default buttons for switch on/off lights, it doesn't really matter.
          I wonder if it is possible because it needs to catch a press button event to send payload to sensor ? or maybe there is a trick for that in java?

          jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
          • jkandasaJ offline
            jkandasa @heyjay
            global:last-edited-by,

            @heyjay You may need to write angular controller and put it on Utilities >> HTML additional headers >> AngularJS custom controllers

            H one-reply-to-this-post last-reply-time reply quote 0
            • H offline
              heyjay @jkandasa
              global:last-edited-by,

              @jkandasa Thanks for the tip. I'm not familiar with AngularJS. I will try to learn a bit about this and make something!

              one-reply-to-this-post last-reply-time reply quote 0
              • first-post
                last-post

              0

              online

              644

              users

              532

              topics

              3.4k

              posts
              Copyright © 2015-2025 MyController.org | Contributors | Localization