Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#845 closed enhancement (fixed)

[patch][cla] FormContainer

Reported by: [email protected] Owned by: dylan
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: FormContainer Cc: [email protected]
Blocked By: Blocking:


This is FormContainer? widget.

Currently you create forms like this:

myContent='<form name="myForm">";
myContent+='<input type="text" name="name" value="''" />";
myContent+='<input type="text" id="birthday" date="' Date(obj.birthday),string)+'" />';
myContent+='<input type="button" onClick="myGet()" />';

function myGet() {
 var obj={};

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()" />

Then you define object (like, get from the server):'Joose Vettenranta';

Then you just command formcontainer:


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) (3.0 KB) - added by [email protected] 16 years ago.
FormContainer?.js, test-FormContainer?.js and showposts.php
FormContainer.js (6.2 KB) - added by [email protected] 15 years ago.
Fixed bugs and made it work with RepeaterContainer? and support for latest trunk syntax.

Download all attachments as: .zip

Change History (10)

Changed 16 years ago by [email protected]

Attachment: added

FormContainer?.js, test-FormContainer?.js and showposts.php

comment:1 Changed 15 years ago by dylan

Owner: changed from anonymous to dylan
Status: newassigned

comment:2 Changed 15 years ago by dylan

Summary: FormContainer[patch][cla] FormContainer

comment:3 Changed 15 years ago by dylan

I hate to ask, but any chance you could update to use the new widget/package syntax?

comment:4 Changed 15 years ago by [email protected]

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 15 years ago by [email protected]

Attachment: FormContainer.js added

Fixed bugs and made it work with RepeaterContainer? and support for latest trunk syntax.

comment:5 Changed 15 years ago by dylan

(In [5767]) references #845, new FormContainer? widget, needs inline documentation

comment:6 Changed 15 years ago by dylan

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 15 years ago by dylan

Resolution: fixed
Status: assignedclosed

comment:8 Changed 15 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.