You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by storo84 <se...@gmail.com> on 2014/06/10 00:37:37 UTC

Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Hello everyone,

I used to be able to toggle the property *displayAsPassword* of a /TextInput
/ in a very simple way:

/<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
		xmlns:s="library://ns.adobe.com/flex/spark"
		title="DisplayAsPassword">
	
	<fx:Script>
		
	</fx:Script>
	
	<s:TextInput id="appPassword"
				 restrict="-A-Za-z0-9._" displayAsPassword="true"
				 top="20" left="0" right="0"/>
	<s:CheckBox id="showPasswordButton"
				change="togglePasswordDisplay(event)"
				top="{appPassword.y + appPassword.height + 20}" right="0"/>
	
</s:View>/

The previous code used to work when using SDK version 4.6, but now, that I'm
using 4.12.0 it doesn't. It should be pretty straight-forward so why isn't
it working?

Any help is appreciated.

Regards,

Sebastián





--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-displayAsPassword-in-TextInput-as-in-previous-versions-tp6790.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Posted by storo84 <se...@gmail.com>.
Hello Swen,

Thanks for answering. I don't know why you can´t see that part of the code.
I did insert it and am able to see it. Although, when i try to quote it, it
doesn't appear.

                        //**
			 * Shows or hides the characters in the password field.
			 */
			protected function togglePasswordDisplay(event:Event):void
			{
				appPassword.displayAsPassword = !event.target.selected;
			} /

The function is incredibly simple.

Regards,

S



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-displayAsPassword-in-TextInput-as-in-previous-versions-tp6790p6795.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Posted by Swen van Zanten <in...@hdsign.nl>.
What you didn't copy from the example project when is use to work was the function you pass in on the checkbox change event..

The script part is empty in your code snippet.
And the checkbox is executing that function

Verstuurd vanaf mijn iPhone

> Op 10 jun. 2014 om 00:38 heeft "storo84" <se...@gmail.com> het volgende geschreven:
> 
> Hello everyone,
> 
> I used to be able to toggle the property *displayAsPassword* of a /TextInput
> / in a very simple way:
> 
> /<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
>        xmlns:s="library://ns.adobe.com/flex/spark"
>        title="DisplayAsPassword">
>    
>    <fx:Script>
>        
>    </fx:Script>
>    
>    <s:TextInput id="appPassword"
>                 restrict="-A-Za-z0-9._" displayAsPassword="true"
>                 top="20" left="0" right="0"/>
>    <s:CheckBox id="showPasswordButton"
>                change="togglePasswordDisplay(event)"
>                top="{appPassword.y + appPassword.height + 20}" right="0"/>
>    
> </s:View>/
> 
> The previous code used to work when using SDK version 4.6, but now, that I'm
> using 4.12.0 it doesn't. It should be pretty straight-forward so why isn't
> it working?
> 
> Any help is appreciated.
> 
> Regards,
> 
> Sebastián
> 
> 
> 
> 
> 
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-displayAsPassword-in-TextInput-as-in-previous-versions-tp6790.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Posted by storo84 <se...@gmail.com>.
Hello everyone,

I just wanted to add that I tested the previous code using Flex 4.12.1 and
Flex 4.11.0. The lastest SDK release (4.12.1) presents the same behaviour,
while the previous release (4.11.0) didn't show any problems with the
previous code.

Clearly the issue was added on version 4.12.0.

Regards,

Sebastián



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-displayAsPassword-in-TextInput-as-in-previous-versions-tp6790p6803.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Posted by storo84 <se...@gmail.com>.
Hello Alex,

The bug was submited. You can find it on this  link
<https://issues.apache.org/jira/browse/FLEX-34365>  .

Regards,

Sebastián



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-displayAsPassword-in-TextInput-as-in-previous-versions-tp6790p6801.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Posted by Alex Harui <ah...@adobe.com>.
Please file a bug with a test case so we can track this issue.

On 6/10/14 9:25 AM, "storo84" <se...@gmail.com> wrote:

>Hi Swen,
>
>Binding the /displayAsPassword/ to the /selected/ property of the
>/CheckBox/
>does solve half of the issue: the text inside the /TextInput /does appear
>when the /CheckBox/ is selected and hides when it's not.
>
>The other part of the problem is that when the text appears and you focus
>on
>the component, the key blinking cursor appears at the position where the
>end
>of the text would be if it where hidden using "*". In fact, when you
>select
>the text, the blue selection appears to select from the beggining of the
>text up to its in-hidden-mode end, even though it is /displayAsPassword/
>is
>/false/.
>
>When was this bug introduced?
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-di
>splayAsPassword-in-TextInput-as-in-previous-versions-tp6790p6797.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Posted by storo84 <se...@gmail.com>.
I've tested this issue only using spark components and only using mobile
environments. Probably that's why the issue is not present in the 4.6 or
4.11.

Regards,

S



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-displayAsPassword-in-TextInput-as-in-previous-versions-tp6790p6807.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Posted by Peter Ginneberge <p....@gmail.com>.
At least 4.6, but it may actually always have been like that. And only with 
the Halo framework.

regards,
Peter

On 10/06/2014 19:18, storo84 wrote:
> Hello Peter,
>
> Great workaround. When did you start noticing this bug?
>
> Regards,
>
> S
>
>
>
>
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-displayAsPassword-in-TextInput-as-in-previous-versions-tp6790p6799.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
> .
>

Re: Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Posted by storo84 <se...@gmail.com>.
Hello Peter,

Great workaround. When did you start noticing this bug?

Regards,

S




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-displayAsPassword-in-TextInput-as-in-previous-versions-tp6790p6799.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Posted by Peter Ginneberge <p....@gmail.com>.
 > The other part of the problem is that when the text appears and you focus on
 > the component, the key blinking cursor appears at the position where the end
 > of the text would be if it where hidden using "*". In fact, when you select
 > the text, the blue selection appears to select from the beggining of the
 > text up to its in-hidden-mode end, even though it is /displayAsPassword/ is
 > /false/.

That is indeed a nasty bug and the only fix I know of is to use a "fixed 
width" (monospace) font, which makes the text in both cases just as wide thus 
"hiding" the actual bug.

regards,
Peter


On 10/06/2014 18:25, storo84 wrote:
> Hi Swen,
>
> Binding the /displayAsPassword/ to the /selected/ property of the /CheckBox/
> does solve half of the issue: the text inside the /TextInput /does appear
> when the /CheckBox/ is selected and hides when it's not.
>
> The other part of the problem is that when the text appears and you focus on
> the component, the key blinking cursor appears at the position where the end
> of the text would be if it where hidden using "*". In fact, when you select
> the text, the blue selection appears to select from the beggining of the
> text up to its in-hidden-mode end, even though it is /displayAsPassword/ is
> /false/.
>
> When was this bug introduced?
>
>
>
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-displayAsPassword-in-TextInput-as-in-previous-versions-tp6790p6797.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Posted by storo84 <se...@gmail.com>.
Hi Swen,

Binding the /displayAsPassword/ to the /selected/ property of the /CheckBox/
does solve half of the issue: the text inside the /TextInput /does appear
when the /CheckBox/ is selected and hides when it's not.

The other part of the problem is that when the text appears and you focus on
the component, the key blinking cursor appears at the position where the end
of the text would be if it where hidden using "*". In fact, when you select
the text, the blue selection appears to select from the beggining of the
text up to its in-hidden-mode end, even though it is /displayAsPassword/ is
/false/.

When was this bug introduced?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-displayAsPassword-in-TextInput-as-in-previous-versions-tp6790p6797.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Flex 4.12.0: Can't toggle displayAsPassword in TextInput as in previous versions

Posted by Swen van Zanten <in...@hdsign.nl>.
Hi,

Why don't you do it like is:

<s:TextInput displayAsPassword="{showPasswordButton.checked}"/>

<s:CheckBox id="showPasswordButton"/>

Verstuurd vanaf mijn iPhone

> Op 10 jun. 2014 om 00:38 heeft "storo84" <se...@gmail.com> het volgende geschreven:
> 
> Hello everyone,
> 
> I used to be able to toggle the property *displayAsPassword* of a /TextInput
> / in a very simple way:
> 
> /<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
>        xmlns:s="library://ns.adobe.com/flex/spark"
>        title="DisplayAsPassword">
>    
>    <fx:Script>
>        
>    </fx:Script>
>    
>    <s:TextInput id="appPassword"
>                 restrict="-A-Za-z0-9._" displayAsPassword="true"
>                 top="20" left="0" right="0"/>
>    <s:CheckBox id="showPasswordButton"
>                change="togglePasswordDisplay(event)"
>                top="{appPassword.y + appPassword.height + 20}" right="0"/>
>    
> </s:View>/
> 
> The previous code used to work when using SDK version 4.6, but now, that I'm
> using 4.12.0 it doesn't. It should be pretty straight-forward so why isn't
> it working?
> 
> Any help is appreciated.
> 
> Regards,
> 
> Sebastián
> 
> 
> 
> 
> 
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-4-12-0-Can-t-toggle-displayAsPassword-in-TextInput-as-in-previous-versions-tp6790.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.