Help! set dinamically visibility of panels
Hello, I am writing because I have problems to manage the visibility of some components of my application.
I'm doing a web application and I have many panels.
I wrote this code in an attempt to control the visibility of the panels in response to an event from the user. Place the code:
Code:
var selectedPanel = panelHome;
function gestione():Void{
{selectedPanel}.visible=true;
var pannelli=[panelHome,panelChiSiamo,panelContatti,panelDestinazioni,panelDinamico];
var sizepannelli=(sizeof pannelli);
var pannelli2=pannelli;
delete selectedPanel from pannelli2;
for (i in [0..sizepannelli] ) {
{pannelli2[i]}.visible=false;
}
};
function chi_siamoOnMouseClicked(event: javafx.scene.input.MouseEvent): Void {
selectedPanel=panelChiSiamo;
gestione();
}
The idea is to create a sequence containing all panels,
putting the visibility of selectedPanel = true, remove it from the sequence, and then set the visibility = false to all other panels.
The selected panel is changed at the click of a button.
would know someone help me?
Thanks in advance
Stefania