Hi all,
I'm just starting out with wicket and I would like to use a client-side
javascript library--ExtJs, to enhance the end user experience. ExtJs
doesn't do a whole lot in markup, for instance to create a form you would do
something like the following:
Ext.onReady(function(){
Ext.QuickTips.init();
// turn on validation errors beside the field globally
Ext.form.Field.prototype.msgTarget = 'side';
var bd = Ext.getBody();
/*
* ================ Simple form =======================
*/
bd.createChild({tag: 'h2', html: 'Form 1 - Very Simple'});
var simple = new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
url:'save-form.php',
frame:true,
title: 'Simple Form',
bodyStyle:'padding:5px 5px 0',
width: 350,
defaults: {width: 230},
defaultType: 'textfield',
items: [{
fieldLabel: 'First Name',
name: 'first',
value: 'Jeremy',
allowBlank:false
})
],
buttons: [{
text: 'Save'
},{
text: 'Cancel'
}]
});
simple.render(document.body);
});
This will create a form with a 'Save' and 'Cancel' button and one textfield
called first with a default value of 'Jeremy'. It's not that hard but I
don't see how to integrate it with wicket in a clean fashion as there is no
way to add wicket:id tags, etc.
I would really appreciate it if anyone could give me any suggestions of how
to use ExtJS in a wicket-like way.
Thanks!