-
5 Dec 2008 2:23 AM #21
Ok, I guess you are calling isValid on the form or the field and its doing the right thing, which is to validate. So what you really want is a never validate option - which doesn't exist.
I was only fixing the validate on blur problem when isValid wasn't being called (ie even when not calling validate, it would validate).
Have I summerized it correctly?

If so, I'll proceed and update it right now and add a setAllowScoreFail(boolean) which, when set to true, should do what you need and allow the pwd fld to never invalidate even if the pwd scores below the allowed values...
Sounds good ?GXT JavaDocs: http://extjs.com/deploy/gxtdocs/
GXT FAQ & Wiki: http://extjs.com/learn/Learn_About_the_Ext_GWT_Library
Buy the Book on GXT: http://www.apress.com/book/view/9781430219408
Follow me on Twitter: http://twitter.com/gslender
-
5 Dec 2008 2:42 AM #22
Hmmm, thinking in what you say I see that its true that my app have a bad code that is the call of validate on this passwordField (while it should only validate the confirmPassword).
I'll change this option and see what its happening.
About the setAllowScoreFail(boolean) I don't know if is an option needed for other ones. Maybe is usefull thinking in that if someone adds a "informative" PasswordField into a FormPanel and then uses the method FormPanel.isValid() the PasswordField isValid will be called.
-
12 Dec 2008 4:33 AM #23
I guess what u guess are talking about
a confirm field. connected to the password field.
I am using your nice widget already.
Some additional feature would be to extend this field with and extra field to let the user retype the password set via a flag attribute and builtin validator. Just some idea.
I do know it is more than jut one field and than there can be problems to customize the layout of this 2 fields.Code:final TextField<String> retype = new TextField<String>(); retype.setFieldLabel("Retype"); retype.setAllowBlank(false); retype.setPassword(true); retype.setValidator(new Validator<String, Field<String>>(){ public String validate(Field<String> field, String value) { if(pwdfld.getValue().equals(value)) // pwdfld = your Password Textfield return null; else return "Value do not match the password!"; // I know bad english :D } });
It just came to my mind and iam using such field extra.
-
20 Dec 2008 11:11 AM #24
I have problem with the PasswordField you should also overwrite the setValue() and getValue() methods...
Cuz the FormBinding is not working...
The field is not getting updated.
Code of the Formbinding method:
EDIT: i have overwritten these setValue/getValue.Code:/** * Updates the field's value with the model value. */ public void updateField() { Object val = model.get(property); if (convertor != null) { val = convertor.convertModelValue(val); } field.setValue(val); }
It is still not working the binding to that field. Iam trying to find out why.
EDIT2: ok thinking about it, problems were this set/get for the Value... but also for the binding the getName/setName which is used to bind the property. I overwrote them as well... BUT the real problem (i think) is the EventListener of the FormBinding i will have to manually bind it... and use your getInputField() method right? This listener listen on the Change event of the field.
But the big problem is the change event the Change Event of the PasswordField Component will never happen... so the FormBinding does not work.Code:/** * Creates a new binding instance. * * @param field the bound field for the binding */ public FieldBinding(Field field, String property) { this.field = field; this.property = property; changeListener = new Listener<FieldEvent>() { public void handleEvent(FieldEvent be) { onFieldChange(be); } }; modelListener = new ChangeListener() { public void modelChanged(ChangeEvent event) { if (event.type == ChangeEventSource.Update) onModelChange((PropertyChangeEvent) event); } }; }
Edit3: ok solved, i had to add costum binding and use this inputfield method
than the overwriting of the set/getValue and set/getName arent not necessary.Code:binding = new FormBinding(form,true); binding.setStore(form.getStore()); binding.addFieldBinding(new FieldBinding(form.getPassword().getInputField(),"password")); binding.bind(form.getStore().getAt(0));

Sorry for confusing
-
3 Jan 2009 4:00 PM #25
Regex problem
Regex problem
Hi gslender,
I was having an issue with the regex in this in GXT 1.2.1 and GWT 1.5.3 so I changed it to Javascript compatible regex.
Not sure if anyone else is or will have issues, but this is what worked for me:
Code:boolean lowletters = false; // LETTERS if (value.matches("^.*[a-z].*$")) { // at least one lower case // letter score += 2; lowletters = true; } boolean upletters = false; if (value.matches("^.*[A-Z].*$")) { // at least one upper case // letter score += 5; upletters = true; } boolean numbers = false; // NUMBERS if (value.matches("^.*[0-9].*$")) { // at least one number score += 5; numbers = true; } boolean specials = false; // SPECIAL CHAR if (value.matches("^.*[-!\\\"#$%&'()*+,./:;<=>?@\\[\\]\\^_`{|\\\\}~].*$")) { // at least one of // -!"#$%&'()*+,./:;<=>?@[]^_`{|\}~ score += 5; specials = true; }
-
3 Jan 2009 7:56 PM #26
Mmm, so I wonder which Regex is supposed to work?
It seems odd that Java regex is not the same outcome in GWT.. I know its target is Javascript, but I would have thought Google would have handled the Regex differences - does anyone know for sure what is supposed to happen in Java vs GWT etc...GXT JavaDocs: http://extjs.com/deploy/gxtdocs/
GXT FAQ & Wiki: http://extjs.com/learn/Learn_About_the_Ext_GWT_Library
Buy the Book on GXT: http://www.apress.com/book/view/9781430219408
Follow me on Twitter: http://twitter.com/gslender
-
3 Jan 2009 8:08 PM #27
Some of the reading I did to pinpoint this stated
I didn't dig much further into it after that...Since your java
source is churned into javascript by gwt, a regex string literal in
your source code will become a regex string literal -in javascript-.
http://groups.google.com/group/Googl...e36fd627341165
-
3 Jan 2009 9:19 PM #28
true - but did you also read this... !!
So not really the simplest solution isn't it?...and the GWTShell executes your *Java* code, so the regexps have to
be Java-regexp-compatible for your app to work in Hosted Mode.
In a few words:
- if you use JavaScript-only regexp constructs, your app will fail in
Hosted Mode, so developping and debugging will become a pain
- if you use Java-only regexp constructs, your app will run in Hosted
Mode but will fail in "web mode"
So you should base your developments on the JavaScript regexp syntax;
and if it fails in Hosted Mode, then find an alternate that's still
JavaScript-compaible and happens to also be Java-compatible. If you
base your devs on the Java regexp syntax, you'll only notice the
incompatibilities when testing in web mode, which generally happen
late in the development process...GXT JavaDocs: http://extjs.com/deploy/gxtdocs/
GXT FAQ & Wiki: http://extjs.com/learn/Learn_About_the_Ext_GWT_Library
Buy the Book on GXT: http://www.apress.com/book/view/9781430219408
Follow me on Twitter: http://twitter.com/gslender
-
13 Jan 2009 7:26 AM #29
bad class file: C:\Program Files\Google Web Toolkit\PasswordField\PasswordField.jar(ext/ux/pwd/client/PasswordField.class)
class file has wrong version 50.0, should be 49.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
import ext.ux.pwd.client.PasswordField;
1 error
I'm using Netbeans and gxt1.2.1 with gwt1.5.3
I added the <inherits name='ext.ux.pwd.PasswordField'/>
and the lib! I'm a bit lost can someone help please?
-
13 Jan 2009 7:32 PM #30
this might be due to the version of the JVM/JDK - you are using v5.x and the lib was built using v6.x
I'll try and rebuild for v5.x and repostGXT JavaDocs: http://extjs.com/deploy/gxtdocs/
GXT FAQ & Wiki: http://extjs.com/learn/Learn_About_the_Ext_GWT_Library
Buy the Book on GXT: http://www.apress.com/book/view/9781430219408
Follow me on Twitter: http://twitter.com/gslender


Reply With Quote