Commit f39c1abb authored by Yoshinori Okuji's avatar Yoshinori Okuji

Try to find the default value from selection, if it is not found in request.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1200 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 71813d00
...@@ -41,6 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -41,6 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<span tal:define="groups python: form.get_groups(include_empty=1); <span tal:define="groups python: form.get_groups(include_empty=1);
field_errors python: request.get('field_errors',{}); field_errors python: request.get('field_errors',{});
params python: here.portal_selections.getSelectionParams(selection_name, REQUEST=request);
dummy python: request.set('here',here)"> dummy python: request.set('here',here)">
<table class="Border" width="100%"> <table class="Border" width="100%">
<tr> <tr>
...@@ -99,7 +100,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -99,7 +100,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
and field.is_required()" and field.is_required()"
class="required"> class="required">
</td> </td>
<td tal:define="value python:request.get(field.id,None)"> <td tal:define="value python:request.get(field.id,None) or params.get(field.id.startswith('my_') and field.id[3:] or field.id,None)">
<span tal:replace="structure python:field.render(value,request)" /> <span tal:replace="structure python:field.render(value,request)" />
</td> </td>
</tr> </tr>
...@@ -137,7 +138,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -137,7 +138,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
and field.is_required()" and field.is_required()"
class="required"> class="required">
</td> </td>
<td tal:define="value python:request.get(field.id,None)"> <td tal:define="value python:request.get(field.id,None) or params.get(field.id.startswith('my_') and field.id[3:] or field.id,None)">
<span tal:replace="structure python:field.render(value,request)" /> <span tal:replace="structure python:field.render(value,request)" />
</td> </td>
</tr> </tr>
...@@ -181,7 +182,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -181,7 +182,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
</td> </td>
</tr> </tr>
<tr> <tr>
<td tal:define="value python:request.get(field.id,None)"> <td tal:define="value python:request.get(field.id,None) or params.get(field.id.startswith('my_') and field.id[3:] or field.id,None)">
<span tal:replace="structure python:field.render(value,request)"/> <span tal:replace="structure python:field.render(value,request)"/>
</td> </td>
</tr> </tr>
...@@ -198,7 +199,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -198,7 +199,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<span tal:condition="python: len(groups)>3"> <span tal:condition="python: len(groups)>3">
<span tal:repeat="field python:form.get_fields_in_group(groups[3])"> <span tal:repeat="field python:form.get_fields_in_group(groups[3])">
<span tal:define="value python:request.get(field.id,None)" <span tal:define="value python:request.get(field.id,None) or params.get(field.id.startswith('my_') and field.id[3:] or field.id,None)"
tal:replace="structure python:field.render(value,request)" /> tal:replace="structure python:field.render(value,request)" />
</span> </span>
</span> </span>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment