Jay Roy
asked on
capture selected value from mouseover
hi guys
i have a requirment where i have a label . when user puts the cursor on the label
a small window should popup and show the usernames from an ArrayCollection. When a username is clicked the clicked username should be passed to backend.
Here is the mxml
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:projectWork="org.vie w.projectW ork.*"
xmlns:projectNav="org.view .projectNa v.*"
creationComplete="init()"
styleName="dashBoardPage"
xmlns:services="services.* ">
<mx:Script >
<![CDATA[
import org.entity.project.Project SummaryDTO ;
[Bindable]
public var users:ArrayCollection; --> this collection has a list of usernames
public var selectedusername:String; -->holds the selected username
<mx:Label styleName="usernames" text="show users"/> --when user puts mouse here, a window should popup and show the usernames from 'users' Arraycollection
<mx:VBOX>
If 5 usernames are displayed in the box , when user clicks on a username i need to capture that username and pass it to the backend.
So i have created a string var 'selectedusername' which will contain the selected username.
Am i in the right direction?
Can anyone please help me with some code
thanks
i have a requirment where i have a label . when user puts the cursor on the label
a small window should popup and show the usernames from an ArrayCollection. When a username is clicked the clicked username should be passed to backend.
Here is the mxml
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:projectWork="org.vie
xmlns:projectNav="org.view
creationComplete="init()"
styleName="dashBoardPage"
xmlns:services="services.*
<mx:Script >
<![CDATA[
import org.entity.project.Project
[Bindable]
public var users:ArrayCollection; --> this collection has a list of usernames
public var selectedusername:String; -->holds the selected username
<mx:Label styleName="usernames" text="show users"/> --when user puts mouse here, a window should popup and show the usernames from 'users' Arraycollection
<mx:VBOX>
If 5 usernames are displayed in the box , when user clicks on a username i need to capture that username and pass it to the backend.
So i have created a string var 'selectedusername' which will contain the selected username.
Am i in the right direction?
Can anyone please help me with some code
thanks
ASKER
by dataprovider do you mean datagrid? I dont want to use a datagrid. My boss wants a pop-up window when the mouse cursor is placed on the label. Is that possible?
thanks
thanks
Everything is possible just need to know what you want
<mx:Script>
<![CDATA[
import mx.controls.Alert;
]]>
</mx:Script>
<mx:Label styleName="usernames" text="show users" mouseOver="Alert.show(even t.target.t ext)"/>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
]]>
</mx:Script>
<mx:Label styleName="usernames" text="show users" mouseOver="Alert.show(even
ASKER
Ok cool.. When I click on a username I need to pass the username to my
java backend. Any idea how I can do that?
Thanks for the help
java backend. Any idea how I can do that?
Thanks for the help
what services are you using? RemoteObject, WebService or HttpService?
ASKER
using RemoteObject to call java methods. So i am basically passing the selected username
to the backend java method.
thx
to the backend java method.
thx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
cool, thx very much
>><mx:Label text="Current Selected User is '{selectedUser}'" click="selectUser(event)"/ >
Instead of click, i should be able to do 'mouseover' ,right ?
>><mx:Label text="Current Selected User is '{selectedUser}'" click="selectUser(event)"/
Instead of click, i should be able to do 'mouseover' ,right ?
you can assign any events for Label component. (focus, mouseOver, mouseDown, click etc..)
ASKER
thanks.
trying to impliment this , have a question
You have
<mx:arguments>
<user>{selectedUser}</user>
</mx:arguments>
i understand the arguments tag, but can you tell me what is <user> tag? Is this a tag in Flex?
thanks.
trying to impliment this , have a question
You have
<mx:arguments>
<user>{selectedUser}</user>
</mx:arguments>
i understand the arguments tag, but can you tell me what is <user> tag? Is this a tag in Flex?
thanks.
No user is function argument on the server side.
http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html
http://johncblandii.com/2008/01/tip-mxremoteobject-method-arguments.html
or you can create a bean object
http://codeofdoom.com/wordpress/2009/02/01/blazeds-with-remote-objects-example/
http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html
http://johncblandii.com/2008/01/tip-mxremoteobject-method-arguments.html
or you can create a bean object
http://codeofdoom.com/wordpress/2009/02/01/blazeds-with-remote-objects-example/
ASKER
thx v much, it works perfectly.
can you please help out with the next question
https://www.experts-exchange.com/questions/26916522/display-data-in-multiple-rows.html
thx.
can you please help out with the next question
https://www.experts-exchange.com/questions/26916522/display-data-in-multiple-rows.html
thx.
when user click on row you will listen itemClick event and set selectedusername - event.target.selectedItem;