Validation must pass twice to clear errorColor?

I am using an external CSS file to style my app. In it I specify a custom errorColor property for TextInput controls.
This StringValidator is placed on a TextInput:
<mx:StringValidator id="validatorUserName"
        source="{textinputUserName}"
        property="text"
        required="true"
        minLength="4" maxLength="25" 
        tooShortError="Your username must be at least 4 characters long."
        tooLongError="Your username must be less than 25 characters long."
        trigger="{textinputUserName}" triggerEvent="valueCommit"
        valid="formatControlErrorStatus(textinputUserName,0)"
        invalid="formatControlErrorStatus(textinputUserName,1)"/>
The StringValidator's valid and invalid events call a function to carry out further commands. I want the invalid field to be very boldy marked, so I have the function thicken its border and set the background color to orange. Once it validates, then it returns the control's formatting to the default.
public function formatControlErrorStatus(theControl:Object,isError:Number):void
    {//valid/invalid trigger must pass name of target control and 0 for no error, 1 for error
    if(isError==1)
        theControl.setStyle("borderColor","#FF4B00");
        theControl.setStyle("borderThickness",2);
        theControl.setStyle("backgroundColor","#FF4B00");
        theControl.setStyle("backgroundAlpha",.4);
    else if (isError==0)
        theControl.setStyle("borderColor","#7D6441");
        theControl.setStyle("borderThickness",1);
        theControl.setStyle("backgroundColor","#FFFFFF");
        theControl.setStyle("backgroundAlpha",.75);
Here is the problem: When the StringValidator's "valid" event is fired, the code in formatControlErrorStatus is completed successfully, but the border of the TextInput remains the errorColor color rather than returning to its default color.  If I go into the field and exit it again without changing the value, then the errorColor border disappears and is replaced properly with the standard border. Why would the field have to pass validation twice to reset the border color?

Hi there,
I've also encountered this hard to explain behaviour with Flex validators.
One line fix would be to call
validatorUserName.validateProperties()
at the end  of the method "formatControlErrorStatus"
I was curious, why this extra call is needed, thus I've described my findings at my blog http://www.jabbypanda.com/blog/?p=54
(the reading requires knowledge of validation/invalidation mechanism in Flex http://frishy.blogspot.com/2007/10/validationinvalidation-mechanism.html)

Similar Messages

  • EO Validation method called twice

    Hi,
    I have written an EO based field Validation method. But the problem is it is being called twice. First time ,it is validating correctly. But the second time it is not taking the field value and giving the error
    I have included it like this in my jspx.
    <af:inputText value="#{bindings.SubOrgName.inputValue}"
    label="#{bindings.SubOrgName.label}"
    required="#{bindings.SubOrgName.mandatory}"
    columns="#{bindings.SubOrgName.displayWidth}"
    binding="#{backing_Org.inputText3}"
    id="inputText3"
    rows="1">
    <af:validator binding="#{bindings.SubOrgName.validator}"/>
    </af:inputText>
    Please help.

    Thanks for sharing! ;-)

  • [10g] entity validation are triggered twice and more?

    hello,
    i have a problem with validation method in an entity.
    in the ordre:
    1- i have created a methode validation "validationA" on the attribute "A"
    in my jspx, i change his value from 1 to 2
    3a- if my method (data = 1) return true, no problem.
    3b- if my method (data = 1) return false, she is call another time with the old value (data = 2)
    in my application where i have more than one view linked with this entity, my validationA method is triggered a lot.
    what can do to just check validation once? thanks
    Edited by: user10494597 on 20 nov. 2008 05:00

    Clicking the back button, doesn't clear the second entity and therefore it will still fail the validation.
    The user shouldn't click the back button, instead you should supply a "Cancel" button in the second page that will then clear the information that was entered in that screen and will navigate to the first form.

  • Javascript code to retrieve metadata - must run twice to work

    Hi all
    This is frustrating the hell out of me. I've got a script to batch add headers/footers (via watermarks) to a range of pdf documents by using the respective document's metadata (title, subject).
    Checked everything: Script running ok, metadata all there and fine.
    However - I need to run the script twice in order for the metadata to be processed. What I mean: I open a given document, run the script on it and the metadata is not displayed in the header/footer. Save the document and close. I then run the script on the same document again and all works fine, i.e. the metadata title is displayed in the header and the metadata subject is displayed in the footer. Driving me nuts.
    What am I **** wrong? How can I get this to work on the first run? Guessing it might have to do with some specific form of variable declaration or pre-parsing the metadata?!
    Script below (please not, I've also tried declaring 2 variables and assigning the metadata title & subject to them, then calling those variables in the watermark statements ... same result):
    /* Batch Header - DocProp Title */
    var i = 0
    this.addWatermarkFromText({
        cText: this.info.title,
        nTextAlign: app.constants.align.center,
        cFont: "Century Gothic",
        nFontSize: 8,
        nHorizAlign: app.constants.align.center,
        nVertAlign: app.constants.align.top,
        nHorizValue: 10, nVertValue: -10,
            nScale: -1
    this.addWatermarkFromText({
        cText: "Q-Pulse Id " + this.info.Subject,
        nTextAlign: app.constants.align.left,
        cFont: "Century Gothic",
        nFontSize: 8,
        nHorizAlign: app.constants.align.left,
        nVertAlign: app.constants.align.bottom,
        nHorizValue: 20, nVertValue: 10
    this.addWatermarkFromText({
        cText: "Active 10/12/2014",
        nTextAlign: app.constants.align.center,
        cFont: "Century Gothic",
        nFontSize: 8,
        nHorizAlign: app.constants.align.center,
        nVertAlign: app.constants.align.bottom,
        nVertValue: 10
    Hope someone can help with this. Guessing it's something simple code related that I'm not aware of - I'm a complete novice.

    My guess is your watermarks are overwriting one another, as they are all
    saved under an OCG with the same name. Try flattening the page after adding
    them, or use a different method, like a form field or an annotation.

  • ITunes item info - was good, now must click twice to get product info

    Does anyone else find the new look iTunes 9 less useful and user friendly the the previous version? It was nice to look at release date and other info for albums, songs, books, etc. in pervious iTunes versions, BUT NOW one must scroll over an click on the "i" symbol to get additional info on all items. It is inefficient and in some cases slows down the use of iTunes. C'mon Apple get back to common sense. Sometimes the bells and whistles of old are much better than anything new and much more efficient.
    Does anyone from APPLE read these reviews and comments? Seems like not at all

    Thanks to all who helped with this.

  • Why I must click twice Back Link in TLN to get back to Area Page

    Hi everyone, i need a little help about TLN. I'm developed webdynpro application and i have integrated it with ess. The problem is arise when I click <b>Back</b> link in top level navigation (TLN) from my iview (custom application). I need to click this link twice to get back to area page (actually just one click to go back to area page). How i handle this problem ? Thank you.
    Regards,
    Satria B

    Hi,
    <b>So that means when i click link to my custom application X, it will create 2 link into history. Why this happen ?</b>
    Exactly, so now you know why you have to click twice, right ? Well, why it has created two links there, that needs to be checked or thought over. Need some time for this.
    <b>I have a button in my iview (custom application), when i click this button, the page will be back to area page but Detailed Navigation will be display (i have setting this to be hide), why this happen ?</b>
    Sorry, didn't get your question. Do you mean to say that you want to hide the detailed navigation on the Area page. Is this Area Page a custom application ? What is the code written on the click of button ? Is the Area Page an iview within a page and then attached to role or workset or just an iview attached to role or workset ?
    Have you changed the following property of iview or page (for Area Page) "Initial State of Navigation Panel" to closed ?
    Hope this helps.
    Cheers,
    Sunil
    PS: Reward points for helpful answers.

  • Passing marks to clear the exam for C_JAVA_70(80 questions) ?

    Hi All,
    Anybody have an idea for passing marks(out of 80 questions) for
    C_JAVA_70 SAP Certified Development Associate - JAVA with SAP NetWeaver 7.0  ?
    Also they have devided the above certification topics into 2 parts(60% and 40%)
    means, each part has it' s own passing criteria..?
    Anybody having sample questions/could remember for the above test pls forward it
    [email protected]
    Thx
    Praveen

    Hi Praveen,
    There is no individual passing criteria for the 2 parts (60% and 40%). The overall passing criteria for the certification is 70%.
    Bye
    Ankur
    Do reward points if it helps!!

  • Why did I have to buy NBA League Pass TWICE for it to work?

    League Pass Choice wouldn't work at all (2014) so out $150 plus tax. Had to buy the $200 Premium package. Now, after $350, finally get the games this year at my home in Costa Rica. Awfully expensive and absolutely NO service from NEULION franchisee down here. ---- NONE!

    First thing to try is to reset your device. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart.
    If that doesn't work Make an appointment at an Apple Store to have your device examined by a technician. Or contact Apple Support.

  • Deletion of territory if valid dates passed

    Hi All,
    I want to delete the territories. But it is saying "No changes are possible if the validity period is in past". Even if I m not able to change. How can I change the validity period
    Thanks
    Chinmaya

    Please refer this URL
    http://help.sap.com/saphelp_crm50/helpdata/en/cd/74b93e724eb300e10000000a114084/frameset.htm
    <b>Reward points if it helps!</b>

  • How can I (and why is it neccessary) unite all songs to the albums  covers they belong to. Some are listed multiple times, instead of all under the one album artwork. Example: All Things Must Pass by George Harrison. Album picture is there, square, and tr

    I really must protest. iTunes does a terrible job, at least mine always has it messed up some how for some reason. like for instance. There are multiple listings of Album covers or empty sqyartes with art work moissing, and only some songs listed on each listing, instead of all the dangf song (tracks) that are on that disc, listed there as on that disc, you understand me. its mostly all spread out, not where it should nbe. Why is that and how can i easily make it the way it is supposed to be, all tracks belonging to the particulart album listed under that albums picture , album cover art woirk.? Why is it doing this. Whats the magic button to straighten this mess out. And duplicates, i thought they were supoposed to be elliminated. not so. Help. [email protected]...thjanks.

    My daughter has had her Razr for about 9 months now.  About two weeks ago she picked up her phone in the morning on her way to school when she noticed two cracks, both starting at the camera lens. One goes completely to the bottom and the other goes sharply to the side. She has never dropped it and me and my husband went over it with a fine tooth comb. We looked under a magnifying glass and could no find any reason for the glass to crack. Not one ding, scratch or bang. Our daughter really takes good care of her stuff, but we still wanted to make sure before we sent it in for repairs. Well we did and we got a reply from Motorola with a picture of the cracks saying this was customer abuse and that it is not covered under warranty. Even though they did not find any physical damage to back it up. Well I e-mailed them back and told them I did a little research and found pages of people having the same problems. Well I did not hear from them until I received a notice from Fed Ex that they were sending the phone back. NOT FIXED!!! I went to look up why and guess what there is no case open any more for the phone. It has been wiped clean. I put in the RMA # it comes back not found, I put in the ID #, the SN# and all comes back not found. Yet a day earlier all the info was there. I know there is a lot more people like me and all of you, but they just don't want to be bothered so they pay to have it fix, just to have it do it again. Unless they have found the problem and only fixing it on a customer pay only set up. I am furious and will not be recommending this phone to anyone. And to think I was considering this phone for my next up grade! NOT!!!!

  • First Screen click box -must click twice

    My colleague created a simulation in Captivate and inserted a
    clickbox over the Start Button. The clickbox is set to appear for
    rest of slide (and, in attempt to troubleshoot the issue, he's set
    clickbox to appear for a specific number of seconds as well ); the
    option to pause the movie until learner clicks is selected; the
    double click option is NOT selected.
    When movie runs, the user must click then wait a while, then
    click on the start button again before moving to next screen.
    Why is this? Any theories?

    Another method of avoiding this issue is to insert the Mark
    of the Web (MOTW) on your HTML pages. Google "Mark of the Web" to
    see learn more about this method. As long as we have the MOTW on
    our HTML pages, the page is considered to be in the Internet zone.
    Also note, you must have MOTW on all your HTML pages otherwise
    moving from page to page does not work. As some pages are
    considered to be in the Internet zone and others are not.
    The nice thing about this method is that it works for other
    items besides Flash and the learners do not have to perform any
    extra tasks to make it work correctly. Someone else provided code
    that you can add to just the HTML pages you use to launch your
    Captivate (Flash) files. It works too. But I prefer the MOTW
    because it doesn't try to circumvent the inherent security
    features.
    Thanks, DBlake

  • Macbk pro 2010 won't wake after sleep, must restart twice to get it working

    If I close the macbook or leave it open for too long the screen goes black and I must restart it via the power button 2 times before it starts up normally.  On the first restart, the computer shuts down but when starting back up the screen stays asleep, so must shut down again.  OS X 10.9.5, tried running apple hardware test (AHT) but couldn't get the icon to show up.  No idea what to do...

    OK, 10.6.7 update did NOT fix the issue.
    So before putting mbp to sleep last night, I did a SMC reset procedure.
    This morning when it woke up, it detected the cable immediately.
    Thanks leroydouglas.

  • Firefox frequently loses almost all navigation (scroll wheel, page up/down) - must exit/restart to clear problem

    This problem began sometime when I was using FF 3.6.x. I have since upgraded to 8.0.1, and the problem occurred more frequently than with 3.6.x. I finally decided to create a new profile, and I did not copy any files from the default profile. The problem persists. The problem has occurred regardless of whether I have one tab open or multiple tabs open. It occurs at seemingly random times.
    Here's what happens: I will be merrily working along, and suddenly I will notice that my scroll wheel will no longer navigate the page I am on. Neither the page up/down keys work, and the up/down arrows no longer work either. However, I can still navigate by sliding the scroll bar up and down, and the Home and End keys work normally.
    Additionally, I can not click on a tab to open it, but I can use CTRL-Tab to navigate from tab to tab.
    A new artifact appeared after I upgraded to 8.0.1. Now, when I close a tab while this condition is in place, the tab actually closes and the appropriate page (next to the closed tab) will render, but the tab itself does not disappear from the tab bar. It's in effect a zombie tab.
    Sometimes in this state I can click on links and the linked page will appear, and sometimes I get nothing. As a matter of fact, just after I loaded this very support page, the condition occurred. (Which is why I'll be copying this statement in case the Post Question link doesn't work :( )
    I want to emphasize that I'm working with a completely new profile, so it's apparently not places.sqlite or any other file that's causing the problem. Please help if you can - I'm considering moving to Chrome if I can't figure this out. In recent days this problem has been occurring dozens of times a day.
    TIA.

    Well, I was really excited there for a while. Last night I set up FF with the new profile, in safe mode, and then disabled all the plugins. (BTW, I was surprised to learn that safe mode didn't disable the plugins.) Exit/restart, visited some sites, no problems. Then I spent the rest of the night watching hockey (I have my priorities). I left FF up all night, and this morning it was not "locked up", which gave me a huge amount of hope - normally if I've left FF running overnight there's a near zero chance that it will respond. However, I went to Google News, and after I had opened about 7-8 tabs - no joy. Same symptoms. I guess I'll have to check out Chrome or Opera, because I tried using IE8 for a few hours yesterday and it was not a fun experience.
    Thanks anyway, cor-el.

  • Must run twice for daq to work

    I have an application I am working on that is giving some minor problems.  When I first boot up the computer, it doesn't seem the DAQ is working at initial startup.  I am using a Daqpad 6016 (I think that is the model, it is the USB daq) and have some digital outs that should turn on some units under test whent he program first runs.  It doesn't turn them on.  If I stop the program, and restart it, it works fine, it just doesn't work on the initial startup.  After that, it works again, until I reboot the computer, than I have to go through that again.

    Unfortunately, I don't have the code on this computer, so I can't do that right now, although I'm not sure what screen capture to send, as it is a pretty large project.  Let me try to describe further what my program does.
    When started, it pops up a couple of boxes for user input, basically setting up the test (each box is its own sub vi, and no data aquistion is involved).  From there, it moves on to another sub vi which powers up my units that will be tested with the software.  That vi (at least to this point) only contains a DAQmx write to a digital channel (setting to true) which turns on a relay supplying power to my UUTs.  At that point, none of the UUTs turn on (and the digital line never goes high either).  If I stop the program, and restart it from there, it works fine.
    All that said, when you talk about initializing the DAQ, I wasn't aware there was anything to initialize.  All I am doing is using a DAQmx write with a task created in the Measurement Explorer (or whatever its called).

  • Upgrade to OS 10.5, now must click twice on windows to drag them

    I remember, in my hindbrain, that I used to be able to click & drag on the title bar of a doc window in Photoshop. That window would come to the front and I could continue dragging it.
    Now, I have to click to bring to front, release, then click again to drag. This is a "drag".
    Can I get the old behaviour back?
    Thanks

    Reynolds (Mark) wrote:
    They introduced something called the Application Frame. This can be turned off by going to Window > Application Frame. If you also disable "Open documents as Tabs" is Preferences, then it will be back to the way you are used to working.
    This Application frame means that on a mac you have the option to have a sealed in area as PC users are used to, or a mac free floating window setup . For certain types of mechanical multiple image work it certainly has its uses to use the application Frame, and tabs.
    I do not have any such items in my Photoshop (as far as I can see): Window > Application Frame, Prefs > Open documents as Tabs
    If fact, now, even if I click the red close-window button, it does not close that window, only brings it to the front. Yuck.

Maybe you are looking for

  • JBO-33035: Row currency has changed since the user interface was rendered

    First - Yes I have read a number of the postings regarding this error - HOWEVER - there seems to be a 'rather' serious side effect that I need to get fixed. Am dropping on a a UIX datapage a datacontrol VO component as a Search Form. I have added Del

  • Report - Primary User is name not shown

    Hey there, I've got a problem with the reporting Server functions. When creating a report containing "Primary User Name (Calculated)" there is no data shown within this column. If I add "Is Primary User Calculated?" I get "YES" for every Device name

  • Problems Viewing external Projector on Imac ISight

    I have the new Imac iSight. I was able to connect it to my HT using the apple DMI-Mini-DVI cable. However the following day I turned the system on and my Imac is no longer recognizing my mini-dvi port. I have checked System Profile and I don't see it

  • How do I move my current hard drive OS and data to a new drive for internal installation?

    I want to replace my Macbook Pro 500GB Hard Drive with a 2TB Hard Drive.  How do I make this new drive bootable and a replica of my current drive programs and data?   I also want to upgrade the OS.  Is it best to mirror the drive and then upgrade the

  • Cisco NAC Web Agent + Windows 8

    Hello, I´m implementing a Cisco ISE 1.2 and I am having troubles with NAC Web Agent and Windows 8 compatibility. All time that I try install NAC Web Agent in Windows 8, I get the message "Agent User Operating System is Not Supported". Follow are some