How to allow multiple selection of nodes in a JTree

How to allow multiple selection of nodes in a JTree ?
Thanks
S.Satish

By default when you create new instance og JTree the selection model is multiple selection. And if you want to change it you use next:
tee.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
or
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.CONTIGUOUS_TREE_SELECTION);
or
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
Hope will help!

Similar Messages

  • How to create a parameter to allow multiple selection

    Hi,
    I am developing report in Oracle EBusiness suite. I use concurrent program to develop the report. My question is how to create a parameter to allow multiple selection for such kind of report?
    thanks
    Lei

    I dont think, we have multiple selection in the parameters of Concurrent Program :).

  • Error On Selection Cardinality doesnot allow multiple selection

    Hi All,
    Every one... Am new to SAP am learning WebDynpro Java..
    Now am working on Multiple selection on a table But it is giving Error
    Like:
    Failed to Process reques. Please Contact Your System Administrator.
    Root Case is :
    com.sap.tc.webdynpro.progmodel.ContextException Node (....) Selection Cardinality doesnot allow multiple selection ....
    Please Help Me..

    Hi Ramesh,
    please check the property of the node which you are using.
    check the Cardinality  property, for multi select it must be 0.n or 1 . n.
    Hope thiw will help
    Regards
    Narendra

  • Derived Column : for Lookup type column with 'Allow Multiple Selection' : True in sharepoint list

    Hello,
    I have one column where field type is Lookup but 'Allow Multiple Selection' is true in SharePoint List.
    So, in this scenario data from the SharePoint list is being exported as below.
    1;#Red;#3;#Blue;#4;#Black;#5;#Green
    Now resultant text exported to SQL Table should be :
    1,3,4,5
    OR
    Red,Blue,Black,Green
    Either way it is fine. How can we get this using Derived Column and Data Conversion?
    I am able to do this for single occurrence using below expression.
    (DT_STR,100,1252)(SUBSTRING([BusinessUnit],FINDSTRING([BusinessUnit],"#",1)+1,LEN([BusinessUnit])-FINDSTRING([BusinessUnit],"#",1)))
    Please suggest.
    Thank you,
    Mittal.

    Your best bet would be to do this in sql using a string parsing udf as below
    http://visakhm.blogspot.com/2010/02/parsing-delimited-string.html
    You can make it into procedure and call it from oledb command task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to get multiple selected fields in list

    Hello all,
    I am trying to get multiple selected value from a list but i dont know how to get multiple selected fields from a list though AS3.
    Actually i want to pass the selected fields to php, so for that i need to get the selections and send to php.
    Thankx..

    i want to put the selected fields of list in an array through AS3....
    actually......i figured it out how to do that...........
    Its simple......use
    list.selectedItems[index]
    and to get the number of items selected......
    list.selectedItems.length
    simple.....

  • How to use multiple selection parameters in the data model

    Hi, after have looked all the previous threads about how to use multiple selection parameters , I still have a problem;
    I'm using Oracle BI Publisher 10.1.3.3.2 and I'm tried to define more than one multiple selection parameters inside the data template;
    Inside a simple SQL queries they work perfectly....but inside the data template I have errors.
    My data template is the following (it's very simple...I am just testing how the parameters work):
    <dataTemplate name="Test" defaultPackage="bip_departments_2_parameters">
    <parameters>
    <parameter name="p_dep_2_param" include_in_output="false" datatype="character"/>
    <parameter name="p_loc_1_param" include_in_output="false" datatype="character"/>
    </parameters>
    <dataTrigger name="beforeReport" source="bip_departments_2_parameters.beforeReportTrigger"/>
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    select deptno, dname,loc
    from dept
    &p_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_DEPT" source="Q2">
    <element name="deptno" value="deptno"/>
    <element name="dname" value="dname"/>
    <element name="loc" value="loc"/>
    </group>
    </dataStructure>
    </dataTemplate>
    The 2 parameters are based on these LOV:
    1) select distinct dname from dept (p_dep_2_param)
    2) select distinct loc from dept (p_loc_1_param)
    and both of them have checked the "Multiple selection" and "Can select all" boxes
    The package I created, in order to use the lexical refence is:
    CREATE OR REPLACE package SCOTT.bip_departments_2_parameters
    as
    p_dep_2_param varchar2(14);
    p_loc_1_param varchar2(20);
    p_where_clause varchar2(100);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    CREATE OR REPLACE package body SCOTT.bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    if (p_dep_2_param is not null) --and (p_loc_1_param is not null)
    then
    p_where_clause := 'where (dname in (' || replace (p_dep_1_param, '''') || ') and loc in (' || replace (p_loc_1_param, '''') || '))';
    else
    p_where_clause := 'where 1=1';
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    As you see, I tried to have only one p_where_clause (with more than one parameter inside)....but it doesn't work...
    Using only the first parameter (based on deptno (which is number), the p_where_clause is: p_where_clause := 'where (deptno in (' || replace (p_dep_2_param, '''') || '))';
    it works perfectly....
    Now I don't know if the problem is the datatype, but I noticed that with a single parameter (deptno is number), the lexical refence (inside the data template) works.....with a varchar parameter it doesn't work....
    So my questions are these:
    1) how can I define the p_where_clause (inside the package) with a single varchar parameter (for example, the department location name)
    2) how can I define the p_where_clause using more than one parameter (for example, the department location name and the department name) not number.
    Thanks in advance for any suggestion
    Alex

    Alex,
    the missing thing in your example is the fact, that if only one value is selected, the parameter has exact this value like BOSTON. If you choose more than one value, the parameter includes the *'*, so that it looks like *'BOSTON','NEW YORK'*. So you need to check in the package, if there's a *,* in the parameter or not. If yes there's more than one value, if not it's only one value or it's null.
    So change your package to (you need to expand your variables)
    create or replace package bip_departments_2_parameters
    as
    p_dep_2_param varchar2(1000);
    p_loc_1_param varchar2(1000);
    p_where_clause varchar2(1000);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    create or replace package body bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    p_where_clause := ' ';
    if p_dep_2_param is not null then
    if instr(p_dep_2_param,',')>0 then
    p_where_clause := 'WHERE DNAME in ('||p_dep_2_param||')';
    else
    p_where_clause := 'WHERE DNAME = '''||p_dep_2_param||'''';
    end if;
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || ' AND LOC IN ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || ' AND LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    else
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || 'WHERE LOC in ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || 'WHERE LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    I've written a similar example at http://www.oracle.com/global/de/community/bip/tipps/Dynamische_Queries/index.html ... but it's in german.
    Regards
    Rainer

  • How to handle multiple selection in the Spark List control with checkbox as itemrenderer?

    Hi All,
    I am using checkbox as an ItemRenderer in spark list.
    I have a query.
    how to handle multiple selection in the Spark List control with checkbox as itemrenderer?
    how to retrieve the selected item label?
    Thank you in advance.

    Hi there, I'll tweak your code a little bit to something like this:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    layout="vertical">
        <mx:Script>
            <![CDATA[
                 import mx.events.ListEvent;
                 import mx.controls.CheckBox;
               [Bindable]
               private var mySelectedIndexes:ArrayCollection=new ArrayCollection();
                private function onChange(e:ListEvent):void
                   if(CheckBox(e.itemRenderer).selected){
                             mySelectedIndexes.addItem(e.rowIndex);
                   }else{
                                  mySelectedIndexes.removeItemAt(mySelectedIndexes.getItemIndex(e.rowIndex));     
                   chkList.selectedIndices=mySelectedIndexes.toArray();
            ]]>
        </mx:Script>
    <mx:ArrayCollection id="collection">
            <mx:Object label="Test A"/>
            <mx:Object label="Test B"/>
            <mx:Object label="Test C"/>
            <mx:Object label="Test D"/>
            <mx:Object label="Test E"/>
            <mx:Object label="Test F"/>
            <mx:Object label="Test G"/>
        </mx:ArrayCollection>
    <mx:List id="chkList" dataProvider="{collection}" itemRenderer="mx.controls.CheckBox"  itemClick="onChange(event);" allowMultipleSelection="true"/>
    </mx:Application>

  • How to create multiple selection screens in reports

    How to create multiple selection screens in reports
    Thanks,
    Sridhar

    Ex: hope you will find an idea from the below example :
    SELECTION-SCREEN BEGIN OF BLOCK SEL1 WITH FRAME TITLE TIT1.
    PARAMETERS: CITYFR LIKE SPFLI-CITYFORM,
                CITYTO LIKE SPFLI-CITYFORM.
    SELECTION-SCREEN end OF BLOCK SEL1
    SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
    SELECTION-SCREEN INCLUDE BLOCKS SEL1.
    SELECTION-SCREEN BEGIN OF BLOCK SEL2 WITH FRAME TITLE TIT2 .
    PARAMETERS: AIRPFFR LIKE SPFLI-AIRPFROM,
                AIRPTO LIKE SPFLI-AIRPTO.
    SELECTION-SCREEN END OF BLOCK SEL2
    SELECTION-SCREEN END OF SCREEN 5000.
    INITIALIZATION.
    TIT1 = 'ITIES'.
    aT SELECTION-SCREEN.
    CASE SY-DYNNR.
    WHEN '0500'.
       MESSAGE W159(at) WITH 'SCREEN 500'.
    WHEN '1000'.
       MESSAGE W159(at) WITH 'SCREEN 1000'.
    ENDCASE.
    START-OF-SELECTION.
    TIT1 = 'CITIES FOR AIRPORTS'.
    TIT2 = 'AIRPORTS'.
    CALL SELECTION-SCREEN 500 STARTING AT 10 10.
    TIT1 = 'CITIES AGAIN'.
    CALL SELECTION-SCREEN 1000 STARTING AT 10 10.

  • How to select a node in a JTree by name

    I have a JTree in my program. I want to programmatically set one of these nodes selected by the name of the node. I do not know how to do this. I read the "How to use trees", but no help
    Thanks!

    I have a JTree and each node on the JTree has a string name. I also have a JEditorPane that lists all these names at start up. If the user clicks on one of these names, I want to catch the HyperlinkEvent and automatically select that node in the JTree.
    So in short, I have the String name of the node that I want to programatically select.
    Thanks!

  • How to allow multiple instances of air desktop application

    hi all
    Adobe air desktop application only allow single instance of
    application. How to allow multiple instances like in other desktop
    applications?.
    thanks

    Thanks a lot morgair, i will check with exe4j tool.
    Actually the problem is, thread is not waiting for second request.
    thatswhat i thought it may because of thread.
    Thanks & Regards
    Sudha

  • Choices - Checkboxes (allow multiple selections) Links

    Is there a way to make the below possible:
    This is with respect to Sharepoint 2010 list functionality
    I have a list with 7 choices 
    The type of choices is: Checkboxes (allow multiple selections)
    Is it possible to have links as the various choices as compared to plain text?
    Is there any other alternative to have links with multiple selection option which works like choices option in a list?
    Thanks,
    Abhilasha Thackur

    Hi,
    According to your post, my understanding is that you wanted to have links as the various choices as compared to plain text.
    There is no out of the box way to accomplish this with SharePoint.
    By design in SharePoint, the options in the Choice filed look like Single line of text type.
    To achieve what you want, you need to custom filed Type programmatically.
    More information:
    Walkthrough: Creating a Custom Field Type
    Creating Custom SharePoint 2010 Field Types
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Allow multiple selections in 2nd box of cf_TwoSelectsRelated

    Greetings. I'm very new to ColdFusion, so I apologize if this
    seems like a no-brainer.
    I've successfully used cf_TwoSelectsRelated to add related
    selects to a form. I'm able to have a user select a school, and
    have the second select box retrieve only the teachers that are from
    that school. Now I'd like to allow multiple teachers to be selected
    from the second list (to register for a workshop) and have them all
    be inserted in my registration table as individual records.
    I think I can figure out the second part of my task (insert
    them as individual records) based on
    Dan
    Bracuk's answer to a query back in February. However, for the
    first part (allow multiple selections in the second select list)
    I'm not sure whether to:
    a) try to edit the cf_TwoSelectsRelated custom tag (I think I
    would need to know some JavaScript for that? yipe!)
    or
    b) do something to my existing code to allow the second
    select to have multiple selections (but doesn't cf_select just
    require that you specify in the attributes "multiple="true"? which
    means I will probably need to edit the cf_TwoSelectsRelated custom
    tag (back to *yipe*!)
    Can anyone point me in the right direction? I've attached
    cf_TwoSelectsRelated. Please let me know if you need me to supply
    my code.
    Thanks very much in advance.
    Marianne

    Dear Dan,
    Thanks for this! Well, I went ahead and kept trying to figure
    it out while I waited - I found and took a look at
    cf_ThreeSelectsRelated and the third select box did indeed have a
    "multiple" attribute - so I borrowed it and edited the
    cf_TwoSelectsRelated (as attached - just added one line to the
    attributes list and added one cfif to the cfoutput for the 2nd
    select box), called it in the attributes of the
    cf_TwoSelectsRelated tag call in my "add attendees" page - and it
    seems to work great! No messing about with scary javascript needed.
    *whew*
    Now I just have to edit the code to allow it to insert each
    set of id's as an individual record... but I think I can handle
    that :)
    Hopefully this will help someone who's wondering if this will
    work. I couldn't find any reference to it anywhere!

  • How to get multiple selections from jsp page in my servlet

    Hello Everyone,
    I've a list that allows users to make multiple selections.
    <select name=location multiple="multiple">
        <option>
             All
        </option>
        <option>
             Hyd
        </option>
        <option>
             Dub
        </option>
        <option>
             Mtv
        </option>
      </select>I want to get the selections made by user in jsp page from my servlet, selections can be multiple too.
    ArrayList locList = new ArrayList();
    locList = request.getParameter("location");when I do so, I get compilation error as the request returns string type. How do I then get multiple selections made by the user.
    Please let me know.

    For those kind of basic questions it would help a lot if you just gently consult the javadocs and tutorials.
    HttpServletRequest API: [http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html]
    Java EE tutorial part II: [http://java.sun.com/javaee/5/docs/tutorial/doc/]
    Coreservlet tutorials: [http://courses.coreservlets.com/Course-Materials/]

  • How to remove multiple selections button in LDB selection screens

    Hi Friends,
    I am facing a problem while doing an HR object. I took an LDB with Selection screen '100'. i got the company code select-option in it. But i need to avoid multiple selection button so that i have to take only a single company code to print the ALV heading as the company Text. Please tell me quickly, how can i do it.
    Regards,
    Santosh.

    You may have to do something like below where S_BUKRS is your company code select option of the LDB.
    REPORT  zakstest1 NO STANDARD PAGE HEADING.
    TABLES t001.
    TYPE-POOLS: sscr.
    SELECT-OPTIONS s_bukrs FOR t001-bukrs.
    INITIALIZATION.
    *-- Remove the the ranges option
      PERFORM remove_ranges_for_sel_options.
    *&      Form  remove_ranges_for_sel_options
    *       text
    FORM remove_ranges_for_sel_options.
      DATA: optlist  TYPE sscr_opt_list,
            restrict TYPE sscr_restrict,
            ***      TYPE sscr_***.
    *-- Allow EQ only
      CLEAR optlist.
      optlist-name       = 'EQ_ONLY'.
      optlist-options-eq = 'X'.
      APPEND optlist TO restrict-opt_list_tab.
      CLEAR ***.
      ***-kind    = 'S'.
      ***-sg_main = 'I'.
      ***-sg_addy = 'N'.
    *-- Make S_BUKRS range to have only EQ
      ***-name    = 'S_BUKRS'.
      ***-op_main = 'EQ_ONLY'.
      APPEND *** TO restrict-***_tab.
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
        EXPORTING
          restriction            = restrict
        EXCEPTIONS
          too_late               = 1
          repeated               = 2
          selopt_without_options = 3
          selopt_without_signs   = 4
          invalid_sign           = 5
          empty_option_list      = 6
          invalid_kind           = 7
          repeated_kind_a        = 8
          OTHERS                 = 9.
    ENDFORM.                    " rem_ranges

  • How to allow multiple domains under Access-Control-Allow-Origin

    Hi,
    We have a domain where will get CORS request from another domain hosted on seperate DC. We can't set
    Access-Control-Allow-Origin as * due to security concerns & IIS can't take more than 1 value at a time. Kindly suggest how to pass multiple httpheader  for
    Access-Control-Allow-Origin.
    Regards,
    Dhiraj

    Hello Dhiraj,
    This is not the suitable forum for your question, you may post in
    IIS forums for more help.
    Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • How Many OS can I install with BootCamp?

    I am thinking of installing the following on my MacPro, all at the same time: 1. OSX - which is currently the only OS installed 2. Windows XP 3. Windows 7 4. Another install of OSX from the disks that came with my MacPro. Is any of this possible befo

  • Web Logic 10.3 upgrade causes issues with escaped characters in JSP.

    We recently upgraded our application servers from Weblogic 9.2 to Weblogic 10.3 and we are having an issue with escaped characters in a JSP code. Here is an example of what we are seeing: var convertedBody1 = document.getElementById('body').value.rep

  • Analysing tools for KM documents

    Hello, Does anybody know, if there are any analysing tools available, with which you can analyse the access of the KM documents. They should answer questions like - when was the last access to a documents? - which documents have an average rating low

  • How can I view another users calendar

    I need to setup an assistant to view a calendar from another employee.  He can already do this on a computer but we have them both mobile now and would like to do this from their blackberry's.  We utilize Exchange 2003 for mail.  Has anyone attempted

  • Adobe Reader print error

    When I try to print some (but not all) pdf documents using Adobe Reader, my printer "stops" and it won't print. I get an error message in my Printer Status box that says "The process "pdffilter" stopped unexpectedly with status 1." I need to delete t