Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#845 closed enhancement (fixed)

[patch][cla] FormContainer

Reported by: joose@… Owned by: dylan
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: FormContainer Cc: joose@…
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 joose@… 10 years ago.
FormContainer.js, test-FormContainer.js and showposts.php
FormContainer.js (6.2 KB) - added by joose@… 9 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 10 years ago by joose@…

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

comment:1 Changed 9 years ago by dylan

  • Owner changed from anonymous to dylan
  • Status changed from new to assigned

comment:2 Changed 9 years ago by dylan

  • Summary changed from FormContainer to [patch][cla] FormContainer

comment:3 Changed 9 years ago by dylan

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

comment:4 Changed 9 years ago by joose@…

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 9 years ago by joose@…

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

comment:5 Changed 9 years ago by dylan

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

comment:6 Changed 9 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 9 years ago by dylan

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:8 Changed 8 years ago by anonymous

  • Milestone 0.4 deleted

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.