Problem in refreshing JTree inside Jscrollpane on Button click

hi sir,
i have problem in refreshing JTree on Button click inside JscrollPane
Actually I am removing scrollPane from panel and then again creating tree inside scrollpane and adding it to Jpanel but the tree is not shown inside scrollpane. here is the dummy code.
please help me.
import javax.swing.*;
import java.awt.*;
import javax.swing.tree.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.WindowListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class Test
public static void main(String[] args)
     JFrame jf=new TestTreeRefresh();
     jf.addWindowListener( new
     WindowAdapter()
     public void windowClosing(WindowEvent e )
     System.exit(0);
     jf.setVisible(true);
class TestTreeRefresh extends JFrame
     DefaultMutableTreeNode top;
JTree tree;
     JScrollPane treeView;
     JPanel jp=new JPanel();
     JButton jb= new JButton("Refresh");
TestTreeRefresh()
setTitle("TestTree");
setSize(500,500);
getContentPane().setLayout(null);
jp.setBounds(new Rectangle(1,1,490,490));
jp.setLayout(null);
top =new DefaultMutableTreeNode("The Java Series");
createNodes(top);
tree = new JTree(top);
treeView = new JScrollPane(tree);
treeView.setBounds(new Rectangle(50,50,200,200));
jb.setBounds(new Rectangle(50,300,100,50));
jb.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent ae)
          jp.remove(treeView);
          top =new DefaultMutableTreeNode("The Java ");
createNodes(top);
          tree = new JTree(top);
               treeView = new JScrollPane(tree);
               treeView.setBounds(new Rectangle(50,50,200,200));
               jp.add(treeView);     
               jp.repaint();     
jp.add(jb);     
jp.add(treeView);
getContentPane().add(jp);
private void createNodes(DefaultMutableTreeNode top) {
DefaultMutableTreeNode category = null;
DefaultMutableTreeNode book = null;
category = new DefaultMutableTreeNode("Books for Java Programmers");
top.add(category);
book = new DefaultMutableTreeNode("The Java Tutorial: A Short Course on the Basics");
category.add(book);
book = new DefaultMutableTreeNode("The Java Tutorial Continued: The Rest of the JDK");
category.add(book);
book = new DefaultMutableTreeNode("The JFC Swing Tutorial: A Guide to Constructing GUIs");
category.add(book);
book = new DefaultMutableTreeNode("Effective Java Programming Language Guide");
category.add(book);
book = new DefaultMutableTreeNode("The Java Programming Language");
category.add(book);
book = new DefaultMutableTreeNode("The Java Developers Almanac");
category.add(book);
category = new DefaultMutableTreeNode("Books for Java Implementers");
top.add(category);
book = new DefaultMutableTreeNode("The Java Virtual Machine Specification");
category.add(book);
book = new DefaultMutableTreeNode("The Java Language Specification");
category.add(book);
}

hi sir ,
thaks for u'r suggession.Its working fine but the
properties of the previous tree were not working
after setModel() property .like action at leaf node
is not working,I'm sorry but I don't understand. I think you are saying that the problem is solved but I can read it to mean that you still have a problem.
If you still have a problem then please post some code (using the [code] tags of course).

Similar Messages

  • Problem setting a hidden item value when button clicked with dynamic action or pl/sql process

    Apex 4.1
    Oracle 11g
    I have a page that consists of a main region and several sub regions.  I have a pl/sql process in After Header SET_DISPLAY(:P400_DISPLAY :='MAIN';)
    Three subregions have a contional display where P400_DISPLAY = STORE.  This works in hiding the sub regions.
    Now I want to change the P400_DISPLAY value to STORE to show the subregions when I hit a button.
    I tried creating a dynamic action for on click of the add button but get the following error:
    The selected button uses a 'Button Template' that does not contain the #BUTTON_ID# substitution string
    I went to the templates and found:
    Substitution Strings
    Substitution strings are used within sub templates to reference component values. This report details substitution string usage for this template.
    Substitution String
    Referenced
    From
    Description
    #LINK#
    Yes
    Template
    To be used in an "href" attribute
    #JAVASCRIPT#
    No
    To be used in an "onclick" attribute
    #LABEL#
    Yes
    Template
    Button Label
    #BUTTON_ATTRIBUTES#
    No
    Button Attributes
    #BUTTON_ID#
    No
    Generated button ID will be either the button's Static ID if defined, or if not will be an internally generated ID in the format 'B' || [Internal Button ID]
    I then tried creating a page process, pl/sql, :P400_DISPLAY :='STORE'; when the appropriate button is pressed.  The button action is submit page. However, it does not change the P400_DISPLAY value and the subregions stay hidden.
    Suggestions please on how to fix the template or change the P400_DISPLAY value?

    The root issue is that, although you change the value of your page item, it isn't visible to other areas of the page until it is in the session. So, any other action based on the value of your page item; the visibility of a control, a report based on the item's value, etc. will all be unaffected by changing the value of the page item until it has been changed in the session. Even after this the items are stored in the session, you must thereafter do something to cause the value to be reevaluated. To see the effect of this, observe that your page loads and evaluates the value of your page item, it sees that is "MAIN" and hides the regions. However, it doesn't reevaluate them after this.
    So; your choices to get this value set in the session are to either Submit the page, or use JavaScript to set the value in the session. If you use the latter of these, you'll have to do some further work to cause the visibility tests to be re-run, So, let's stick with with the submit method.
    What you've done above sounds correct for this but, there are a lot of decisions you could have made that might have caused things not to happen in the correct sequence.
    Firstly, let's confirm that what I describe above is your problem. From the development environment, load the page, click the button to change the value and submit. Now, click the link labelled Session. Is it still set to MAIN? If so; this is your issue.
    Let's start with the your After Header computation. Did you set it to *only* run if the current value of your page item is NULL??? If not, that's your problem.
    Load Page -> Item set to 'Main' by Computation -> Click Button -> Item set to STORE -> Submit -> Load Page -> Item set to 'Main' by Computation
    See the problem?
    Assuming this isn't the issue, you created a Branch to the same page, right? What is your process point for the Branch? Is it *After* Validation, Computation etc? Because if not, you aren't changing the value before the submit happens.
    I bet it is the first issue but, take a look at these.
    Cheers,
    -Joe

  • Refreshing a UI field on Button click.

    I have and input text and a search icon next to in on UI. On click on search icon I show a popup and on click of OK button on popup I set a value in pageFlowScope and tries to refresh input text. Input text value is same pageFlowScope variable so I was expecting it to show value in input text. But its not happening.
    jsff code
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core">
      <af:panelLabelAndMessage label="Label 1" id="plam1">
        <af:inputText id="it1" value="#{pageFlowScope.pSecureByAdminRole}"/>
        <f:facet name="end">
               <af:commandImageLink id="cil1" icon="/adf/webcenter/find_ena.png" partialSubmit="true" actionListener="#{backingBeanScope.RelationshipBean.launchSearchRolePopup}" immediate="true"/>
        </f:facet>
      </af:panelLabelAndMessage>
      <af:popup id="p1" binding="#{backingBeanScope.RelationshipBean.searchRolePopup}">
        <af:dialog id="d1" type="none">
               <f:facet name="buttonBar">
                    <af:commandButton text="Ok" id="cb1" actionListener="#{backingBeanScope.RelationshipBean.handleRoleSearchOK}" partialSubmit="true"/>
               </f:facet>
        </af:dialog>
      </af:popup>
    </jsp:root>
    Bean code
        public void launchSearchRolePopup(ActionEvent actionEvent) {
                    ADFUtils.showPopup(this.getSearchRolePopup(), null, null, null);
        public void handleRoleSearchOK(ActionEvent actionEvent){
               ADFUtils.getPageFlowScope().put("pSecureByAdminRole", "TEST");
               this.getSearchRolePopup().hide();
               ADFUtils.refreshUI(this.getSecureByAdminRoleOnNewDocument());
    ADFUtil Code:
        public static void showPopup(RichPopup popup,UIComponent alignComponent,RichPopup.PopupHints.AlignTypes alignType,RichPopup.PopupHints additionalHints ){
               FacesContext context = FacesContext.getCurrentInstance();
               if(additionalHints == null)
                    additionalHints = new RichPopup.PopupHints();
               String alignId = null;
               if(alignComponent != null){
                        alignId = alignComponent.getClientId(context);
                        additionalHints.add(RichPopup.PopupHints.HintTypes.HINT_ALIGN_ID, alignId);
                if(alignType != null){
                    additionalHints.add(RichPopup.PopupHints.HintTypes.HINT_ALIGN,  alignType);
               popup.show(additionalHints);
        public static void refreshUI(UIComponent uiComponent){
              AdfFacesContext adfctx = AdfFacesContext.getCurrentInstance();
              adfctx.addPartialTarget(uiComponent);
    Input text does not show new value (TEST). If I just click on browser refresh icon, it starts showing TEST. By that way it looks like refresh issue only.
    I tried setting partial trigger of input-text to refer to OK button of popup but no success.
    Thanks
    Sanjeev.

    I do have binding but some how I missed to that while posting in forum. Actuall jsff code is like
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core">
      <af:panelLabelAndMessage label="Label 1" id="plam1">
        <af:inputText id="it1" value="#{pageFlowScope.pSecureByAdminRole}" binding="#{backingBeanScope.RelationshipBean.secureByAdminRoleOnNewDocument}"/>
        <f:facet name="end">
               <af:commandImageLink id="cil1" icon="/adf/webcenter/find_ena.png" partialSubmit="true" actionListener="#{backingBeanScope.RelationshipBean.launchSearchRolePopup}" immediate="true"/>
        </f:facet>
      </af:panelLabelAndMessage>
      <af:popup id="p1" binding="#{backingBeanScope.RelationshipBean.searchRolePopup}">
        <af:dialog id="d1" type="none">
               <f:facet name="buttonBar">
                    <af:commandButton text="Ok" id="cb1" actionListener="#{backingBeanScope.RelationshipBean.handleRoleSearchOK}" partialSubmit="true"/>
               </f:facet>
        </af:dialog>
      </af:popup>
    </jsp:root>
    One strange thing I noticed is if I disable input component (disable = "true") , it starts refreshing it.
    Any suggestions.
    Thanks
    Sanjeev

  • JTree and JScrollPane problems

    Hello all.
    bear with me a second, so I can explain what is happenning with my code. I have got a java application that is accessing an SQL database (either Oracle or postgreSQL) and inputing the data into a tree.
    More specifically it takes the "enrollment" data and draws into the scrollpane the courses and students enrolled. Everything seems to be working perfectly with the building of the tree.
    but I have a drop down list that can select which years to display (1-4th year). I want the tree in the scrollPane to update when u change the year in the drop down list.
    I have added an ActionListener to the drop down list and it picks up the right selection, and I create a new tree object with the new year details and nothing is changed in the scrollpane.
    This is what the GUI looks like:
    This is my tree class which creates teh tree and adds it to the scrollPane object:
    package Interface;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.sql.*;
    import Database.Database;
    public class Tree{
         JTree tree;
         JScrollPane scrollPane;
         public Tree(GridBagConstraints c, Container contentPane, GridBagLayout gridBag, int year){
              //Set up the default table.
              TreeNode root = buildTree("Enrollments", year);
              tree = new JTree(root);
              //Set up a scrollPane for the tree.
              scrollPane = new JScrollPane(tree);
              //Set constraints for the ScrollPane
              c.fill = GridBagConstraints.BOTH;
              c.weightx = 1;
              c.weighty = 1;
              c.gridwidth = 2;
              c.gridx = 0;
              c.gridy = 1;
              c.anchor = GridBagConstraints.CENTER;
              gridBag.setConstraints(scrollPane, c);
              contentPane.add(scrollPane);     
              //Set defaults for teh Tree object.
              tree.expandRow(0);
              tree.setRootVisible(false);
              tree.setEditable(true);     
         public DefaultMutableTreeNode buildTree(String s, int year){
              //Set root of tree.
              DefaultMutableTreeNode node = new DefaultMutableTreeNode(s);
              //Create a database object.
              Database db = new Database();
              //change this bit to get the name's of the courses and add into array.
              ResultSet className = db.query("SELECT name FROM courses WHERE year = "+year);
              DefaultMutableTreeNode course = null;
              DefaultMutableTreeNode name = null;
              try {
                        while(className.next()){
                             String classStr = className.getString("name");
                             course = new DefaultMutableTreeNode(classStr);
                             node.add(course);
                             ResultSet firstName = db.query("SELECT students.name FROM students, enrollments, courses WHERE students.id = enrollments.studentID AND enrollments.courseid = courses.id AND courses.name = '"+classStr+"'");
                             while(firstName.next()){
                                  String nameStr = firstName.getString("name");
                                  name = new DefaultMutableTreeNode(nameStr);
                                  course.add(name);
                   catch(Exception e){
                        System.err.println("" + e.getMessage());
                        e.printStackTrace(System.err);
              return node;
    }This is the GUI class that calls on the tree class and draws the GUI. and the actionlistener for the drop down list.
    package Interface;
         import java.awt.*;
         import javax.swing.*;
         import java.awt.event.*;
    import java.sql.*;
         public class GUI extends JFrame implements ActionListener{
              private static final long serialVersionUID = 1L;     
              DropDownMenu yearDrop;
              ScrollPane scrollPane;
              JMenuItem menuItemSave;
              JMenuItem menuItemQuit;
              JMenuBar menuBar;
              JMenu menu;
              JButton save;
              JButton quit;
              Tree tree;
              String year[] = { "First Year", "Second Year", "Third Year", "Fourth Year" };
              Container contentPane = getContentPane();
              GridBagLayout gridBag = new GridBagLayout();
              GridBagConstraints c = new GridBagConstraints();
              public GUI(){
                   setSize(500,500);
                   setTitle("UTAS Enrollments");
                   contentPane.setLayout(gridBag);          
                   save = new JButton("Save");
                   quit = new JButton("Quit");
                   menuItemSave = new JMenuItem("Save");
                   menuItemQuit = new JMenuItem("Quit");
                   menuItemSave.setMnemonic('s');
                   menuItemQuit.setMnemonic('q');
                   yearDrop = new DropDownMenu(year, c, contentPane, gridBag);
                   tree = new Tree(c, contentPane, gridBag, 1);
                   menuBar = new JMenuBar();
                   menu = new JMenu("File");
                   menu.setMnemonic('f');
                   menuBar.add(menu);
                   menu.add(menuItemSave);
                   menu.add(menuItemQuit);
                   setJMenuBar(menuBar);
                   //Set constraints for the Save button
                   c.fill = GridBagConstraints.NONE;
                   c.weightx = 1;
                   c.weighty = 0;
                   c.gridwidth = 1;
                   c.gridx = 0;
                   c.gridy = 2;
                   c.anchor = GridBagConstraints.WEST;
                   save.setMnemonic('s');
                   gridBag.setConstraints(save, c);
                   contentPane.add(save);
                   //Set constraints for the Quit button
                   c.fill = GridBagConstraints.NONE;
                   c.weightx = 1;
                   c.weighty = 0;
                   c.gridwidth = 1;
                   c.gridx = 1;
                   c.gridy = 2;
                   c.anchor = GridBagConstraints.EAST;
                   quit.setMnemonic('q');
                   gridBag.setConstraints(quit, c);
                   contentPane.add(quit);
                   //Add ActionListener to the interactive buttons on the GUI.
                   //QUIT MENU
                   menuItemQuit.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                             quitAction();
                   //SAVE MENU
                   menuItemSave.addActionListener(new ActionListener(){
                        public void actionPerformed(ActionEvent e){
                             saveAction();
                   //QUIT BUTTON
                   quit.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e){
                             quitAction();
                   //SAVE BUTTON
                   save.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e){
                             saveAction();
                   //DROPDOWN LIST
                   yearDrop.dropDown.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e){
                             listAction();
              public void listAction(){
                   System.out.println("getSelected: "+ year[yearDrop.getSelected()]);
                   tree = new Tree(c, contentPane, gridBag, (yearDrop.getSelected()+1));
                   repaint();
         I have taken out the quitAction and saveAction methods to save space.
    I would have thought creating a new Tree object over the original tree would have updated the scrollPane.
    Any ideas would be awesome.
    Thanks in advance.

    and I create a new tree object with the new year details and nothing is changed in the scrollpane.Creating a new Tree doesn't add the tree to the scroll pane. It just changes the reference of the tree variable to point to the new Tree object. To update the scroll pane you would need to do:
    scrollPane.setViewportView( tree );
    Or another option is to just create a new TreeModel and then change the model that your existing tree is using:
    TreeModel model = new TreeModel(...);
    tree.setModel( model );

  • Small problem in refreshing JFrame

    Please help me in sorting out this small problem. I called a function on a button click. In that function i tried to change the text on a button initially then i have some code to execute and then again i set other text to the same button. But iam not able to see the initial text while execution. It is as follows
    jbut.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    connectServer(); //The function that i called
    //conncetServer function
    public void connectServer
    jbut.setText("Please Wait");
    // jbut.validate();
    try{
    Thread.sleep(10000);
    }catch(Exception e)
    jbut.setText("Disconnect");
    // jbut.validate(); This i tried
    But i am not able to see the please wait label on the screen i tried in several ways. can anyone of you tell me how to solve it..

    Hi, Problem is Gui manages its own Thread, so once u invoke a process, until it finishes GUI won't get refreshed. 2 ways to handle it.
    1. Either use SwingUtilities.invokeLater method
    Example Code.
    jbut.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    jbut.setText("Please Wait...");// set the text
    Runnable connectServerThread = new Runnable(){
    public void run()
    connectServer();
    jbut.setText("");// return back to normal.
    SwingUtilities.invokeLater(connectServerThread);
    or
    2. Implement Runnable interface in ur class and invoke the same inside run method. It will definitely work since i checked it.
    Example code.
    Thread connectServerThread = null;
    jbut.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae)
    connectServerThread = new Thread(this);
    connectServerThread.start();
    public void run()
    // set the label visible here.
    jbut.setText("Please Wait...");
    // invoke server process.
    connectServer();
    // hide the label or button here.
    jbut.setText("");
    Sreni.

  • Refreshing JTree

    I am trying to develop a file explorer for my homework.
    I have a JComboBox which lists the drives in the system.
    I have a JTree in JScrollPane which has to display the contents
    of the chosen drive.
    I have the JTree working the first time. But when I change the drive
    in JComboBox, how would I make the JTree to change
    to show the contents of new drive?
    All I have for now is to capture the comboBoxChanged event and
    find the drive the user has chosen. How should I proceed to
    refresh the JTree?
    Thanks in advance for your help.
    Matt

    Again answering my own post...
    Found the answer! Just so it will be useful for others who search,
    call to <JTree Object>.updateUI() solved this problem
    Matt

  • Displaying Refresh, Edit Page, Customize Page buttons from Banner Template

    I have built a customized banner template which displays button images for refresh, edit page, and customize page. The functions all work well, but these functions should not be invisible to the user when they do not have the proper privileges
    For Example, when page caching is enabled, I need to see the Refresh Link (icon), or when the user cannot edit the page, then the icon for page editing should not be displayed.
    What are the API calls that I can make from a banner template to decide if the page is cached or not?
    How do I tell whether the user had edit page privilege? Customize Page?
    null

    All these solutions offered above are correct related to the refresh of the page, but it seems to be other problem, it seems that when the Save button is pressed, the commit is done(after I press Save I checked the database and the row is updated), but the transaction is not ended, it seems to get stuck, this is the reason why a refresh is not done on the page, only when Cancel is pressed, the transaction finishes and the page refreshes.
    Is this possible for the inline popup, not to end the transaction even if on the task flow I have a task flow return for Save, where at the End Transaction property I have Commit?
    I have changed the task flow by setting Behaviour to <No Controler Transaction>, for the task flow returns I changed End Transaction from Commit/Rollback to none and added on the jspx page of the inline popup the Save and Cancel buttons, with actionListener="#{bindings.Commit/Rollback.execute}" but the problem remains the same.
    I suppose that it's a problem with the way I use the VO instance in the popup. Do you have any idea in what situations this can happen or did you encounter similar situations?
    Thanks,
    Georgiana

  • Programmatically refresh components inside a specific row of an af:table

    How to programmatically refresh components inside a specific row of an af:table without refreshing the whole table ?_
    I have an af:table displaying a read-only view object. There is an edit button inside the table calling an af:popup, where the user can update some informations and click a submit button to validate his changes.
    The action property of this button is a method in a backing been where
    -     1 : A stored procedure is called to update several tables (related to my read-only VO).
    -     2 : The VO is re-queried (VO. refreshQueryKeepingCurrentRow() )
    -     3 : The whole table is refreshed (AdfFacesContext.getCurrentInstance().addPartialTarget(myTable) )
    Is it possible to programmatically refresh some components of the current row of the table without refreshing the whole table (point 3)?
    I’ve tried to play with the “partialTrigger” property of af:outputText (table:column:outputText), without success.
    Thanks
    Nicolas

    "+do you happen to want to refresh following an action on the row? Like a link/button click?+" : NO
    There is a table on my page. The user select a row and click on an edit button. This edit button call a popup where the user can modify some information (not directly on the viewObject. All fields in the popup are dummy fields bind to attributes in my backing bean) and then he click on a submit button.
    The submit button action execute a method "submitInformation" in a backing been.
    public String submitInformation(){
            Map<String, Object> params = new HashMap<String, Object>();
            params.put("pManNo", xManNo.getValue()); //xManNo is an attribute of the backing bean
            params.put("pDate", xPeriod.getValue()); //xPeriod is an attribute of the backing bean
            // Execute Operation
            OperationBinding oper = ADFUtils.findOperation("serviceSubmitInfo");
            oper.getParamsMap().putAll(params);
            String results = (String)oper.execute();
            // Close Popup & Refresh Row if OK
            if(!StringUtils.isStringEmpty(results) && results.equals("TRUE")){
                 closePopup("pt1:popAbs");
                 refreshMyCol();
    }The serviceSubmitInfo method is defined in my serviceImpl
        public String serviceSubmitInfo (String pManNo, String pPeriod, ......){
             String results =
                callStoredFunction("? :=myDatabaseFunction(?, ?, ?, ?)",
                                   new Object[] { pManNo, pPeriod, ...... });
              // Commit
              getDBTransaction().commit();
              // Refresh VO (re-query & set currentRow)
              getMyVO().refreshQueryKeepingCurrentRow();         
              return results; // TRUE if ok
        }I want the " refreshMyCol()" method to refresh only the current row and not the whole table...
    Regards
    Nicolas

  • Reuse_alv_grid_display TITLE problem after refresh

    All,
    I have a alv report using fm reuse_alv_grid_display. While calling initially this fm i am passing the grid tile in I_GRID_TITLE parameter. its displaying in grid, then after user click on the app toolbar button , i am doing some filteration , then coming back to grid the TITLE is missing in display
    Any Info .  below is the code snipet
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program             = sy-repid
         i_callback_pf_status_set       = 'F_PF_STATUS_SET'
         i_callback_user_command        = gc_user_com
         i_grid_title                   = gv_gtitle "<< passing initially
    then in User_command i am filering some values on the basis of button clicked (Button placed in app toolbar)
    FORM f_user_command USING p_ucomm    LIKE sy-ucomm
                              p_selfield TYPE slis_selfield .
        WHEN '&EXP'.
          perform f_expand.
          p_selfield-refresh = 'X'.  "<<<----- refresh the grid
      code for f_expand
    form f_expand.
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'  " Getting current layout
          IMPORTING
            es_layout      = ls_layout
            et_filter      = lt_filter
            es_grid_scroll = ls_grid_scroll
            es_print       = ls_print
          EXCEPTIONS
            OTHERS         = 1.
    " Here doing some filteration. ie append some values to IT_FILTER table for enabling then filter
        perform f_set_fltr_val_exp using lt_filter[].
        ls_layout-colwidth_optimize = gc_x.
        read table gt_sfieldcat into gv_fieldcat
                          with key fieldname = 'REGIO'.
        if sy-subrc eq 0.
          gv_fieldcat-no_out = ' '.
          modify gt_sfieldcat from gv_fieldcat index sy-tabix.
        endif.
    * Set the grid title to include the parameters and the report type
      CONCATENATE text-027 p_bukrs text-028 p_perio
                  text-029 p_gjahr
             INTO gv_gtitle SEPARATED BY space.
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
          EXPORTING
            is_layout      = ls_layout
            it_fieldcat    = gt_sfieldcat
            it_sort        = gt_sort
            it_filter      = lt_filter
            is_grid_scroll = ls_grid_scroll
            is_print       = ls_print
          EXCEPTIONS
            OTHERS         = 0.
    endform.                    " F_expand

    Hi All,
    Thanks for your replies.  I have done all that has been said.  My problem is that when the user double clicks on the ALV without pressing the sort button in the ALV display, the index provided in the user-command subroutine is the same as the index of the record in the internal table.  But, when the user sorts dynamically when the ALV is displayed and then double clicks, the index of the record provided by ALV is different from the index of that record in the internal table.
    For example, when the ALV grid is shown a record is in the 1st row, and when the user double clicks now, the index of this record provided is 1 which is same as the index in the internal table.
    But, after the user sorts in the display, if this record moves to the 5th row, the index provided by ALV will become 5, but, actually the index in the internal table is still 1.
    Hope I have clarified my problem.
    Thanks,
    Sridhar

  • Problem in Passing JTree object from Servlet pgm to browser

    Dear all:
    Can anybody help to resolve the problem - pass the JTree obejct from servlet (Tomcat) to IE 6.0. The JTree oject alway shows invalid charcter in IE. Following is my coding.
    import java.io.*;
    import java.awt.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.swing.*;
    import java.net.URL;
    import java.sql.*;
    import java.lang.*;
    import java.util.*;
    import javax.swing.tree.*;
    //* Testing1 give it null
    public class SimpleServer extends HttpServlet
    DefaultMutableTreeNode top;
    DefaultMutableTreeNode EX01;
    DefaultMutableTreeNode EX02;
    DefaultMutableTreeNode QB01;
    DefaultMutableTreeNode QB02;
    DefaultMutableTreeNode N2BS;
    DefaultMutableTreeNode N2TS;
    //StringTokenizer st2, st1;
    String query;
    Connection con ;
    Statement statm;
    ResultSet res, backupRes;
    //RowSet res, backupRes;
    TreeSet treeset ;
    String [] tempArray;
    //ServletContext sc ;
    ObjectOutputStream out ;
    DefaultMutableTreeNode temp_node;
         public void doGet(HttpServletRequest req, HttpServletResponse resp)
         throws ServletException, IOException
    resp.setContentType("text/html");
    // resp.setContentType("application/octet-stream");
    System.out.println("create main node") ;
              out = new ObjectOutputStream(resp.getOutputStream());
              out.writeObject(this.set_NodeMain()); //no DB access,
         public void doPost(HttpServletRequest req, HttpServletResponse resp)
         throws ServletException, IOException
         try
         System.out.println("doPost " );
         doGet(req,resp);
              finally
         public DefaultMutableTreeNode set_NodeMain()
    top = new DefaultMutableTreeNode("Tandem");
    EX01 = new DefaultMutableTreeNode("EX01");
    EX02 = new DefaultMutableTreeNode("EX02");
    QB01 = new DefaultMutableTreeNode("QB01");
    QB02 = new DefaultMutableTreeNode("QB02");
    N2BS = new DefaultMutableTreeNode("N2BS");
    N2TS = new DefaultMutableTreeNode("N2TS");
    top.add(EX01);
    top.add(EX02);
    top.add(QB01);
    top.add(QB02);
    top.add(N2BS);
    top.add(N2TS);
    return top;
    }

    JMO - I hate seeing things like this in code:
    Just use whitespace to separate the methods.
    You can't just send a JTree to a browser. A browser has no idea how to render a Java object.
    Put that JTree inside an applet and make it part of a JSP. That'll work.
    MOD

  • Problems with broadcom wlan adapter and wlan-button.

    I've got a laptop (HP Compaq 6715S), which has an integrated wlan adapter (broadcom 4311/4312?). A couple of weeks ago the adapter was working ok with ndiswrapper and bcmwl5.inf driver, but it stopped working recently probably after ndiswrapper and/or kernel upgrade. Loading the ndiswrapper module from rc.conf made the whole system kernel panic (IRQ problem?) until I added:
    acpi=noirq
    to the kernel boot parameters. Now this error doesn't occur every time I load ndiswrapper, but the problem still exists. BCM43xx driver doesn't work either. I'm using the 64-bit arch.
    in my rc.conf I have:
    MOD_AUTOLOAD="yes"
    MOD_BLACKLIST=(pcspkr joydev bcm43xx bluetooth hci_usb pcmcia yenta_socket pcmcia_core)
    MODULES=(fglrx ieee80211 ieee80211softmac ieee80211_crypt ieee80211_crypt_wep ieee80211_crypt_tkip
    ieee80211_crypt_ccmp powernow-k8 k8temp thermal fan battery button cpufreq_powersave cpufreq_ondemand
    freq_table)
    # Scan for LVM volume groups at startup, required if you use LVM
    USELVM="no"
    DAEMONS=(syslog-ng dbus laptop-mode acpid cpufreq @alsa network wicd gdm)
    lspci:
    00:00.0 Host bridge: ATI Technologies Inc RS690 Host Bridge
    00:01.0 PCI bridge: ATI Technologies Inc RS690 PCI to PCI Bridge (Internal gfx)
    00:04.0 PCI bridge: ATI Technologies Inc Unknown device 7914
    00:05.0 PCI bridge: ATI Technologies Inc Unknown device 7915
    00:06.0 PCI bridge: ATI Technologies Inc RS690 PCI to PCI Bridge (PCI Express Port 2)
    00:12.0 SATA controller: ATI Technologies Inc SB600 Non-Raid-5 SATA
    00:13.0 USB Controller: ATI Technologies Inc SB600 USB (OHCI0)
    00:13.1 USB Controller: ATI Technologies Inc SB600 USB (OHCI1)
    00:13.2 USB Controller: ATI Technologies Inc SB600 USB (OHCI2)
    00:13.3 USB Controller: ATI Technologies Inc SB600 USB (OHCI3)
    00:13.4 USB Controller: ATI Technologies Inc SB600 USB (OHCI4)
    00:13.5 USB Controller: ATI Technologies Inc SB600 USB Controller (EHCI)
    00:14.0 SMBus: ATI Technologies Inc SBx00 SMBus Controller (rev 14)
    00:14.1 IDE interface: ATI Technologies Inc SB600 IDE
    00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia
    00:14.3 ISA bridge: ATI Technologies Inc SB600 PCI to LPC Bridge
    00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge
    00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
    00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
    00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
    00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
    01:05.0 VGA compatible controller: ATI Technologies Inc RS690M [Radeon X1200 Series]
    02:04.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b6)
    10:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5906M Fast Ethernet PCI Express (rev 02)
    30:00.0 Network controller: Broadcom Corporation BCM4312 802.11a/b/g (rev 02)
    dmesg |grep ndis (after error)
    ndiswrapper version 1.49 loaded (smp=yes, preempt=yes)
    ndiswrapper (link_pe_images:576): fixing KI_USER_SHARED_DATA address in the driver
    ndiswrapper: driver bcmwl5 (Broadcom,10/12/2006, 4.100.15.5) loaded
    Modules linked in: ndiswrapper snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss
    snd_mixer_oss container tsdev rtc_cmos rtc_core rtc_lib serio_raw evdev psmouse i2c_piix4 i2c_core ehci_hcd
    ohci_hcd shpchp pci_hotplug cpufreq_ondemand cpufreq_powersave k8temp ieee80211_crypt_ccmp
    ieee80211_crypt_tkip ieee80211_crypt_wep ieee80211softmac ieee80211 ieee80211_crypt fglrx(P) usbcore tg3
    snd_hda_intel snd_pcm snd_timer snd_page_alloc snd_hwdep snd soundcore ac button battery fan sbs thermal
    video output powernow_k8 freq_table processor ext3 jbd mbcache sd_mod sr_mod cdrom sg ahci ata_generic
    pata_atiixp libata
    [<ffffffff88405e77>] :ndiswrapper:win2lin2+0xe/0x11
    [<ffffffff883fa330>] :ndiswrapper:IoAcquireCancelSpinLock+0x10/0x20
    [<ffffffff883fae47>] :ndiswrapper:IofCompleteRequest+0x87/0x180
    [<ffffffff883fc4d2>] :ndiswrapper:pdoDispatchPnp+0x52/0x490
    [<ffffffff88400c08>] :ndiswrapper:mp_init+0xa8/0x1e0
    [<ffffffff883fa5f4>] :ndiswrapper:IofCallDriver+0x34/0xc0
    [<ffffffff883fb930>] :ndiswrapper:IoSyncForwardIrp+0x90/0xd0
    [<ffffffff88400e1b>] :ndiswrapper:NdisDispatchPnp+0xdb/0xee0
    [<ffffffff883fb1db>] :ndiswrapper:IoInitializeIrp+0x3b/0x70
    [<ffffffff88405e77>] :ndiswrapper:win2lin2+0xe/0x11
    [<ffffffff883fa5f4>] :ndiswrapper:IofCallDriver+0x34/0xc0
    [<ffffffff883fa61f>] :ndiswrapper:IofCallDriver+0x5f/0xc0
    [<ffffffff883fa330>] :ndiswrapper:IoAcquireCancelSpinLock+0x10/0x20
    [<ffffffff883fa5f4>] :ndiswrapper:IofCallDriver+0x34/0xc0
    [<ffffffff883fb6bf>] :ndiswrapper:IoBuildSynchronousFsdRequest+0x2f/0x50
    [<ffffffff883fc9fc>] :ndiswrapper:IoSendIrpTopDev+0xac/0x100
    [<ffffffff883fccff>] :ndiswrapper:pnp_start_device+0x4f/0xa0
    [<ffffffff883fcf6f>] :ndiswrapper:wrap_pnp_start_device+0x21f/0x260
    [<ffffffff883fd000>] :ndiswrapper:wrap_pnp_start_pci_device+0x50/0x60
    [<ffffffff883ef04c>] :ndiswrapper:loader_init+0x13c/0x260
    [<ffffffff883700b7>] :ndiswrapper:wrapper_init+0xb7/0xc3
    The other problem that I have is the wlan-button: The wlan adapter isn't always turned on at boot and I have found no way to turn it on from linux. It can be turned on by booting to windows or resetting the bios to defaults, but it is not very nice. I've noticed that pressing the wlan button adds one usb device:
    Bus 001 Device 003: ID 03f0:171d Hewlett-Packard
    Is there a way to fix these problems?

    lenni wrote:
    When I used to use ndiswrapper, just downloading one of the generic INF files didn't do the trick for me. I had to go to my manufacturer's homepage and download it there extract the drivers from the exe and use them in order to get my card work reliably.
    Also, have you used a 64 bit driver? This guy reckons you need it:
    http://www.linuxquestions.org/questions … ost2952703
    I guess I solved it. I have been using the 64-bit driver, but have tried the 32-bit driver from hp diver site too.  For some reason ndiswrapper seems to install a driver named "ndiswrapper" with this 32-bit driver, which is why it didn't work. So my solution was:
    1) Get the 32-bit driver from hp.com
    2) rmmod ndiswrapper
    3) remove all installed ndiswrapper drivers: ndiswrapper -r <drivername>
    4) installed the 32-bit driver: ndiswrapper -i bcmwl5.inf
    5) ndiswrapper -l gave me:
    bcmwl5 : driver installed
    device (14E4:4312) present (alternate driver: bcm43xx)
    ndiswrapper : invalid driver!
    6) Got rid of the weird ndiswrapper driver inside ndiswrapper: ndiswrapper -r ndiswrapper
    7) modprobe ndiswrapper
    Rebooted a couple of times and it seems to work ok.
    How about the wlan-button problem?

  • JTextPane inside JScrollPane

    Hi,
    I've seen a lot of possibilities to get a JTextPane into JScrollPane without wraping the text in the forum. None worked for me..
    My situation:
    JTextPane(editable=false) with given text(DefaultStyledDocument) is inside JScrollPane.
    I replace (by pressing a button) some text parts with longer text AND JTextPane wraps it!..
    I tried to set the size of the textPane to the computed line width of the longst line, but nothing happened.. (I expected the JScrollPane to show off horizontal scrollbar, because the width of JTextPane is getting bigger than the width of JScrollPane).
    Anyone knows how to put formatted text into text- or scrollpane without wraping it?
    And who allowed JTextPane to wrap my lines anyway?!
    (it's called StyledDocument and not ChaosDocument :)
    Thanks in advance!
    Raman.

    Not sure that JTextPane is the best place to start. The wrapping is controlled by ParagraphView and its underlying structure. Try looking at implementing extensions to the standard EditorKit/ViewFactory to tweak this behaviour

  • I am having an MacBok Pro 13inch,having an Startup Problem, the time i press the power button after few seconds the apple symbol appears w/a loading sign below it

    i am having an MacBook Pro 13inch  , having an Startup Problem , the time i press the power button after few seconds the apple symbol appears with a loading sign below it and wont go further ahead of it . My data is all in the hard drive .. . I even tried the Internet recovery but no use !!!! but still no respons and the recovery and macintosh hd is now lock! but earlier only the recovery is lock and after both of them is lock.  i can reinstall,... and i didnt try to back up any data bec i dont know how? so please help me to resolve my prroblem.?

    luoie wrote:
    This thing happend,, it say Disk utility stopped repairing "Macintosh HD" disk utility can't repair this disk
    Sorry, possibly you need a new hard drive or try reformating. First
    you can try something like http://www.alsoft.com/diskwarrior/  it has been known to repair disk that DiskUtility could not. YMMV and they don't give it away.
    If Disk Warrior can not repair then you need to Reformate the drive. Make sure you have a back-up in place no matter what.
    http://www.apple.com/support/backup/
    Disk Utility will tell you something about it's SMART status:

  • Problem in refreshing the data of the UI element Table

    Hi Experts,
    I am having a problem.
    I have a screen which displays list of variants in table ( variant name , variant desc )
    I am binding the entries of table in WDDOINIT method.
    but when i go back to selection screen view and come back to display variants view, WDDOINIT is not triggering.
    Now if i move the code written in WDDOINIT method to WDDOMODIFYVIEW method, its not retaining the lead selection as the binding happens on every server round trip. if i check with First_time = 'X'. its same as that of having it in WDDOINIT method.
    How do i overcome this problem of refreshing the table data.
    any clue is highly appreciated.
    Regards,
    Ajay

    hi Ajay ,
    create a custom controller for this and when u want to move from selection screen view to display variant ,
    call method of this custom controller
    DATA lo_edit TYPE REF TO ig_edit .
    lo_edit =   wd_this->get_edit_ctr( ).
      lo_edit->edit1(
    here I am calling the edit1 method of my custom controller named EDIT.
    try to move code of ur WDDOINIT here.
    it shud help
    rgds,
    amit

  • Problem with refresh of snapshot

    I am facing one problem with refresh of a snapshot. In the front end (developed in D2K) there is a PL/SQL code written which loops through user_snapshots and refreshes each snapshots one by one.
    With one particular snapshot its giving the error. I traced the session and found the problematic snapshot. I tried to refresh the same snapshot with some other user with DBA role granted to it and its working fine.
    Now I logged in to SQL Plus with the user Z0000 ( This is the user with which the application user logs in to the application) and tried to rerfresh the snapshot. Its giving me ORA-03113 end-of-file on communication channel. Then I granted DBA role to user Z000 and then tried to refresh its again giving the same error.
    I tried with many different users and its working fine.
    Any ideas where could be the problem.
    Thanks
    Sidhu
    Database is 10gR2 on AIX 5.3
    Message was edited by:
    Sidhu

    Hi,
    did you try to do it locally?
    Maybe a possible problem on the network.
    This issue remembers me a bug on older versions.
    It is strange on a 10.2
    Acr

Maybe you are looking for

  • How can I convert SQL Server 2008 Timestamp to DB2/iSeries Timestamp?

    In DB2/iSeries I have a column that accepts Timestamp value. When I try to insert a timestamp value from the SQL 2008 table and into DB2/iSeries table I recieve the following error message: OLE DB provider "IBMDA400" for linked server "XXX" returned

  • Pictures screen saver.  My "best" photos look granular. Why?

    Hello. I have a number of photos saved on my mac. Some were taken years ago with a cheap digital camera. Some were scanned in recently using a scanner. Others were taken using a more expensive, good quality, slr camera. I refer to the slr pictures as

  • Importing iPhoto Back Up from DVD - Duplicate Event Issue

    i'm trying to transfer the iphoto back ups (created in iPhoto) from DVD to my external hard drive. with the disc in, i create a new iphoto library, name it and import the "iPhoto Library" file from the DVD on to my laptop's hard drive. When i do so,

  • Calculate Date IN APEX

    Hi Friends, I have 2 Items one is date item(Date Picker) and another one is textfield item. If i pick the date from Date picker then the output will automatically come to the 2 textfield item. My Requirement output is: For Example: If i select 07.07.

  • Changing country and you get locked out of your iTunes account?

    Hi All, Can anyone help? I've sadly got nowhere with Apple sending just a cut and paste process that I've tried (and which fails to understand the point) I have n itunes account set up in the UK. I've moved myself and my UK bank account address to th