some fixes to make dialogs work with IE

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1391 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2006-10-06 13:35:17 +00:00
parent 804ac92565
commit c3064f8fa4
2 changed files with 26 additions and 13 deletions

View file

@ -14,8 +14,14 @@
</tr> </tr>
</tbody> </tbody>
<tbody id="form.fields"> <tbody>
<metal:fields use-macro="view/template/macros/fields" /> <tr>
<td colspan="5">
<div id="form.fields">
<metal:fields use-macro="view/template/macros/fields" />
</div>
</td>
</tr>
</tbody> </tbody>
<tbody> <tbody>
@ -34,7 +40,7 @@
<metal:block define-macro="create"> <metal:block define-macro="create">
<form method="post" action="." enctype="multipart/form-data"> <form method="post" action="." enctype="multipart/form-data">
<input type="hidden" name="form.action" value="create" <input type="hidden" name="form.action" value="create"
tal:attributes="value view/form_action" /> tal:attributes="value view/form_action" />
<table cellpadding="3" class="form"> <table cellpadding="3" class="form">
<tbody> <tbody>
<tr> <tr>
@ -45,7 +51,8 @@
<select name="form.type" id="form.type" <select name="form.type" id="form.type"
tal:attributes="onChange tal:attributes="onChange
string:return replaceFieldsNode( string:return replaceFieldsNode(
'form.fields', 'form.type', 'inner_form.html')"> 'form.fields', 'form.type',
'${view/url}/inner_form.html')">
<option value=".loops/concepts/note" <option value=".loops/concepts/note"
tal:repeat="type view/resourceTypes" tal:repeat="type view/resourceTypes"
tal:content="type/title" tal:content="type/title"
@ -60,8 +67,14 @@
</tr> </tr>
</tbody> </tbody>
<tbody id="form.fields"> <tbody>
<metal:fields use-macro="view/template/macros/fields" /> <tr>
<td colspan="5">
<div id="form.fields">
<metal:fields use-macro="view/template/macros/fields" />
</div>
</td>
</tr>
</tbody> </tbody>
<tbody> <tbody>
@ -79,8 +92,9 @@
<metal:fields define-macro="fields"> <metal:fields define-macro="fields">
<tal:block tal:define="dummy view/setUp"> <tal:block tal:define="dummy view/setUp">
<table width="100%">
<tr tal:repeat="widget view/widgets"> <tr tal:repeat="widget view/widgets">
<td class="label" <td class="label" width="10%"
tal:define="hint widget/hint"> tal:define="hint widget/hint">
<label tal:attributes="for widget/name"> <label tal:attributes="for widget/name">
<span class="required" tal:condition="widget/required" <span class="required" tal:condition="widget/required"
@ -88,7 +102,7 @@
tal:content="widget/label">label</span> tal:content="widget/label">label</span>
</label> </label>
</td> </td>
<td class="field" colspan="4" <td class="field" colspan="4" width="90%"
tal:define="hint widget/hint"> tal:define="hint widget/hint">
<div class="widget" tal:content="structure widget"> <div class="widget" tal:content="structure widget">
<input type="text" /> <input type="text" />
@ -99,6 +113,7 @@
</div> </div>
</td> </td>
</tr> </tr>
</table>
</tal:block> </tal:block>
</metal:fields> </metal:fields>

View file

@ -15,9 +15,8 @@ function focusOpener() {
function replaceFieldsNode(targetId, typeId, url) { function replaceFieldsNode(targetId, typeId, url) {
token = dojo.byId(typeId).value; token = dojo.byId(typeId).value;
dojo.io.updateNode(targetId, { uri = url + '?form.type=' + token;
url: url + '?form.type=' + token dojo.io.updateNode(targetId, uri);
});
} }
function submitReplacing(targetId, formId, actionUrl) { function submitReplacing(targetId, formId, actionUrl) {
@ -81,7 +80,7 @@ function addConceptAssignment() {
dojo.require('dojo.html') dojo.require('dojo.html')
node = dojo.byId('form.assignments'); node = dojo.byId('form.assignments');
els = document.forms[0].elements; els = document.forms[0].elements;
for (var i=0; i<els.length; i++) { //getElementsByName does not work in IE for (var i=0; i<els.length; i++) { //getElementsByName does not work here in IE
el = els[i]; el = els[i];
if (el.name == 'concept.search.text_selected') { if (el.name == 'concept.search.text_selected') {
cToken = el.value; cToken = el.value;
@ -100,7 +99,6 @@ function addConceptAssignment() {
td.innerHTML = '<input type="checkbox" name="form.assignments.selected:list" value="' + token + '" checked><span>' + title + '</span>'; td.innerHTML = '<input type="checkbox" name="form.assignments.selected:list" value="' + token + '" checked><span>' + title + '</span>';
var tr = document.createElement('tr'); var tr = document.createElement('tr');
tr.appendChild(td); tr.appendChild(td);
//alert(tr.firstChild.attributes['colSpan'].value);
node.appendChild(tr); node.appendChild(tr);
} }