3 Replies Latest reply: Jun 21, 2011 3:46 PM by 863138 RSS

    Help, dinamically assign visibility at panels

    863138
      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:
      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}.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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
        • 1. Re: Help, dinamically assign visibility at panels
          DarrylBurke
          Cross posted
          http://www.java-forums.org/javafx/45556-help-set-dinamically-visibility-panels.html

          db
          • 2. Re: Help, dinamically assign visibility at panels
            jojorabbit
            unkus_nob wrote:
            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:
            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}.visible=false;
            }
            };

            function chi_siamoOnMouseClicked(event: javafx.scene.input.MouseEvent): Void {
            selectedPanel=panelChiSiamo;
            gestione();

            }
            The idea is to create a sequence containing all panels,
            Good idea.
            putting the visibility of selectedPanel = true, remove it from the sequence, and then set the visibility = false to all other panels.
            No need to remove it from sequence just hide it. It can be easy done with css selected pseudoclass see this thread Image conversion between AWT and FX my post with a lot of code see protected class NodeThumb.
            The selected panel is changed at the click of a button.
            Node thumb acts as button and it changes currently selected node to visible. All others are hidden, all are in Sequence/ObservableList nodeThumbs.
            Try to transfer code somehow to 1.3 jfx. Or I can record video so you can see behavior of NodeThumb.
            would know someone help me?
            Thanks in advance
            Stefania
            Hope it helps.

            EDIT:
            Or see this Thread Transition between VBox how to slide Nodes left to right.

            Edited by: jojorabbit on Jun 21, 2011 9:29 PM
            • 3. Re: Help, dinamically assign visibility at panels
              863138
              thanks a lot, I've been very helpful! now works