Skip to Content
avatar image
Former Member

How can i hide a button clicking on the same button and showing an hidden chart or container?

I wold like to use javascript for showing and hiding clicking by a button menu.

in the "on click" section of the button i wrote different kind of code:

the "getelementbyid" to get the buttonid and the "style.duspaly = 'none' for changing visibility but with no outcomes.

When i run the app and i clic on the button nothing happens. I checked on firebug and i do not get any warning or error.

What can i do?

example code commented:

//var el = document.getElementById('BUTTON_DISTRIBUTION_button');
// Hide
BUTTON_DISTRIBUTION_button.setVisible(false);
//var id = document.getElementById('__layout20');
//id.style.display = 'none';

//id.onClick("BUTTON_DISTRIBUTION_button.style.display = 'none'");


//element.style.display = 'none';

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Nov 06, 2016 at 06:01 PM

    Hi Marco,

    . In the "on Click" section of button you can use simply use the below code to hide the button.

    me.setVisible(false);

    The "me" is used to call name of the component inside it's own scripting area like "on Click" section in button.

    To show an another component, you can simply use the code as given below. Give name of the component and make it visible by giving property value true

    INFOCHART_1.setVisible(true);

    No need to complicate the coding in design studio by accessing ID in java script, you can use the name given to the component in the application and give require property values to it.

    Thanks,

    Poovarasan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 07, 2016 at 08:56 AM

    Thanks! It works!

    If i would like to set display to "none". (e.g. Display: 'None') ?

    I saw that if i have a button has set visible = 'false' from properties area, i'm not able to click on that invisible button.

    the visibility set to false means also that is not clickable?

    Thanks again

    Marco

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 07, 2016 at 09:04 AM

    Hi Marco,

    Yes the button will not be available for interaction when it's visibility is set to false. You can make it visible through some other event in your application.

    Thanks,

    Poovarasan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 07, 2016 at 09:36 AM

    So there is not other way to click on an INFOCHART or a GRID LAYOUT and trigger an event such as :

    GRID_LAYOUT_6.setHeight(500);

    or

    INFOCHART_6.setHeight(500);

    I put this code in INFOCHART "on select" area but with no response, GRID LAYOUT has not any "on select" area.

    I thought about an invisible button but now i know it's not the right solution.

    Thank you

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 07, 2016 at 10:14 AM

    Hi Marco,

    Grid layout don't have any selection event. But you can use chart selection event to set height.

    You may have given chart height value as auto in property window, if the value is in auto you cannot change it in scripting.

    You can change it only when it has a constant value.

    Thanks,

    Poovarasan

    Add comment
    10|10000 characters needed characters exceeded