Expand/Collapse (or Maximize/Minimize) JPanel

Hi,
We have a JFrame that has many components like JComboBox, JTextArea etc. It also has a JPanel that contains a graph.
Now my requirement is to have expand/collapse button. When user clicks on expand, this JPanel with the graph should occupy the whole screen. At this point, the expand button would be replace with collapse button.
When user clicks on collapse, the JPanel should resume its original place and all other components should re-appear with correct state.
Can anyone help me with some pointers/resources?
Thanks in advance,
Regards,
Manu
Edited by: Manupriya on Apr 7, 2009 2:05 PM

One way to solve this would be to create a model / view set of classes for your JPanel with the graph. When the expand button is pressed I'd create a new JPanel that uses the same model (displays the same graph), place it in a JDialog, and show it in a size to fill the screen. Other options include having the JFrame's contentPane use a CardLayout and swap JPanels as desired.

Similar Messages

  • Better way for having Auto Expand/Collapse JSplitPane

    Hi,
    I have a JSplitPane, on the left I have a panel (the main content), and on the right I have another component which is more like a "toolbox". So initially I have the right component invisible, so taht my split pane divider will be all the way to the right, and only the left component is visible. As I move my mouse over the divider I would like to have it "pop" open (or expand)....then when the mouse is moved out of the right component, I would like it to collapse. Make sense so far??
    Ok, so I implemented the following:
            MouseMotionAdapter paneMotionAdapter = new MouseMotionAdapter() {
                public void mouseMoved(MouseEvent e) {
                    if (collapsed == false) {
                        preferredDividerLocation = getDividerLocation();
            MouseMotionAdapter dividerMotionAdapter = new MouseMotionAdapter() {
                public void mouseMoved(MouseEvent e) {
                    int x = e.getX() + getDivider().getX();
                    if (getRightComponent().isVisible() == false) {
                        collapsed = true;
                    // if you move mouse to fast, the event is not caught in time
                    QoviaLogger.logDebug("x: " + x + ", dX: " + getDivider().getX());
                    // moving to the right, so expand it
                    if (x > getDivider().getX()) {
                        if (collapsed) {
                            if (getRightComponent().isVisible() == false) {
                                getRightComponent().setVisible(true);
                            if (doneOnce == false) {
                                setDividerLocation(getLastDividerLocation());
                                doneOnce = true;
                            else {
                                setDividerLocation(preferredDividerLocation);
                            collapsed = false;
                            return;
                    // moving to left of divider, so collapse it
                    else {
                        setDividerLocation(Integer.MAX_VALUE);
                        collapsed = true;
                        return;
            getDivider().addMouseMotionListener(dividerMotionAdapter);
            addMouseMotionListener(paneMotionAdapter);...the problem is, if the user moves the mouse to fast over the divider..the event is not caught...so the split pane wont expand/collapse.
    any ideas how to make it better, or perhaps always catch this event??
    thanks

    I tried to show you that mouseExited() would work and ran into the same kind of problems except on a slightly less annoying scale. You should have explained what the problems were. I just assumed that the problem was that you couldn't code it. Here's what I finally had to do.import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.plaf.basic.*;
    public class Test3 extends JFrame {
      JSplitPane jsp = new JSplitPane();
      BasicSplitPaneDivider spd = ((BasicSplitPaneUI)jsp.getUI()).getDivider();
      Container content = getContentPane();
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jsp.setDividerLocation(0);
        JPanel jp = new JPanel();
        jp.add(new JLabel("Label:"));
        jp.add(new JTextField("text"));
        jsp.setLeftComponent(jp);
    //    ((JComponent)jsp.getLeftComponent()).setMinimumSize(new Dimension(0,0));
        content.add(jsp, BorderLayout.CENTER);
        Component c = getGlassPane();
        c.setVisible(true);
        c.addMouseMotionListener(new MouseMotionListener() {
          public void mouseMoved(MouseEvent me) {
            Point p = SwingUtilities.convertPoint((Component)me.getSource(),me.getPoint(),jsp);
            int loc = jsp.getDividerLocation();
            if (loc<=1) {
              if (p.x<spd.getWidth()) jsp.setDividerLocation(.5);
            } else {
              if (p.x>loc) jsp.setDividerLocation(0);
            mousey(me);
          public void mouseDragged(MouseEvent me) { mousey(me); }
        c.addMouseListener(new MouseListener() {
          public void mouseExited(MouseEvent me) {
            if (me.getX()<=0) jsp.setDividerLocation(.5);
            else jsp.setDividerLocation(0);
            mousey(me);
          public void mouseClicked(MouseEvent me) { mousey(me); }
          public void mouseEntered(MouseEvent me) { mousey(me); }
          public void mousePressed(MouseEvent me) { mousey(me); }
          public void mouseReleased(MouseEvent me) { mousey(me); }
        setSize(200,200);
        setVisible(true);
      public void mousey(MouseEvent me) {
        Point p = SwingUtilities.convertPoint((Component)me.getSource(), me.getPoint(), content);   
        Component c = content.findComponentAt(p);
        if (c!=null) c.dispatchEvent(SwingUtilities.convertMouseEvent((Component)me.getSource(), me, c));
      public static void main(String[] args) { new Test3(); }
    }

  • Expand/Collapse feature in table maintenance view

    Hello experts,
    We have created a custom table and maintenace view.   For some table rows, the only key value difference is an EFFECTIVE DATE.   The generated table maintenace dialog by default "Collapses" the rows that only differ by Effective Date.  Using the Expand <-> Collapse button, we can see the missing detail for individual rows.
    Can the maintenace dialog be expanded by default?

    Hi,
    See the given link, It may help to you.
    maintenance view
    Regards,
    Shamma

  • The Hyperlinks and even the active buttons(like Back, Forward, Maximize,minimize,closeetc) on a webpage opened on Firefox page become inactive and there is no action on mouse click on them.

    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    I use Firefox Version 3.6.6. If firefox is kept opened for a day or two with some tabs opened, then the active buttons like the "Back","Forward","Maximize","minimize","Close", etc and even the links on the webpage become disabled. On mouse click no action gets performed on these type of links. Once this starts only a PC restart causes Firefox to work normally.
    Please kindly help me with a solution and I would request a fix for this issue.
    == This happened
    ==
    A few times a week
    == Firefox is kept opened for long time, may be for a day or two with quite a lot of tabs opened.
    ==
    == Troubleshooting information
    ==
    Application Basics
    Name Firefox
    Version 3.6.6
    Profile Directory
    Open Containing Folder
    Installed Plugins
    about:plugins
    Build Configuration
    about:buildconfig
    Extensions
    Name
    Version
    Enabled
    ID
    Google Redesigned 0.4.5 false
    Greasemonkey 0.8.20100211.5 false
    Java Console 6.0.16 true
    Java Console 6.0.17 true
    Java Console 6.0.20 true
    Java Quick Starter 1.0 false [email protected]
    Microsoft .NET Framework Assistant 1.1 false {20a82645-c095-46ed-80e3-08825760534b}
    New Tab King 3.1.4 false
    RealPlayer Browser Record Plugin 1.1.1 false
    Stylish 1.0.8 false {46551EC9-40F0-4e47-8E18-8E5CF550CFB8}
    Modified Preferences
    Name
    Value
    accessibility.typeaheadfind.casesensitive 1
    accessibility.typeaheadfind.flashBar 0
    browser.places.smartBookmarksVersion 2
    browser.startup.homepage_override.mstone rv:1.9.2.6
    extensions.lastAppVersion 3.6.6
    general.useragent.extra.microsoftdotnet (.NET CLR 3.5.30729)
    network.cookie.prefsMigrated true
    print.print_printer \\secureprint\Level 8 Right Wing Printer
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_bgcolor false
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_bgimages false
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_command
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_downloadfonts false
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_edge_bottom 0
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_edge_left 0
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_edge_right 0
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_edge_top 0
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_evenpages true
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_footercenter
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_footerleft &PT
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_footerright &D
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_headercenter
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_headerleft &T
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_headerright &U
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_in_color true
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_margin_bottom 0.5
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_margin_left 0.5
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_margin_right 0.5
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_margin_top 0.5
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_oddpages true
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_orientation 0
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_pagedelay 500
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_paper_data 1
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_paper_height 11.00
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_paper_size_type 0
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_paper_size_unit 0
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_paper_width 8.50
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_reversed false
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_scaling 1.00
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_shrink_to_fit true
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_to_file false
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_unwriteable_margin_bottom 0
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_unwriteable_margin_left 0
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_unwriteable_margin_right 0
    print.printer_\\secureprint\Level_8_Left_Wing_Printer.print_unwriteable_margin_top 0
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_bgcolor false
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_bgimages false
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_command
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_downloadfonts false
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_edge_bottom 0
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_edge_left 0
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_edge_right 0
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_edge_top 0
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_evenpages true
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_footercenter
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_footerleft &PT
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_footerright &D
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_headercenter
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_headerleft &T
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_headerright &U
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_in_color true
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_margin_bottom 0.5
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_margin_left 0.5
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_margin_right 0.5
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_margin_top 0.5
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_oddpages true
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_orientation 0
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_pagedelay 500
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_paper_data 1
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_paper_height 11.00
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_paper_size_type 0
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_paper_size_unit 0
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_paper_width 8.50
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_reversed false
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_scaling 1.00
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_shrink_to_fit true
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_to_file false
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_unwriteable_margin_bottom 0
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_unwriteable_margin_left 0
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_unwriteable_margin_right 0
    print.printer_\\secureprint\Level_8_Right_Wing_Printer.print_unwriteable_margin_top 0
    privacy.sanitize.migrateFx3Prefs true
    security.warn_viewing_mixed false
    == User Agent
    ==
    Opera/9.80 (Windows NT 5.1; U; en) Presto/2.5.24 Version/10.54

    I do not use McAfee software and I am having this issue. I can right-click on the "back-or-forward" buttons and get a history list to choose from (which is far from an improvement), but do not get any response from a left-click. The "back-or-forward" navigation buttons are greyed-out. Also, when I open Firefox (4), I get two title bars at the top with two separate sets of the "minimize", "maximize" and "close" icons. It appears as if one window is open within another, but if I click any of the commands "both" windows respond. It's annoying and cumbersome.

  • Expand/Collapse a block in a selection screen

    Hey Folks,
    I have a requirement , where I have a selection screen, with 3 selection blocks. I have a requirement that I need to make 2 of these blocks expandible/collapsible on the toggle of a button.. How can this be achieved.
    In case of a normal screen, I would have had to create the blocks as subscreens (one type of screen for expanded state...another for collapsed state) and called it from the main screen. But how do I achieve the same using the selection screens?
    I was considering creating the blocks as subscreens in the selection screen and calling them in the PBO of the main selection screen. However, I am unsure if thats a wise thing to do since the screen is generated automatically in case of a selection screen and I do believe its not a good idea to manually alter it.
    Does anyone has any pointers on this?
    Thanks and Best Regards,
    Puja.

    Hi,
    I have modified the code to show the expand/collapse ICON accordingly..Please check..
    TABLES sscrfields.
    TYPE-POOLS icon.
    * Expand/collapse buttons.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN PUSHBUTTON 2(23)  b1 USER-COMMAND usr1.
    SELECTION-SCREEN END OF LINE.
    * Block 1
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    PARAMETERS: p_test1 TYPE char10  MODIF ID m1,
                p_test2 TYPE char10  MODIF ID m1.
    SELECT-OPTIONS  s_date  FOR sy-datum MODIF ID m1.
    SELECTION-SCREEN END OF BLOCK b1.
    * Block 2
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN PUSHBUTTON 2(23)  b2 USER-COMMAND usr2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF BLOCK b2.
    PARAMETERS: p_test3 TYPE char10  MODIF ID m2,
                p_test4 TYPE char10  MODIF ID m2.
    SELECTION-SCREEN END OF BLOCK b2.
    * Declarations
    DATA: v_flag, v_flag1.
    INITIALIZATION.
      b1 = 'Button1'.
      b2 = 'Button2'.
      v_flag = 'X'.
      v_flag1 = 'X'.
    AT SELECTION-SCREEN.
    * Check the user command.
      IF sy-ucomm = 'USR1'.
        IF v_flag IS INITIAL.
          v_flag = 'X'.
        ELSE.
          CLEAR v_flag.
        ENDIF.
      ELSEIF sy-ucomm = 'USR2'.
        IF v_flag1 IS INITIAL.
          v_flag1 = 'X'.
        ELSE.
          CLEAR v_flag1.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN OUTPUT.
      IF v_flag1 = 'X'.
        CALL FUNCTION 'ICON_CREATE'
          EXPORTING
            name   = icon_expand
            text   = 'Button 2'
            info   = 'Button 2'
          IMPORTING
            RESULT = b2
          EXCEPTIONS
            OTHERS = 0.
      ELSEIF v_flag1 IS INITIAL.
        CALL FUNCTION 'ICON_CREATE'
          EXPORTING
            name   = icon_collapse
            text   = 'Button 2'
            info   = 'Button 2'
          IMPORTING
            RESULT = b2
          EXCEPTIONS
            OTHERS = 0.
      ENDIF.
      IF v_flag = 'X'.
        CALL FUNCTION 'ICON_CREATE'
          EXPORTING
            name   = icon_expand
            text   = 'Button 1'
            info   = 'Button 1'
          IMPORTING
            RESULT = b1
          EXCEPTIONS
            OTHERS = 0.
      ELSEIF v_flag IS INITIAL.
        CALL FUNCTION 'ICON_CREATE'
          EXPORTING
            name   = icon_collapse
            text   = 'Button 1'
            info   = 'Button 1'
          IMPORTING
            RESULT = b1
          EXCEPTIONS
            OTHERS = 0.
      ENDIF.
      LOOP AT SCREEN.
    * Expand collapse block1
        IF v_flag = 'X' AND screen-group1 = 'M1'.
          screen-active = 0.
        ELSEIF v_flag IS INITIAL AND screen-group1 = 'M1'.
          screen-active = 1.
        ENDIF.
    * Expand collapse block2
        IF v_flag1 = 'X' AND screen-group1 = 'M2'.
          screen-active = 0.
        ELSEIF v_flag1 IS INITIAL AND screen-group1 = 'M2'.
          screen-active = 1.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    Thanks
    Naren

  • [Forum FAQ] How to use parameter to control the Expand/Collapse drill-down options in SSRS report?

    In SQL Server Reporting Services (SSRS), drill-down is an action we can apply to any report item to hide and show other report items. They all are ways that we can organize and display data to help our users understand our report better. In this article,
    we are talking about how to use parameter to control the Expand/Collapse drill-down options in SSRS report.
    Consider that the report has a dataset (dsSales) with following fields: SalesTerritoryGroup, SalesTerritoryCountry, CalendarYear, SalesAmount.
    1. The report has the following group settings:
    Parent Group: SalesTerritoryGroup
     Child Group: SalesTerritoryCountry
      Child Group: CalendarYear
       Details: SalesAmount
    2. Add three parameters in the report:
    GroupExpand:
    Available Values: “Specify values”
    Label: Yes           Value: Yes
    Label: No            Value: No
    Default Values: “Specify values”
    Value: Yes
    CountryExpand:
    Available Values: “Specify values”
    Label: Yes           Value: =IIF(Parameters!GroupExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No","No","Yes")
    YearExpand:
    Available Values: “Specify values”
    Label: Yes          
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No","No","Yes")
    3. Right click SalesTerritoryCountry icon in the Row Groups dialog box, select Group Properties.
    4. Click Visibility in the left pane. Select “Show or hide based on an expression” and type with following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", False, True)
    Select “Display can be toggled by this report item” option, and select “SalesTerritoryGroup” in the drop down list.
    5. Use the same method setting CalendarYear, (Details) drill-down with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", False, True)
    =IIF(Parameters!YearExpand.Value="Yes", False, True)
    6. Click SalesTerritoryGroup text box in the tablix. Select InitialToggleState property in the Properties dialog box, and type following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", True, False)
    7. Use the same method setting SalesTerritoryCountry, CalendarYear text box with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", True, False)
    =IIF(Parameters!YearExpand.Value="Yes", True, False)
    After that, when we preview the report, we can use these three parameters to expand/collapse drill-down.
    Note:
    In our test, we may meet following issue. We can check the expression of InitialToggleState property to troubleshooting the issue.
    Applies to
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012

    In SQL Server Reporting Services (SSRS), drill-down is an action we can apply to any report item to hide and show other report items. They all are ways that we can organize and display data to help our users understand our report better. In this article,
    we are talking about how to use parameter to control the Expand/Collapse drill-down options in SSRS report.
    Consider that the report has a dataset (dsSales) with following fields: SalesTerritoryGroup, SalesTerritoryCountry, CalendarYear, SalesAmount.
    1. The report has the following group settings:
    Parent Group: SalesTerritoryGroup
     Child Group: SalesTerritoryCountry
      Child Group: CalendarYear
       Details: SalesAmount
    2. Add three parameters in the report:
    GroupExpand:
    Available Values: “Specify values”
    Label: Yes           Value: Yes
    Label: No            Value: No
    Default Values: “Specify values”
    Value: Yes
    CountryExpand:
    Available Values: “Specify values”
    Label: Yes           Value: =IIF(Parameters!GroupExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No","No","Yes")
    YearExpand:
    Available Values: “Specify values”
    Label: Yes          
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No","No","Yes")
    3. Right click SalesTerritoryCountry icon in the Row Groups dialog box, select Group Properties.
    4. Click Visibility in the left pane. Select “Show or hide based on an expression” and type with following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", False, True)
    Select “Display can be toggled by this report item” option, and select “SalesTerritoryGroup” in the drop down list.
    5. Use the same method setting CalendarYear, (Details) drill-down with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", False, True)
    =IIF(Parameters!YearExpand.Value="Yes", False, True)
    6. Click SalesTerritoryGroup text box in the tablix. Select InitialToggleState property in the Properties dialog box, and type following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", True, False)
    7. Use the same method setting SalesTerritoryCountry, CalendarYear text box with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", True, False)
    =IIF(Parameters!YearExpand.Value="Yes", True, False)
    After that, when we preview the report, we can use these three parameters to expand/collapse drill-down.
    Note:
    In our test, we may meet following issue. We can check the expression of InitialToggleState property to troubleshooting the issue.
    Applies to
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012

  • How to Remove maximize/minimize/close top-bar in full-screen view [MAC]?

    Hi.
    My Q. is pretty much as the title implies.
    It's a small thing, and maybe kind of trivial,
    but I'd like to know how to get rid of the maximize/minimize/close top-bar in full-screen view in Adobe Reader on the Mac.
    I am definitely in fullscreen view [I hit command+L], just so you know,
    but I still have that top grey bar showing with the maximize/minimize/close buttons [the red, yellow, and green].
    As I said, kind of a trivial concern, but I'd like to know how to hide that in full-screen mode.
    I tried searching around a few places for an answer, but there is nothing too obvious.
    I can't find anything in the full-screen preferences of reader either. Maybe I'm missing something...
    Thanks!

    Version 11.0 , so I guess that is the most recent?
    I think this is an application-specific problem too, because I don't encounter this in full-screen mode with other applications.

  • Maximize/Minimize/Close buttons are all greyed out

    Hello. Ever since a few days ago, the green, yellow, and red maximize/minimize/close buttons at the top left of every window have all been greyed out. They're all still completely usable and they do what you would expect them to do...there's just no color in them anymore. This is happening for all applications.
    I'm not really sure what's causing this. I don't remember exactly when it stopped working or what happened right before it, but it may have started happening right after my computer shut down, possibly from overheating (My friend was trying to be funny and opened the application window in finder and then pressed Cmd+a followed by Cmd+o --- To open all of my applications. We watched it chugging along for a while and then the screen just went black and the computer turned off). I don't know if that would cause the problem, I'm not really sure why it would.
    I tried a google search but came up empty handed. Any advice on how to fix this would be much appreciated. Thanks.

    No problem at all! Do remember to check the smallest things first before thinking that it is a big thing.

  • How do I remove the "TOC" btn in the playbar WITHOUT removing the TOC "Expand/Collapse" icon?

    I am working in CP7 on a project with a Table of Contents that is set to 'Overlay'. The client has requested that I remove the "TOC" button in the playbar, without removing the TOC "Expand/Collapse" icon, so that the user can still hide/reveal the TOC when necessary. The only control I can find is the "Show TOC" checkbox under Project > Table of Contents. However, un-checking this option removes both the "TOC" button AND the "Expand/Collapse" icons. Is it possible to remove just the "TOC" button in the playbar?

    If you are using SWF output you can always edit the playbar in Flash and remove it.
    If HTML5 you can edit the JavaScript out put to remove the button from the playbar.

  • Expand/Collapse all the Bookmarks in a PDF file

    Hi,
    This is my first message on the board :-)
    I work with very large PDF files (i.e 2000 pages, 700 bookmarks on 5 or 6 levels!) and I'm looking for a script (Acrobat 9 Pro) allowing to expand/collapse all the bookmarks in a PDF file.
    Thanks in advance for your valuable help,
    Cheers
    Antonella

    The Acrobat Javascript Scripting reference (http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJS.pdf) describes how to use scripting to access bookmarks and how to open and close them, which is what you're looking for.
    I suggest you read the reference and make a function that will do the job for you.
    That's the way I would do it.
    I don't think you can access the keyboard shortcuts "/" and "Shift + *" via scripting.
    Torben.

  • JTree with XML content expand/collapse problem

    Hello all,
    I'm having this very weird problem with a JTree I use to display the contents of an XML file. I use the DOM parser (and not JDOM since I want the application to run as an applet as well, and don't want to have any external libraries for the user to download) and have a custom TreeModel and TreeNode implementations to wrap the DOM nodes so that they are displayed by the JTree.
    I have also added a popup menu in the tree, for the user to be able to expand/collapse all nodes under the selected one (i.e. a recursive method).
    When expandAll is run, everything works fine and the children of the selected node are expanded (and their children and so on).
    However, after the expansion when I run the collapseAll function, even though the selected node collapses, when I re-expand it (manually not by expandAll) all of it's children are still fully open! Even if I collapse sub-elements of the node manually and then collapse this node and re-expand it, it "forgets" the state of it's children and shows them fully expanded.
    In other words once I use expandAll no matter what I do, the children of this node will be expanded (once I close it and re-open it).
    Also after running expandAll the behaviour(!) of the expanded nodes change: i have tree.setToggleClickCount(1); but on the expanded nodes I need to double-click to collapse them.
    I believe the problem is related to my implementations of TreeModel and TreeNode but after many-many hours of trying to figure out what's happening I'm desperate... Please help!
    Here's my code:
    public class XMLTreeNode implements TreeNode 
         //This class wraps a DOM node
        org.w3c.dom.Node domNode;
        protected boolean allowChildren;
        protected Vector children;
        //compressed view (#text).
         private static boolean compress = true;   
        // An array of names for DOM node-types
        // (Array indexes = nodeType() values.)
        static final String[] typeName = {
            "none",
            "Element",
            "Attr",
            "Text",
            "CDATA",
            "EntityRef",
            "Entity",
            "ProcInstr",
            "Comment",
            "Document",
            "DocType",
            "DocFragment",
            "Notation",
        static final int ELEMENT_TYPE =   1;
        static final int ATTR_TYPE =      2;
        static final int TEXT_TYPE =      3;
        static final int CDATA_TYPE =     4;
        static final int ENTITYREF_TYPE = 5;
        static final int ENTITY_TYPE =    6;
        static final int PROCINSTR_TYPE = 7;
        static final int COMMENT_TYPE =   8;
        static final int DOCUMENT_TYPE =  9;
        static final int DOCTYPE_TYPE =  10;
        static final int DOCFRAG_TYPE =  11;
        static final int NOTATION_TYPE = 12;
        // The list of elements to display in the tree
       static String[] treeElementNames = {
            "node",
      // Construct an Adapter node from a DOM node
      public XMLTreeNode(org.w3c.dom.Node node) {
        domNode = node;
      public String toString(){
           if (domNode.hasAttributes()){
                return domNode.getAttributes().getNamedItem("label").getNodeValue();
           }else return domNode.getNodeName();      
      public boolean isLeaf(){ 
           return (this.getChildCount()==0);
      boolean treeElement(String elementName) {
          for (int i=0; i<treeElementNames.length; i++) {
            if ( elementName.equals(treeElementNames)) return true;
    return false;
    public int getChildCount() {
         if (!compress) {   
    return domNode.getChildNodes().getLength();
    int count = 0;
    for (int i=0; i<domNode.getChildNodes().getLength(); i++) {
    org.w3c.dom.Node node = domNode.getChildNodes().item(i);
    if (node.getNodeType() == ELEMENT_TYPE
    && treeElement( node.getNodeName() ))
    // Note:
    // Have to check for proper type.
    // The DOCTYPE element also has the right name
    ++count;
    return count;
    public boolean getAllowsChildren() {
         // TODO Auto-generated method stub
         return true;
    public Enumeration children() {
         // TODO Auto-generated method stub
         return null;
    public TreeNode getParent() {
         // TODO Auto-generated method stub
         return null;
    public TreeNode getChildAt(int searchIndex) {
    org.w3c.dom.Node node =
    domNode.getChildNodes().item(searchIndex);
    if (compress) {
    // Return Nth displayable node
    int elementNodeIndex = 0;
    for (int i=0; i<domNode.getChildNodes().getLength(); i++) {
    node = domNode.getChildNodes().item(i);
    if (node.getNodeType() == ELEMENT_TYPE
    && treeElement( node.getNodeName() )
    && elementNodeIndex++ == searchIndex) {
    break;
    return new XMLTreeNode(node);
    public int getIndex(TreeNode tnode) {
         if (tnode== null) {
              throw new IllegalArgumentException("argument is null");
         XMLTreeNode child=(XMLTreeNode)tnode;
         int count = getChildCount();
         for (int i=0; i<count; i++) {
              XMLTreeNode n = (XMLTreeNode)this.getChildAt(i);
              if (child.domNode == n.domNode) return i;
         return -1; // Should never get here.
    public class XMLTreeModel2 extends DefaultTreeModel
         private Vector listenerList = new Vector();
         * This adapter converts the current Document (a DOM) into
         * a JTree model.
         private Document document;
         public XMLTreeModel2 (Document doc){
              super(new XMLTreeNode(doc));
              this.document=doc;
         public Object getRoot() {
              //System.err.println("Returning root: " +document);
              return new XMLTreeNode(document);
         public boolean isLeaf(Object aNode) {
              return ((XMLTreeNode)aNode).isLeaf();
         public int getChildCount(Object parent) {
              XMLTreeNode node = (XMLTreeNode) parent;
    return node.getChildCount();
         public Object getChild(Object parent, int index) {
    XMLTreeNode node = (XMLTreeNode) parent;
    return node.getChildAt(index);
         public int getIndexOfChild(Object parent, Object child) {
    if (parent==null || child==null )
         return -1;
              XMLTreeNode node = (XMLTreeNode) parent;
    return node.getIndex((XMLTreeNode) child);
         public void valueForPathChanged(TreePath path, Object newValue) {
    // Null. no changes
         public void addTreeModelListener(TreeModelListener listener) {
              if ( listener != null
    && ! listenerList.contains( listener ) ) {
    listenerList.addElement( listener );
         public void removeTreeModelListener(TreeModelListener listener) {
              if ( listener != null ) {
    listenerList.removeElement( listener );
         public void fireTreeNodesChanged( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeNodesChanged( e );
         public void fireTreeNodesInserted( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeNodesInserted( e );
         public void fireTreeNodesRemoved( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeNodesRemoved( e );
         public void fireTreeStructureChanged( TreeModelEvent e ) {
    Enumeration listeners = listenerList.elements();
    while ( listeners.hasMoreElements() ) {
    TreeModelListener listener =
    (TreeModelListener) listeners.nextElement();
    listener.treeStructureChanged( e );
    The collapseAll, expandAll code (even though I m pretty sure that's not the problem since they work fine on a normal JTree):
        private void collapseAll(TreePath tp){
             if (tp==null) return;
             Object node=tp.getLastPathComponent();
             TreeModel model=tree.getModel();
             if (!model.isLeaf(node)){
                  tree.collapsePath(tp);
                  for (int i=0;i<model.getChildCount(node);i++){
                  //for (int i = node.childCount()-4;i>=0;i--){
                       collapseAll(tp.pathByAddingChild(model.getChild(node,i)));
                  tree.collapsePath(tp);
        private void expandAll(TreePath tp){
             if (tp==null) return;
             Object node=tp.getLastPathComponent();
             TreeModel model=tree.getModel();
             if (!model.isLeaf(node)){
                  tree.expandPath(tp);
                  for (int i=0;i<model.getChildCount(node);i++){
                  //for (int i = node.childCount()-4;i>=0;i--){
                       expandAll(tp.pathByAddingChild(model.getChild(node,i)));

    Hi,
    Iam not facing this problem. To CollapseAll, I do a tree.getModel().reload() which causes all nodes to get collapsed and remain so even if I reopen them manually.
    Hope this helps.
    cheers,
    vidyut

  • ADF TreeTable: selective expand/collapse of rows

    Hi
    I have a query. How can i selectively expand or collapse nodes in a Tree Table. I have got the tree model but i need to expand even further so that the nodes can be expanded/collapsed initially based on some logic.
    It would be of great hhelp if any1 has some solution to it

    This doesnt work
    What i am doing:
    1. I have a TreeTable
    2. Its value is a TreeModel whose each node is my customized Object : MyObject
    So if i use this kinda code which is in ur tutorial
    CollectionModel model = (CollectionModel)tree1.getValue();
    treeBinding = (JUCtrlHierBinding)model.getWrappedData();
    I get a classcastexception:
    MyObject cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierBinding
    since model.getWrappedData(); returns the root node of the tree which should be of my customized Object type

  • Outlook 2013 - Online Archive folders do not remember expand / collapse

    For our QA group, we have just upgraded them from Office 2010 to Office 2013 SP1. We have one user that noticed something. With Outlook 2010, the client would remember which folders he had expanded or collapsed under his "Archive" (the online archive
    generated by the Archiving feature of Exchange server). However, once we upgraded him to Outlook 2013, this is no longer true. Now, the "Online Archive" header is fully collapsed when he open Outlook every time.
    To test, I created a small folder structure with some items in my own "Online Archive" section and was able to reproduce this behavior. Outlook 2013 will remember which folders are expanded or collapsed for the folders in my Inbox but not for the
    folders in my Archive. Is there a way to have Outlook 2013 remember the expand / collapse settings for the Archive?

    Hi,
    I'm marking the reply as answer as there has been no update for a couple of days.
    If you come back to find it doesn't work for you, please reply to us and unmark the answer.
    Best Regards,
    Steve Fan
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • Expand/collapse button functionality on module pool screen

    Hi ,
    I want to design a module pool screen with a expand/collapse button on it.
    The desired functionality associated with this button would be something similiar to that available in ME21N screen. When the expand button is clicked it should open up a section of screen that allows the user to enter some parameter. Based on this parameter some selections from DB can be perfomed and then displayed below it.
    Any pointers on how to achieve this? Any kind of help would be appreciated.
    Regards-
    Harmeet Singh.

    example for three pushbutton with expand collapse .
    First of all define your push button as output field with icon tick in the pushbutton characteristick,
    then define this pushbutton in top_include
    include <icon>.
    data : push_a1 like icons-l4,
             push_a2 like icons-l4,
             push_a3 like icons-l4.
    data : a1 ,
             a2,
             a3.
    in pai of the screen
    suppose i had assign function code a1 ,a2 , a3 for repective pushbutton
    module user_command_9002 input.
      okcd = ok_code.
      clear ok_code.
      case okcd.
        when 'A1'.
          if a1 is initial.
            a1 = 'X'.
          else.
            clear a1.
          endif.
        when 'A2'.
          if a2 is initial.
            a2 = 'X'.
          else.
            clear a2.
          endif.
        when 'A3'.
          if a3 is initial.
            a3 = 'X'.
          else.
            clear a3.
          endif.
      endcase.
    endmodule.                 " USER_COMMAND_9002  INPUT
    define three seprate screen -group for three pushbutton say a1 a2 a3
    during pbo you can directly assign name of icon .
    if a1 is initial.
        push_a1 = icon_collapse.
      else.
        push_a1 = icon_expand.
      endif.
      if a2 is initial.
        push_a2 = icon_collapse.
      else.
        push_a2 = icon_expand.
      endif.
      if a3 is initial.
        push_a3 = icon_collapse.
      else.
        push_a3 = icon_expand.
      endif.
    loop at screen.
        if screen-group1 = 'A1'.
          if a1 = 'X'.
            screen-invisible = 1.
            screen-input = 0.
            modify screen.
          else.
            screen-active = 1.
            screen-invisible = 0.
            screen-input = 1.
          endif.
        elseif screen-group1 = 'A2'.
          if a2 = 'X'.
            screen-invisible = 1.
            screen-input = 0.
            modify screen.
          else.
            screen-active = 1.
            screen-invisible = 0.
            screen-input = 1.
          endif.
        elseif screen-group1 = 'A3'.
          if a3 = 'X'.
            screen-invisible = 1.
            screen-input = 0.
            modify screen.
          else.
            screen-active = 1.
            screen-invisible = 0.
            screen-input = 1.
          endif.
        endif.
      endloop.
    regards,
    Alpesh
    Edited by: Alpesh on May 28, 2009 10:28 AM

  • Expand / Collapse a View -- How can i control it

    Our component has 5 pages and each page has its set of fields and validations. (some are required fields).
    This works fine if all pages are Visible.
    But if user collapse one of the page then none of the logic written for that page gets executed, in other words in a page is collapsed CRM just ignores it completely.
    Because of this users are able to create transaction with incomplete data.
    Is there a way to make a page permanent, so that user can never collapse it. (Collapse / Expand functionality will not work)
    How do you recommend to solve this problem

    Is there a way to deactivate Expand/Collapse button ?
    We never want user to click on that, i guess it might require JavaScript but will appreciate if somebody can provide some insight on this.
    I found below article but couldnt understand how i can implement for my requirement.
    http://www.bloggroll.com/view/16

Maybe you are looking for

  • MacBook Pro will not go to sleep

    When I close the lid on my laptop the computer conitnues to run and gets extremely hot.....

  • Slideshow issue

    I created a slide show on iphoto and would like to burn it to a dvd but my Mac does not have a cd burner. What can I do?

  • Oracle WebLogic Server (WLS), Time Zones, and DayLight Saving Time (DST) Changes

    Hello, We are approaching this time of the year again... I would like to redirect you to the Support Note 1370083.1 "Oracle WebLogic Server (WLS), Time Zones, and DayLight Saving Time (DST) Changes" This note lists what is to be expected from WebLogi

  • Frozen pointer in mountain lion Can not get wi fi  or open close pages. Help!

    The pointer is stuck in upper left corner. I can only go to preferences and force quit . Nothing, cannot get connected. By force closing and restarting all the closed pages reopen but I can't do anything.

  • Adobe: Necessary evil?

    Is it me, or is Adobe software almost as hostile to our machines as Microsoft? LOL... But yeah, seriously. I have that impression both from my G5 and from my Minis at work (had a PPC mini originally, Intel now), based on problems with their creative