[flexcoders] Looping over a tree and selecting an entry
Hi folks, I want to have a tree with the functionality of preselecting a particular entry. So I'm working myself through all the nodes and leafs, which is working fine. But it seems, that I just can set the .selectedNode property on nodes or leafs which are already visible or opened. Is that correct, can others share this experience ;) ? Cheers Kai Yahoo! Groups Sponsor ~-- Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Changing the wrongLengthError in a DateValidator
Hi Matt, if you're thinking about the validators in general, another thing I'd love to have is something like a defaultErrorMessage attribute which automatically sets the value for all the more specific error attributes if one doesn't specify those in particular. Cheers Kai MC I think someone else ran into this (maybe Mika?) but I don't MC remember if it had a work around. This is something we're fixing MC in 2.0, I don't have a solution for you off the top of my head. MC Matt MC -Original Message- MC From: flexcoders@yahoogroups.com MC [mailto:[EMAIL PROTECTED] On Behalf Of Kai König MC Sent: Wednesday, August 17, 2005 6:56 AM MC To: flexcoders@yahoogroups.com MC Subject: [flexcoders] Changing the wrongLengthError in a DateValidator MC Hi all, MC another validator-related question: MC Having to validate for a date using a DateValidator, the requirements MC are to just deliver one validation message if the validation fails. MC Following the concept, I'd have to add a long list of attributes to my MC validator call, as in: MC mx:DateValidator ... invalidCharError=blabla MC invalidFormatCharsError=blabla ... / MC So we thought it might be nice to subclass the DataValidator and to MC define a defaultErrorMessage which we can pass into our own validator MC class and internally, the class is responsible to overwrite the values MC of the pre-defined errors. MC Works quite good, BUT doesn't work for wrongLengthError. The docs MC state: Error message when the length of the date doesn't match that of the inputFormat. Default is Please type the date in the format iinputFormat/i.. MC That means the default error might be something like: MC Please...format mm/dd/ MC As far as I understand, I'd expect to be able to overwrite the default MC with anything I like, but regardless to what I set the value for MC wrongLengthError, Flex always adds the value of inputFormat to my MC error message - I end up with something like MC This is my errortext and I want you to type it correct mm/dd/ MC This is especially annoying with localized error messages in which the MC inputFormat has to be at another place within the error message by MC grammar: Bitte nutzen Sie das Format dd.mm. in diesem Feld. MC Is there a way to get rid of the automatic concatenation of the MC inputFormat within the wrongLengthError of this validator? MC Cheers MC Kai MC -- MC Flexcoders Mailing List MC FAQ: MC http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt MC Search Archives: MC http://www.mail-archive.com/flexcoders%40yahoogroups.com MC Yahoo! Groups Links MC -- MC Flexcoders Mailing List MC FAQ: MC http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt MC Search Archives: MC http://www.mail-archive.com/flexcoders%40yahoogroups.com MC Yahoo! Groups Links -- Best regards, Kaimailto:[EMAIL PROTECTED] Yahoo! Groups Sponsor ~-- font face=arial size=-1a href=http://us.ard.yahoo.com/SIG=12hpdvqk2/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124357529/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992 Fair play? Video games influencing politics. Click and talk back!/a./font ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Changing the wrongLengthError in a DateValidator
Mika, thx, this is a very helpful one. Today I ran into another one, I was trying to access the field attribute of a validator inside the class, got an undefined all the time. The docs states that the field propery is not to be set in ActionScript, is it not accessable at all? app.mxml: MyOwnValidator field=model.bla / inside of MyOwnValidator.as: class MyOwnValidator extens mx.validators.EmailValidator { public var myfield = ??? ; ... } Cheers Kai MK Oops, this is the problem I was trying to answer to. Sorry folks about the MK previous post... :) MK Class MyDateValidator extends mx.validators.DateValidator MK { MK public function validationError(errorCode:String, MK defaultMessage:String,subfield:String):Void MK { MKIf (errorCode == wrongLength) MK defaultMessage = yourTranslatedMessage; MKsuper.validationError(errorCode, defaultMessage, subfield); MK } MK } MK Only thing you need to do is catch the wrongLength error and re-write the MK error message yourself. MK -Mika MK -Original Message- MK From: flexcoders@yahoogroups.com MK [mailto:[EMAIL PROTECTED] On MK Behalf Of Kai König MK Sent: 17. elokuuta 2005 16:56 MK To: flexcoders@yahoogroups.com MK Subject: [flexcoders] Changing the wrongLengthError in a DateValidator MK Hi all, MK another validator-related question: MK Having to validate for a date using a DateValidator, the requirements MK are to just deliver one validation message if the validation fails. MK Following the concept, I'd have to add a long list of attributes to my MK validator call, as in: MK mx:DateValidator ... invalidCharError=blabla MK invalidFormatCharsError=blabla ... / MK So we thought it might be nice to subclass the DataValidator and to MK define a defaultErrorMessage which we can pass into our own validator MK class and internally, the class is responsible to overwrite the values MK of the pre-defined errors. MK Works quite good, BUT doesn't work for wrongLengthError. The docs MK state: Error message when the length of the date doesn't match that of the inputFormat. Default is Please type the date in the format iinputFormat/i.. MK That means the default error might be something like: MK Please...format mm/dd/ MK As far as I understand, I'd expect to be able to overwrite the default MK with anything I like, but regardless to what I set the value for MK wrongLengthError, Flex always adds the value of inputFormat to my MK error message - I end up with something like MK This is my errortext and I want you to type it correct mm/dd/ MK This is especially annoying with localized error messages in which the MK inputFormat has to be at another place within the error message by MK grammar: Bitte nutzen Sie das Format dd.mm. in diesem Feld. MK Is there a way to get rid of the automatic concatenation of the MK inputFormat within the wrongLengthError of this validator? MK Cheers MK Kai MK -- MK Flexcoders Mailing List MK FAQ: MK http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt MK Search Archives: MK http://www.mail-archive.com/flexcoders%40yahoogroups.com MK Yahoo! Groups Links MK -- MK Flexcoders Mailing List MK FAQ: MK http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt MK Search Archives: MK http://www.mail-archive.com/flexcoders%40yahoogroups.com MK Yahoo! Groups Links -- Best regards, Kaimailto:[EMAIL PROTECTED] Yahoo! Groups Sponsor ~-- font face=arial size=-1a href=http://us.ard.yahoo.com/SIG=12h6vcbsa/M=362131.6882499.7825260.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124380306/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy/a./font ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Validation TextInput
Hi all, I want a bunch of TextInputs within a form to be required and to validate against a common mx:Validator. This works fine in general, but the customer wants that the validation comes up even if someone just sets the focus to the particular TextInput, doesn't type anything and immediately removes the focus from that field. An example would be to just use the tab key to speedo through the whole form... But obviously, the validation shouldn't trigger before that (so - not loading a form which is full of failed validations) To fullfill another requirement (validation during typing) I subclassed TextInput and made the change Event committing as Steven and Allister explained in their book on pg. 189: [ChangeEvent(change)] So, my idea of triggering the validation for my particular issue was to broadcast the focusOut event in the subclass as committing as well: [ChangeEvent(focusOut)] But, it doesn't work out. What works is to add focusOut=mx.validators.Validator.isValid(this,'mymodel.myfield') as an attribute to my subclassed MyTextInput. But that doesn't seem to be the best way doing it as there might be a bunch of input fields, isn't there a better solution? Cheers Kai Yahoo! Groups Sponsor ~-- font face=arial size=-1a href=http://us.ard.yahoo.com/SIG=12hlf0u2s/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124287970/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992 Fair play? Video games influencing politics. Click and talk back!/a./font ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Changing the wrongLengthError in a DateValidator
Hi all, another validator-related question: Having to validate for a date using a DateValidator, the requirements are to just deliver one validation message if the validation fails. Following the concept, I'd have to add a long list of attributes to my validator call, as in: mx:DateValidator ... invalidCharError=blabla invalidFormatCharsError=blabla ... / So we thought it might be nice to subclass the DataValidator and to define a defaultErrorMessage which we can pass into our own validator class and internally, the class is responsible to overwrite the values of the pre-defined errors. Works quite good, BUT doesn't work for wrongLengthError. The docs state: Error message when the length of the date doesn't match that of the inputFormat. Default is Please type the date in the format iinputFormat/i.. That means the default error might be something like: Please...format mm/dd/ As far as I understand, I'd expect to be able to overwrite the default with anything I like, but regardless to what I set the value for wrongLengthError, Flex always adds the value of inputFormat to my error message - I end up with something like This is my errortext and I want you to type it correct mm/dd/ This is especially annoying with localized error messages in which the inputFormat has to be at another place within the error message by grammar: Bitte nutzen Sie das Format dd.mm. in diesem Feld. Is there a way to get rid of the automatic concatenation of the inputFormat within the wrongLengthError of this validator? Cheers Kai Yahoo! Groups Sponsor ~-- font face=arial size=-1a href=http://us.ard.yahoo.com/SIG=12hcaovgm/M=362335.6886445.7839731.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124294163/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOOcmpgn=GRPRTP=http://groups.yahoo.com/;In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!/a./font ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re[2]: [flexcoders] Problem with Umlauts in external AS files
Dirk, Yukari, sorry Dirk, it even works in my German enviroment ;-) I'm running MS IE 6.0.2800.1106.xpsp2.030422-1633 on Win XP with the latest Flash Player 7. My mxml page rendes in UTF-8, but even if I switch the browser to ISO, traditional chinese etc. it doesn't change the umlauts... Cheers Kai YM Hi Dirk, YM mmm, this works for me. I think I need a bit more information. Only those YM particular characters you mentioned not working and others are OK? Also, YM which platform, browser, Flash player version are you running? YM Thank you! YM -Yukari YM -Original Message- YM From: Dirk Eismann [mailto:[EMAIL PROTECTED] YM Sent: Wednesday, May 12, 2004 4:06 AM YM To: FLEXCODERS (E-Mail) YM Subject: [flexcoders] Problem with Umlauts in external AS files YM I have a problem when defining Strings in external AS files that contain YM German umlauts (ä,ö,ü). Although the AS file is saved as UTF-8 the text does YM not show up correctly in the Flex application. Umlauts that reside in the YM MXML file are displayed correctly: YM // testFile.as YM function getTestString(Void):String { YM return Ää Öö Üü; YM } YM // end testFile.as YM !-- test.mxml -- YM ?xml version=1.0? YM mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; YM mx:Script source=testFile.as / YM mx:Label text=AS Umlauts: {getTestString()} / YM mx:Label text=MXML Umlauts: Ää Öö Üü / YM /mx:Application YM !-- end test.mxml -- YM I first stumbled across this as I tried to set the monthNames property of YM the DateField programmatically. In Germany the month march is written YM März - the DateField chooses to display März instead. YM Any ideas? YM Dirk. YM Yahoo! Groups Links YM Yahoo! Groups SponsorADVERTISEMENT YM Yahoo! Groups Links YM To visit your group on the web, go to: YM http://groups.yahoo.com/group/flexcoders/ YM To unsubscribe from this group, send an email to: YM [EMAIL PROTECTED] YM Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- Best regards, Kai mailto:[EMAIL PROTECTED]
Re[4]: [flexcoders] Re: Required validation doesn't work...
Hi Matt, MC Hope this clarifies things, yes, it sure does! Thanks for that! Let me just comment on you, because I couldn't fully agree with you ;) Let's imagine a form in the context of the order processing of a shopping cart. When the user follows the process, why should he leave a certain field open to fill in later? I don't see a use for that. For me, one big advantage of the Flex validation would be that if I tab out of an empty required field I instantly will receive an error message. I'm sure that there is a way to trigger the validation of the certain field capturing the key event or whatever in AS, but I would really like to be able to choose how my validation should behave. There might be situations where the application should behave like you described, I don't know. But in my sense of understanding validation it means that a required field is required - always and not just if I entered something before. Otherwise - let's say my form is completly empty at the start - I could tab throught an n-fielded form and pushing my action-button and will receive my validation result during click time. For me that's not the natural behaviour, it's very similar to HTML forms with some JavaScript which checks for errors after collecting all that data - which I always disliked ;) Cheers Kai MC It is intended behavior that if you do not MC change anything in an initially blank field the validator will not fire. The MC reason we did this is that many times a user will tab through a field intending MC to fill it in later, so we found it to be frustrating when the field MC immediately turned red (how can my value be invalid when I didn't MC enter anything yet?). Additionally, if you had an alert or some other obtrusive MC mechanism to indicate that validation had failed it was even more frustrating MC to the user. So we decided if they didn't actually change the value and MC the value had not been set before, don't fire validation. Essentially MC you have to get one real value (not null, not undefined, not empty string) before MC binding and validation will start to fire.
Re[2]: [flexcoders] Re: Required validation doesn't work...
Hello Dirk and Susan, in my case it even doesn't do anything. It doesn't do any validation, I left all to be validated fields empty and was able to tab around the field, sending the form etc. Cheers Kai Can you point me to which snippet of code doesn't work? I tried the code on pg. 582 of devflexapps.pdf and it works for me. DE sure. I was referring to the snippet on bottom of page 582. I pasted it DE into a bare bone Application, code is as follows: DE ?xml version=1.0? DE mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; xmlns:local=* DE DE !-- start code block from the docs -- DE mx:Model id=date DE month{monthInput.text}/month DE day{dayInput.text}/day DE year{yearInput.text}/year DE /mx:Model DE DE mx:TextInput id=monthInput/ DE mx:TextInput id=dayInput/ DE mx:TextInput id=yearInput/ DE DE mx:DateValidator field=date/ DE !-- end code block from the docs -- DE /mx:Application DE This is *not* working. The Validator doesn't gets triggered after DE changing focus by tabbing, clicking etc. I guess it is because the DE field attribute of the DateValidator is set to the whole model data DE instead of a field of the model, e.g. data.month. The code is working DE if you do this e.g. DE mx:DateValidator field=date.month/ DE now the DateValidator gets triggered after leaving the monthInput DE TextInput field. DE Another thing I want to mention here is the following: validators only DE get triggered if you type at least one char into them - you can delete DE this characer afterwards but you have to type once. If you leave them DE blank (that is: load the mxml, click into the first TextInput so that it DE gets the focus, then change the focus by tabbing) they do not get DE triggered. Is this the intended/expected behavior?