Hi Srikanth,

There is not attachment, so I couldn't look at it ;-)

Since Flex/Flash application is running within browser, if you do JavaScript
alerts, focus is set to html/browser from Flash player. The application
doesn't have focus until a user clicks somewhere in the Flex/Flash
application.

This is known problem, which is mostly because of browser. However, send the
code we will see what other alternatives can help you.

-abdul


-----Original Message-----
From: Srikanth Duvvuri [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 08, 2005 4:54 PM
To: [email protected]
Subject: RE: [flexcoders] couple of things needed for dropdown


Hi Abdul

Can you have a look at the attached mxml file. This is regarding setting
focus to a combobox.

If you open the mxml in a browser and click on the go button, you get an
alert message. Now acknowledge the alert by pressing the space bar. The
focus does not go to the combo box i.e. clicking the down arrow does
nothing. Click on the go button again. Now acknowledge the alert message by
clicking on the ok button. Now press the down arrow and you find that the
combobox gets the select event and you can see the values changing.

Why is there a difference in behaviour depending on how we acknowledge the
alert message

Note: we are able to set focus to the combobox if we generate the alert
message from flex but are unable to set focus to combobox if the alert
message is generated from a javascript function, which is invoked on
clicking a button. 

Another observation: we unable to set focus to a textinput if the alert
message is being generated from a javascript function. Our existing
application has numerous instances of alert messages being generated from
javascript functions. So changing all these to alert messages from flex may
not be acceptable

Your inputs please

Srikanth



-----Original Message-----
From: Abdul Qabiz [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 08, 2005 1:33 PM
To: [email protected]
Subject: RE: [flexcoders] couple of things needed for dropdown


Hi Srikanth,

I will look into this issue, I will confirm the same later in evening.

Thanks

-abdul 

-----Original Message-----
From: Srikanth Duvvuri [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 08, 2005 1:25 PM
To: [email protected]
Subject: RE: [flexcoders] couple of things needed for dropdown


Hey Abdul

Shall look into the combobox focus thing sent by you

Regarding the other point, yeah I mean the scroll wheel on the mouse. I
am
using IE 6.0 and it does not work. Dunno why??

Srikanth



-----Original Message-----
From: Abdul Qabiz [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 08, 2005 1:23 PM
To: [email protected]
Subject: RE: [flexcoders] couple of things needed for dropdown


See inline comments:-




> 1.Need to be able to set focus to a dropdown. Scenario: Click on save
button and you find that there is a validation error which needs the
user to
make a/another 
> choice on the dropdown. The focus should get set to the dropdown. 

Setting the focus on ComboBox while mouse is still over Button, would be
hard. But there is a better of doing validation, you can use Validator
to
show error messages. If user has selected a wrong option, ComboxBox's
border
would turn read and doing a mouse-hover would reveal a error message.

See the example code below.




> 2.Need facility to be able to scroll through the list of values in a
dropdown using the roller button on a mouse. This does not seem to
happen
for a dropdown created 
> using Flex 

You mean Scroll Wheel in Mouse. It does work, did you test in browser?
it
works on Firefox as well as IE.


###test.mxml###

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";
creationComplete="onAppInit()" >
<mx:Script>
<![CDATA[
var countries;

function onAppInit()
{
countries = ["India", "Pakistan", "Sri Lanka",
"Indonesia", "Singapore", "USA", "UAE"];
}

function validateCountry(validator, value)
{


if (value == "Pakistan" || value ==
"Indonesia") {
validator.validationError("Wrong
Country", "This country is not supported country list.", "country");

}
}

]]>
</mx:Script>
<mx:Model id="membership">
<country>{countryNames_cb.value}</country>
</mx:Model>
<mx:Form id="membershipForm">
<mx:FormItem id="countryNamesItem" label="Countries">
<mx:ComboBox id="countryNames_cb" dataProvider="{countries}"/>
</mx:FormItem>
</mx:Form>
<mx:Validator field="membership.country" listener="countryNames_cb"
validate="validateCountry(event.validator, event.value);"/>
</mx:Application>




HTH,

-abdul



Yahoo! Groups Links










Yahoo! Groups Links









Yahoo! Groups Links










Yahoo! Groups Links








Reply via email to