Doubleclick in listboxes
Hey
I used a attribute note called doubleclick in a listbox control, but when i
run another attribute note before the double click attribute, its reset the
doubleclick attribute. Is there a way out of this.
Regards
EsJ
implement a mouselistener and pick one of the necessary methods (let's say mouseClicked( MouseEvent evt) ). Then, Get the mouse event (it's the parameter of the mouseClicked() method) and check to see if it was a double click
evt.getClickCount(), see if it's two (i.e. two clicks = double click) , also you can check if it's the left or right mouse button by using:
javax.swing.SwingUtilities.isLeftMouseButton(evt) which returns a boolean indicating if it was the left mouse button, there is also a method for right mouse button.
Hope this helps...
Similar Messages
-
Onclick and doubleclick event not working in CC
hi.. onclick and doubleclick event not working in CC.. how to get these events to work?
Please advise anyone. Thanks alot!Is your event target a ListBox?
In that case there are serious issues to deal with:
http://indiscripts.com/blog/public/ScriptUIEvents.pdf
@+
Marc -
DoubleClick List Item with Icon (is this a bug)
DoubleClick event is not called when you double click an Icon
displayed in a list !
Help ! is this a bug or me being thick ??
Demo App Below (just supply your own Icon.)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" width="566" height="526">
<mx:Script>
<![CDATA[
[Embed(source="icons/folder.gif")] public var
folderIcon:Class;
[Bindable]
public var myList: Array = [ {label:"None", data:"",
myIcon:"folderIcon"},
{label:"Dataset", data:"Dataset", myIcon:"folderIcon"},
{label:"Image", data:"Image", myIcon:"folderIcon"},
{label:"Interactive Resource", data:"Interactive",
myIcon:"folderIcon"},
{label:"Moving Image", data:"MovingImage",
myIcon:"folderIcon"},
{label:"Software", data:"Software", myIcon:"folderIcon"},
{label:"Sound", data:"Sound", myIcon:"folderIcon"},
{label:"Text", data:"Text", myIcon:"folderIcon"}];
public function ItemSelected():void {
Log.text = "Clicked " + listbox.selectedItem.label + "\r" +
Log.text;
public function ItemDoubleClick():void {
Log.text = "DoubleClicked " + listbox.selectedItem.label +
"\r" + Log.text;
]]>
</mx:Script>
<mx:List x="127" y="30" id="listbox" labelField="label"
width="312" height="275"
borderStyle="solid" iconField="myIcon" cornerRadius="6"
enabled="true"
doubleClickEnabled="true" doubleClick="ItemDoubleClick();"
click="ItemSelected();"
dataProvider="{myList}">
</mx:List>
<mx:TextArea x="127" y="393" width="312" height="80"
liveScrolling="true" id="Log"/>
<mx:Label x="128" y="367" text="Log"/>
</mx:Application>You got my mind cranking so your fix did help me. Thank you
very much. Here is my archaic workaround.
// To get around the double click on the list box adobe bug
private var doubleClickTimer:Timer = new Timer(1000, 1); //
one second
private var singleClick:Boolean = false;
private function courseFiles_click():void
if(isDoubleClick())
courseFiles_doubleClick();
private function isDoubleClick():Boolean
var myReturn:Boolean = false; // default false
if(singleClick)
myReturn = true; // we get here if it is a double click so
return true
if(singleClick == false)
// init timer
doubleClickTimer.start();
doubleClickTimer.addEventListener(TimerEvent.TIMER_COMPLETE,
onTimerCompleteDoubleClickTimer);
singleClick = true;
return myReturn;
private function
onTimerCompleteDoubleClickTimer(evt:TimerEvent):void
singleClick = false; // set it to false after the timer
interval
} -
Hello,
i am working on evenment structure. I have a Source list box . I have created a Target listbox by doubleclicking everytime on an element in the Source listbox.
My goal is to create on the same line of every element in the Target listbox 3 commands: 2 time commands (Start & END time) and a boolean command.
These commands are used as entries to Write Trace and Historical Trend blocks. Then i should be able to change them all time.
How could i do that ?
Thx
Samer,Hi samer,
it seems you want to mix several datatypes, so an array of clusters would be fine...
(The example is not perfect, but should show how to get your task done.)
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome
Attachments:
Unbenannt 2_LV80.vi 25 KB -
Get selected values from Listbox control
Hi All,
I'm still new to SL so please bear with me.
I have a ListBox being bound with some records from a DB. Here's the xaml:
<ListBox x:Name="lstClassSeries" SelectionMode="Multiple" DisplayMemberPath="Description" Grid.Row="11" Grid.Column="1"></ListBox>
What I need is to get the values of the items that were selected and I can't seem to get it to work. I've tried looping through the SelectedItems but there's no property for value or text. I even tried to cast the item as a ListBoxItem but I
get the following error:
Unable to cast object of type 'UI.Silverlight.TransactionService.DTODropDown' to type 'System.Windows.Controls.ListBoxItem'.
How can I get the values of the items selected?
ThanksYou're using windows forms style techniques with xaml.
This is a bad idea.
You ought to learn MVVM.
You probably don't think you want to learn it, but trust me on this one.
Learn MVVM as soon as you can.
There's a selecteditems collection.
You have to cast to listboxitem, it has a content property which you cast to whatever you put in there originally.
Here's a snippet.
I have a class foo, load a bunch of them in. Do stuff. Work out what's selected in the click event of a button.
public class foo
public int id {get;set;}
public string description {get;set;}
public partial class MainPage : UserControl
public MainPage()
InitializeComponent();
lb.Items.Add(new ListBoxItem{Content=new foo{ id=1, description="a"}});
lb.Items.Add(new ListBoxItem { Content = new foo { id = 2, description = "b" } });
lb.Items.Add(new ListBoxItem { Content = new foo { id = 3, description = "c" } });
private void Button_Click(object sender, RoutedEventArgs e)
List<foo> selectedfoos = lb.SelectedItems.Cast<ListBoxItem>().Select(x=>x.Content as foo).ToList();
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML -
How to populate values in listbox of a field?
HI all,
My requirement is : i have one filed , for that i have five values,
i want to display those five values in the list box. then i have to select one of them and based on this field i have to display few fields in table control .
here i am able to display the values in listbox but even i select any value , it showing the first vale only !!!!!!
please help me in this regard.This is the way........
DATA: DYNFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.
DATA : L_PSPNR TYPE PROJ-PSPID,
L_WBSE TYPE PRPS-POSID.
PARAMETERS : P_BPO TYPE CKIS-EXTNR
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BPO.
DATA : BEGIN OF IT_BPO OCCURS 100,
BPO LIKE ZCKIS-BPO,
END OF IT_BPO.
DYNFIELDS-FIELDNAME = 'P_PSPNR'.
APPEND DYNFIELDS.
CLEAR DYNFIELDS.
DYNFIELDS-FIELDNAME = 'P_WBSE'.
APPEND DYNFIELDS.
CLEAR DYNFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = DYNFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
Rewards if satisfied
Thanks -
How can i add to a listBox items near in a new column other items ?
The items on the right i changed the property of the listBox1 righttoleft to Yes.
My problem is i want to build a new column for the number so each number i'm adding will be next on the left to the belong item string. And not under it like now.
1. Maybe i need to use another control and not listBox ?
2. How can i add column/s and also maybe adding a title to each column like: Names Id Number....?If you want columns, you should consider a
ListView or
DataGridView. -
Goto field and listbox color formats
i've got two questions
1. i've scripted a functional listbox (field2) that hides or shows fields depending on options selected ('yes' opens field2a, 'no' hides field2a) but depending the option chosen i want to 'go to' an appropriate field. example: 'yes' automatically goes to field2a, 'no' proceeds to field3
as it is the 'yes' jumps to field3 and 'no' goes back to the top of the page. is there a command/script i can enter at the end of the 'if' and 'or' statement that will place the cursor in a designated field?
2. the list box only shows as white text on a blue background. is there a way to make it show like a regular text box (black text on a white background)?
any help is greatly appreciated!!
..joseph gYou are sure you are getting only "No" and "Yes" from your list box?
$host.messageBox(Concat("Event value = ", event.vlaue), "Verify Event Value", 3, 1);
if (event.value=="No") {
this.getField("5S1").hidden = true;
xfa.host.setFocus("8");
}else {
if (event.value=="Yes") {
this.getField("5S1").hidden = false;
xfa.host.setFocus("5S1") };
Are your 2 fields are not in the same section, you will need to provide the full reference. -
Hi guys,
I have a question.
I have a from xml populated listbox and want to select by pushing a button all populated items in the list.
this is my code.
the interesting thing is, that this code works before I import xml data, but as soon as i import xml data, it doesnt work anymore.
Do you have any idea, what the problem is and how can I fix it?
and second question. Is it possible deselect single items, when all are selected?
var temp1 = "";
for (i=0;i< PAGE3.ListBox1.length.rawValue;i++){
temp1 = temp1 + ListBox1.getDisplayItem(i) + "\n";
ListBox1.rawValue = temp1
Thank you in advance for any help!!
DianaThe code should work as long as you set "Allow Multiple Selection" at design time.
However I will suggest small change to your code...try the following...
var temp1 = "";
for (i=0;i< PAGE3.ListBox1.length;i++){
temp1 = temp1 + ListBox1.getDisplayItem(i) + "\n";
ListBox1.rawValue = temp1
Hold "Ctrl" btn for deselcting from the list. -
Get All images from a website and put them in a listbox.
Hi Everyone, I am new to Java Programming.
I wanted to know if there is a way to get all the images in a website and put them in a listbox. And if an item is clicked in list box, view it in a picturebox.Harsimran_Singh wrote:
what is the whole idea about .Net vs. Java...guys, .NET users are so friendly and helpful, they don't even judge english
This is not putting a good impression of Java Users on me.good luck with .net. im sorry that things didnt work out with java.
unfortunately, .net is essentially a clone of java so you may find that you will be looking
to learn exactly the same things but for an expensive propriety platform.
if you change your mind, read:
[swing tutorials|http://java.sun.com/docs/books/tutorial/uiswing/]
jlist
listcellrenderer
[list tutorial|http://java.sun.com/docs/books/tutorial/uiswing/components/list.html]
[advanced list programming|http://java.sun.com/products/jfc/tsc/tech_topics/jlist_1/jlist.html]
on your way out thank the moderators : ) -
How to select multiple values from a listbox
Hi,
I have a list box on my UI which is not allowing me to select multiple values
I want to use multi select list box .. When i go to source of UI component and change that to select many listbox my page is not rendering it is giving error
When i drag & drop the component i am unable to drop it as a multi select list box that option is not coming.
I am working on Jdev 11.1.1.3 and I am using ADF/BC components
How to select multiple values from a listbox ?
Thanks,Hi,
I want to use multi select list box .. When i go to source of UI component and change that to select many listbox my page is not rendering it is giving errorank
And what is the error ?
Frank -
Removing selected items from listbox
Hi ADF Experts,
I have a selectmanylistbox with few values displaying in UI and a Remove Button at the bottom.
User selects certain items from the listbox and clicks on Remove button. The selected items should be reomved. Can anybody suggest how to do this.
Thanks,
AnimeshDuplicate of https://forums.oracle.com/thread/2562542
User, please don't ask the same question multiple times. If you don't get the answer you want it may be because you did not give the right information and or use case me understand.
Timo -
Getting selected value from Listbox
Hi,
I have populated my listbox on the selection screen using the function module VRM_SET_VALUES.
How do I get the value which is selected from the list box.
Where is the selected value in the listbox stored.
Thanks,
AbhishekThe code I used is:
Another issue is that whenever I select any value in the listbox it is not displayed on the screen. It becomes blank again.
PARAMETERS: p_prin AS LISTBOX VISIBLE LENGTH 30 USER-COMMAND sele.
DATA: i_printers TYPE STANDARD TABLE OF frprlist,
wa_printers TYPE frprlist.
DATA: l_name TYPE vrm_id,
i_list TYPE vrm_values,
l_ctr TYPE i VALUE 0,
wa_value LIKE LINE OF i_list.
CLEAR: wa_value.
Get printers
CALL FUNCTION 'RSPO_FRONTEND_PRINTERS_FOR_DEV'
EXPORTING
device = p_print
TABLES
list = i_printers
EXCEPTIONS
no_list = 1
list_truncated = 2
name_not_found = 3
OTHERS = 4.
IF sy-subrc EQ 0.
Populate to drop down box
l_name = c_prin.
LOOP AT i_printers INTO wa_printers.
l_ctr = l_ctr + 1.
wa_value-key = l_ctr.
wa_value-text = wa_printers-prname.
APPEND wa_value TO i_list.
CLEAR wa_value.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = l_name
values = i_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc NE 0.
Do nothing
ENDIF.
ENDIF.
CLEAR: l_name, l_ctr, wa_value, i_list. -
Display selected item from Listbox
hi,
i get <h:selectOneListbox> value from database, now i want to know which item is selected in the listbox
my JSP code is
<h:selectOneListbox binding="#{DynamicListBean.std_list_lbx}" id="std_list_lbx" immediate="true"
onchange="common_timeoutSubmitForm(this.form, 'std_list_lbx');" required="true" size="5"
style="height: 312px; left: 168px; top: 192px; position: absolute; width: 216px" value="#{DynamicListBean.selectedCategory1}" valueChangeListener="#{DynamicListBean.std_list_lbx_processValueChange}">
<f:selectItems id="listbox1SelectItems1" value="#{DynamicListBean.items1}"/>
</h:selectOneListbox>Java code is public String getSelectedCategory1() {
return selectedCategory1;
public void setSelectedCategory1(String selectedCategory1) {
this.selectedCategory1 = selectedCategory1;
public void std_list_lbx_processValueChange(ValueChangeEvent vce) {
connection();
int n1 = 0;
String a = "";
if (con != null) {
try {
stmt = con.createStatement();
String query = "select std_id, std_name from std_detail";
rs = stmt.executeQuery(query);
String iddata = "";
if (rs != null) {
while (rs.next()) {
iddata = rs.getString("std_id");
// System.out.println(rs.getInt("std_id"));
stmt1 = con.createStatement();
String query1 = "select chpt_detail from chapter_detail right outer join std_detail on chapter_detail.std_id = std_detail.std_id where chapter_detail.std_id = " + iddata + " ";
String data3 = "";
rs1 = stmt1.executeQuery(query1);
if (rs1 != null) {
while (rs1.next()) {
data3 = rs1.getString("chpt_detail");
chpt_lst_lbx.setValue(data3);
dList2.add(data3);
stmt1.close();
rs1.close();
List selectItems = new ArrayList();
Iterator it = dList2.listIterator();
while (it.hasNext()) {
String label = (String) it.next();
chpt_lst_lbx.setValue(label);
selectItems.add(new SelectItem(label));
items2 = (SelectItem[]) selectItems.toArray(new SelectItem[0]);
stmt.close();
rs.close();
con.close();
} catch (Exception e) {
System.out.println("Sorry failed to display values from the database table. " + e.getMessage());
System.out.println(e);
}any idea or suggestion tell meYou usually use the property behind value="#{DynamicListBean.selectedCategory1}" for that. But in your case you'll need the vce.getNewValue() as the valueChangeListener is been invoked before the property is been set.
Having said that, your code is terrible. Please read on about the DAO pattern. Further on, did you know that you can also just use List<SelectItem> instead of SelectItem[] as f:selectItems value?
If you want to populate child menu's, you may find this article useful to avoid future and painful problems: [http://balusc.blogspot.com/2007/10/populate-child-menus.html]. -
Hi,
I have a ListBox populated with values. The user can select multiple values. One of the values is "OTHER". If this is selected (alone or amongst multiple selections) a text field should be turned from read only to open.
So far I can do this only when the OTHER value is selected by itself. How can I modify my current script to accommodate for multiple selections?
Current JavaScript:
if (this.rawValue == "OTHER - Please Specify")
PO.main.Subform5.OtherRegion.rawValue = "-->SPECIFY<--";
PO.main.Subform5.OtherRegion.access = "open";
else
PO.main.Subform5.OtherRegion.rawValue = "------";
PO.main.Subform5.OtherRegion.access = "readOnly";
ThanksTry something like this
<select size="1" name="tst" tabindex="3">
<option value="item1">item1</option>
<option value="item2">item2</option>
<option value="item3">item3</option>
</select>
then in the response
<%
String result = request.getParameter("tst");
out.println("You selected: " + result);
%>
I haven't tested this out, but I believe something like this should work
Maybe you are looking for
-
Creating a Good Receipt PO via DI API No matching records found (ODBC -2028)
Hi, I trying to create a Good Receipt PO via DI API. It is working when the user I used to log in to SAP via the DI API is a Professional User but when I changed it to a Limited Logistics User, I'm receiving the No matching records found (ODBC -2028
-
Do we document BOM information for each item in BR100 for BOM?
Hi, I'm working on BR100 for BOM. I noticed that in BR100 BOM template there is not a section for the documentation of BOMs for each item. I wonder if the standard is not documenting any of that information in this document? Thanks a lot, Robert
-
WHAT IS MEANT RFC METADATA?
Hi What is meant by RFC METADATA? BR SAGAR
-
Sync Issue (different(
Something weird is going on with my ipod. When I plug in my ipod it shows its connected but nothing is transfered to it. After that I click the playlists I want on my ipod and click apply and says that its syncing on itunes, but nothing is happening
-
Why is the FileFilter class for the JFileChooser an abstract class? How easy would it have been for Sun to do the following (see code below)? It would certainly save on code bloat and make file handling programs just that little more compact, which i