You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Devesh Mishra <De...@mastek.com> on 2013/11/19 11:21:29 UTC

RE: Issue with setFocus method of UIComponent

Hi Alex,

I have tried to write a JavaScript method using ExternalInterface to set the focus of browser window first (As it is suggested in this forum - http://forums.adobe.com/thread/452365), then I set the focus of textInput control in Flex. 

After this, I don't need to click manually on textInput control, but it's only working in IE, not in firefox & chrome.

Any solution, please suggest ?

-----Original Message-----
From: Alex Harui [mailto:aharui@adobe.com] 
Sent: 19 November 2013 12:31
To: users@flex.apache.org
Subject: Re: Issue with setFocus method of UIComponent

Generally, you have to click somewhere in the SWF once to activate it.
SWFObject claims it can set your SWF to the active state programmatically
on all browsers, but I've only seen it work on IE.

On 11/18/13 10:03 PM, "Devesh Mishra" <De...@mastek.com> wrote:

>Hi,
>
>I am facing one issue related to setFocus() method of UIComponent. I have
>one textinput and I have written textInput.setFocus() on creationComplete
>of application i.e.
>
>private function onCreationComplete():void
>{
>                textInput.setFocus(); // 1st approach
>
>                textInput.focusManager.setFocus(textInput); // 2nd
>approach
>                textInput.focusManager.showFocus();
>}
>
>While using both the approach, I can see that my text input has got a
>cursor which shows that it has got focus. But issue is that it doesn't
>get any input from keyboard until or unless I click on text input
>manually.
>
>Is this behaviour normal in Flex or is there any issue with Flash Player
>which I am using or any issue with browser ?
>
>Flex SDK: 4.1
>Browser & Flash Player Version
>
>1.       IE 9 with Flash Player debugger version 11.3.300.257...
>
>2.       Chrome 15.0.874.121 with Flash Player 11.1.102.55...
>
>3.       Firefox 20.0.1 with Flash Player 11.9.900.117...
>
>
>--
>Devesh
>MASTEK LTD.
>In the US, we're called MAJESCOMASTEK
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Opinions expressed in this e-mail are those of the individual and not
>that of Mastek Limited, unless specifically indicated to that effect.
>Mastek Limited does not accept any responsibility or liability for it.
>This e-mail and attachments (if any) transmitted with it are confidential
>and/or privileged and solely for the use of the intended person or entity
>to which it is addressed. Any review, re-transmission, dissemination or
>other use of or taking of any action in reliance upon this information by
>persons or entities other than the intended recipient is prohibited. This
>e-mail and its attachments have been scanned for the presence of computer
>viruses. It is the responsibility of the recipient to run the virus check
>on e-mails and attachments before opening them. If you have received this
>e-mail in error, kindly delete this e-mail from desktop and server.
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Integer value conver to currency format

Posted by raghav kulshrestha <ra...@firmwisegroup.com>.
Hi All,
       Plz Tell me how to conver integer value to currency format in apache
flex .

Raghav Kulshrestha




RE: Integer value conver to currency format

Posted by raghav kulshrestha <ra...@firmwisegroup.com>.
Thanks Justin,
		This process i used it but in datagrid this value not sorted
according number but it sorted according string then data is not correct.
Thanks,
Raghav




RE: Integer value conver to currency format

Posted by raghav kulshrestha <ra...@firmwisegroup.com>.
Hi Justin
		<mx:CurrencyFormatter id="Price" precision="2"
							  rounding="none"
	
decimalSeparatorTo="."
	
thousandsSeparatorTo=","
	
useThousandsSeparator="true"
	
useNegativeSign="true"
							  currencySymbol="$"
	
alignSymbol="left"/>


					if(arr[4]==Global._Cty &&
arr[5].toString().indexOf(Global._Prd.substr(0,1))!=-1){
						var r1:int=sno++;
						var
r2:String=arr[0].toString();
						var r3:int=arr[1];
						var r4:Number=arr[2];
						
						var
r5:String=arr[3].toString();
						
						arrcol2.addItem(new
raghavGrid(r1,r2,r3,numForm.format(r4),r5));
					
					}
In this example i used currencyformatter in my Apps and r4 variable is int
type raghavGrid is As Class and but not sorted.

Thanks
Raghav 




Re: Integer value conver to currency format

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,
> This process i used it but in datagrid this value not sorted
> according number but it sorted according string then data is not correct.

You can set the sorftSompareFunction on the data grid column. If you post some sample code (or a link to it) it may be easier for people to help you.

Thanks,
Justin

Re: Integer value conver to currency format

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> Plz Tell me how to conver integer value to currency format in apache flex .

Use the CurrancyFormatter format method, it  takes Numbers or a Strings. Ints will be converted to Number when passed.

http://flex.apache.org/asdoc/spark/formatters/CurrencyFormatter.html

Thanks,
Justin

Re: Issue with setFocus method of UIComponent

Posted by Alex Harui <ah...@adobe.com>.

On 11/19/13 2:21 AM, "Devesh Mishra" <De...@mastek.com> wrote:

>Hi Alex,
>
>I have tried to write a JavaScript method using ExternalInterface to set
>the focus of browser window first (As it is suggested in this forum -
>http://forums.adobe.com/thread/452365), then I set the focus of textInput
>control in Flex. 
>
>After this, I don't need to click manually on textInput control, but it's
>only working in IE, not in firefox & chrome.
>
>Any solution, please suggest ?
Like I said, I've never seen it work anywhere but IE.  You are welcome to
contact the SWFObject folks and look at their forum for help.

-Alex


Re: Issue with setFocus method of UIComponent

Posted by Alex Harui <ah...@adobe.com>.

On 11/19/13 2:21 AM, "Devesh Mishra" <De...@mastek.com> wrote:

>Hi Alex,
>
>I have tried to write a JavaScript method using ExternalInterface to set
>the focus of browser window first (As it is suggested in this forum -
>http://forums.adobe.com/thread/452365), then I set the focus of textInput
>control in Flex. 
>
>After this, I don't need to click manually on textInput control, but it's
>only working in IE, not in firefox & chrome.
>
>Any solution, please suggest ?
Like I said, I've never seen it work anywhere but IE.  You are welcome to
contact the SWFObject folks and look at their forum for help.

-Alex