documentation update:

- fixed wrong / not working popup javascript
- updated xet-file example to include <template> tags
- updated the describtion: a (nested) widget tree is allowed in HEAD now and not just one grid as in the 1.0.0
This commit is contained in:
Ralf Becker 2005-04-10 13:39:33 +00:00
parent 389596faa8
commit c84e492e91

View File

@ -38,52 +38,54 @@ an eTemplate from the example app in the <a href="etemplate.html">Tutorial</a>
&lt;?xml version="1.0"?>
<span>&lt;!-- $Id$ --></span>
&lt;overlay>
&lt;grid id="et_media.edit" template="" lang="" group="" version="" width="100%">
&lt;columns>
&lt;column/>
&lt;column/>
&lt;column/>
&lt;column/>
&lt;/columns>
&lt;rows>
&lt;row>
&lt;description options="ib" span="all" value="eTemplates MediaDB" no_lang="1" id="msg"/>
&lt;/row>
&lt;row>
&lt;hrule span="all"/>
&lt;/row>
&lt;row>
&lt;template id="et_media.edit" template="" lang="" group="" version="">
&lt;grid width="100%">
&lt;columns>
&lt;column/>
&lt;column/>
&lt;column/>
&lt;column/>
&lt;/columns>
&lt;rows>
&lt;row>
&lt;description options="ib" span="all" value="eTemplates MediaDB" no_lang="1" id="msg"/>
&lt;/row>
&lt;row>
&lt;hrule span="all"/>
&lt;/row>
&lt;row>
&lt;description span="all"/>
&lt;/row>
&lt;row>
&lt;description value="Name"/>
&lt;textbox size="100" maxlength="100" span="all" id="name" statustext="here goes the name of the publication / record"/>
&lt;/row>
&lt;row>
&lt;description value="Author"/>
&lt;textbox size="100" maxlength="100" span="all" id="author" statustext="please use Name, First Name"/>
&lt;/row>
&lt;row>
&lt;description value="Type"/>
&lt;menulist span="all" statustext="select the type fitting most">
&lt;menupopup id="type"/>
&lt;/menulist>
&lt;/row>
&lt;row>
&lt;description value="Description"/>
&lt;textbox ="" cols="3" rows="100" span="all" id="descr" statustext="we have a fulltext search using that description"/>
&lt;/row>
&lt;row>
&lt;description span="all"/>
&lt;/row>
&lt;row>
&lt;description value="Name"/>
&lt;textbox size="100" maxlength="100" span="all" id="name" statustext="here goes the name of the publication / record"/>
&lt;/row>
&lt;row>
&lt;description value="Author"/>
&lt;textbox size="100" maxlength="100" span="all" id="author" statustext="please use Name, First Name"/>
&lt;/row>
&lt;row>
&lt;description value="Type"/>
&lt;menulist span="all" statustext="select the type fitting most">
&lt;menupopup id="type"/>
&lt;/menulist>
&lt;/row>
&lt;row>
&lt;description value="Description"/>
&lt;textbox ="" cols="3" rows="100" span="all" id="descr" statustext="we have a fulltext search using that description"/>
&lt;/row>
&lt;row>
&lt;description span="all"/>
&lt;/row>
&lt;row>
&lt;button label="Read" id="read" statustext="reads or searches for entries matching the criteria above"/>
&lt;button label="Save" id="save" statustext="saves the change to the db"/>
&lt;button label="Cancel" id="cancel" statustext="clears the form, without changing anything"/>
&lt;button label="Delete" id="delete" statustext="deletes an entry"/>
&lt;/row>
&lt;/rows>
&lt;/grid>
&lt;/row>
&lt;row>
&lt;button label="Read" id="read" statustext="reads or searches for entries matching the criteria above"/>
&lt;button label="Save" id="save" statustext="saves the change to the db"/>
&lt;button label="Cancel" id="cancel" statustext="clears the form, without changing anything"/>
&lt;button label="Delete" id="delete" statustext="deletes an entry"/>
&lt;/row>
&lt;/rows>
&lt;/grid>
&lt;/template>
&lt;/overlay>
</pre>
<p>The tags / widget-names and attributes / parameters used are as close as possible to XUL. For more
@ -97,17 +99,17 @@ implement only a subset of XUL. Here are the main differences:</p>
different template syntax to fill in content from a variable: &lt;label value="?label"/><br />
eTemplates get there content from an array passed to the exec or show-function of the template-object
and reference to the content by the id / name-field of each widget.
<li>xul-files can contain an unlimited number of nested elements, where as the eTemplates xml-root-node
has to be a xul-grid and can not contain other grids as element (vbox and hbox are Ok).
<i>This limitation might be removed in the near future, for now you have to use the non-xul-element
&lt;template id="app.template_name"/> us load an other template by its name.</i>
<li>xul-files can contain an unlimited number of nested elements, the xml-root-node of an eTemplates has to
be an overlay, containing multiple (non-xul) &lt;template>'s. That templates can contain now (HEAD)
a tree of other widgets, but not other templates direct. You can use &lt;template id="app.template_name" />
to load an other template by its name.</i>
</ul>
<p>Like XUL the eTemplate-xml-files are quite strict with the xml-syntax:</p>
<ul>
<li>All tags and attributes must be written in lowercase
<li>All strings must be double quoted, like id="string"
<li>Every XUL widget must use close tags (either &lt;tag>&lt;/tag> or &lt;tag/>) to be well-formed
<li>All attributes must have a value, no &lt;tag attr> it has to be &lt;tag attr="">
<li>All attributes must have a value, no &lt;tag attr> it has to be &lt;tag attr="1">
</ul>
<hr>
<a name="reference"></a>
@ -497,9 +499,12 @@ implement only a subset of XUL. Here are the main differences:</p>
<b>onclick</b>: specify some java-script to be called if the button gets pressed/clicked: <br />
a) general javascript: "window.close();"<br />
b) confirmation: "return window.confirm('<message>');" (message get run through lang()!)<br />
c) popups: "window.open(egw::link('/index.php','menuaction=app.class.func&id=$cont[id]'), 'dependent=yes,width=600,height=450,location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes'); return false;"
(egw::link('<url>','<vars>') calls $GLOBALS['phpgw']->link() to allow eGW installtion relative links and to pass the session-id.
You can use $cont[<name>] (note no quotes!) to pass further information to the popup via the content array.)
c) popups: "window.open(egw::link('/index.php','menuaction=app.class.func&id=$cont[id]'),'_blank',
'dependent=yes,width=600,height=450,scrollbars=yes,status=yes'); return false;"
(egw::link('<url>','<vars>') calls $GLOBALS['phpgw']->link() to allow eGW installtion relative links
and to pass the session-id.
You can use $cont[<name>] or $row_cont[<name>] (note no quotes!) to pass further information to the popup
via the content array.)
</td>
</tr>
<tr>