Permalink
Browse files

- Added support for password fields

- Form now return the form values as native object and not as a JSON string 

git-svn-id: https://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib@20006 09f7d036-9b2a-0410-8fbe-9cff4eb17569
  • Loading branch information...
cboulanger
cboulanger committed Apr 24, 2010
1 parent 2c9c342 commit 898205bbc4a7c4b33184875a2e5d9442c7ae2df5
Showing with 17 additions and 8 deletions.
  1. +17 −8 source/class/dialog/Form.js
@@ -205,7 +205,7 @@ qx.Class.define("dialog.Form",
*/
_applyFormData : function ( formData, old )
{
- try{
+
/*
* remove container content, form, controller
*/
@@ -285,6 +285,10 @@ qx.Class.define("dialog.Form",
formElement.setLiveUpdate(true);
break;
+ case "passwordfield":
+ formElement = new qx.ui.form.PasswordField();
+ break;
+
case "combobox":
//@todo use data model for list
formElement = new qx.ui.form.ComboBox();
@@ -348,6 +352,7 @@ qx.Class.define("dialog.Form",
*/
case "textarea":
case "textfield":
+ case "passwordfield":
case "combobox":
this._formController.addTarget(
formElement, "value", key, true,
@@ -492,7 +497,15 @@ qx.Class.define("dialog.Form",
);
}
}
-
+
+ /*
+ * if field width is specified
+ */
+ if ( fieldData.width !== undefined )
+ {
+ formElement.setWidth( fieldData.width );
+ }
+
/*
* add label and form element to form
*/
@@ -511,11 +524,7 @@ qx.Class.define("dialog.Form",
* validate the form
*/
this._form.getValidationManager().validate();
- }
- catch(e)
- {
- this.error(e);
- }
+
},
/**
@@ -545,7 +554,7 @@ qx.Class.define("dialog.Form",
this.hide();
if( this.getCallback() )
{
- this.getCallback()( qx.util.Serializer.toJson( this.getModel() ) );
+ this.getCallback()( qx.util.Serializer.toNativeObject( this.getModel() ) );
}
this.resetCallback();
}

0 comments on commit 898205b

Please sign in to comment.