Added background-submit-refresh-target to form field submit, auto-update-target to screen container; also added example that uses thetainer; also updated example to use these new ajax features
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@645115 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -27,7 +27,6 @@ under the License.
|
||||
<set field="headerItem" value="AjaxExample"/>
|
||||
<set field="titleProperty" value="PageTitleFindExample"/>
|
||||
|
||||
<set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/>
|
||||
<set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
@@ -39,13 +38,10 @@ under the License.
|
||||
</condition>
|
||||
<widgets>
|
||||
<container><label style="h1">${uiLabelMap.${titleProperty}}</label></container>
|
||||
<container id="example-list">
|
||||
<include-screen name="listExamples"/>
|
||||
<container id="ListExamplesAutoUpdate" auto-update-target="ListExampleFormOnly">
|
||||
<include-screen name="ListExampleFormOnly"/>
|
||||
</container>
|
||||
<container/>
|
||||
<container id="create-form">
|
||||
<include-screen name="createScreenForm"/>
|
||||
</container>
|
||||
<include-screen name="CreateExampleFormOnly"/>
|
||||
</widgets>
|
||||
<fail-widgets>
|
||||
<label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>
|
||||
@@ -57,33 +53,28 @@ under the License.
|
||||
</section>
|
||||
</screen>
|
||||
|
||||
<screen name="listExamples">
|
||||
<screen name="ListExampleFormOnly">
|
||||
<section>
|
||||
<actions>
|
||||
<entity-condition entity-name="Example" list-name="examples"/>
|
||||
<!-- NOTE: these are needed because this may be run as a top level screen and would have no decorator -->
|
||||
<property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/>
|
||||
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<container id="list-example-table">
|
||||
<platform-specific><html><html-template location="component://example/webapp/example/ajax/listExamplesAjax.ftl"/></html></platform-specific>
|
||||
</container>
|
||||
<include-form name="ListExamples" location="component://example/widget/example/ExampleForms.xml"/>
|
||||
</widgets>
|
||||
</section>
|
||||
</screen>
|
||||
|
||||
<screen name="createScreenForm">
|
||||
<screen name="CreateExampleFormOnly">
|
||||
<section>
|
||||
<actions>
|
||||
<entity-condition entity-name="ExampleType" list-name="types"/>
|
||||
<entity-condition entity-name="StatusItem" list-name="statusItems">
|
||||
<condition-expr field-name="statusTypeId" operator="equals" value="EXAMPLE_STATUS"/>
|
||||
<order-by field-name="sequenceId"/>
|
||||
</entity-condition>
|
||||
<!-- these are only needed so that when bsh evaluates use-when attributes these will exist and not cause an error -->
|
||||
<set field="exampleId" from-field="parameters.exampleId"/>
|
||||
<entity-one entity-name="Example" value-name="example"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<container id="create-example-form">
|
||||
<platform-specific><html><html-template location="component://example/webapp/example/ajax/createExampleAjax.ftl"/></html></platform-specific>
|
||||
</container>
|
||||
<include-form name="EditExampleBackgroundSubmit" location="component://example/widget/example/ExampleForms.xml"/>
|
||||
</widgets>
|
||||
</section>
|
||||
</screen>
|
||||
</screens>
|
||||
</screens>
|
||||
|
||||
@@ -20,10 +20,9 @@ under the License.
|
||||
|
||||
<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
|
||||
<form name="ListExamples" type="list" list-name="examples"
|
||||
paginate-target="FindExample">
|
||||
<form name="ListExamples" type="list" list-name="examples" paginate-target="FindExample">
|
||||
<actions>
|
||||
<entity-condition entity-name="Example"><order-by field-name="description"/></entity-condition>
|
||||
<entity-condition entity-name="Example"><order-by field-name="exampleName"/></entity-condition>
|
||||
</actions>
|
||||
|
||||
<field name="exampleId" title="${uiLabelMap.ExampleExampleId}" widget-style="buttontext">
|
||||
@@ -34,6 +33,7 @@ under the License.
|
||||
<field name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem"/></field>
|
||||
<field name="description" title="${uiLabelMap.CommonDescription}"><display/></field>
|
||||
</form>
|
||||
|
||||
<form name="EditExample" type="single" target="updateExample" title="" default-map-name="example">
|
||||
<actions>
|
||||
<entity-one entity-name="StatusItem" value-name="currentStatus" auto-field-map="false">
|
||||
@@ -88,6 +88,10 @@ under the License.
|
||||
<field name="submitButton" use-when="example==null" title="${uiLabelMap.CommonCreate}"><submit button-type="button"/></field>
|
||||
<field name="submitButton" use-when="example!=null" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
|
||||
</form>
|
||||
<form name="EditExampleBackgroundSubmit" extends="EditExample">
|
||||
<field name="submitButton" use-when="example==null" title="${uiLabelMap.CommonCreate}"><submit button-type="button" background-submit-refresh-target="CreateExampleFormOnly"/></field>
|
||||
<field name="submitButton" use-when="example!=null" title="${uiLabelMap.CommonUpdate}"><submit button-type="button" background-submit-refresh-target="CreateExampleFormOnly"/></field>
|
||||
</form>
|
||||
|
||||
<!-- ExampleItem -->
|
||||
<form name="ListExampleItems" type="list" list-name="exampleItems" target="updateExampleItem">
|
||||
|
||||
Reference in New Issue
Block a user