Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rebulid the ConfirmDemo page to make it easier to verify that all nec…

…essary information makes it up to the server
  • Loading branch information...
commit 4538dbb3e261b8808afbb2c66a595a953a9e2594 1 parent 6fb2f99
@hlship authored
View
67 tapx-core/src/test/java/core/demo/pages/ConfirmDemo.java
@@ -14,39 +14,62 @@
package core.demo.pages;
-import org.apache.tapestry5.PersistenceConstants;
+import org.apache.tapestry5.alerts.AlertManager;
import org.apache.tapestry5.annotations.InjectComponent;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.Zone;
+import org.apache.tapestry5.ioc.annotations.Inject;
public class ConfirmDemo {
- @Property
- @Persist(PersistenceConstants.FLASH)
- private String message;
- @InjectComponent
- private Zone zone, messageZone;
+ @Inject
+ private AlertManager alertManager;
- void onActionFromLink1() {
- message = "update from link1";
- }
+ @Persist
+ @Property
+ private int updates;
- Object onActionFromLink2() {
- return zone.getBody();
- }
- void onSuccessFromForm() {
- message = "update via form submit";
- }
+ @InjectComponent
+ private Zone zone;
- Object onSuccessFromZoneForm() {
- message = "update via zone form submit";
+ void onActionFromLink1() {
+ alertManager.info("update from link1");
+ }
- return messageZone.getBody();
- }
+ void onSelectedFromFormSubmit() {
+ alertManager.info("formSubmit was selected");
+ }
- void onActionFromLink3() {
- message = "update from link3";
- }
+ void onSelectedFromZoneFormSubmit() {
+ alertManager.info("zoneFormSubmit was selected");
+ }
+
+ Object onActionFromLink2() {
+
+ updates++;
+
+ alertManager.info("update from link2");
+
+ return zone.getBody();
+ }
+
+ void onSuccessFromForm() {
+ alertManager.info("update via form submit");
+ }
+
+ Object onSuccessFromZoneForm() {
+
+ updates++;
+
+ alertManager.info("update via zone form submit");
+
+ return zone.getBody();
+
+ }
+
+ void onActionFromLink3() {
+ alertManager.info("update from link3");
+ }
}
View
63 tapx-core/src/test/resources/core/demo/pages/ConfirmDemo.tml
@@ -1,38 +1,37 @@
<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
- xmlns:tx="tapestry-library:tapx">
+ >
- <t:zone id="messageZone" t:id="messageZone">
- <p id="message">${message}</p>
- </t:zone>
+ <t:alerts/>
- <ul>
- <li>
- <t:actionlink t:id="link1" t:mixins="tapx/confirm">actionlink
- </t:actionlink>
- </li>
- <li>
- <t:actionlink t:id="link2" zone="zone" t:mixins="tapx/confirm"
- title="Update zone?" message="Custom message?">zone update link</t:actionlink>
- </li>
- <li>
- <t:actionlink class="tx-disable-confirm" t:id="link3"
- t:mixins="tapx/confirm">confirm disabled
- </t:actionlink>
- </li>
- <li>
- <t:form t:id="form">
- <t:submit value="Form Submit" t:mixins="tapx/confirm" />
- </t:form>
- </li>
- <li>
- <t:form t:id="zoneForm" zone="messageZone">
- <t:submit value="Zone Form Submit" t:mixins="tapx/confirm" mode="cancel"/>
- </t:form>
- </li>
+ <ul>
+ <li>
+ <t:actionlink t:id="link1" t:mixins="tapx/confirm">actionlink
+ </t:actionlink>
+ </li>
+ <li>
+ <t:actionlink t:id="link2" zone="zone" t:mixins="tapx/confirm"
+ title="Update zone?" message="Custom message?">zone update link
+ </t:actionlink>
+ </li>
+ <li>
+ <t:actionlink class="tx-disable-confirm" t:id="link3"
+ t:mixins="tapx/confirm">confirm disabled
+ </t:actionlink>
+ </li>
+ <li>
+ <t:form t:id="form">
+ <t:submit t:id="formSubmit" value="Form Submit" t:mixins="tapx/confirm"/>
+ </t:form>
+ </li>
+ <li>
+ <t:form t:id="zoneForm" zone="zone">
+ <t:submit t:id="zoneFormSubmit" value="Zone Form Submit" t:mixins="tapx/confirm" mode="cancel"/>
+ </t:form>
+ </li>
- </ul>
+ </ul>
- <t:zone t:id="zone" id="zone" visible="false">
- <p id="zone-message">Zone link was clicked.</p>
- </t:zone>
+ <t:zone t:id="zone" id="zone" visible="false">
+ <p id="zone-message">Zone link updated ${updates} times.</p>
+ </t:zone>
</t:layout>
Please sign in to comment.
Something went wrong with that request. Please try again.