Commit Graph

138 Commits

Author SHA1 Message Date
Andreas Stöckel
127e629eef Adapted selectbox widget code to new etemplate2 js core scheme 2011-08-21 08:48:53 +00:00
Andreas Stöckel
7c7a8230cf Added basic approach to have selectbox widget running again (probably not fully working yet) 2011-08-20 18:34:14 +00:00
Andreas Stöckel
fcff01e3cc Fixed textbox cols/rows always being set to 1 2011-08-19 16:39:28 +00:00
Andreas Stöckel
5af5594f60 Major update of the et2_widget internal structure. The following changes were made:
- All attributes of the widgets are now parsed from XML before the widget itself is created.
These attributes plus all default values are then added to an associative array. The associative array is passed as second parameter to the init function of et2_widget, but is also available as this.options *after* the constructor of the et2_widget baseclass has been called.
The et2_widget constructor also calls a function parseArrayMgrAttrs(_attrs) - in this function widget implementations can read the values from e.g. the content and validation_errors array and merge it into the given _attrs associative array.
After the complete internal widgettree is completely loaded and created the "loadingFinished" function gets called and invokes all given setter functions. After that it "glues" the DOM tree together. This should also (I didn't measure it) be a bit faster than before, when the DOM-Tree was created on the fly. 

Please have a look at the changes of the et2_textbox widget to see how this affects writing widgets.

Note: The "id" property is copied to the object scope on the top of the et2_widget constructor.

- When widgets are cloned the "options" array gets passed along to the newly created widget. This means that changes made on the widgets during runtime are not automatically copied to the clone - as this didn't happen anyhow it is not a really disadvantage.
On the other side there should be no difference between widgets directly inside the "overlay" xet tag and widgets which are inside instanciated templates.

- The selbox widget doesn't work anymore - it relied on the loadAttributes function which isn't available anymore. et2_selbox should use the parseArrayMgrAttrs function to access

- I've commented out some of the "validator"-code in etemplate2.js as it created some error messages when destroying the widget tree.
2011-08-19 16:00:44 +00:00
Nathan Gray
5e54d6b12b Add basic radio, readonly version of checkbox/radio 2011-08-18 17:34:01 +00:00
Nathan Gray
fb43e96aeb Use getInputNode() instead of inconsistant variable for default label implementation 2011-08-17 23:26:01 +00:00
Nathan Gray
9f3551cc7a PHP test page, works inside eGW + validation test 2011-08-17 23:06:25 +00:00
Nathan Gray
e76cf6eab2 - Add labels to input widgets
- Add row & col properties to textarea
2011-08-17 22:56:49 +00:00
Nathan Gray
03d549bab9 Add validation (basic client & server side) 2011-08-17 21:36:08 +00:00
Nathan Gray
c409e8d73e Fix typo breaking selectbox options 2011-08-17 21:32:38 +00:00
Nathan Gray
ba5fee777c Basic widgets xml file 2011-08-17 19:46:19 +00:00
Nathan Gray
379b05b39f Get empty label / row count legacy option working 2011-08-17 17:50:15 +00:00
Nathan Gray
abf37487b8 Fix typo 2011-08-17 17:48:39 +00:00
Andreas Stöckel
2234cc3413 Added very simple but working implementation of the tabs widget 2011-08-17 09:07:09 +00:00
Nathan Gray
e792130479 Stop errors from missing _data and missing array managers 2011-08-16 21:18:26 +00:00
Nathan Gray
e981e7911f Get option value from content, add empty label 2011-08-16 21:18:06 +00:00
Ralf Becker
fae753a551 added hiearchical names in widget id's like 'button[save]' 2011-08-16 20:32:18 +00:00
Nathan Gray
f0db6211b9 Put options in selectbox 2011-08-16 20:32:13 +00:00
Ralf Becker
510ce7c159 - using etemplate_request object and a etemplate_exec_id
- "processing" the submit on serverside (no validation yet)
--> content returned by ajax call is not an hiearchical array: eg. "button[save]" => 1, instead of "button" => array("save" => 1)
- new call to etemplate_new::exec() is send back via new JSON generic et2_load response
--> how do we handle output of callback: a) debug output, eg. echos and b) echo "<html><head><script>window.close();</script></head></html>"; exit;
2011-08-16 19:40:48 +00:00
Nathan Gray
11ccd9c057 Check that value is a string before treating it as one 2011-08-16 19:01:45 +00:00
Nathan Gray
df2869c07f Add simple checkbox, missing ID property 2011-08-16 18:42:17 +00:00
Andreas Stöckel
63d0baf497 Added event listener system to etemplate2 2011-08-16 18:18:18 +00:00
Nathan Gray
03b4704685 Add basic implementation of numeric (int & float) and selectbox widgets 2011-08-16 17:02:09 +00:00
Andreas Stöckel
fb8ef99c0b Added align property and working hbox/vbox implementation 2011-08-16 16:46:22 +00:00
Nathan Gray
a6ebfff827 Fix infinite loop 2011-08-16 16:44:21 +00:00
Andreas Stöckel
fef5ad8ebd Improved invalde type handling 2011-08-16 13:45:41 +00:00
Andreas Stöckel
786ec9220c Added widget for html-XET tag and added forgotten et2_styles.js 2011-08-16 13:12:39 +00:00
Andreas Stöckel
40a11bdb4f Added widget for 'styles' XET tag 2011-08-16 12:56:55 +00:00
Andreas Stöckel
41787c36f3 - Reading readonly properties
- Added system for readonlys: Readonly is passed in constructor as third parameter. If a widget class is registerd with "[type]_ro" (see et2_textbox for example) this one is created
- Added new 'valueWidget' base class which introduces the 'value' attribute and implements auto loading from the content array
- Implemented readonly attribute for buttons and textboxes
2011-08-16 12:31:18 +00:00
Nathan Gray
4fe9d951a8 Fix typo 2011-08-15 18:54:13 +00:00
Andreas Stöckel
3bdca867e7 et2_debug is now capable of taking any count of arguments as the console.* functions do, improved 'Attribute does not exist' message, fixed memory leak in grid (inherited destructor was not called) 2011-08-15 16:03:53 +00:00
Andreas Stöckel
8207a325aa Moved loading of data-array attributes to the new 'loadingFinished' function 2011-08-15 14:52:45 +00:00
Andreas Stöckel
7800cfc5d4 Implemented et2_IInput interface for et2_button in order to transfer the id of the clicked button back to the server, implemented etemplate2.submit function, implemented egw_json et2_load response type to load a new template with new data. 2011-08-15 14:29:58 +00:00
Andreas Stöckel
fd21e247a1 etemplate2 object now creates not passed entries in the data array 2011-08-15 12:46:27 +00:00
Andreas Stöckel
8c9fd0f636 Implemented usage of mutliple array-manager objects (the object which cares about proper namespacing etc.) for each supplied data manager part (like 'content', 'readonlys' etc.), renamed et2_contentArrayMgr.js to et2_arrayMgr.js, renamed et2_all.js to etemplate2.js and added an top-level object which cares about loading the template, creating the array managers etc. 2011-08-15 12:34:00 +00:00
Andreas Stöckel
be34748b32 Added et2_all.js 2011-08-15 11:13:22 +00:00
Andreas Stöckel
f9914e069c Fixed problem with getValues iterating over widgets which are in proxied templates 2011-08-15 10:04:37 +00:00
Andreas Stöckel
29c16431ad Added new attribute type 'js', which cares about converting given JS code to a function 2011-08-15 09:24:32 +00:00
Andreas Stöckel
bb4aab7854 Fixed two dependencies 2011-08-15 08:42:07 +00:00
Andreas Stöckel
a28295db58 Added et2_all.js which contains references to all widgets and can be included by egw to load the complete etemplate2 js module, fixed problem in 'et2_DOMWidget::set_disabled', interpreting 'type' attribute like the node name when creating the wigdets from XML 2011-08-15 08:34:21 +00:00
Ralf Becker
9657dd6c1c fixed not working dependency 2011-08-13 17:34:22 +00:00
Ralf Becker
358fbf6d9e first try to call new etemplate2 stuff from server-side, just replace etemplate with etemplate_new, eg. in timesheet_ui::edit() 2011-08-13 16:51:35 +00:00
Andreas Stöckel
0c71ee3931 Added correct handling of namespaces for the getValues function 2011-08-12 17:02:21 +00:00
Andreas Stöckel
2fc29718f1 Added correct handling of namespaces 2011-08-12 16:29:24 +00:00
Andreas Stöckel
8a420df721 Moved basic functions of 'Class' from the 'add*Functions' functions to Class.prototype 2011-08-12 15:35:27 +00:00
Andreas Stöckel
89230b86cf Added functions to expand names and a basic implementation for 'disabled' 2011-08-12 15:26:08 +00:00
Andreas Stöckel
b9bb6280e3 Added getValues() function to the base widget which creates an associative 'array' with all form values. 2011-08-12 12:15:44 +00:00
Andreas Stöckel
7a6b105dc3 Moved et2_DOMWidget to its own file, added getInputNode function to et2_inputWidget 2011-08-11 13:53:35 +00:00
Andreas Stöckel
9ea38d694b Added very basic implementation for reading the content array 2011-08-10 17:44:22 +00:00
Andreas Stöckel
4f2eeaafe1 Fixed problem with id not being copied when cloning an template rewrote a part of the attribute merging system - now not only references of the attribute descriptors are copied between the instances. 2011-08-10 16:23:02 +00:00