Spark List muiltiple select-Single Click

I have a list (tileLayout) with a custom item renderer. AllowMultipleSelection is set to true.
Is there a way for me to allow thr user to select more than one item without having to hold down CTRL? I'd like a single click to select/de-select the items.
Any Help appreciated

I haven't given it much thought, but you would probably have to do something involving a few things.
1. event.preventDefault on the List when something is clicked
2.  Listen for clicks, get the clicked item, put in the selectedItems array of the list.
3. Check to see if item was already in  selectedItems list, if so remove to deselect it
Like I said, I didn't give this much thought, especially on the event.preventDefault but that is where I would start.  But there probably is a simpler solution out there.

Similar Messages

  • Disable Spark List selection indicator

    How do I get rid of the Spark List selection indicator entirely?  I don't want the rectangular indicator when the mouse hovers over an item, and I don't want the color to change when the mouse is clicked.

    You'll have to extend default item renderer (ItemRenderer for instance) and set autoDrawBackground to false. And then use your item renderer in a list.
    See this document for more information on spark item renderers.

  • In XP single-click mode, hovering overwrites filenames in select downl loc

    My grandmother has arthritis, there's no way she can use double click mode. She gets pictures in the mail and she wants to save them to relevant folders. when she enters a subfolder with a bunch of other pictures, in just 1 second of not moving the mouse, the file name in the select download location window is overwritten because hovering for one second is treated like a single click. Is there any way around this problem?

    "...Things are worse than that now... When you single click on a folder name in the folder list, the folder contents show in the right hand file window, as usual. But, when you use an arrow key to move to a folder name in the folder list, the folder
    contents no longer show in the right hand file window...."
    The option  seems to be disabled. It is in Explorer>tools>folder options>navigation pane>"automatically expand to current folder" (win7 v6.1
    Excluding this extremely useful feature really cripples Win7Explorer. I was spoiled by w9x and XP explorers. I am new to MS forums. Is there a moderated microsoft forum where this question can be posted, in the hope that a patch is produced?
    I asked this in 2007 and I was answered <<WE DON'T GIVE A SH*T OF WHAT YOU WANT>>
    See here:
    http://connect.microsoft.com/WindowsServerFeedback/feedback/details/313066/explorer-should-expand-folder-tree-the-windows-xp-way

  • "Dynamic List Box with Single Selection" Survey Suite in CRM 6.0

    Hi
    I am using CRM 6.0. There in Survey Suite there are 2 answering options "Dynamic List Box with Single Selection" & "Dynamic List Box with Multiple Selection". I am able to make out, how we can assign values to this. I have seen example "Example_Dynamic_survey" also.
    I believe we have to use programming for populating this. But how do we have to carry that out.
    Thanx and Regards
    Hitesh

    Hi Hitesh,
    There is no need of programming for populating values for Answer category 'List Box with Single Selection' or 'List Box with Multiple Selection'. You have to follow the following steps to populate values for those:
    - In the Answer Category select List Box with Single Selection from drop down list
    - Then on left hand side tree, right click on Answer and select Insert Answer Option (Answer->Insert Answer Option)
    - Then on right side, provide Text for the answer (value)
    - To add more values, repeat the process Answer->Insert Answer Option and providing text for those answers in the right side.
    Similarly you can populate values for 'List Box with Multiple Selection' also.
    This has to be done in the transaction CRM_SURVEY_SUITE.
    Hope this is clear to you
    regards
    Srikantan

  • Selecting a page with a single-click instead of double-click

    Is there anyway to make InDesign CS5.5 move my file to the page I have selected in the pages panel without having to double-click the page in the pages panel?
    I keep forgetting that the page selected in the panel may or may not be the page I'm currently editing & this is very frustrating.

    Page that you're currently on is highlighted in reverse (black background white text)
    If you're select a page in the pages panel it highlights blue to indicate it's selected. This allows you to move the page if you need to, or select over dozen other options for that page, numbering, sections, override, move, duplicate, apply master page to, delete, rotate view, colour label, page transiitions, hide master items and spread flattening!
    You double click a page to move to that page. If it was only a single click then it would be quite frustrating to be hopping all over the document when all you want to do is renumber/resection/dupe or over a dozen different options mentioned above.
    CTRL/CMD J will bring up the Go To Page dialog box.
    Navigate with the page numbers as peter suggested.
    There's a reason it works like that - because it works best.

  • 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>

  • JTable select row by double click, single click

    Hi all,
    I would like to double click on the row of the JTable and pop up a window for adding stuff, a single click for selecting the row and then in the menu bar I can choose to etither add, change or delete stuff. I try to use the ListSelectionModel but does not seems to distinguish between double or single click.
    Any idea, doc, samples?
    or I should not use ListselectionModel at all?
    thanks
    andrew

    Hi. I used an inner class. By using MouseAdapter u dont have to implement all methods in the interface..
    MouseListener mouseListener = new MouseAdapter()
    public void mouseClicked(MouseEvent e)
    if(SwingUtilities.isLeftMouseButton(e))// if left mouse button
    if (e.getClickCount() == 2) // if doubleclick
    //do something
    U also need to add mouselistener to the table:
    table.addMouseListener(mouseListener);
    As I said, this is how I did it.. There are probably alot of ways to solve this, as usual :). Hope it helps

  • Single click to show selected file in editor when in "edit view"?

    Anyone know if there is an option to set single click to show selected file in editor when in "edit view"?  Instead of having to double click?

    I would also like to be able to "right-click > edit source file" in multi-track view WHEN A CLIP IS GROUPED.
    Currently, when a clip is grouped with another clip, if you select a portion of that clip to edit, then right-click it, IT WILL NOT ALLOW YOU TO "EDIT SOURCE FILE" until you have ungrouped then re-selected it, which is cumbersome.
    Not only do you have to do that, but upon returning to MT VIEW you have to remember to re-group that clip with the other clips, not being able to right-click and edit the source file of grouped clips adds unnecassary trouble and confusion to the interface, and for what?

  • Selection on single-click with custom TreeCellEditor

    Hi,
    In a JTree with a custom treecell editor (contains checkbox, label with icon) that overrides abstractcelleditor, selection of nodes does not highlight the selection on a single click. The selection is highlighted on a double click. clicking on the checkbox works fine. any ideas? the treecellrenderer works fine. So if i remove the custom editor and only have the renderer (for checkbox, label and icon) selections are highlighted properly.
    Thanks!

    Ok, came up with a solution - it makes keyboard navigation and mouse-based multiple selection work. Here's the fixed code:
    creating the tree :
    JTree tree = new JTree( root  );
    tree.setUI( new MyTreeUI() );
    tree.setCellRenderer( new OverlayTreeCellRenderer() );
    tree.setCellEditor( new OverlayTreeCellRenderer() );
    tree.setEditable(true);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
    tree.setInvokesStopCellEditing( true );
    scrollPane.setViewportView( tree );
    add( scrollPane );the renderer / editor:
      protected static class OverlayTreeCellRenderer extends JPanel implements TreeCellRenderer, TreeCellEditor
        protected Color selBdrColor = UIManager.getColor( "Tree.selectionBorderColor" );
        protected Color selFG = UIManager.getColor( "Tree.selectionForeground" );
        protected Color selBG = UIManager.getColor( "Tree.selectionBackground" );
        protected Color txtFG = UIManager.getColor( "Tree.textForeground" );
        protected Color txtBG = UIManager.getColor( "Tree.textBackground" );
        protected JCheckBox visibleCheckBox = new JCheckBox();
        protected JLabel overlayName = new JLabel();
        protected JCheckBox showLabelCheckBox = new JCheckBox();
        protected LinkedList<CellEditorListener> listeners = new LinkedList<CellEditorListener>();
        protected final ActionListener checkBoxListener = new ActionListener() {
          public void actionPerformed ( ActionEvent ae )
            if ( stopCellEditing() )
              fireEditingStopped();
        protected final MouseListener labelListener = new MouseAdapter() {       
          public void mouseReleased ( MouseEvent e )
            if ( stopCellEditing() )
              fireEditingStopped();
         * Constructor.
        public OverlayTreeCellRenderer ()
          setLayout( new BoxLayout( this, BoxLayout.LINE_AXIS ) );
          visibleCheckBox.setOpaque( false );
          showLabelCheckBox.setOpaque( false );
          add( visibleCheckBox );
          add( overlayName );
          add( showLabelCheckBox );
          setBackground( txtBG );
          setForeground( txtFG );     
          visibleCheckBox.addActionListener( checkBoxListener );
          showLabelCheckBox.addActionListener( checkBoxListener );
          overlayName.addMouseListener( labelListener );
         * Returns the renderer
        public Component getTreeCellRendererComponent ( JTree tree, Object value,
            boolean selected, boolean expanded, boolean leaf, int row,
            boolean hasFocus )
          DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;           
          OverlayDescriptor data = (OverlayDescriptor) node.getUserObject();
          overlayName.setText( data.overlayName );
          visibleCheckBox.setSelected( data.visible );
          showLabelCheckBox.setSelected( data.label );   
          if ( selected )
            setBackground( selBG );
            setForeground( selFG );
          else
            setBackground( txtBG );
            setForeground( txtFG );
          return this;
        // ------------------------------------------------- Cell Editor
        // Returns the editor
        public Component getTreeCellEditorComponent ( JTree tree, Object value,
            boolean isSelected, boolean expanded, boolean leaf, int row )
          return getTreeCellRendererComponent( tree, value, true, expanded, leaf, row, true );
        // Implement the CellEditor methods.
        public void cancelCellEditing ()
        // Stop editing only if the user entered a valid value.
        public boolean stopCellEditing ()
          requestFocusInWindow();
          return true;
        // This method is called when editing is completed.
        // It must return the new value to be stored in the cell.
        public Object getCellEditorValue ()
          return new OverlayDescriptor( overlayName.getText(), showLabelCheckBox.isSelected(), visibleCheckBox.isSelected() );
        // Start editing when the mouse button is clicked.
        public boolean isCellEditable ( EventObject eo )
          return true;
        public boolean shouldSelectCell ( EventObject eo )
          return true;
        // Add support for listeners.
        public void addCellEditorListener ( CellEditorListener cel )
          listeners.add( cel );
        public void removeCellEditorListener ( CellEditorListener cel )
          listeners.remove( cel );
        protected void fireEditingStopped ()
          if ( listeners.size() > 0 )
            ChangeEvent ce = new ChangeEvent( this );
            for ( CellEditorListener l : listeners )
              l.editingStopped( ce );
      }subclass of BasicTreeUI:
       * Fix multiple-selection handling in BasicTreeUI which doesn't appear to work
       * when the tree has a custom editor.
      protected static class MyTreeUI extends BasicTreeUI {   
        protected boolean startEditing ( TreePath path, MouseEvent event )
           * BasicTreeUI startEditing(..) method doesn't handle multiple selection
           * well. This circumvents that for when Ctrl or Shift is held down by
           * first saving the current selection, and then restoring it after calling
           * super.startEditing(..).
          ArrayList<TreePath> selectedPaths = null;
          if ( tree.getSelectionCount() > 0 && event.isControlDown() )
            selectedPaths = new ArrayList<TreePath>( tree.getSelectionCount() + 1 );
            for ( TreePath p : tree.getSelectionPaths() )
              selectedPaths.add( p );
            if ( !tree.isPathSelected( path ) )
              selectedPaths.add( path );
            else
              selectedPaths.remove( path );
          else if ( tree.getSelectionCount() > 0 && event.isShiftDown() )
            int endRow = tree.getRowForPath( path );
            int startRow = tree.getAnchorSelectionPath() == null ? endRow : tree
                .getRowForPath( tree.getAnchorSelectionPath() );
            if ( startRow > endRow )
              int temp = endRow;
              endRow = startRow;
              startRow = temp;
            selectedPaths = new ArrayList<TreePath>( endRow - startRow + 1 );
            for ( int row = startRow; row <= endRow; row++ )
              selectedPaths.add( tree.getPathForRow( row ) );
          boolean val = super.startEditing( path, event );
          if ( selectedPaths != null )
            tree.setSelectionPaths( selectedPaths.toArray( new TreePath[0] ) );
          return val;
      };

  • How do i set spark list selected item's color??

    hey guys... so got a little problem... i have a spark list which gets populated from a array collection that looks likda like this
    [0] = "name1"
    [1] = "name 2"
    [2] = "name 3"
    when i click on say "name 1" i  need the color of "name 1" to change to say red...
    and when i click on another item i need that color to stay... red on "name 1"...
    oh and... i need to do the color change in actionscript rather than the mxml file...
    any ideas???

    Hi,
    I'm not sure if this is exactly what you are looking for. What I did was created an itemRender for the list and assigned it like so
    <s:List dataProvider="{ listDataProvider}" itemRenderer="listItemRenderer"/>
    And the listItemRenderer will look some
    //Code Begins
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                              xmlns:s="library://ns.adobe.com/flex/spark"
                              xmlns:mx="library://ns.adobe.com/flex/mx"
                              focusEnabled="true" >
        <fx:Script>
            <![CDATA[
                var clicked:Boolean=true;
                protected function clickHandler(event:MouseEvent):void
                        clicked?labelRender.setStyle("color","0x00FF00"):labelRender.setStyle("color","0xFF0000") ;
                        clicked=!clicked;
            ]]>
        </fx:Script>
        <s:Label  id="labelRender" text="{data}" color="0xFF0000" click="clickHandler(event)"/>
    </s:ItemRenderer>
    //Code Ends
    In the above example the colour toggles on each click. So, you can apply anything. assume you have a property called color in your array collection, you can access it as data.color and then set the text to that color when it is clicked. I hope this helps. Do write back if you have any issues.
    Nishad

  • Single Click Text Select

    Hey all I have a Noneditable JTextArea and I want to make it so a line of text is selected with a single click instead of the double click it normally takes. Can this be done?

    Doesn't a double-click normally select a single word, and a triple-click selects a whole line? (this is Windows behaviour, don't know if JTextArea is the same).
    Regardless, I don't know of any methods you can call. You could scour the API. My solution would be to extend JTextArea, and override the mouseClicked() method. Have a look at the source code, and just change the number of clicks required.
    Hope this helps,
    Radish21

  • Single click object selection painfully slow

    Hi,
    I don't have any particular speed issue with illustrator CS6 in general.
    However there is a massive speed problem when I'm trying to select on object on the artboard with a single click.
    Is anyone else having the same issue? Is it simply a setting that may be wrong somewhere for me?
    When selecting a object by creating a "rectangle" over the object it works fine and normal speed.
    When clicking the object to select it, nothing happens for about 3/4 seconds, then the loading little rainbow circle appears and loads for another 3/4 seconds...
    I really don't understand what's happening.
    If anyone could help me that would be greatly appreciated (it's driving me insane)...
    Thanks

    Nevermind...
    Finally found the reason after hours searching on the Adobe forum or google, and battling with different settings in illustrator...
    For those who may encounter the same issue, I'm running "RightZoom" on my Mac to fully maximize my windows.
    For some reasons they don't seem to like each other! Well, Illustrator doesn't like RightZoom...
    To fix the issue, simply open RightZoom and deactive it for the time you're using Illustrator CS6. Job done, working super fine
    You can re-activate "RightZoom" whilst you're done with Illustrator.
    Hope it can save someone the hassle I had!

  • Why does selecting a web link open 2 windows, one with the link and the other the home page? This is a single click of the mouse.

    When I single click on a weblink (usually in an email, Firefox starts up and opens two windows; one with the selected web page and one with my home page. If Firefox is running, it opens a new tab which is what normally occurs. It is only when it is not open that I now get the 2 windows. I have an imac running OSX 10.6.3
    == This happened ==
    Every time Firefox opened
    == In the past couple of weeks.

    Hi,
    The rolling over from radius servers only occurs on the same wlan and only when the controller deems the radius server being dead. However, if you get rejected from one WLAN but then you reassociate to another WLAN there is no mechanism in place in rejecting the attempt because they previously failed on a seperate wlan. This happens all the time with users connecting on incorrect wlans.
    The failover feature is for when you have multiple servers (usually for redundancy) on the same WLAN. So when user is rejected but radius server 1 the process stops there and the request isnt sent to radius server 2.
    Hope that helps!
    Tarik Admani
    *Please rate helpful posts*

  • How to differentiate between Single click and double click event in List

    I am facing a problem while using list in awt.
    I want to execute some code on single click and other on double click but when double click event occurs it also executes the single click code.
    because i have added both actionlistener and itemlistener on the list.
    How to sort out this problem.
    please help me out.
    Thanks buddies.

    Hello Meeraj_Kanaparthi
    Thanks for helping i m giving u the code i have tried.
    Plz help me on this...
    Thanks........
    import java.awt.*;
    import java.awt.event.*;
    class CheckList extends Frame implements MouseListener
         List l1;
         int x;
         int y;
         CheckList()
         setSize(500,500);
         setLayout(new FlowLayout());
         l1=new List(10);
         add(l1);
         l1.add("Item 1");l1.add("Item 2");l1.add("Item 3");l1.add("Item 4");l1.add("Item 5");
         x=6;
         y=0;
         l1.addMouseListener(this);
    //     l1.addItemListener(this);
         show();
         public void execute(int y)
         if(y==1)
         {System.out.println("3");
              l1.remove(l1.getSelectedIndex());
         if(y==2)
         {System.out.println("4");
              l1.add("item " + x);
              x++;
         public void mousePressed(MouseEvent e)
              System.out.println("Pressed");
         public void mouseReleased(MouseEvent e)
              System.out.println("Released");
         public void mouseEntered(MouseEvent e) {}
         public void mouseExited(MouseEvent e) {}
         public void mouseClicked(MouseEvent e)
         if (e.getClickCount()==1)
              System.out.println("1");
              y=1;
         if (e.getClickCount() == 2)
         {System.out.println("2");
              y=2;
              execute(y);
         public void actionPerformed(ActionEvent ae)
         public void itemStateChanged(ItemEvent it)
         public static void main(String ag[])
         new CheckList();
    }

  • Unselect Spark List when clicking in the empty area?

    Hi there.
    I'm wondering if it's possible to unselect a Spark List when clicking in the empty area?
    I've attached this function to the list's click event:
    protected function list_clickHandler(event:MouseEvent):void
        list.selectedIndex = -1;
    But the list gets unselected even if I click on a item in the list. Is there a way to prevent the event when clicking on an item?
    Thanks a lot!:)

    Hi
    It's because the event bubbles all the way up. You have to explicit stop the event doing so.
    You can do it within an "item_clickHandler(ev:Event)" where you can stop propagation via the Event stopImmediatePropagation or stopPropagation methodes...

Maybe you are looking for

  • IMac 27 mid 2010 graphics performance issue

    Hi all my iMac has a strange problem and I need to understand how to fix it. First of all, this my configuration: iMac 27'' - 2.8 ghz - 12 Gb RAM - ATI 5750 1GB GDDR5, Mountain Lion 10.8.2 The problem is simple. After a while, the graphic performance

  • White Screen Of Doom.  Someone save me .

    If someone can help me immediately, I would greatly appreciate it. When I turned on my computer after work tonight, everything seemed fine. The logo came up with the progress wheel and everything. However it was taking an unusual amount of time to lo

  • Please Read , my mic isnt working (creative soundblaster live! 24b

    Just now i installed my sound blaster card and installed the cd that came with it , i dont hear any sound and my mic is not working i have unmuted the mic in sourrend mixer , but still nothing. Also im using a headset (planatronics audio .90's). i ha

  • Row chaining in table with more than 255 columns

    Hi, I have a table with 1000 columns. I saw the following citation: "Any table with more then 255 columns will have chained rows (we break really wide tables up)." If I insert a row populated with only the first 3 columns (the others are null), is a

  • Value - based Auditing vs. Continuous Auditing

    Hi, I just learned about auditing in Oracle. Can anyone help, what is the difference between value - based auditing and continuous auditing? Thanks in advance