Displaying data in tableview on click of a tree node

Hi,
I am new to BSP. I created a tree structure having the tablenames as tree nodes, and now if I click on a node I want to display corresponding table data in a tableview. How can I acheive this....??
Thanks in advance,
Ravindra.

Hi Ravindra,
You can achieve this by reading the node clicked OnInput Processing and You can assign name of your table in "onNodeClick" attribute .
then onInputprocessing you can read the name of your table from
"event->server_event" .
Check this sample code .
****************OnLayout*******************************
<htmlb:content design="design2003">
  <htmlb:page title = " ">
    <htmlb:form>
        <htmlb:tree     id          = "myTree1"
                         title       = "Tree"
                         tooltip     = "Tooltip for myTree1">
            <htmlb:treeNode id="NODE1" text="TABLE1" isOpen="true" onNodeClick="TABLE1">
              </htmlb:treeNode>
              <htmlb:treeNode id="NODE2" text="TABLE2" isOpen="true" onNodeClick="TABLE2">
             </htmlb:treeNode>
                <htmlb:treeNode id="NODE3" text="TABLE3" onNodeClick="TABLE3"/>
                <htmlb:treeNode id="NODE4" text="TABLE4"onNodeClick="TABLE4" />              
              <htmlb:treeNode id="NODE5" text="TABLE5" isOpen="false" onNodeClick="TABLE5">
              </htmlb:treeNode>
                <htmlb:treeNode id="NODE6" text="TABLE6" onNodeClick="TABLE6"/>
        </htmlb:tree>
    </htmlb:form>
  </htmlb:page>
</htmlb:content>
*****************OnInputProcessing****************
CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
Data: TABLE_NAME type STRING.
Optional: test that this is an event from HTMLB library.
IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
Scenario 1: Read event from manager.
  DATA: event TYPE REF TO CL_HTMLB_EVENT.
  event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
  IF event IS NOT INITIAL AND event->name = 'tree'.
    DATA: tree_event TYPE REF TO CL_HTMLB_EVENT_TREE.
    tree_event ?= event.
   TABLE_NAME = event->server_event.
  ENDIF.
ENDIF.
Check examples given in "SBSPEXT_HTMLB" bsp application.
I hope this will help.
Regards,
Monica

Similar Messages

  • When generate automatically a JTable after a click on a tree node

    final int x[] = {0, 1, 2, 22, 0, 2, 0, 1, 0, 2};
    final int y[] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3};
    final int larg[] = {1, 1, 20, 1, 2, 21, 1, 22, 2, 22};
    final int haut[] = {1, 1, 1, 1, 1, 1, 1, 1, 22, 22};
    final int px[] = {5, 5, 85, 5, 0, 0, 0, 0, 0, 0};
    final int py[] = {2, 0, 0, 0, 2, 0, 2, 0, 94, 0};
    //****************** POSITIONNEMENT DES COMPOSANTS
    final Container conteneur = getContentPane();
    final GridBagLayout gridBg = new GridBagLayout();
    conteneur.setLayout(gridBg);
    final GridBagConstraints contrainte = new GridBagConstraints();
    contrainte.fill = contrainte.BOTH;
    //*********** JCOMBO1 **************
    borneDate1 = new JComboBox();
    Calendrier req = new Calendrier();
    String[] valCal = req.lireDansTable();
    borneDate1.addItem("");
    for (int i = 0; i<= valCal.length - 1; i++){
          borneDate1.addItem(valCal);
    contrainte.gridx = x[0];
    contrainte.gridy = y[0];
    contrainte.gridwidth = larg[0];
    contrainte.gridheight = haut[0];
    contrainte.weightx = px[0];
    contrainte.weighty = py[0];
    contrainte.insets = new Insets(1, 1, 1, 1);
    contrainte.ipadx = 20;
    gridBg.setConstraints(borneDate1, contrainte);
    conteneur.add(borneDate1);
    //*********** JCOMBO2 **************
    borneDate2 = new JComboBox();
    req = new Calendrier();
    valCal = req.lireDansTable();
    borneDate2.addItem("");
    for (int i = 0; i<= valCal.length - 1; i++){
    borneDate2.addItem(valCal[i]);
    contrainte.gridx = x[1];
    contrainte.gridy = y[1];
    contrainte.gridwidth = larg[1];
    contrainte.gridheight = haut[1];
    contrainte.weightx = px[1];
    contrainte.weighty = py[1];
    gridBg.setConstraints(borneDate2, contrainte);
    conteneur.add(borneDate2);
    //*********** JLABEL1 **************
    lbl1 = new JLabel(" Dates de S�lection.");
    contrainte.gridx = x[2];
    contrainte.gridy = y[2];
    contrainte.gridwidth = larg[2];
    contrainte.gridheight = haut[2];
    contrainte.weightx = px[2];
    contrainte.weighty = py[2];
    gridBg.setConstraints(lbl1, contrainte);
    conteneur.add(lbl1);
    //*********** BOUTON IMPRIMER **************
    btmImprimer = new JButton("IMPRIMER");
    contrainte.gridx = x[3];
    contrainte.gridy = y[3];
    contrainte.gridwidth = larg[3];
    contrainte.gridheight = haut[3];
    contrainte.weightx = px[3];
    contrainte.weighty = py[3];
    gridBg.setConstraints(btmImprimer, contrainte);
    conteneur.add(btmImprimer);
    //*********** BOUTON AUJOURD'HUI **************
    btmAujourdhui = new JButton("Ce jour");
    contrainte.gridx = x[4];
    contrainte.gridy = y[4];
    contrainte.gridwidth = larg[4];
    contrainte.gridheight = haut[4];
    contrainte.weightx = px[4];
    contrainte.weighty = py[4];
    gridBg.setConstraints(btmAujourdhui, contrainte);
    conteneur.add(btmAujourdhui);
    //*********** JLABEL 2 **************
    lbl2 = new JLabel(" Journal.");
    //lbl2.setVisible(false);
    contrainte.gridx = x[5];
    contrainte.gridy = y[5];
    contrainte.gridwidth = larg[5];
    contrainte.gridheight = haut[5];
    contrainte.weightx = px[5];
    contrainte.weighty = py[5];
    gridBg.setConstraints(lbl2, contrainte);
    conteneur.add(lbl2);
    //*********** JLABEL 3 **************
    lbl3 = new JLabel(" Adresse ");
    contrainte.gridx = x[6];
    contrainte.gridy = y[6];
    contrainte.gridwidth = larg[6];
    contrainte.gridheight = haut[6];
    contrainte.weightx = px[6];
    contrainte.weighty = py[6];
    gridBg.setConstraints(lbl3, contrainte);
    conteneur.add(lbl3);
    //*********** JTEXTFIELD **************
    txtPath = new JTextField();
    contrainte.gridx = x[7];
    contrainte.gridy = y[7];
    contrainte.gridwidth = larg[7];
    contrainte.gridheight = haut[7];
    contrainte.weightx = px[7];
    contrainte.weighty = py[7];
    gridBg.setConstraints(txtPath, contrainte);
    conteneur.add(txtPath);
    //*********** JTREE **************
    DefaultMutableTreeNode racine = new DefaultMutableTreeNode("MEDIACAST");
    //**********RECUPERER LES LIGNES ANIMATEUR*******
    parentNode = new DefaultMutableTreeNode("ANIMATEURS");
    racine.add(parentNode);
    GenererEnregistrement enregAnimateur = new GenererEnregistrement();
    String[] sEnregAnim = enregAnimateur.lireDansTable("SELECT numero_anim FROM animateur ORDER BY numero_anim", "numero_anim");
    for(int i = 0; i <= sEnregAnim.length - 1; i++){
    fils = new DefaultMutableTreeNode(sEnregAnim[i]);
    parentNode.add(fils);
    //************RECUPERER LES LIGNES COMPTE******************
    parentNode = new DefaultMutableTreeNode("COMPTES");
    racine.add(parentNode);
    GenererEnregistrement enregCompte = new GenererEnregistrement();
    String[] sEnregCompte = enregCompte.lireDansTable("SELECT id_compte FROM compte ORDER BY id_compte", "id_compte");
    for(int i = 0; i <= sEnregCompte.length - 1; i++){
    fils = new DefaultMutableTreeNode(sEnregCompte[i]);
    parentNode.add(fils);
    //************RECUPERER LES LIGNES DATE******************
    parentNode = new DefaultMutableTreeNode("DATES");
    racine.add(parentNode);
    GenererEnregistrement enregDate = new GenererEnregistrement();
    String[] sEnregDate = enregDate.lireDansTable("SELECT daty FROM calendrier ORDER BY numero_enreg", "daty");
    for(int i = 0; i <= sEnregDate.length - 1; i++){
    fils = new DefaultMutableTreeNode(sEnregDate[i]);
    parentNode.add(fils);
    //*************AFFICHAGE******************
    TreeNode root = racine;
    arbre = new JTree(root);
    JScrollPane paneTree = new JScrollPane();
    //**********EVENEMENT CLICK DROIT DANS JTREE***************
    MouseListener ml = new MouseAdapter() {
    public void mousePressed(MouseEvent e) {
    int selRow = arbre.getRowForLocation(e.getX(), e.getY());
    TreePath selPath = arbre.getPathForRow(selRow);
    if(selRow != -1) {
         if(e.getButton() == 1) {
         txtPath.setText(selPath.toString());
         //**-> CREER LE VECTEUR POUR JTable**<-
         String sPere = txtPath.getText();
         int iResComp = sPere.compareTo("[MEDIACAST, ANIMATEURS]" + arbre.getLastSelectedPathComponent().toString() + "]");
         //****ANIMATEURS***************
         switch(iResComp){
         case -49:
              String sReq = "SELECT animateur.matricule, animateur.prenom, calendrier.daty, compte.id_compte";
              sReq = sReq + " " + "FROM animateur, liaison";
              sReq = sReq + " " + "WHERE animateur.numero_anim = ? AND liaison.numero_anim = ? AND calendrier.daty = liaison.daty";
              String[] sParamIn = {
              arbre.getLastSelectedPathComponent().toString(), arbre.getLastSelectedPathComponent().toString()
              String[] sTypeParamIn = {
              "entier", "entier"
              String[] sParamOut = {
              "matricule", "prenom", "daty", "id_compte"
              GenererEnregistrement enreg = new GenererEnregistrement();
              objEnreg = enreg.retournerToutEnreg(sReq, sParamIn, sTypeParamIn, sParamOut);
              iNbEnreg = enreg.donnerNbEnreg(sReq, sParamIn, sTypeParamIn, sParamOut);
              Object[] teteTable = {
              "Matricule","Prenom","Date", "Numero Compte"
                                            data = clickTreeNode(teteTable.length, iNbEnreg, sParamOut.length, objEnreg);
              tableau = new JTable(data);
                                            //*********** JTABLE **************
              JScrollPane paneTab = new JScrollPane(tableau);
              contrainte.gridx = x[9];
              contrainte.gridy = y[9];
              contrainte.gridwidth = larg[9];
              contrainte.gridheight = haut[9];
              contrainte.weightx = px[9];
              contrainte.weighty = py[9];
              gridBg.setConstraints(paneTab, contrainte);
              conteneur.add(paneTab);
              break;
              else if(e.getButton() == 3) {
                   arbre.setSelectionPath(selPath);//Donne le focus au noeud click�
                   txtPath.setText(selPath.toString());
              //***********POUR LES NOEUDS PERES*******************************
              if(arbre.getLastSelectedPathComponent().toString() == "ANIMATEURS"){
                   System.out.println(selPath.getParentPath().toString());
              //***********POUR LES NOEUDS FILS********************************
              String sPere = txtPath.getText();
              int iResComp = sPere.compareTo("[MEDIACAST, ANIMATEURS]" + arbre.getLastSelectedPathComponent().toString() + "]");
              switch(iResComp){
                   case -49:
                        System.out.println("NOEUDS DANS ANIMATEURS:" + iResComp + " " + arbre.getLastSelectedPathComponent().toString());
                        break;
                   case 2:
                        if(arbre.getLastSelectedPathComponent().toString() != "COMPTES")
                             System.out.println("NOEUDS DANS COMPTES:" iResComp " " + arbre.getLastSelectedPathComponent().toString());
                             break;
                   case 3:
                        if(arbre.getLastSelectedPathComponent().toString() != "DATES")
                             System.out.println("NOEUDS DANS DATES:" + iResComp + " " + arbre.getLastSelectedPathComponent().toString());
                             break;
              arbre.addMouseListener(ml);
              paneTree.setViewportView(arbre);
              contrainte.gridx = x[8];
              contrainte.gridy = y[8];
              contrainte.gridwidth = larg[8];
              contrainte.gridheight = haut[8];
              contrainte.weightx = px[8];
              contrainte.weighty = py[8];
              gridBg.setConstraints(paneTree, contrainte);
              conteneur.add(paneTree);
              //Afficher la fen�tre
              ImageIcon ico = new ImageIcon("c:\\works\\mediacast\\gpao\\hlpglobe.gif");
              this.setIconImage(ico.getImage());
              //this.pack();
              this.setVisible(true);
    I want to generate automatically a table after a click on a tree node but I don't know when to procede

    Please do the following.<br><br>
    #In the location bar, type '''about:config''' and hit Enter.<br><br>
    #In the filter at the top, type: '''keyword.URL'''<br><br>
    #Double click it and remove whatever's in there and replace it with http://www.google.com/search?q= and then click OK.<br><br>
    #Close the tab
    The URL to add in "keyword.URL" becomes a link in this post, so right click it and choose "Copy Link Location" to copy it to the Windows clipboard. Then hit CTRL+V to paste it. Saves you having to type the whole thing.
    '''To reset your home page, do the following'''.<br><br>
    * Go to the site you want to set as your homepage.<br><br>
    * Click the Firefox button, go to '''Options '''| '''Options '''| '''General'''.<br><br>
    * Make sure it says "''Show My Homepage''" in the first dropdown menu.<br><br>
    * Click the button called "'''Use Current Pages'''" to set the homepage to the one you have on the screen.<br>
    N.B. Some of your plugins are out of date which exposes your system to attack. Please visit the [http://www.mozilla.com/en-US/plugincheck/ Plugins Check] page and update where necessary.
    Also, click '''Help '''| '''Check For Updates''' to update Firefox to 3.6.19

  • How to trigger event when double click on a tree node

    I have this code which creates new tab in a remote Java Class.
    treeView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<TreeItem<String>>()
       @Override
       public void changed(ObservableValue<? extends TreeItem<String>> observable, TreeItem<String> oldValue, TreeItem<String> newValue)
       System.out.println("Selected Text : " + newValue.getValue());
       // Create New Tab
       Tab tabdata = new Tab();
       Label tabALabel = new Label("Test");
      tabdata.setGraphic(tabALabel);
       DataStage.addNewTab(tabdata);
    Can you tell me how I can modify the code to open new tab when I double click on a tree node. In my code the tab is opened when I click once. What event handler do I need?

    import java.util.Arrays;
    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.StackPane;
    import javafx.scene.control.TreeCell;
    import javafx.scene.control.TreeView;
    import javafx.scene.control.TreeItem;
    import javafx.scene.control.SelectionMode;
    import javafx.util.Callback;
    public class TreeTest extends Application {
      public static void main(String[] args) {
        launch(args);
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("TreeView Test");
        primaryStage.setScene(createScene());
        primaryStage.show();
      private Scene createScene() {
        final StackPane stackPane = new StackPane();
        final TreeView<String> treeView = new TreeView<String>();
        treeView.setRoot(createModel());
        treeView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
        treeView.setCellFactory(new Callback<TreeView<String>, TreeCell<String>>() {
          @Override
          public TreeCell<String> call(TreeView<String> treeView) {
            return new ClickableTreeCell();
        stackPane.getChildren().add(treeView);
        return new Scene(stackPane);
      private TreeItem<String> createModel() {
        TreeItem<String> root = new TreeItem<String>("RootNode");
        TreeItem<String> packageA = new TreeItem<String>("package A");
        packageA.getChildren().addAll(
            Arrays.asList(new TreeItem<String>("A1"), new TreeItem<String>("A2"), new TreeItem<String>("A3"))
        TreeItem<String> packageB = new TreeItem<String>("package B");
        packageB.getChildren().addAll(
            Arrays.asList(new TreeItem<String>("B1"), new TreeItem<String>("B2"), new TreeItem<String>("B3"))
        root.getChildren().addAll(Arrays.asList(packageA, packageB));
        return root;
      private class ClickableTreeCell extends TreeCell<String> {
        ClickableTreeCell() {
          setOnMouseClicked(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
              // Handle double-clicks on non-empty cells:
              if (event.getClickCount()==2 && ! isEmpty()) {
                System.out.println("Mouse double-clicked on: " + getItem());
        @Override
        protected void updateItem(String item, boolean empty) {
          super.updateItem(item, empty);
          if (empty) {
            setText(null);
          } else {
            setText(item);

  • How to trigger an ActionListener in different class on click of a tree node

    Hi guyz,
    There are three panels inside my main Frame
    -->TopPanel,MiddlePanel and BottomPanel. I have a tree structure inside a panel. This panel along with couple more panels is in MiddlePanel. My main class is "mainClass.java". Inside that i have an actionListener for a specific button. I need to trigger that actionListener when i click one of the tree nodes in the panel i specified before. The problem is that my MiddlePanel is itself a different ".java" file which is being called in my "mainClass" when a specific button is clicked. There are different buttons in my "mainClass" file and for each one i am creating different MiddlePanels depending on the buttons clicked.
    So, if i click the tree node, i need to remove the MiddlePanel and recreate the MiddlePanel(One that will be created when a different button in the mainClass file is clicked). i.e., i need to trigger the actionListener for that corresponding button. Is there a way to do it?

    use this code to call different panel by selecting tree node.....ok
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.*;
    import java.sql.SQLException;
    import javax.swing.event.*;
    class MainTree extends JFrame
    private static final long serialVersionUID = 1L;
         CardLayout cl = new CardLayout();
         JPanel panel = new JPanel(cl);
    public MainTree() throws Exception
    JPanel blankPanel = new JPanel();
    blankPanel.setBorder(BorderFactory.createTitledBorder("Blank Panel"));
    panel.add(blankPanel,"0");
    panel.add(blankPanel,BorderLayout.CENTER);
         panel.setPreferredSize(new Dimension(800, 100));
         setSize(1000, 700);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    // getContentPane().setLayout(new GridLayout(1,2));
    getContentPane().setLayout(new BorderLayout());
    ConfigTree test = new ConfigTree();
    DefaultMutableTreeNode mainTree = (DefaultMutableTreeNode)test.buildTree();
    JTree tree = new JTree(mainTree);
    tree.setCellRenderer(new DefaultTreeCellRenderer(){
    private static final long serialVersionUID = 1L;
         public Component getTreeCellRendererComponent(JTree tree,Object value,
    boolean sel,boolean expanded,boolean leaf,int row,boolean hasFocus){
    JLabel lbl = (JLabel)super.getTreeCellRendererComponent(tree,value,sel,expanded,leaf,row,hasFocus);
    NodeWithID node = (NodeWithID)((DefaultMutableTreeNode)value).getUserObject();
    if(node.icon != null)lbl.setIcon(node.icon);
    return lbl;
    getContentPane().add(new JScrollPane(tree));
    loadCardPanels((DefaultMutableTreeNode)((DefaultTreeModel)tree.getModel()).getRoot());
    getContentPane().add(panel,BorderLayout.EAST);
         getContentPane().add(blankPanel,BorderLayout.WEST);
    // getContentPane().add(panel);
    tree.addTreeSelectionListener(new TreeSelectionListener(){
    public void valueChanged(TreeSelectionEvent tse){
    NodeWithID node =(NodeWithID)((DefaultMutableTreeNode)((TreePath)tse.getPath())
    .getLastPathComponent()).getUserObject();
    if(node.nodePanel != null)
    String cardLayoutID = node.ID;
    cl.show(panel,cardLayoutID);
    cl.show(panel,"0");
    public void loadCardPanels(DefaultMutableTreeNode dmtn)
    for(int x = 0; x < dmtn.getChildCount(); x++)
    if(((DefaultMutableTreeNode)dmtn.getChildAt(x)).isLeaf() == false)
    loadCardPanels((DefaultMutableTreeNode)dmtn.getChildAt(x));
    NodeWithID node = (NodeWithID)((DefaultMutableTreeNode)dmtn.getChildAt(x)).getUserObject();
    if(node.nodePanel != null)
    String cardLayoutID = node.ID;
    panel.add(cardLayoutID,node.nodePanel);
    public static void main(String[] args) throws Exception{new MainTree().setVisible(true);}
    class ConfigTree
    public Object buildTree() throws Exception
    NodeWithID n0 = new NodeWithID("HelpDesk","");
    NodeWithID n1 = new NodeWithID("Administrator",n0.nodeName);
    NodeWithID n2 = new NodeWithID("Report Form",n1.nodeName,new Tree().getContentPane());
    NodeWithID n3 = new NodeWithID("Create User",n2.nodeName,new JPanel());
    NodeWithID n4 = new NodeWithID("Unlock User",n2.nodeName,new unlockui().getContentPane());
    NodeWithID n5 = new NodeWithID("List User",n2.nodeName,new JPanel());
    NodeWithID n6 = new NodeWithID("Assign Role",n2.nodeName,new AssignRole());
    NodeWithID n9 = new NodeWithID("Operator",n1.nodeName,new JPanel());
    NodeWithID n10 = new NodeWithID("Create Ticket",n9.nodeName,new JPanel());
    NodeWithID n11 = new NodeWithID("My Ticket",n9.nodeName,new JPanel());
    NodeWithID n12 = new NodeWithID("All Ticket",n9.nodeName,new JPanel());
    NodeWithID n13 = new NodeWithID("Event Viewer",n1.nodeName,new JPanel());
    DefaultMutableTreeNode top = new DefaultMutableTreeNode(n0);
    DefaultMutableTreeNode branch1 = new DefaultMutableTreeNode(n1);
    top.add(branch1);
    DefaultMutableTreeNode node1_b1 = new DefaultMutableTreeNode(n2);
    DefaultMutableTreeNode n1_node1_b1 = new DefaultMutableTreeNode(n3);
    DefaultMutableTreeNode n2_node1_b1 = new DefaultMutableTreeNode(n4);
    DefaultMutableTreeNode n3_node1_b1 = new DefaultMutableTreeNode(n5);
    DefaultMutableTreeNode n4_node1_b1 = new DefaultMutableTreeNode(n6);
    branch1.add(node1_b1);
    branch1.add(n1_node1_b1);
    branch1.add(n2_node1_b1);
    branch1.add(n3_node1_b1);
    branch1.add(n4_node1_b1);
    DefaultMutableTreeNode node4_b1 = new DefaultMutableTreeNode(n9);
    DefaultMutableTreeNode n1_node4_b1 = new DefaultMutableTreeNode(n10);
    DefaultMutableTreeNode n2_node4_b1 = new DefaultMutableTreeNode(n11);
    DefaultMutableTreeNode n3_node4_b1 = new DefaultMutableTreeNode(n12);
    node4_b1.add(n1_node4_b1);
    node4_b1.add(n2_node4_b1);
    node4_b1.add(n3_node4_b1);
    DefaultMutableTreeNode node5_b1 = new DefaultMutableTreeNode(n13);
    branch1.add(node1_b1);
    branch1.add(node4_b1);
    branch1.add(node5_b1);
    return top;
    class NodeWithID
    String nodeName;
    String ID;
    JPanel nodePanel;
    ImageIcon icon;
    public NodeWithID(String nn,String parentName)
    nodeName = nn;
    ID = parentName+" - "+nodeName;
    public NodeWithID(String nn,String parentName,Container container)
    this(nn,parentName);
    nodePanel = (JPanel) container;
    nodePanel.setBorder(BorderFactory.createTitledBorder(ID + " Panel"));
    public NodeWithID(String nn,String parentName,JPanel p, ImageIcon i)
    this(nn,parentName,p);
    icon = i;
    public String toString(){return nodeName;}
    }

  • How to find the coordinates of a mouse click in a Tree node ?

    Hello
    I have a JTree that have few nodes. The nodes contain an icon and a label (using custom cell renderer) and I want to receive right clicks on the icon and show a popup menu.
    The problem is I can only get the right click on the whole tree node, not only the icon.
    I tried two approaches:
    1. register the mouse listener directly with the icon in the cell renderer. That doesnt work since the events received by the tree node do not propagate to its sub-components.
    2. Register the event with the JTree itself and then try to find which part of the tree node was clicked (see if it was within the coordinates of the icon).
    But I cant get the node's coordinates or width.
    I tried using SwingUtilities.convertPoint or SwingUtilities.ConvertMouseEvent but it just doesnt work with DefaultMutableTreeNode.
    Any ideas how to do it ?

    user11973359 wrote:
    1. register the mouse listener directly with the icon in the cell renderer. That doesnt work since the events received by the tree node do not propagate to its sub-components.No, it doesn't work because a renderer isn't added to any component hierarchy. It isn't in any way a 'sub-component'.
    Read about editor and renderer concepts in the Oracle tutorial on How to Use Tables.
    user11973359 wrote:
    2. Register the event with the JTree itself and then try to find which part of the tree node was clicked (see if it was within the coordinates of the icon).
    But I cant get the node's coordinates or width.<tt>getPathForLocation(...) </tt>in conjunction with<tt> getPathBounds(...)</tt>.
    db

  • Context Menu on the right click of af:tree node

    Hi Experts,
    I am using drag and drop functionality in af:tree.In that i used one tree for drag source and another one tree for drop target,and it is working as expected.
    Now I want to bring one additional option in the context menu of the target tree node that is ,when i right click on any of the target tree node in addition to the default menu options like "Collapse","Expand" i want to add one more option .For this i added "contextMenu" facet after the "nodeStamp" facet inside the tree.
    *<f:facet name="contextMenu">*
    *<af:popup id="p1">*
    *<af:menu text="Delete" id="m1">*
    *<af:commandMenuItem text="Delete" id="cmi1"*
    *action="#{myWorkflow.deleteWorkflowNode}"/>*
    *</af:menu>*
    *</af:popup>*
    *</f:facet*>
    Now the problem is : before using drag and drop the context menu workes without any problem .But after using drag and drop the context menu is not popped up.
    can anybody help me to resolve this?
    Thanks,
    Priya.

    Hi Frank,
    1. I am using JDeveloper 11.1.1.3 version
    2. Drop target tree is having the context menu.
    3. Yes . In Drop event am calling a backing bean method with return type DnDAction and i return the value as DnDAction.MOVE to reflect the changes in the database table to the target tree.
    Regards,
    Priya.

  • Help for Activating Editing Mode on F2 Keyboard Click for a Tree Node

    I have a Jtree with several Nodes on the Left Pane. On the Right Pane I have a nodes corresponding Screen with many properties. There is a way to change the Node Name by editing the Name Field property on the Right.
    I want to Edit the tree Node name by Clicking F2 on the selected Node, Get it in the Editable Mode, Change the name and press enter. How Do I activate this editable Mode on Click of Keyboard F2 Button.

    tree.setEditable( true );

  • How to display data in tableview based on a dropdown filter selection

    Hi All,
    I have implemented a flow logic based BSP page to display the SFLIGHTS table when I open this page it displays all records in the table SFLIGHTS. I would like the set a drop down box filter on CARRID and CONNIND. Only once the user selects the CARRID and CONNID and presses on display buttont the data for that selection in the drop down box should be displayed.
    Can you kindly share the code how I can put 2 drop down boxes and make the data retrieval on the page occur based on the dropdown box selection. The layout page is  as below. Appreciate if you could kindly share the code to implement this.
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page>
        <htmlb:form>
          <htmlb:tableView id              = "tv1"
                           visibleRowCount = "10"
                           selectionMode   = "lineEdit"
                           table           = "<%= flights %>"
                           filter = "SERVER"
                           sort = "server"
                           iterator        = "<%= iterator %>" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Thanks
    Karen

    Yeh Karen,
    What  i have written is that only.. ok fine i will tell you in detail ok...
    first what you do is if ur wrking with MVC concept in *do request * add the code for the dropdown as
    select single connid from sflights into wa_sflights.
    this code will give you the coniid  in the dropdown ok
    if you not wrking with MVC ,if its just a Flow with page login then write the same code in Oninitialization
    now if you select the connid from the dropdown and you want to display the details of the that connid in the tableview .. rite?
    then in do handle event write the code when i have written before  if itsnot MVC add in oninputProcessing
    DATA: HTMLB_EVENT TYPE REF TO CL_HTMLB_EVENT,
    W_ID TYPE STRING,
    W_VARIABLE TYPE STRING,
    tvdata TYPE REF TO CL_HTMLB_TABLEVIEW.
    IF HTMLB_EVENT IS NOT INITIAL.
    W_ID = HTMLB_EVENT->ID.
    IF W_ID EQ 'dd_project_name' . ------>this is the name of the dropdown
        DATA ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = RUNTIME->SERVER->REQUEST
                             NAME = 'dropdownListBox'
                             ID = 'dd_project_name' ).
        IF DATA IS NOT INITIAL.
          W_variable = DATA->SELECTION.
        ENDIF.
    if w_variable is not initial.
    select * from sflights into table lt_flights where connid eq w_variable.
    endif.
    now in the view you should
    <htmlb:tableView id = "tv1"
    visibleRowCount = "10"
    selectionMode = "lineEdit"
    table = "<%= lt_flights %>"
    filter = "SERVER"
    sort = "server" />
    Hope it works fine

  • How to display data in ComboBox when click on DataGrid Row.

    Hi!
         I am new to Adobe Flex. I am building one Project that was related to Comapny and Customer. First I created Company Master. Then I create Customer Master successfully and My Backkend is SQLite Database.
         My Problem is I have two files one is CustomerMaster and second one is CustomerForm.
         In CustomerMaster I have a datagrid in that data was displaying thru Array Collection. When ever we doublick on datagrid row it's displayed a CompanyForm. CompanyForm  contains TextFiled and ComboBox. TextFiled populating data but Combobox doesnot. It display always prompt message.
          Please help.
    Thanks,
    Sree Kumar

    Hi! Vibhuti Gosavi,
                          First of all thanks for your quick reply. Already I saw that link.
    Actually, In CustomerForm successfully store the information into the database. While retrieving the data problem cames. Sample Code:
    CustomerMaster:
    private function createItem():void
                                            openTab(new Object());
                                  public function openTab(customer:Object):void
                                            var children:Array = tn.getChildren();
                                            var length:int = children.length;
                                            for (var i:int = 0; i<length; i++)
                                                      if (children[i].customer.customerId == customer.customerId)
                                                                tn.selectedIndex = i;
                                                                return;
                                            var form:CustomerForm = new CustomerForm();
                                            tn.addChild(form);
                                            form.customer = customer;
                                            form.dao = dao;
                                            form.addEventListener(CustomerEvent.CREATE, customerChangeHandler),
                                                      form.addEventListener(CustomerEvent.UPDATE, customerChangeHandler),
                                                      form.addEventListener(CustomerEvent.DELETE, customerChangeHandler),
                                                      tn.selectedChild = form;
                                  private function customerChangeHandler(event:CustomerEvent):void
                                            customerArrayList = dao.findByCustomerAll();
                                            if (event.type == CustomerEvent.DELETE)
                                                      tn.removeChild(event.target as CustomerForm);
                        ]]>
              </fx:Script>
              <mx:Canvas id="container" left="12" right="12" top="12" bottom="12">
                        <mx:Canvas left="0" top="2" right="0" height="33">
                                  <mx:Button id="AddCustomer" x="1" width="108" height="32" click="createItem()"
                                                         icon="@Embed('assets/icon_plus.png')" label="Add Customer" toolTip="Add Customer"
                                                         verticalCenter="-1"/>
                        </mx:Canvas>
                        <code:SuperTabNavigator id="tn" x="0" y="39" width="681" height="197"/>
                        <mx:DataGrid id="customerList" x="1" y="262" width="680" height="231"
                                                       dataProvider="{customerArrayList}"
                                                       doubleClick="openTab(customerList.selectedItem)" doubleClickEnabled="true">
                                  <mx:columns>
                                            <mx:DataGridColumn dataField="customerId" headerText="Id"/>
                                            <mx:DataGridColumn dataField="customerName" headerText="Name" />
                                            <mx:DataGridColumn dataField="companyName" headerText="companyName" />
                                  </mx:columns>
                        </mx:DataGrid>
              </mx:Canvas>
    CustomerForm:
    public function set customer(customer:Object):void
                                            this._customer = customer;
                                  public function get customer():Object
                                            return this._customer;
                                  private function saveCustomer():void
                                            if (Validator.validateAll(customerValidators).length>0)
                                                      return;
                                            _customer.customerName = customerName.text;
                                             _customer.companyName = companyName.text;
                                            if (_customer.customerId > 0)
                                                      updateCustomer();
                                            else
                                                      insertCustomer();
                                  private function insertCustomer():void
                                            try
                                                      Alert.show(_customer.normalPkts);
                                                      dao.insertCustomer(_customer);
                                                      customerId.text = _customer.customerId;
                                                      dispatchEvent(new CustomerEvent(CustomerEvent.CREATE, _customer, true));
                                                      var alertText:String="Company Created Successfully!";
                                                      Alert.show(alertText,"",4,null,null,ConfirmMessage);
                                            catch (error:SQLError)
                                                      var alertErrorCreate:String="Company not Created...";
                                                      Alert.show(alertErrorCreate+"\n"+error.details,"",4,null,null,ErrorMessage);
                                  private function updateCustomer():void
                                            try
                                                      dao.updateCustomer(_customer);
                                                      dispatchEvent(new CustomerEvent(CustomerEvent.UPDATE, _customer, true));
                                                      var alertText:String="Company Updated Successfully!";
                                                      Alert.show(alertText,"",4,null,null,ConfirmMessage);
                                            catch (error:SQLError)
                                                      var alertErrorText:String="Company not Updated...";
                                                      Alert.show(alertErrorText+"\n"+error.details,"",4,null,null,ErrorMessage);
                                  private function deleteItem():void
                                            try
                                                      dao.deleteCustomer(_customer);
                                                      dispatchEvent(new CustomerEvent(CustomerEvent.DELETE, _customer, true));
                                            catch (error:SQLError)
                                                      Alert.show(error.details, "Error");
                        ]]>
              </mx:Script>
       <mx:Grid x="10" y="10" width="665" height="130" verticalAlign="middle">
                        <mx:GridRow width="665" height="100%">
                                  <mx:GridItem width="85" height="100%">
                                            <mx:Label width="85" text="Customer Id:"/>
                                  </mx:GridItem>
                                  <mx:GridItem width="115" height="100%">
                                            <mx:TextInput id="customerId" text="{_customer.customerId}" editable="false" width="115"/>
                                  </mx:GridItem>
                                  <mx:GridItem width="102" height="100%">
                                            <mx:Label width="102" text="Company Name:"/>
                                  </mx:GridItem>
                                  <mx:GridItem width="100" height="100%">
                                            <mx:ComboBox id="companyName" dataProvider="{companyIdList}" labelField="companyName"
                                                                           prompt="Select..." text="{_customer.companyName}" width="100"/>
                                  </mx:GridItem>
                          <mx:GridItem width="230" height="100%" horizontalAlign="center" verticalAlign="middle">
                                            <mx:Button label="Save" click="saveCustomer()"/>
                                            <mx:Button label="Delete" click="deleteItem()"/>
                                  </mx:GridItem>
                        </mx:GridRow>
              </mx:Grid>
    =====================================================================
    I have two ArrayCollections 1) companyIdList (CustomerForm)
                                              2) customerArrayList(CustomerMaster)
    please go through the bold text. Please focus on two dataProviders. These dataproviders are binding for One Combo Field.
    Thanks,
    Sree Kumar
    Message was edited by: sreekumar1976

  • How to display a search(query) on a report clicking on a tree node to open

    I need to know how can I do with that when I press on the link(on a tree node(leaf)), open on the other region in the same page a classic or interactive report with my results(passed by parameter, example: ID).
    One example are present on web site posted below:
    http://apex.oracle.com/pls/apex/f?p=36648:34:1599336964673301::NO:::
    I have tried this to composite my tree:
    select case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status, level, "NAME" as title, null as icon, "ID" as value, null as tooltip, decode(level, 1, 'f?p=&APP_ID.:106:'||:APP_SESSION||'::::P106_MAQ_ID:'||ID, 2,'f?p=&APP_ID.:106:'||:APP_SESSION||'::::::::P106_MAQ_ID:'||(ID-1000), 3,'f?p=&APP_ID.:104:'||:APP_SESSION||'::::P106_MAQ_ID:'||(ID-10000), 4,'f?p=&APP_ID.:105:'||:APP_SESSION||'::::P106_MAQ_ID:'||(ID-100000)) as link from "#OWNER#"."V_TREE1" start with "PID" is null connect by prior "ID" = "PID" order siblings by "NAME"
    But the parameter passed dont do with the report change your view to the one row with ID passed. I need to obtain the same results showed on website posted above.
    I obtained success on action to redirect to other page with Form with Report to edit, but dont to show. And i want to show and the same page.
    below the code that i obtained to redirect:
    select case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status, level, "NAME" as title, null as icon, "ID" as value, null as tooltip, decode(level, 1, 'f?p=&APP_ID.:102:'||:APP_SESSION||'::::P102_MAQ_ID:'||ID, 2,'f?p=&APP_ID.:103:'||:APP_SESSION||'::::P103_SRV_ID:'||(ID-1000), 3,'f?p=&APP_ID.:104:'||:APP_SESSION||'::::P104_INS_ID:'||(ID-10000), 4,'f?p=&APP_ID.:105:'||:APP_SESSION||'::::P105_SIS_ID:'||(ID-100000)) as link from "#OWNER#"."V_TREE1" start with "PID" is null connect by prior "ID" = "PID" order siblings by "NAME"
    Thank you so much for your help.

    Muhammad,
    you can add a user parameter (p_count), which get the default value value 1 for example. Then add a field (with some source of type character like desname) for your footer with a format trigger like
    if :p_count=1 then
         srw.set_field_char(0,'Office Copy');
    elsif :p_count=2 then
         srw.set_field_char(0,'Shop Copy');
    else
         srw.set_field_char(0,'Account Dept Copy');
    end;
    return true;
    Or you build 3 boilerplates with format triggers like
    if :p_count=1 then return true; else return false; end if; for "Office Copy" .....
    In the After Report Trigger start the Report with same paramters using a higher value for p_count as parameter. If p_count=3, do nothing in the trigger.
    Regards
    Rainer

  • Single Click on simple tree node

    Hi Experts,
    I have a problem ,please help me.
    I need event is trigger on single click on node of simple tree.There is event of double click but i need on single click only.
    If you have any test program please forward it also.
    Ankur Garg.

    i dont think for single click you can get any event in simple list... you can make hotspot on by this way single click will trigger the at line-selection event.
    REPORT  ZSPDEXDET LINE-SIZE 200 line-count 19(4).
    TABLES : MAST,STPO,MARA,MARC.
    INCLUDE <SYMBOL>.
    DATA : BEGIN OF I_BOM OCCURS 0.
            INCLUDE STRUCTURE STPOX.
    DATA : END OF I_BOM.
    DATA : BEGIN OF ITAB OCCURS 0,
           STUFE LIKE STPOX-STUFE,
           IDNRK LIKE STPOX-IDNRK,
           WEGXX LIKE STPOX-WEGXX, "NODE NO
           TTIDX LIKE STPOX-TTIDX, "NODE NO WITH PARENTNODE + 1
           VWEGX LIKE STPOX-VWEGX, "NODE NO OF PARENT
           MENGE LIKE STPOX-MENGE,
           SYMBOL,
           END OF ITAB.
    DATA : ITAB1 LIKE ITAB OCCURS 0 WITH HEADER LINE,
           ITAB2 LIKE ITAB OCCURS 0 WITH HEADER LINE.
    DATA : V_PARENTID LIKE STPOX-VWEGX,
           V_WEGXX LIKE STPOX-WEGXX,
           V_STUFE LIKE STPOX-STUFE,
           PREV_STUFE LIKE STPOX-STUFE.
    DATA : V_OFFSET TYPE I VALUE 1,
           V_CONTENT TYPE I,
           TABIX LIKE SY-TABIX,
           V_TABIX LIKE SY-TABIX,
           T_TABIX LIKE SY-TABIX,
           V_SYMBOL,
           V_LINE LIKE SY-TABIX,
           T_INDEX TYPE I.
    DATA :  V_PAGE LIKE SY-PAGNO,
            T_PAGE LIKE SY-PAGNO,
            V_LIN LIKE SY-LILLI.
    PARAMETERS : P_MATNR LIKE MAST-MATNR,
                 P_WERKS LIKE MARC-WERKS.
    PERFORM BOM_EXPLODE.
    ITAB1[] = ITAB[].
    READ TABLE ITAB1 INDEX 1.
    APPEND ITAB1 TO ITAB2.
    PERFORM PRINT TABLES ITAB2.
    AT LINE-SELECTION.
      V_LIN = SY-LILLI.
      T_PAGE = V_PAGE.
      PREV_STUFE = ITAB2-STUFE.
      V_STUFE = ITAB2-STUFE + 1.
      V_WEGXX = ITAB2-WEGXX.
      V_SYMBOL = ITAB2-SYMBOL.
      IF ITAB2-SYMBOL = '+'.
        ITAB2-SYMBOL = '-'.
        MODIFY ITAB2 INDEX V_TABIX.
      ELSEIF ITAB2-SYMBOL = '-'.
        ITAB2-SYMBOL = '+'.
        MODIFY ITAB2 INDEX V_TABIX.
      ENDIF.
      LOOP AT ITAB WHERE STUFE = V_STUFE AND VWEGX = V_WEGXX.
        V_TABIX = V_TABIX + 1.
        IF V_SYMBOL = '+'.
          MOVE-CORRESPONDING ITAB TO ITAB2.
          ITAB2-SYMBOL = '+'.
          INSERT ITAB2 INDEX V_TABIX.
        ELSEIF V_SYMBOL = '-'.
         IF V_TABIX GT 2.
          LOOP AT ITAB2 FROM V_TABIX WHERE STUFE = PREV_STUFE.
            T_TABIX = SY-TABIX.
            T_TABIX = T_TABIX - 1.
            EXIT.
          ENDLOOP.
           IF V_TABIX LE T_TABIX.
            DELETE ITAB2 FROM V_TABIX TO T_TABIX.
           ELSE.
            LOOP AT ITAB2 FROM V_TABIX.
    *          T_TABIX = T_TABIX + 1.
              IF ITAB2-STUFE GT PREV_STUFE.
               DELETE ITAB2 INDEX SY-TABIX.
              ELSE.
                EXIT.
              ENDIF.
            ENDLOOP.
    *        DELETE ITAB2 FROM V_TABIX WHERE STUFE LT V_STUFE.
           ENDIF.
           EXIT.
          ELSE.
            DELETE ITAB2 FROM V_TABIX.
            EXIT.
          ENDIF.
        ENDIF.
      ENDLOOP.
      SY-LSIND = 0.
      T_INDEX = 1.
      PERFORM PRINT TABLES ITAB2.
      SCROLL LIST INDEX T_INDEX TO PAGE T_PAGE . " LINE V_LIN .
    *&      Form  BOM_EXPLODE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM BOM_EXPLODE .
      CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
        EXPORTING
          CAPID                 = 'PP01'
          DATUV                 = SY-DATUM
          MEHRS                 = 'X'
          MTNRV                 = P_MATNR
          WERKS                 = P_WERKS
        TABLES
          STB                   = I_BOM
        EXCEPTIONS
          ALT_NOT_FOUND         = 1
          CALL_INVALID          = 2
          MATERIAL_NOT_FOUND    = 3
          MISSING_AUTHORIZATION = 4
          NO_BOM_FOUND          = 5
          NO_PLANT_DATA         = 6
          NO_SUITABLE_BOM_FOUND = 7
          CONVERSION_ERROR      = 8
          OTHERS                = 9.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ITAB-IDNRK = P_MATNR.
      ITAB-MENGE = '1'.
      ITAB-STUFE = '0'.
      ITAB-WEGXX = '0'.
      ITAB-TTIDX = '0'.
      ITAB-VWEGX = '-1'.
      ITAB-SYMBOL = '+'.
      APPEND ITAB.
      CLEAR ITAB.
      LOOP AT I_BOM.
        MOVE-CORRESPONDING I_BOM TO ITAB.
        APPEND ITAB.
        CLEAR ITAB.
      ENDLOOP.
    ENDFORM.                    " BOM_EXPLODE
    *&      Form  PRINT
    *       text
    *      -->P_ITAB1  text
    FORM PRINT  TABLES   P_ITAB1 STRUCTURE ITAB.
      DATA : V_ID LIKE STPOX-VWEGX.
      DATA : T_LINE LIKE SY-TABIX,
             V_LINE TYPE I,
             V_HLINE TYPE I.
      DATA : PAGE TYPE I.
      DESCRIBE TABLE P_ITAB1 LINES V_LINE.
      T_LINE = V_LINE - 1.
      LOOP AT P_ITAB1.
        V_OFFSET = P_ITAB1-STUFE * 3.
        V_CONTENT = P_ITAB1-STUFE * 6.
        V_LINE = P_ITAB1-STUFE * 4.
        IF P_ITAB1-STUFE NE 0.
          V_HLINE = V_LINE + 2.
        ELSE.
          V_HLINE = 2.
        ENDIF.
    *    T_INDEX = T_INDEX + 1.
        COMPUTE PAGE = SY-TABIX MOD 13.
        IF PAGE EQ 0.
          NEW-PAGE.
          V_PAGE = SY-PAGNO.
    *     T_INDEX = 0.
        ENDIF.
        V_TABIX = SY-TABIX.
        IF P_ITAB1-SYMBOL = '+'.
           WRITE : /.
            WRITE AT : V_OFFSET  SYM_PLUS_FOLDER AS SYMBOL
                    COLOR 4 INTENSIFIED HOTSPOT.
            WRITE : AT V_CONTENT P_ITAB1-IDNRK,P_ITAB1-MENGE.
          HIDE : P_ITAB1,V_TABIX,V_PAGE.
        ELSEIF P_ITAB1-SYMBOL = '-'.
          WRITE : /.
          WRITE AT V_OFFSET SYM_MINUS_FOLDER AS SYMBOL
                    COLOR 4 INTENSIFIED HOTSPOT.
          WRITE : AT V_CONTENT P_ITAB1-IDNRK,P_ITAB1-MENGE.
          HIDE : P_ITAB1,V_TABIX,V_PAGE.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " PRINT
    regards
    shiba dutta

  • Read only table not displaying data

    hi my read only table is not dispalying data when the page load,am in jdeveloper 11.1.1.6.0
    <af:query id="qryId1" headerText="Search" disclosed="true"
                          value="#{bindings.ImplicitViewCriteriaQuery.queryDescriptor}"
                          model="#{bindings.ImplicitViewCriteriaQuery.queryModel}"
                          queryListener="#{bindings.ImplicitViewCriteriaQuery.processQuery}"
                          queryOperationListener="#{bindings.ImplicitViewCriteriaQuery.processQueryOperation}"
                          partialTriggers="::t1"/>
              </af:panelHeader>
              <af:panelGroupLayout id="pgl1" halign="left" valign="middle"
                                   layout="vertical" inlineStyle="width:1806px;">
                <af:table value="#{bindings.CfgTablesView1.collectionModel}"
                          var="row" rows="#{bindings.CfgTablesView1.rangeSize}"
                          emptyText="#{bindings.CfgTablesView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                          fetchSize="#{bindings.CfgTablesView1.rangeSize}"
                          rowBandingInterval="0" id="t1" width="705"
                          inlineStyle="height:500px;">
                  <af:column sortProperty="Tablename" sortable="false"
                             headerText="#{bindings.CfgTablesView1.hints.Tablename.label}"
                             id="c1">
                    <af:outputText value="#{row.Tablename}" id="ot1"/>
                  </af:column>
                  <af:column sortProperty="Description" sortable="false"
                             headerText="#{bindings.CfgTablesView1.hints.Description.label}"
                             id="c2">
                    <af:outputText value="#{row.Description}" id="ot2"/>
                  </af:column>
                </af:table>it show no data to display even if there is data in the database
    Edited by: adf0994 on 2012/11/15 9:43 AM
    Edited by: adf0994 on 2012/11/15 9:45 AM
    Edited by: adf0994 on 2012/11/15 10:02 AM
    Edited by: adf0994 on 2012/11/15 10:09 AM

    ok i did that is working,but the problem is when the page load it does not display data,i have to click search button and on my query panel and click refersh than able to see data
    <?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:panelHeader text="Maintain Schema" id="ph1"
                      inlineStyle="height:853px; border-color:Lime; border-style:ridge;">
        <f:facet name="context"/>
        <f:facet name="menuBar"/>
        <f:facet name="toolbar">
          <af:outputLabel value="CF-L-017" id="ol1"/>
        </f:facet>
        <f:facet name="legend"/>
        <f:facet name="info"/>
        <af:panelStretchLayout id="psl1" inlineStyle="width:1869px; height:801px;"
                               bottomHeight="345px">
          <f:facet name="bottom">
            <af:panelGroupLayout layout="scroll"
                                 xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                                 id="pgl3" inlineStyle="width:1950px;">
              <af:panelStretchLayout id="psl2"
                                     inlineStyle="width:1861px; height:376px;"
                                     endWidth="4px">
                <f:facet name="center">
                  <af:panelHeader text="Fields" id="ph6"
                                  inlineStyle="height:500px; border-color:Lime; border-style:ridge;">
                    <f:facet name="context"/>
                    <f:facet name="menuBar"/>
                    <f:facet name="toolbar"/>
                    <f:facet name="legend"/>
                    <f:facet name="info"/>
                    <af:table value="#{bindings.CfgFieldsView1.collectionModel}"
                              var="row" rows="#{bindings.CfgFieldsView1.rangeSize}"
                              emptyText="#{bindings.CfgFieldsView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                              fetchSize="#{bindings.CfgFieldsView1.rangeSize}"
                              rowBandingInterval="0"
                              selectedRowKeys="#{bindings.CfgFieldsView1.collectionModel.selectedRow}"
                              selectionListener="#{bindings.CfgFieldsView1.collectionModel.makeCurrent}"
                              rowSelection="single" id="t2"
                              partialTriggers="::cb2 ::cb5 ::cb6 ::cb4 ::cb3 ::t1"
                              inlineStyle="height:164px;" columnStretching="last"
                              width="918">
                      <af:column sortProperty="Fieldlabel" sortable="true"
                                 headerText="#{bindings.CfgFieldsView1.hints.Fieldlabel.label}"
                                 id="c7">
                        <af:outputText value="#{row.Fieldlabel}" id="ot4"/>
                      </af:column>
                      <af:column sortProperty="Format" sortable="true"
                                 headerText="#{bindings.CfgFieldsView1.hints.Format.label}"
                                 id="c4">
                        <af:outputText value="#{row.Format}" id="ot7"/>
                      </af:column>
                      <af:column sortProperty="Type" sortable="true"
                                 headerText="#{bindings.CfgFieldsView1.hints.Type.label}"
                                 id="c3">
                        <af:outputText value="#{row.Type}" id="ot6"/>
                      </af:column>
                      <af:column sortProperty="Length" sortable="true"
                                 headerText="#{bindings.CfgFieldsView1.hints.Length.label}"
                                 id="c6">
                        <af:outputText value="#{row.Length}" id="ot3">
                          <af:convertNumber groupingUsed="false"
                                            pattern="#{bindings.CfgFieldsView1.hints.Length.format}"/>
                        </af:outputText>
                      </af:column>
                      <af:column sortProperty="Fielddescription" sortable="true"
                                 headerText="#{bindings.CfgFieldsView1.hints.Fielddescription.label}"
                                 id="c5">
                        <af:outputText value="#{row.Fielddescription}" id="ot5"/>
                      </af:column>
                    </af:table>
                    <af:panelHeader text="Details" id="ph4"
                                    inlineStyle="height:191px; border-style:ridge; border-color:Lime;">
                      <f:facet name="context"/>
                      <f:facet name="menuBar"/>
                      <f:facet name="toolbar"/>
                      <f:facet name="legend"/>
                      <f:facet name="info"/>
                      <af:panelFormLayout id="pfl1" maxColumns="2" rows="3"
                                          partialTriggers="t1"
                                          inlineStyle="width:589px;">
                        <af:inputText value="#{bindings.Fieldlabel.inputValue}"
                                      label="#{bindings.Fieldlabel.hints.label}"
                                      required="#{bindings.Fieldlabel.hints.mandatory}"
                                      columns="20"
                                      maximumLength="#{bindings.Fieldlabel.hints.precision}"
                                      shortDesc="#{bindings.Fieldlabel.hints.tooltip}"
                                      id="it4">
                          <f:validator binding="#{bindings.Fieldlabel.validator}"/>
                        </af:inputText>
                        <af:inputText value="#{bindings.Format.inputValue}"
                                      label="#{bindings.Format.hints.label}"
                                      required="#{bindings.Format.hints.mandatory}"
                                      columns="20"
                                      maximumLength="#{bindings.Format.hints.precision}"
                                      shortDesc="#{bindings.Format.hints.tooltip}"
                                      id="it3">
                          <f:validator binding="#{bindings.Format.validator}"/>
                        </af:inputText>
                        <af:selectOneChoice value="#{bindings.Type.inputValue}"
                                            label="#{bindings.Type.label}"
                                            required="#{bindings.Type.hints.mandatory}"
                                            shortDesc="#{bindings.Type.hints.tooltip}"
                                            id="soc1">
                          <f:selectItems value="#{bindings.Type.items}" id="si1"/>
                        </af:selectOneChoice>
                        <af:inputText value="#{bindings.Length.inputValue}"
                                      label="#{bindings.Length.hints.label}"
                                      required="#{bindings.Length.hints.mandatory}"
                                      columns="20"
                                      maximumLength="#{bindings.Length.hints.precision}"
                                      shortDesc="#{bindings.Length.hints.tooltip}"
                                      id="it2">
                          <f:validator binding="#{bindings.Length.validator}"/>
                          <af:convertNumber groupingUsed="false"
                                            pattern="#{bindings.Length.format}"/>
                        </af:inputText>
                        <af:inputText value="#{bindings.Fielddescription.inputValue}"
                                      label="#{bindings.Fielddescription.hints.label}"
                                      required="#{bindings.Fielddescription.hints.mandatory}"
                                      columns="20"
                                      maximumLength="#{bindings.Fielddescription.hints.precision}"
                                      shortDesc="#{bindings.Fielddescription.hints.tooltip}"
                                      id="it1">
                          <f:validator binding="#{bindings.Fielddescription.validator}"/>
                        </af:inputText>
                        <f:facet name="footer">
                          <af:panelGroupLayout layout="vertical" id="pgl5">
                            <af:panelGroupLayout layout="horizontal" id="pgl2">
                              <af:commandButton actionListener="#{bindings.First.execute}"
                                                text="First"
                                                partialSubmit="true" id="cb2"/>
                              <af:commandButton actionListener="#{bindings.CreateInsert.execute}"
                                                text="Add New"
                                                id="cb5"/>
                              <af:commandButton actionListener="#{bindings.Commit.execute}"
                                                text="Save"
                                                id="cb7"/>
                              <af:commandButton actionListener="#{bindings.Delete.execute}"
                                                text="Delete"
                                                id="cb6"/>
                              <af:commandButton actionListener="#{bindings.Next.execute}"
                                                text="Next"
                                                partialSubmit="true" id="cb4"/>
                              <af:commandButton actionListener="#{bindings.Last.execute}"
                                                text="Last"
                                                partialSubmit="true" id="cb3"/>
                            </af:panelGroupLayout>
                            <af:commandButton text="Submit" id="cb1"/>
                          </af:panelGroupLayout>
                        </f:facet>
                      </af:panelFormLayout>
                    </af:panelHeader>
                  </af:panelHeader>
                </f:facet>
                <f:facet name="end"/>
              </af:panelStretchLayout>
            </af:panelGroupLayout>
          </f:facet>
          <f:facet name="center">
            <af:panelHeader text="Tables" id="ph2"
                            inlineStyle="height:500px; border-color:Lime; border-style:ridge;">
              <f:facet name="context"/>
              <f:facet name="menuBar"/>
              <f:facet name="toolbar"/>
              <f:facet name="legend"/>
              <f:facet name="info"/>
              <af:panelHeader text="Filter" id="ph3"
                              inlineStyle="height:165px; border-style:ridge; border-color:Lime;">
                <f:facet name="context"/>
                <f:facet name="menuBar"/>
                <f:facet name="toolbar"/>
                <f:facet name="legend"/>
                <f:facet name="info"/>
                <af:query id="qryId1" headerText="Search" disclosed="true"
                          value="#{bindings.ImplicitViewCriteriaQuery.queryDescriptor}"
                          model="#{bindings.ImplicitViewCriteriaQuery.queryModel}"
                          queryListener="#{bindings.ImplicitViewCriteriaQuery.processQuery}"
                          queryOperationListener="#{bindings.ImplicitViewCriteriaQuery.processQueryOperation}"
                          partialTriggers="::t1"/>
              </af:panelHeader>
              <af:panelGroupLayout id="pgl1" halign="left" valign="middle"
                                   layout="vertical"
                                   inlineStyle="width:1796px; height:298px;">
                <af:table value="#{bindings.CfgTablesView11.collectionModel}"
                          var="row" rows="#{bindings.CfgTablesView11.rangeSize}"
                          emptyText="#{bindings.CfgTablesView11.viewable ? 'No data to display.' : 'Access Denied.'}"
                          fetchSize="#{bindings.CfgTablesView11.rangeSize}"
                          rowBandingInterval="0" id="t1" width="833"
                          inlineStyle="height:186px;" columnStretching="last"
                          columnSelection="multiple"
                          partialTriggers="::cb8 ::cb10 ::cb9"
                          rowSelection="single"
                          selectedRowKeys="#{bindings.CfgTablesView11.collectionModel.selectedRow}"
                          selectionListener="#{bindings.CfgTablesView11.collectionModel.makeCurrent}">
                  <af:column sortProperty="Tablename" sortable="true"
                             headerText="#{bindings.CfgTablesView11.hints.Tablename.label}"
                             id="c2">
                    <af:outputText value="#{row.Tablename}" id="ot2"/>
                  </af:column>
                  <af:column sortProperty="Description" sortable="true"
                             headerText="#{bindings.CfgTablesView11.hints.Description.label}"
                             id="c1">
                    <af:outputText value="#{row.Description}" id="ot1"/>
                  </af:column>
                </af:table>
                <af:panelFormLayout id="pfl2" maxColumns="3" rows="1">
                  <f:facet name="footer"/>
                  <af:panelGroupLayout id="pgl6" layout="horizontal" valign="middle"
                                       halign="right" inlineStyle="width:1228px;">
                    <af:inputText value="#{bindings.Tablename.inputValue}"
                                  label="#{bindings.Tablename.hints.label}"
                                  required="#{bindings.Tablename.hints.mandatory}"
                                  columns="#{bindings.Tablename.hints.displayWidth}"
                                  maximumLength="#{bindings.Tablename.hints.precision}"
                                  shortDesc="#{bindings.Tablename.hints.tooltip}"
                                  id="it5">
                      <f:validator binding="#{bindings.Tablename.validator}"/>
                    </af:inputText>
                    <af:inputText value="#{bindings.Description.inputValue}"
                                  label="#{bindings.Description.hints.label}"
                                  required="#{bindings.Description.hints.mandatory}"
                                  columns="#{bindings.Description.hints.displayWidth}"
                                  maximumLength="#{bindings.Description.hints.precision}"
                                  shortDesc="#{bindings.Description.hints.tooltip}"
                                  id="it6">
                      <f:validator binding="#{bindings.Description.validator}"/>
                    </af:inputText>
                    <af:commandButton text="Add New" id="cb8"
                                      actionListener="#{bindings.CreateInsert1.execute}"/>
                    <af:commandButton actionListener="#{bindings.Commit.execute}"
                                      text="Save" id="cb9"/>
                    <af:commandButton actionListener="#{bindings.Delete1.execute}"
                                      text="Delete" id="cb10"/>
                  </af:panelGroupLayout>
                </af:panelFormLayout>
              </af:panelGroupLayout>
            </af:panelHeader>
          </f:facet>
        </af:panelStretchLayout>
      </af:panelHeader>
    </jsp:root>

  • On right click, the focus is not set on tree node.

    Dear members,
    I have a tree and a database block, when i right click on a tree node, the focus is not set on the node.
    If I first click on the node and then right click on selected node it populate the database block.
    But I want to populate the datablock on right click.
    how to implement it?
    Regards:

    No body ever encountered this problem?
    Any advice would be appreciated.
    Thanks

  • Right click tree node

    Hello all,
    I need to process right click on the tree node. I can get the node and process the action well. But the problem is that the selected node doesn't have a gray box (selection indicator) like when I left click it.
    Please help me with this,
    Thanks,
    Fantabk

    Dear Siva,
    You can follow the following steps:-
    - Create local class (eg:- lcl_screen_handler) as handler class.
    - Define and implement methods handle_node_context_menu_req and handle_node_context_menu_sel for handling right click.
    - In Method handle_node_context_menu_req use CALL METHOD menu->add_function for adding entries to context menu.
    - In Method handle_node_context_menu_sel based on node_key and fcode handle logic for right click.
    - Define event handler (eg:- grc_event_handler     TYPE REF TO lcl_screen_handler) to handle events for right click on tree.
    - After creating Tree, specify events that are to be handled and assign them to tree instance
    eg:- lwa_event-eventid = cl_simple_tree_model=>eventid_node_double_click.
          lwa_event-appl_event = ' '.   "system event, does not trigger PAI
          APPEND lwa_event TO lit_event. (where, lit_event TYPE cntl_simple_events)
    - Also, register PAI for context menu as follows:-
    Process PAI if context menu select event occurs
      CALL METHOD grc_tree->set_ctx_menu_select_event_appl (where grc_tree is Tree instance)
        EXPORTING
          appl_event = 'X'.
    - Register Tree events as follows:-
    CALL METHOD grc_tree->set_registered_events
        EXPORTING
          events                    = lit_event ....
    - Create event handler instance for tree
      CREATE OBJECT grc_event_handler. (where, grc_event_handler is already declared on top)
    - Set event handler method to handle various events on tree node
    eg:-  SET HANDLER grc_event_handler->handle_node_double_click FOR grc_tree.
            SET HANDLER grc_event_handler->handle_node_context_menu_req FOR grc_tree.
            SET HANDLER grc_event_handler->handle_node_context_menu_sel FOR grc_tree.
    The events should be handled now. I have followed this approach and it worked for me.
    Regards,
    Ashish

  • How to display an alert message on click of link in tableview

    Hi,
    Following is the code for a tableview in layout section of a BSP( i have specified only one tableview column here). The requirement is to display an alert message on click of link in the first column that is "evbeg". Can anyone please help me how to achieve this? Appreciate quick response on this.
    CREATE OBJECT lr_dateiterator TYPE cl_lso_bsp_it_trdates
                EXPORTING im_application = application
                im_tform = trainingform.
            <htmlb:tableView id            = "dates"
                                 table         = "<%= dates %>"
                                 iterator      = "<%= lr_dateiterator %>"
                                 width         = "100%"
                                 rowCount      = "<%= lp_len %>"
                                 footerVisible = "FALSE"
                                 sort          = "SERVER" >
                  <htmlb:tableViewColumn columnName    = "evbeg"
                                         type          = "user"
                                         title         = "<%= otr(LSO_FRONTEND/schedule) %>"
                                         tooltipHeader = "<%= otr(LSO_FRONTEND/schedule) %>"
                                         sort          = "TRUE" >
                  </htmlb:tableViewColum>
    Thanks and Regards,
    Archana.

    you have to code in the iterator for this.
    in the render_cellstart method of the iterator you need to code.
    this is for a column.
    when 'MATNR'.
    data: text type string.
    text = 'disp_alert()'.   "this java script i placed in the page
    data: lo_link type ref to cl_htmlb_link.
      create object lo_link.
         lo_link->id = p_cell_id.
         lo_link->onclientclick = text.
         lo_link->text = <fs>-matnr.
         p_replacement_bee = lo_link.
    below is the java script i added in my page..
    <  sc ri   pt type="text/javasc ript"   >
    f u n  ction disp_alert()
    a  l e  rt("helloworld");
    < /s  c ript >

Maybe you are looking for

  • Why Light & Function Keys no longer working?

    Function keys from F1 through F5 do not workon my Macbook. All others do, including the F12 Dashboard command. They did work before I cloned my prior laptop configuration onto the Macbook. I was wondering if there was a way to fix this, such as reins

  • Problem in Transporting Function module

    Hi, I have created a bapi(RFC). For testing I created several copies and Bapi Object and the last version got sucessful . but now I am getting problem in transportation, I have included the FM and Function group in the new request no but the include

  • ROLL UP WITHOUT A FUNCTION

    HI, I have a typical Query requirement, which needs to do roll up but I cant use any of the analytical function . Thats a restriction . Here is the detail of my requirements. Now lets say there are two tables. One stores the WBS Detail. The second on

  • Finder Sidebar seems locked

    My finder sidebar appears to be locked.  I have a folder and a jpeg in the places section and I can't get them out.  When I pull them out of the finder they just pop back in.  Any thoughts on how to remove them or unlock the sidebar.  Thanks, Chuck

  • Editing text in elements 11

    I purchased a well designed sample resume and opened it with my elements 11 to edit the text. But I do not know how to. Can somebody help me in this?