Dynamic input to create JTree

I provide path in String form
Example:
/home/fsloke/chemistry/1.txt
/home/fsloke/physic/2.txt
/home/fsloke/physic/general/3.txt
Expected output in the tree
+Home
+ fsloke
+chemistry
- 1.txt
+physic
-2.txt
+general
-3,txt
I headache now. How I should put the String into JTree form
I think about recursive ... but I can't construct the Tree....
One more problem:
Last time I play with lical file system, here I can compare which is directory and which is file. In experience that when we are using the DefaultModeITree, we should have child to attach with root so the root can appear as Directory icon.
The problem is when our Directory do not have any attach to it, the icon will become paint file.... NO longer Directory icon
*** I hope you all can understand what I expressing... Cheer...
-fsloke

You can use <b>Value Help Configuration Wizard</b> for multiple selecion of rows to act as input for another table or form view.
The wizard generates an embedded iView that represents the value help dialog box and its functionality. Next to the input field, the wizard also generates a value help button. At runtime, when the user presses the button, the dialog box appears and lists values for the input field.
In your case you can select multiple rows by enabling "Multiple selection" while creating the Iview.
Have a look at <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/b5/036d391f074f769e00602634ee9960/frameset.htm">Value Help Configuration Wizard</a> for more details.
Regards,
Ankit
Reward points if helpful.

Similar Messages

  • Add Dynamic Input field

    Hi...Experts am new in ABAP Webdynpro. Actually my application is Add Dynamic Input Field in webdynpro. Already One lable, one Input field is there and I add one more button. When I click that button Dynamically Adding same like existing lable and inputfield.Can anyone tel me how to resolve my problem.

    Hi..Yugesh
    U will try this,Definitly Ul get Answer.
    For Dynamically creating Attribute
    DATA : rootnode_info TYPE REF TO if_wd_context_node_info,
    dyn_node_info TYPE REF TO if_wd_context_node_info,
    dyn_node TYPE REF TO if_wd_context_node.
    DATA : dyn_attr_info TYPE wdr_context_attribute_info.
    dyn_attr_info-name = 'NAME'. Attribute Name
    dyn_attr_info-DEFAULT_VALUE = 'Prakash'. +Iam Setting Default value of attribute,u can change as per ur requirement +
    dyn_attr_info-type_name = 'ZDE_NAME' . Data Element(CHAR20) ( Type Of Attribute )
    rootnode_info = wd_context->get_node_info( ).
    CALL METHOD rootnode_info->add_attribute
    EXPORTING
    attribute_info = dyn_attr_info.
    This will create a attribute at run time...
    For Dynamically creating Input Field
    DATA lr_container TYPE REF TO cl_wd_uielement_container.
    DATA lr_input TYPE REF TO cl_wd_input_field.
    DATA lr_table TYPE REF TO cl_wd_table.
    DATA lo_nd_sflight TYPE REF TO if_wd_context_node.
    DATA lr_button TYPE REF TO cl_wd_button.
    DATA lr_grid_data TYPE REF TO cl_wd_grid_data.
    DATA lr_flow_data TYPE REF TO cl_wd_flow_data.
    DATA lr_matrix TYPE REF TO cl_wd_matrix_head_data.
    +Note : Before that change the Layout of ROOTUIELEMENTCONTAINER to MATRIX LAYOUT +
    navigate from <CONTEXT> to <SFLIGHT> via lead selection
    lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    CALL METHOD cl_wd_input_field=>new_input_field
    EXPORTING
    bind_value = 'NAME' + attribute which i created above+
    id = 'INPUT1'
    RECEIVING
    control = lr_input.
    lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_input ).
    lr_input->set_layout_data( lr_matrix ).
    CALL METHOD lr_container->add_child
    EXPORTING
    index = 1
    the_child = lr_input.
    ENDIF.
    Code it in WDDOMODIFYVIEW...

  • Dynamic input

    Hi
    I am displaying a SAPSCIPT through program.Before displaying it I have to choose groupvalues or individual value.If it is individual then i don't have any problem because I have to display the dialog box which accepts details and current status values of that particular individual only once.But I don't know how to display dailog box which accepts these 2 values dynamically without knowing the number before for groupvalues.Because the group which we select may have 3,4 or any other number of individual values.Please help me.
    Thank You.
    Regards
    Giri.

    Hi giri
    I think TAB STRIP is the way to go.
    to create dynamic input
    http://www.geocities.com/rmtiwari/main.html?http://www.geocities.com/rmtiwari/Resources/Utilities/ABAPReference/ABAPSELECTION-SCREEN_DEFINITION.htm
    Reward all helpfull answers
    Regards
    Pavan
    Message was edited by:
            pavan praveen

  • Hashtable or Vector to create Jtree ?Data from dtatbase.

    I want build JTree in JApplet .
    The JApplet is connecting to a database .
    As soon as data change ,JTree change.
    1.How can use hashtable or Vector to create Jtree ?
    the Hashtable's Data or Vector's Data from Database.
    2.How Japplet connect to a database and get data?

    1-How can use hashtable or Vector to create Jtree ?
    read JTree constrcutors in which u can use Vector for creating JTree like new JTree(myVector);
    and in this myVector u can store your own objects and override toString() method of that object (stored in Vector), but as my practice its not good.
    2.How Japplet connect to a database and get data?
    You have to make signed applet for connecting your applet with database , and sorry to say but ita a real pain in your -------------

  • LSMW: standard batch direct input for create document & document str

    hello expert .
    Is there any standard batch direct input for create document (tcode: cv01n ) & document structure (cv11) using lsmw.
    regards
    srinivas

    Hi Srnivas,
    I am not able to find direct input progarm for this, but there is one standard bapi available for this with name BAPI_DOCUMENT_CREATE you can use this.
    Regards
    Dhirendra

  • How i can dynamic changing root in JTree in swing?

    Hello, how i can dynamic changing root in JTree in swing?

    If u r willing to get your hands dirty and not be lazy, you can look around the code for the DefaultTreeTableModel and implement the setRoot functionality in the FileSystemModel. The code should not be too hard to figure out, cause it only replaces the root Object and fires a TreeStructureChanged notification.
    Set root functionality from DefaultTreeModel source (in your JDK installation directory)
         * Sets the root to root. A null root implies
         * the tree is to display nothing, and is legal.
        public void setRoot(TreeNode root) {
            Object oldRoot = this.root;
         this.root = root;
            if (root == null && oldRoot != null) {
                fireTreeStructureChanged(this, null);
            else {
                nodeStructureChanged(root);
        }ICE

  • Creating JTree by JTable Data

    Hi,
    I want to create JTree for the data in JTable, Is it possible. Thanks

    This question is a repeat of your last posting:
    http://forum.java.sun.com/thread.jspa?threadID=648759&tstart=0
    and you still haven't followed the advice given there. Quit cluttering the forum with the same question
    I will first explain what I want. I wanna 3 structures: TextField,JButton, and JTable.The Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/list.html]How to Use Lists has an example that is identical to this except that it uses a JList instead of a JTable. However, the concept is the same.
    .

  • How to Create a Rich Dynamic Input and Output PDF to insert and get data into, from Database (MSSQL)

    HI ,
    I want to use Adobe LiveCycle Designer and Adobe LiveCycle Workbench features to create a Dynamic PDF form which can allow me to store data into database(MSSQL Server) and Can also provide me the Output PDF form with all the information which has been been filled in by the User in input form. Both Input and Output forms must be Dynamic. I am stuck in this process and Need Experts Advice on the Complete optimal process flow of the Adobe.
    Regards
    Ritesh Grover

    HI
    Go to the lay out of your screen and doublr click on the table control fields, you can get the Properties/Attribute of the screen or table control Fields
    Assing a Group GRP1 for all the fields i n the table control.
    in PBO
    if ok_code = 'INPUT'.
    LOOP AT SCREEN.
    IF screen-grp1 = 'GRP1'.
    screen-input = 1.
    modify screen.
    endif.
    ENDLOOP.
    elseif ok_code = 'OUTPUT'.
    LOOP AT SCREEN.
    if screen-grp1 = 'GRP1'.
    screen-input = 0.
    modify screen.
    endif.
    endloop.
    endif.
    Regards
    Ramchander Rao.K
    Edited by: Ramchander Krishnamraju on Aug 8, 2009 5:27 AM

  • Dynamically creating JTree

    Folks - I'm new to Java and hence requesting some assitance in something I'm working on. I want to read a ascii file that constains some containment hierarchy eg., The file is listed below.
    <pre>
    # First field is parent, and fields seprated by '=' are childs.
    NodeA=NodeC, NodeD, NodeE
    NodeE=NodeZ,NodeK
    NodeK=NodeF
    </pre>
    I have no problem in reading the file, and parsing/tokenizing it at all.
    How can I use the information here in creating a dynamic JTree.
    Any help would be greatly appreciated.

    Folks - I'm new to Java and hence requesting some
    assitance in something I'm working on. I want to read
    a ascii file that constains some containment hierarchy
    eg., The file is listed below.
    <pre>
    # First field is parent, and fields seprated by '='
    are childs.
    NodeA=NodeC, NodeD, NodeE
    NodeE=NodeZ,NodeK
    NodeK=NodeF
    </pre>
    I have no problem in reading the file, and
    parsing/tokenizing it at all.
    How can I use the information here in creating a
    dynamic JTree.
    Any help would be greatly appreciated.- i assume that every node is named something unique and there can be no duplicates
    - can you guarantee the order of the file? Is it always from the root downwards? ie. can you guarantee that the when you see "NodeE" in the first line that NodeE has not already been created? these details will greatly affect your algorithm. typically if you can guarantee a certain order or format of the file, it will greatly improve the efficiency of the algorithm
    - here's an algorithm that would do the tree-building line by line, regardless of order, assuming no two nodes can be named the same thing, but it would probably be better to read in the entire file, storing the information in a vector or something and then go through all the data at once
    - this algorithm should be applied after every line is read in; after the last line in the file is read in, the entire tree will be created: how do you know what is the root node?
    - read in each line as: parent, child1, child2, etc...
    - if a node named "parent" has not already been created, create a node named "parent":
    DefaultMutableTreeNode node = new DefaultMutableTreeNode(parent);
    - for each child, if a node named "child1" has not already been created, create a node named "child1" and add it as a child to "parent"
    DefaultMutableTreeNode child = new DefaultMutableTreeNode(parent);
    node.add(child);
    - this algorithm is a pain because you always have to check if a node has already been created

  • Dynamic table rows created based on input value

    I've been searching the forum for either a tutorial or input
    on how to create a table where the number of rows are based on a
    user input value. I can't seem to find anything on this.
    Here's what I'm trying to do. I have site where people are
    charged based on the number of items they register. So if they want
    to register 2 items. They would input the number 2 for quanity and
    I would display a dynamic table with 2 rows. The user will input
    their data for the 2 items and I insert this into an
    itemsRegistered table. If they entered 4 I would give them 4 rows
    for input. I am using dreamweaver with PHP and MySql database. Can
    anyone point me in the right direction. Any help would be
    appreciated!

    Not exactly. The items are all the same but have a different
    registration number (like a serial number). So if the user wants to
    register 2 items. They would input the number 2 on the form. Then 2
    rows would appear on the table, one for each registration number.
    When they finish entering the data it would be inserted into the
    database as 2 records.
    So for example if item 1 has registration number 10000 and
    item 2 has registration number 11000. The registration numbers are
    unique. The table would look like this :
    CustomerID (links to customer table)
    RegistrationID (Unique in this table)
    ItemColor
    ItemShape
    I don't know if I've explained this well but thanks for even
    attempting to answer this! I really appreciate it!

  • Re: Including Applet in JSP with Dynamic input| Help needed

    Hi All,
    We are into a project in Oracle Portal Server where in we want to embed a result of a standalone application in Portal page.
    We can do that once we can embed the result of the standalone application which generates applet based on the input it gets from the current application's database.
    If it was static we could have used jsp:plugin but, it fails in our case!
    We are clueless as to how to embed an applet which will pick up the data dynamically.
    Can anyone of you help me in this regard?
    Thanks & Regards
    Arthi

    Hi Arthi,
    I think this might help you to get an idea why jsp:plugin tag does not allow for dynamically called applets.
    <jsp:plugin type=applet height="100%" width="100%"
    archive="myjarfile.jar,myotherjar.jar"
    codebase="/applets"
    code="com.foo.MyApplet" >
    <jsp:params>
    <jsp:param name="enableDebug" value="true" />
    </jsp:params>
    <jsp:fallback>
    Your browser does not support applets.
    </jsp:fallback>
    </jsp:plugin>
    The plugin example illustrates a <html> uniform way of embedding applets in a web page. Before the advent of the <OBJECT> tag, there was no common way of embedding applets. This tag is poorly designed and hopefully future specs will allow for dynamic attributes (height="${param.height}", code="${chart}", etc) and dynamic parameters. Currently, the jsp:plugin tag does not allow for dynamically called applets. For example, if you have a charting applet that requires the data points to be passed in as parameters, you can't use jsp:params unless the number of data points are constant. You can't, for example, loop through a ResultSet to create the jsp:param tags. You have to hand code each jsp:param tag. Each of those jsp:param tags however can have a dynamic name and a dynamic value.
    I think you can get better information if you look in to the below link
    http://pdf.coreservlets.com/CSAJSP-Chapter12.pdf
    Many Thanks,
    Ramesh.

  • Dynamic input form in ADF

    Hi,
    i need to create an input form in ADF, which contains radio groups ,check boxes ,LOV's and text boxes as form fields.
    these form fields i need to configure in DB specifying the type of the UI component(LOV,Text fields or Radio or check box)
    by reading the type, UI component has to be rendered and validations should be fired dynamically.
    is it possible in ADF?
    Thanks
    Indu

    ADF Faces offers a library of dynamic components that includes dynamic form and
    dynamic table widgets that you can drop from the Data Controls panel. Dynamic
    components differ from standard components in that all the binding metadata is
    created at runtime. This dynamic building of the bindings allows you set display
    information using control hints on a view object instead of configuring the information
    in the Edit Form Fields dialog as you drop the control onto the page. Then if you want
    to change how the data displays, you need only change it on the view object, and all
    dynamic components bound to that view object will change their display accordingly.
    With standard components, if you want to change any display attributes (such as the
    order or grouping of the attributes) you would need to change each page on which the
    data is displayed.

  • Schedule Module program in Background with Dynamic Input values ?

    Hi,
    I am trying a schedule a Standard Transaction which has Month,year and other Check boxes (By default they are Empty) .I need to schedule it monthly and Input must change dynamically when I run in background each month..
    How do we do this?
    Regards
    Vara
    Message was edited by: Vara K

    You can not directly schedule a module pool program in background job.  These are usually reports.   What you can do is create a custom report program with your parameters on a selection screen.  In this program you can do a BDC over the standard transaction filling the parameters from the selection screen of the custom program.  This custom program can also have a selection screen variant which uses selection variables that will change dynamically.  Then you can schedule the custom report program via SM36.
    Regards,
    Rich HEilman

  • How to build dynamic input schedule from version

    Hi experts,
    I want to create an input schedule based on my category selection which will allow users to enter data to budget part but changing the actual part is prohibited.
    For example I have category member which is 2010-09-1. This means I am working on 2010 Budget which has 9 periods of actual and 3 periods of forecast and 2011 Budget. In my input schedule I would have 24 months from 01.2010 to 12.2011 and I will copy actual to budget for the first 9 months but I do not want users to change first 9 months actual data from input schedule.
    What solution can you propose for this in BPC NW ?
    Regards,
    ergin

    Hi Ergin,
    From the description you have provided, I guess you will have the TIME dimension in the Column. The CATEGORY would be set to 2010-09-1, lets suppose. In this case, the first 9 columns should be locked for any changes. For this, you need to use the Data Validation technique, which is native to Excel.
    select an empty cell, lets say D1. in this cell, you should fetch the value "2010-09" from the version "2010-09-1". If the version is changed to "2010-10-1", the cell D1 will be automatically updated and will show "2010-10". In the column, in the row just above the Time dimension, write a formula to fetch the year and monthnum property of the Time member. Lets say, the time dimension members are displayed in the cells E4 to AB4 (24 columns for 24 months). In the cell E2, you can write the formula, =EVPRO("application name",E$4,"YEAR")&"-"&EVPRO("application Name",E$4,"MonthNum"). This will return 2010-01 in the cell E2 for the member 2010.JAN. Similarly, for 2010.FEB, the cell should display "2010-02". We will keep the formula in E2 only. After the expansion, the formula also will be expanded for the other cells.
    Select the first data cell of the EVDRE report. Open Data Validation. In the Settings Tab, in the Formula field, write =D1>E$2. Then go to the error alert tab and choose the style as stop and give some title and message. This would typically mean that if value of D1 (in this case 2010-09) is not greater than E2 (in this case 2010-01), then the error message will be displayed, when we try to enter values in these cells. And it will not allow to enter any value.
    Once the EVDRE is expanded, this data validation will be copied into all the other data cells. So, in this way, the enter input schedule can be kept dynamic.
    Hope this helps.

  • Create JTree Menu Using file system

    I want to create a Dynamic tree menu by using the folder structure on my harddisk like I have a "A" folder as a root on C drive and in "A" folder we have a "B" and "C" folder and in "B" folder there are 2 folders like "B1" and "B2" and in "C" , "C1" and "C2". Now using this folder information i have to create a Dynamic Jtree Menu.

    I used this code here is not any methos which you write above:--------
    package com.reports.common;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.io.File;
    import java.util.Collections;
    import java.util.Vector;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.DefaultMutableTreeNode;
    import com.reports.utils.ComUtils;
    import components.HDSPanel;
    public class FileTree extends HDSPanel {
              /** Construct a FileTree */
              public FileTree(File dir) {
              setLayout(new BorderLayout());
              // Make a tree list with all the nodes, and make it a JTree
              JTree tree = new JTree(addNodes(null, dir));
              // Add a listener
              tree.addTreeSelectionListener(new TreeSelectionListener() {
              public void valueChanged(TreeSelectionEvent e) {
              DefaultMutableTreeNode node = (DefaultMutableTreeNode) e
              .getPath().getLastPathComponent();
              System.out.println("You selected " + node);
              // Lastly, put the JTree into a JScrollPane.
              JScrollPane scrollpane = new JScrollPane();
              scrollpane.getViewport().add(tree);
              add(BorderLayout.CENTER, scrollpane);
              /** Add nodes from under "dir" into curTop. Highly recursive. */
              DefaultMutableTreeNode addNodes(DefaultMutableTreeNode curTop, File dir) {
              String curPath = dir.getPath();
              DefaultMutableTreeNode curDir = new DefaultMutableTreeNode(curPath);
              if (curTop != null) { // should only be null at root
                   String str = DirName(dir);
                   curTop.add(curDir);
              ComUtils.sop("in the FileTree>>>==curPath== "+ curPath +">>>>curTop===="+curTop);
              Vector ol = new Vector();
              String[] tmp = dir.list();
              for (int i = 0; i < tmp.length; i++)
              ol.addElement(tmp);
              Collections.sort(ol, String.CASE_INSENSITIVE_ORDER);
              File f;
              Vector files = new Vector();
              // Make two passes, one for Dirs and one for Files. This is #1.
              for (int i = 0; i < ol.size(); i++) {
              String thisObject = (String) ol.elementAt(i);
              String newPath;
              if (curPath.equals("."))
              newPath = thisObject;
              else
              newPath = curPath + File.separator + thisObject;
              if ((f = new File(newPath)).isDirectory())
              addNodes(curDir, f);
    //          else
    //          files.addElement(thisObject);
              // Pass two: for files.
              for (int fnum = 0; fnum < files.size(); fnum++)
              curDir.add(new DefaultMutableTreeNode(files.elementAt(fnum)));
              return curDir;
              public Dimension getMinimumSize() {
                   return new Dimension(200, 400);
              public Dimension getPreferredSize() {
                   return new Dimension(200, 400);
              private String strName;
              public String DirName(File dir){
                   strName = dir.toString();
                   int i = strName.lastIndexOf("\\");
                   strName = strName.substring(i+1,strName.length());
                   ComUtils.sop("File Name>>"+strName);
                   return strName;

Maybe you are looking for

  • SMB share read-only after upgrade to 10.6.4

    since i upgraded my MBP to 10.6.4 i can access our samba shares only in read-only mode. i'm connecting with the following string: cifs://myUsername@servername/aFolder/anotherFolder/myFolder this connection used to work since 10.3 or 10.4 up to 10.6.3

  • Iphoto is in use or unreadable

    My iphoto library is saying it is being use by another application or is unreadable.  I loaded the library manager and was able to see my pictures but I need to use one on Facebook.  How do I do this?

  • Pop Up menu and IE 7

    I thought I was doing just great with my pop up menus. They were working great...until I took a look a the site with IE. The little arrow for the sub menu is blanked out with the ugly red x. I checked with both a new mac and my PC. I wouldn't mind if

  • How can I tell what datacentre I'm using?

    Apologies, I'm a Newbie. How can I tell where my servers are. Country is OK, I don't need to go to the Data Centre. As a Cloud Partner with a "free" account, maybe I don't have a choice, but I'd like to know the servers are in Canada, and not the US.

  • I need to uninstall v10.0 and re install 3.0 to 3.6.13 Help!

    I am using k12.com Public charter school academy's "elluminate" software for online classroom sessions. I can not log in because It is only compatable with versions 3.0 to 3.6.13