Weekly Update

silence's picture

Hi!

Hopefully you have been to the midweek demo that I had provided a few days back. After that update, I tried to support other widgets. Hence here's the new demo and below is the report:

Changes(since last week):

  1. UI changes for the reuquired functionality.
  2. Manipulation of JS form Object using following functions.
    2.1 addItem(widgetType)
    2.2 deleteItem(widgetID)
    2.3 synchronize(widgetID, widgetType, source) functions.
  3. Provision of the third column to show the properties for the currently selected item.
  4. Temporary arrangement of a button(title of middle column for viewing the JS form object)

Notes:

  1. Not all the properties get updated(most of them do). Also not all the properties of a widget(as described in Form API) are implemented. This is so because, It is a easy task and can be done once the structure is final.
  2. I have commited the source to the contribution repository in /modules/formbuilder. Though this is still not worth viewing. Loads of documentation and cleanups have to be done yet.
  3. The libraries needed to run the application along with other files can be downloaded from here: http://www.freewebs.com/socdemocode/prototype1.zip

Questions:

  1. what is the difference between many checkbox widgets and a checkboxes widget having many options? Similarly for radios?
  2. I have used delete form[widgetID] in JS to delete a form widget. "But I read that it is not suppported below js version 1.2. Is it true? can someone please check?"
  3. I was for some unknown reason not able to chenge the #default_value for 'file' widget in the DOM preview. Is it used any where and is it a big Issue?

Goals for next week(s) (Please tell me if there are more important things to be done before those listed below.):

  1. Make it work on IE.
  2. Create the proper .module file for the formbuilder so that It can be tested with drupal website.
  3. Create all the proper Validation functions for the HTML properties modified through 3rd column.
  4. Include rest of the widgets, remaining properties of the existing widgets.

Finally.... Please look at the demo and indicate all the bugs here.

Thanks in advance :)

avi

Login to post comments

hu?

cemper's picture
cemper - Thu, 2006-07-06 22:01

played a bit with your demo at http://freewebs.com/socdemocode/prototype0/

seems to work in FF, but does nothing in Opera...

Q: what's a form builder alone good for? how would it be bound to a (any) drupal module to replace it's gui? havent read on that...

Christoph C. Cemper

http://www.marketingfan.com
http://www.cemper.com


Well yes... It is for now

silence's picture
silence - Fri, 2006-07-07 03:53

Well yes...

  1. It is for now working only in firefox not even IE. This is one of the goals for me this week and hopefully something will be out there in a few days :).
  2. As far as putting it into drupal is considered, I'll be creating the module soon enough(see the goals again :). Once the module is completed, It will give option to copy or save the $form array created by it somewhere. If there are other modules which require it through some other interface and it(the interface) is used widely enough, It will surely be looked into and taken care of.

Meanwhile... Thnks for pointing that out and checking out the demo.

avi


Some suggestions

nedjo - Fri, 2006-07-07 17:19

1. what is the difference between many checkbox widgets and a checkboxes widget having many options? Similarly for radios?

Checkbox creates a single checkbox while checkboxes creates an array (ditto for radio/radios). The singular versions are used e.g. when we need finer control (for instance, I think, a single checkbox can have a title and description). I think you'll need to support both the singular and plural methods.

2. I have used delete form[widgetID] in JS to delete a form widget. "But I read that it is not suppported below js version 1.2. Is it true? can someone please check?"

See function isJsEnabled() in drupal.js for an example of how we test for required methods. I guess you'll need to test as well for the delete method.

3. I was for some unknown reason not able to chenge the #default_value for 'file' widget in the DOM preview. Is it used any where and is it a big Issue?

See this issue: http://drupal.org/node/60046. It looks like you can forget about trying to support a default value for file fields.

I'm getting some Javascript errors in the demo, when I click to create a Text component and then click Edit.

Error: form[formItem] has no properties
Source File: http://freewebs.com/socdemocode/prototype0/js/functions.js
Line: 224

Good to see your progress. Keep the questions coming!


yes...

silence's picture
silence - Fri, 2006-07-07 19:20

That button still is not complete. I initially thought that there might be cases when we just need labels(wufoo and jotform have this). But after looking at the Form Reference API, I found out that labels do not have a direct counterpart in Form API. We can use #markup to do the work though. So I left it for the moment.

Am I thinking in the right direction? i.e. #markup should be used in place of labels?

meanwhile... I got the .module file you sent.


I'm also getting these error in Firefox (1.5, Windows):

nedjo - Fri, 2006-07-07 21:11

Error: uncaught exception: Permission denied to get property 
HTMLInputElement.parentNode
Error: uncaught exception: Permission denied to get property 
HTMLDivElement.parentNode

when I mouse over form editing elements (e.g., I've created a few new elements and mouse over them).


the new JQuery version...

silence's picture
silence - Sat, 2006-07-08 03:46

JQuery has been lately seeing many changes. The Version I used in mid-week demo was rev #88. Jhon recently released 1.0a and so I used that for the latest demo. Due to the buggy nature of this alpha version, I had to "hide" some of the functionality (Like u could add checkboxes, radios from preview column.) For now, I have been ignoring the Errors(which do not effect functionality) and warnings(there were hardly 5 when I used rev #88). As we move towards a more stable build, I Asume that these errors are going to go away.

Sould I focus on these errors now or work on rest of the things and remove these errors when a staabler version comes out?


more...

silence's picture
silence - Sat, 2006-07-08 05:28

I was searching more on it and It turns out that it is a bug with FF etc. Here' are the bug reports: https://bugzilla.mozilla.org/show_bug.cgi?id=208427

and

https://bugzilla.mozilla.org/show_bug.cgi?id=214340

Apperently it comes when one tries to find out the parentElement of a form widget.