Refresh gui container

Hello,
I've just stumbled over the next annoying gui problem:
I have a top level docking container that is attached to the one and only 'application dynpro'. I'm trying to be as OO as possible here...
In that docking container I want to draw different things depending on user input.
When starting the application I draw some control into the docking container and it works just fine. But now I want to change the contents of the docking container by creating some new control that has the docking container as its parent.
Guess what - the new control doesn't show up :-|
I have even tried to destroy (clear) the docking container create it again and then construct the new control but it didn't solve the problem.
In my opinion the property of being able to change the contents of a container is crucial to any gui framework and I can't believe that sap left this functionality out.
So if anybody has an idea how to change the contents of a container at runtime I would really appreciate that.
Best regards,
Patrick Baer

Anand,
your description of my situation was quite right.
Still the main problem remains.
I will try to explain again what I want to do and what I tried so far:
<b>Situation</b>:
At the top level I have attached a docking container (DC) to the one and only dynpro in my application.
In this DC I put a 'cl_gui_container_bar_xt' (CB) on program start. The subcontainers of CB are filled as well but this should not be relevant.
At some point I want to react to a user event and display a splitting container (SC) in DC <i>replacing</i> CB. It is quite likely that CB will be displayed again later on, so complete destruction would in fact be 'wasteful'.
<b>Problem</b>:
I started off very naive by just creating CB with parent DC. This works. On user event I create SC with parent DC as well -> SC is not shown, CB is still visible.
The desired situation would be: on creation of SC with parent DC the SC should become visible CB should not be visible anymore.
<b>Tried so far</b>:
- Destruction of DC, re-creation of DC then creation of SC with parent 'new' DC. Did not work.
- Destruction of CB, creation of SC with parent DC. Did not work as well.
<b>Possible solution</b>:
Use the 'set_visible' function to dynamically make components visible or invisible - problem here: CB somehow does not have this function, though most other components do.
Once again any help is highly welcome become this problem is currently crucial to the project.
Best regards,
Patrick Baer

Similar Messages

  • Refreshing the container in ALV grid

    hi,
    I am working on ALV GRID display (reports with ALV OOPS).
    I hav created it, but now i need to refresh the container...........i.e when the user presses back and he is giving the new selection criteria , it shd pick the values based on the new selection criteria....
    So, how do it refresh the container???????

    Hi,
    In ALV, to refresh the table you have to call the method "refresh_table_display". 
    It has the syntax very similar to creating the table. 
    It has two parameters. In the first one, you can mention if you want to refresh only the data (the icons are not refreshed) 
    or 
    if you want to refresh only the icons around the grid (the data is not refreshed - this option is mostly not used in day to day applications).
    the synatx is :-
    call method grid (name of grid )->refresh_table_display
    exporting
    IS_STABLE = <STRUCT OF TYPE LVC_S_STBL> (THIS IS FOR DATA REFRESHING)
    I_SOFT_REFRESH = <VARIABLE OF CHAR 01>  (THIS IS FOR ICON REFRESHING).
    Regards,
    Bhaskar

  • How to refresh data contained in CachedRowSet

    Hi all,
    I need to refresh data contained in CachedRowSet. I hope I don't have to call populate or execute again since I'm afraid this will need a big overhead. All I want is to be updated when other user add or delete any records.
    Any advice would be greatly appreciated.
    Setya

    essentially you want a live and sensitive cursor. perhaps you are missing the point of a cache. you can't have your cake and eat it too.
    in summary you need to refresh the whole thing.

  • How to refresh the container

    Hi,
    I have developed a user interface. A JScrollPane is a part of it and the JSP has a JTree in it. During the run time I am trying to remove the JSP from the container by this method:
    jsp.getViewport().remove(myTree);
    //Container content;
    content.remove(jsp);
    The problem is that i still see the JSP and its content (JTree) after the execution of the method. If I minimise the application and maximise it again I see that the JSP disappeared.
    What is the reason for this?
    Do I need something like refresh?
    Thanks

    invalidate()
    refresh()

  • Refreshing alv container

    I have editable alv container in a module pool which runs through transaction code.the problem is each time the editabale alv is displayed the old values remain....How can i refresh my alv container?

    Hi Priya,
    you can try with --
          CALL METHOD grid->refresh_table_display.
              CLEAR:  gh_index.
    Thanks,
    Venkat

  • Refreshing GUI while MultiThreading

    I am trying to refresh a GUI while calling a class that extends the Thread class.My code looks similiar to this:
    myThreadingClass mtc=new myThreadingClass();
    mtc.start();
    while(mtc.isAlive()){
    repaint();
    invalidate():
    The isAlive() is never returning false! ? ! I somehow need to do the repaint while waiting for the thread to finish. I had a mtc.join() before that worked and went on in the program, but I did not have any way to refresh the GUI with the mtc.join().
    Any one have any good ideas?

    If mtc.isAlive() is always returning true then obviously it hasn't exitted myThreadingClass.run() yet.
    So you need to look at what causes run() to exit there.
    Also you needto make thread safe calls to Swing by using the SwingUtilities class. Trying to update a Swing component from another thread is inherently unsafe because Swing is non-reentrant.
    - Also : You can repaint then invalidate().... should swap that around.
    - Also : You're refreshing the screen in a while loop without any delays.
    Try putting in a sleep() for a little bit.
    regards,
    Owen
    while ( mtc.isAlive() )
         // IMPORTANT : You can't update a Swing component in another
         // Thread.  You must update it in a "Swing friendly" manner.
         // Hence this helper function.
         try
              Thread.sleep ( 1000 );     // refresh screen once a second... can be changed
         catch (InterruptedException ignore )
         final Runnable runnable = new Runnable()
             public void run()
                  invalidate();
                  repaint();
             } // run
         };    // runnable
         SwingUtilities.invokeLater(runnable);
    }

  • Refresh GUI

    hi,
    i am quite new to java.I have a GUI.GUI shows the rows retrieved from database in jtable. i wanna refresh content of jtable every 5 seconds (or sometime ) continously. I constructed a method to retrieve the query results , locate them into jtable and repaint it. How can i invoke this method every 5 seconds (or sometime) periodically?
    thanx in advance
    hELin

    Look into threads.yes i have searched a little, i am confused.
    should the function be implementing runnable or should i use SwingUtilities.invokeLater() method?
    (since method accesses swing components)

  • "Refreshing" a Container

    Hey. Is there any way to "refresh" a JPanel, or in other words, to update its contents?
    I have one large JPanel that is the main content pane for a JInternal frame. To this, I added three panels, one of which is a panel called OptionsPanel. I pass OptionsPanel an Options object which contains the information necessary to dynamically draw the OptionsPanel. Problem is, I add the OptionsPanel to the main content pane at the start of the program, and then the Options object is changed as the user interacts with the program.
    Basically, I'm writing a configurations editor for a larger application. I want my program to work so that when the user selects a configuration from a JComboBox, the OptionsPanel "refreshes" (redraws itself maybe?) so that the updated information is displayed.
    I've tried using the revalidate method, but to no avail. Any other suggestions? Thanks in advance.
    Nick

    Well, here's what I do. If a new configuration is selected I call a method in the class where the OptionsPanel (the instance of it is configOptionsPanel) is first initialized. The method is called updateOptionsPanel(Options configOptions), where the options are passed as an argument. In the method I change the value of configOptionsPanel and call repaint(), as such.
    configOptionsPanel = new ConfigOptionsPanel(configOptions);
    configOptionsPanel.repaint();I think that works to an extent, but it doesn't re-add configOptionsPanel to the main content pane. In other words, I think it does recreate it and it does repaint it, but the results never show. How can I go about fixing this? Do I have to physically remove and re-add all panels to the main content pane?
    Thanks for that quick response by the way.

  • Using a GUI container

    I have 3 JPanels and i need the middle one too hold some buttons and Labels. I need there to be a title label and then underneath the buttons related to this title, as shown.
    SWIMMING
    JButton JButton JButton
    TRACK AND FIELD
    JButton JButton JButton
    I have used flow layout but i am not sure this is the correct choice for what i want to do. I have declared and set all my labels and buttons and when i go to display them, i am trying:
         pnlCenter.setLayout(new FlowLayout(FlowLayout.CENTER, 22, 25));
         pnlCenter.add(lbSwimming,  0);  //JLabel
         pnlCenter.add(eveSwim50M,  1); //JButton
         pnlCenter.add(eveSwim100M, 2); //JButton
         pnlCenter.add(lbTrack,     4);  //JLabel
         pnlCenter.add(eveRun100M,  5);  //JButton
         pnlCenter.add(eveRun400M,  6); //JButton
         pnlCenter.add(eveRun800M,  7); //JButton
         pnlCenter.add(eveRun1500M, 8); //JButton
         pnlCenter.add(eveDecathlon,9); //JButtonThis does not give them a very good order though. Is there any way in flow layout i can use somthing simular to '/n'. Or what would be the best container for what i need to do?
    cheers

    I was thinking maybe gridbag layout? don't 'think' about it - do it.
    read the GridBagLayout tutorial from the earlier link,
    put together a program and see how it looks.
    Might not be the easiest layout to use, and possibly overkill
    for what you want, but if you experiment now, the time you do
    need a GridBagLayout will be easier for you.
    one possible way:
    panel(GridLayout(4,1))
    panel.add(swimmingLabel,JLabel.CENTER)//assumes you want the label centered over the middle button
    panel.add(anotherPanel(GridLayout(1,3)-->anotherPanel has the 3 buttons
    ditto for other label
    ditto for other row of buttons
    another possibility is BoxLayout - try 'em all, see how they look

  • Looking for a usable GUI Designer/Container...

    Hi all.
    Since a while, I'm looking for an integrated environment to develop and execute Java/Swing GUI and it seems it's not possible to find such a thing...
    I explain : we are developping lots of J2EE applications hosted in a well known Application Server, and for what concern server, we can find 'on the shelf' almost all we need. Thus, using Session Beans, EJB3, Spring (...), it's pretty comfortable to build professional applications.
    But generally speeking, these applications have a graphical part, and at this point, things become more complicated. For years, we have been using only Java, for both server and client part (Swing, even in its firsts versions... souvenirs...). But even after 10 years of Java, it seems that it is still not possible to find a tool in which we can design, test, deploy and execute our GUIs.
    Since Matisse appeared, it is a little bit easier to design panels (but not so trivial... JFormDesigner has released a beta version supporting the GroupLayout : still lots of bugs) but for what concern, let's say, the 'GUI Container' part, it seems that market/open source has no answer. I tried Netbeans RCP (and also Eclipse...), but these containers have been thought for IDE, and concepts are not easy to map on a standard GUI. Moreover, these containers are huge and not so easy to understand, so very often, the decision to build full custom applications is taken, re-writing for the 1000th time the main window, the menubar/toolbar management, the MDI controller (using sometime a docking framework), ... Thus, the cost of the development and the baseline is high, and of course, our clients are dissatisfied.
    Recently, a new way of developping applications appeared : server part is developped using Java/J2EE, and the client side (fat client) is made using .Net. Interop between client and server leans on WebServices or binary interop (JIntegra).
    I'm totally convinced that this kind of architecture is a mistake, but it's more and more difficult to defend Java on the client side. C# tools seem to be easier to use, more productive, ...
    So my question is : what are your opinions/experiences on this subject? Have you found "the magic tool", "the magic framework", ... that make of Java/Swing a good challenger for desktop developments... or do you think that the game is over, and that Microsoft .Net has definitively won the client?
    Thks for your answers!!
    Rd

    I believe it is not about winning and lossing. Its about learning. By the way, let me mention that God who is the mastermind of all variations is a God of diversity. Every diverse expression of whatever kind is a reflection and coextension of its maker -and that means that even you are a coextension of Himself.
    Perhaps, if you are really looking for a tool that would satisfy your demands or desires along with Java, isnt it not logical to say that... or shall I say "perhaps" God is leading you into that new expression of diversity -a diversity that will challenge the whole creation? I dont blame others with what I cant do for myself.
    One saying says,
    "Seek and you shall find; Knock and the door will be opened to you; Ask and it shall be given you." The shorter way of saying it is..."Be patient and you will be satisfied."
    If the clients lost patience. Make them understand how complex it is to make a java application. They will appreciate your wisdom.
    Well nothing is impossible. The best part of your mind [one variation of the others] will always suggest: "All things are possilbe".
    Therefore, do not despise what God is blessing.
    Oliver Bob Lagumen
    Newbie in Java

  • How to refresh JDialog?

    Hi!
    I have JDialog with 3 tabs. In JDialog I have button "Get Default". And when I click this button I want all default settings will be load and therefore JDialog must be refresh.
    my code:
    public class OptionsView extends JDialog {
         private final class LoadDefaultButtonController implements ActionListener {
              @Override
              public void actionPerformed(ActionEvent e) {
                   try {
                        UserSettings.loadUserOptionsDefault();// reload user setting - OK!
                        trainingTabView.updateGUI();// must refresh GUI , but NOT refresh
                   } catch (IOException ex) {
                        logger.error(ex.getMessage(), ex);
    }Class TrainingTabView have the next code:
    public abstract class TrainingExamView extends JPanel {
           public void updateGUI() {
              revalidate();
              validate();
              repaint();
    }But GUI NOT refresh. Why?

    My guess is that you have to do more than must revalidate or repaint your GUI. You will likely have to reinitialize each component on the GUI, and doing that will be very much dependent on what your GUI holds and how the data is bound to the components. Without seeing this code, it will be hard to know how to guide you.
    Your best bet here is to show us compilable code. We don't want to see your whole program, but rather you should condense your code into the smallest bit that still compiles, has no extra code that's not relevant to your problem, but still demonstrates your problem, in other words, an SSCCE (Short, Self Contained, Correct (Compilable), Example). For more info on SSCCEs please look here:
    [http://homepage1.nifty.com/algafield/sscce.html|http://homepage1.nifty.com/algafield/sscce.html]
    Again, if the code is compilable and runnable more people will be able to help you.
    Edited by: Encephalopathic on Nov 9, 2008 7:21 AM

  • How to schedule macros to open a report , refresh and update database?

    Hi,
    We have the below set of steps that work on a deski environment. It works fine on XI R3.1 Fix pack 1.5, but I am unable to schedule and get the macros to run although i've included the entire macros code in - Private Sub DocumentAfterRefresh()
    Refresh of report
    Step 1 : Report is Refreshed. Refreshed data contains 10 Report Names to be opened by the Macros and the prompt values that these reports need to be refreshed with.
    Macros Functionality:
    Step 1 : Opens 1st report of the 10 reports from the repository in deski thick client, updates the database by setting a flag on the processing to Y or N for the report being processed.
    Step 2 : Refreshes the report with the prompt values obtained from the first refresh in the report, saves the refreshed data to a CSV or PDF at a location.
    Step 3 : Updates the database if the report has been genrated or not and then deletes the local copy of the output csv and pdf.
    The above steps repeat over and over again until all 10 reports open up, get refreshed and update the database.
    Now all of this works on Deski thick client/refresh and macros.
    However, when i schedule it, the macros doesnot seem to be running.
    Is the above scenario even possible to replicate via a schedule process..? 
    Note : The reports need to be retained in Deski itself.
    PLz help...!

    Scheduling Background Jobs 
    Use
    You can define and schedule background jobs in two ways from the Job Overview:
    Directly from Transaction SM36. This is best for users already familiar with background job scheduling.
    The Job Scheduling Wizard. This is best for users unfamiliar with SAP background job scheduling. To use the Job Wizard, start from Transaction SM36, and either select Goto ® Wizard version or simply use the Job Wizard button.
    Procedure
    Call Transaction SM36 or choose CCMS ® Jobs ® Definition .
    Assign a job name. Decide on a name for the job you are defining and enter it in the Job Name field.
    Set the job’s priority, or "Job Class":
    High priority: Class A
    Medium priority: Class B
    Low priority: Class C
    In the Target server field, indicate whether to use system load balancing.
    For the system to use system load balancing to automatically select the most efficient application server to use at the moment, leave this field empty.
    To use a particular application server to run the job, enter a specific target server.
    If spool requests generated by this job are to be sent to someone as email, specify the email address. Choose the Spool list recipient button.
    Define when the job is to start by choosing Start Condition and completing the appropriate selections. If the job is to repeat, or be periodic, check the box at the bottom of this screen.
    Define the job’s steps by choosing Step, then specify the ABAP program, external command, or external program to be used for each step.
    Save the fully defined job to submit it to the background processing system.
    When you need to modify, reschedule, or otherwise manipulate a job after you've scheduled it the first time, you'll manage jobs from the Job Overview.
    Note: Release the job so that it can run. No job, even those scheduled for immediate processing, can run without first being released.
    For a simple job scheduling procedure, see the R/3 Getting Started Guide.

  • Is it possible to display a dynpro in a container?

    Hey guys,
    in the SAP Case Management environment SAP offers the possiblity to define customer specifc "subcomponents". A subcomponent is basically a certain part on the screen.
    For the implementation you get a reference to a GUI container (im_container TYPE Ref To CL_GUI_SIMPLE_CONTAINER). Customers can now easily add for example an ALV table by using the defined container.
    In my situation I want to display a dynpro with several tabstrips on it so I thought of a carrier dynpro attached to the GUI container using docking container.
    Is this possible at all? My code looks like this:
      DATA lr_gui_docking TYPE REF TO cl_gui_docking_container.
      CREATE OBJECT lr_gui_docking
        EXPORTING
          parent                      = im_container
          repid                       = 'ZHG01'
          dynnr                       = '0200'
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          OTHERS                      = 6.
    I get a runtime exception ("CNTL_ERROR"). Debugging in system debug mode shows that the exception is thrown at the end of method "GET_FRAME_CONTAINER":
    METHOD GET_FRAME_CONTAINER.
        DATA: PARENTID TYPE I.
    *    CALL 'DY_GET_MODAL_LEVEL' ID 'MOD_LEV' FIELD PARENTID.
    *    CALL 'DY_GET_MODAL_LEVEL' ID 'MOD_LEV_UI' FIELD PARENTID.
    *    CALL 'DY_GET_MODAL_LEVEL' ID 'ACT_UI_MOD_LEV' FIELD PARENTID.
        IF CONTAINER IS INITIAL.
            CALL 'DY_GET_MODAL_LEVEL' ID 'ACT_UI_MOD_LEV' FIELD PARENTID.
        ELSEIF CONTAINER->H_CONTROL-SHELLID = -1.
            CALL 'DY_GET_MODAL_LEVEL' ID 'ACT_UI_MOD_LEV' FIELD PARENTID.
        ELSE.
            PARENTID = CONTAINER->H_CONTROL-SHELLID.
        ENDIF.
        IF PARENTID BETWEEN 10 AND 19.    " this are the dynpro areas
            PARENTID = PARENTID - 10.     " now its the corresponding frame
        ENDIF.
        data: new_dummy_parent_container type ref to CL_GUI_CONTAINER.
        IF PARENTID BETWEEN 0 AND 9.
        "    CREATE OBJECT DUMMY_PARENT_CONTAINER
        "        EXPORTING CLSID = SPACE.
        "    DUMMY_PARENT_CONTAINER->H_CONTROL-SHELLID = PARENTID.
        "    FRAME_CONTAINER = DUMMY_PARENT_CONTAINER.
            CREATE OBJECT NEW_DUMMY_PARENT_CONTAINER
                EXPORTING CLSID = SPACE.
            NEW_DUMMY_PARENT_CONTAINER->H_CONTROL-SHELLID = PARENTID.
            FRAME_CONTAINER = NEW_DUMMY_PARENT_CONTAINER.
        ELSEIF PARENTID = 99.
            FRAME_CONTAINER = CONTAINER.
        ELSE.
            IF CONTAINER_MUST_BE_TOPLEVEL = 0.
                FRAME_CONTAINER = CONTAINER.
            ELSE.
                RAISE CNTL_ERROR. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< "DUMP!!
           ENDIF.
        ENDIF.
    ENDMETHOD.
    I have no idea what this could mean.
    Variables during runtime:
    PARENTID is set to "181"
    CONTAINER_MUST_BE_TOPLEVEL is set to "1"
    Any ideas?
    Thanks in advance,
    Hendrik

    Hi François,
    you're right. I think I missunderstood the sense of a docking container and it is simply not possbile. I also couldn't locate any reference implementations in the SAP standard for this. To sum up I think that only subclasses of "CL_GUI_CONTROL" can be used to work in a container like the ALVs, pictures or text edit controls.
    Hendrik

  • Remove the contents of the table container in workflow

    hi,
    i want remove the contents of the table container in a method in workflow.
      how can i doit. anyone pls send me the syntax.
    after removing the old contents then i want to insert new values to that table.
    Thanks
    Sankar

    hi,
    i want to refresh the container in workflow.
    anyone pls tell me.
    Thanksin advance.
    sankar.

  • Nokia Belle Refresh update

    Does anyone out there know when will Belle Refresh for N8 be released???? So many rumours, don't know what to believe anymore.
    Kind regards
    Solved!
    Go to Solution.

    1. It's not wise to put more pressure on devs than what they already have from Nokia.
    2. I'm waiting anxiously for this, since Belle Refresh should contain the most important update ever, and that isn't the browser, the Maps or the bugfixes. This update is Qt 4.8.
    As a KDE user (KDE is a full desktop replacement built entirely on Qt), the speed difference between Qt 4.7.4 and Qt 4.8 is MASSIVE. Specially when optimizing for Qt 4.8. Believe me, you really feel the difference. Just like a Nokia Belle phone, KDE depends on Qt for everything, and that includes screen redrawing, effects, acceleration and the like. Don't be surprised if in your N8 you get at the same time more battery life and more performance.
    3. I have a Nokia 500, so I must wait even more than you all. But Qt 4.8 works wonders when it's time to punish the OpenVG GPU of my cell phone. I'm waiting for exactly the same improvements, since I know they are delivered even in Software rendering.

Maybe you are looking for