2 Replies Latest reply on Sep 23, 2010 4:17 PM by shikida

    Show/hide widgets programmatically

    kpalania

      hi,
      we have hidden the "configure" screen but want to be able to show or hide the widgets (all of them are exposed by default) programmatically, or via a simple SQL script. this is particularly important since we have an issue with the widgets disappearing at random and want to be able to add them back.

      any thoughts on how this could be done? it would also be useful if the widgets can be hidden to certain users/roles while they are visible to others.

      thanks.

        • 1. Re: Show/hide widgets programmatically
          kpalania

          any ideas?

          • 2. Re: Show/hide widgets programmatically
            shikida

            try

             

                 HtmlJQuery jq = (HtmlJQuery)application.createComponent(HtmlJQuery.COMPONENT_TYPE);
                    jq.setSelector("#widget1,#widget2");
                    jq.setId("hideme");
                    jq.setName("hide2");
                    jq.setTiming("onJScall");
                    jq.setQuery("hide()");

             

            with

             

            <h:graphicImage width="80" id="jap4" value="someimage.png" onmouseover="hide2()"  />

             

            (or the equivalent generated code)

             

            Best regards

             

            Leo