#845 closed enhancement (fixed)
[patch][cla] FormContainer
Reported by: | Owned by: | dylan | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Widgets | Version: | 0.3 |
Keywords: | FormContainer | Cc: | [email protected]… |
Blocked By: | Blocking: |
Description
This is FormContainer? widget.
Currently you create forms like this:
myContent='<form name="myForm">"; myContent+='<input type="text" name="name" value="'+obj.name'" />"; myContent+='<input type="text" id="birthday" date="'+dojo.date.format(new Date(obj.birthday),string)+'" />'; myContent+='<input type="button" onClick="myGet()" />'; myContent+='</form>' function myGet() { var obj={}; obj["name"]=dojo.byId('myForm').name.value; obj["birthday"]=dojo.widget.byId('birthday').datePicker.storedDate; ... }
So it gets very complex and difficult when you have big and lot's of forms.
Now let's see about FormContainer?.
It's purpose is to get/set values to/from object/form. To make it work with dropdowndatepicker, you need apply patch included in ticket #721.
This helps making forms. With this you can easily create "empty" forms like this:
<form dojoType="FormContainer" id="myForm"> <input type="text" name="name" /> <input type="text" name="birthday" dojoType="dropdowndatepicker" /> <input type="button" onClick="myGet()" /> </form>
Then you define object (like, get from the server):
obj.name='Joose Vettenranta'; obj.birthday='11/22/2006';
Then you just command formcontainer:
dojo.widget.byId("myForm").setValues(obj);
When button is pressed, function could be like this:
function myGet() { var obj=dojo.widget.byId("myForm").getValues(); ... }
So easy!
And now it's very easy to do RAD-style development. Someone creates form, someone creates servers get/set thignies and someone creates stuff together in dojo with formcontainer.
Attachments (2)
Change History (10)
Changed 15 years ago by
Attachment: | formcontainer.zip added |
---|
comment:1 Changed 14 years ago by
Owner: | changed from anonymous to dylan |
---|---|
Status: | new → assigned |
comment:2 Changed 14 years ago by
Summary: | FormContainer → [patch][cla] FormContainer |
---|
comment:3 Changed 14 years ago by
I hate to ask, but any chance you could update to use the new widget/package syntax?
comment:4 Changed 14 years ago by
Yes it might be possible. Last few days I've been working to make formcontainer work better and got it working yesturday. Unfortunally most widgets don't have setValue() or anything similar, so formcontainer currently just works for DropdownDatePicker?.. We definetly would need FormWidget? class to say that we have to have set/getValue() functions.. I'll upload new version of formcontainer soon.
Changed 14 years ago by
Attachment: | FormContainer.js added |
---|
Fixed bugs and made it work with RepeaterContainer? and support for latest trunk syntax.
comment:5 Changed 14 years ago by
(In [5767]) references #845, new FormContainer? widget, needs inline documentation
comment:6 Changed 14 years ago by
cleaned up, and checked in.
It would be nice if we could get a patch with inline documentation for this before we get to 0.4:
comment:7 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
FormContainer?.js, test-FormContainer?.js and showposts.php