Author: fdesbois Date: 2010-05-25 17:13:12 +0200 (Tue, 25 May 2010) New Revision: 3013 Url: http://chorem.org/repositories/revision/pollen/3013 Log: Decompose choice part of the pollForm in components (problem with upload can't be used in zone) Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceDateForm.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceImageForm.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceTextForm.java trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceDateForm.tml trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceImageForm.tml trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceTextForm.tml Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceImage.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/models/PollFormModel.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties trunk/pollen-ui/src/main/webapp/poll/PollForm.tml Modified: trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java =================================================================== --- trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java 2010-05-25 12:40:47 UTC (rev 3012) +++ trunk/pollen-business/src/main/java/org/chorem/pollen/service/ServicePollImpl.java 2010-05-25 15:13:12 UTC (rev 3013) @@ -9,7 +9,9 @@ import org.chorem.pollen.PollenException; import org.chorem.pollen.PollenQueryBuilder; import org.chorem.pollen.TopiaQueryBuilder; +import org.chorem.pollen.common.ChoiceType; import org.chorem.pollen.common.PollType; +import org.chorem.pollen.common.VoteCountingType; import org.chorem.pollen.entity.Choice; import org.chorem.pollen.entity.ChoiceDAO; import org.chorem.pollen.entity.Comment; @@ -68,6 +70,9 @@ @Override protected Poll executeGetNewPoll(UserAccount user) { Poll poll = new PollImpl(); + poll.setChoiceType(ChoiceType.TEXT); + poll.setVoteCountingType(VoteCountingType.NORMAL); + poll.setPollType(PollType.FREE); // Initialize creator as an admin for the poll PollAccount creator = new PollAccountImpl(); creator.setAdmin(true); Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceDateForm.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceDateForm.java (rev 0) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceDateForm.java 2010-05-25 15:13:12 UTC (rev 3013) @@ -0,0 +1,39 @@ +package org.chorem.pollen.ui.components; + +import org.apache.tapestry5.annotations.Parameter; +import org.apache.tapestry5.annotations.Property; +import org.apache.tapestry5.ioc.Messages; +import org.apache.tapestry5.ioc.annotations.Inject; +import org.chorem.pollen.ui.data.ChoiceField; +import org.chorem.pollen.ui.models.PollFormModel; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.List; + +/** + * Created: 25 mai 2010 + * + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$ + */ +public class ChoiceDateForm { + + @Inject + private Messages messages; + + @Parameter(required = true) + private PollFormModel model; + + @Property + private ChoiceField choice; + + public List<ChoiceField> getChoices() { + return model.getChoices(); + } + + public DateFormat getDateFormat() { + return new SimpleDateFormat(messages.get("date-pattern")); + } + +} Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceDateForm.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceImage.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceImage.java 2010-05-25 12:40:47 UTC (rev 3012) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceImage.java 2010-05-25 15:13:12 UTC (rev 3013) @@ -47,6 +47,7 @@ writeLink(writer, link, "rel", "lightbox[pollChoiceImages]"); writer.element("img", "src", thumbLink, "alt", source.getDescription()); writer.end(); + writer.end(); } /** Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceImageForm.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceImageForm.java (rev 0) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceImageForm.java 2010-05-25 15:13:12 UTC (rev 3013) @@ -0,0 +1,28 @@ +package org.chorem.pollen.ui.components; + +import org.apache.tapestry5.annotations.Parameter; +import org.apache.tapestry5.annotations.Property; +import org.chorem.pollen.ui.data.ChoiceField; +import org.chorem.pollen.ui.models.PollFormModel; + +import java.util.List; + +/** + * Created: 25 mai 2010 + * + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$ + */ +public class ChoiceImageForm { + + @Parameter(required = true) + private PollFormModel model; + + @Property + private ChoiceField choice; + + public List<ChoiceField> getChoices() { + return model.getChoices(); + } + +} Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceImageForm.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceTextForm.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceTextForm.java (rev 0) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceTextForm.java 2010-05-25 15:13:12 UTC (rev 3013) @@ -0,0 +1,28 @@ +package org.chorem.pollen.ui.components; + +import org.apache.tapestry5.annotations.Parameter; +import org.apache.tapestry5.annotations.Property; +import org.chorem.pollen.ui.data.ChoiceField; +import org.chorem.pollen.ui.models.PollFormModel; + +import java.util.List; + +/** + * Created: 25 mai 2010 + * + * @author fdesbois <fdesbois@codelutin.com> + * @version $Id$ + */ +public class ChoiceTextForm { + + @Parameter(required = true) + private PollFormModel model; + + @Property + private ChoiceField choice; + + public List<ChoiceField> getChoices() { + return model.getChoices(); + } + +} Property changes on: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/components/ChoiceTextForm.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java 2010-05-25 12:40:47 UTC (rev 3012) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/data/ChoiceField.java 2010-05-25 15:13:12 UTC (rev 3013) @@ -223,7 +223,14 @@ name = String.valueOf(getDate().getTime()); break; case IMAGE: - name = serviceImage.saveImage(getImage(), getImageDir()); + if (image == null) { + return; + } + if (log.isDebugEnabled()) { + log.debug("Saving image... " + getImageFileName() + + " in directory " + imageDir); + } + name = serviceImage.saveImage(image, imageDir); break; case TEXT: name = getText(); Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/models/PollFormModel.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/models/PollFormModel.java 2010-05-25 12:40:47 UTC (rev 3012) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/models/PollFormModel.java 2010-05-25 15:13:12 UTC (rev 3013) @@ -5,6 +5,7 @@ import org.apache.tapestry5.ioc.Messages; import org.chorem.pollen.PollenBusinessException; import org.chorem.pollen.PollenException; +import org.chorem.pollen.common.ChoiceType; import org.chorem.pollen.common.PollType; import org.chorem.pollen.entity.Choice; import org.chorem.pollen.entity.ParticipantList; @@ -141,9 +142,8 @@ if (choices == null) { choices = new ArrayList<ChoiceField>(); if (createMode) { - // Initialized to choice TEXT type for (int i = 0; i < 4; i++) { - choices.add(ChoiceField.getChoiceText()); + choices.add(new ChoiceField(poll)); } } else { for (Choice current : poll.getChoice()) { @@ -154,6 +154,12 @@ return choices; } + public void setChoiceType(ChoiceType type) { + poll.setChoiceType(type); + // Reset choices + choices = null; + } + /** * Change the poll type to {@code type}. The lists managment will depends on * poll type. For a {@link PollType#RESTRICTED} poll, a new list will be @@ -322,9 +328,15 @@ poll.clearChoice(); for (ChoiceField choiceField : getChoices()) { choiceField.saveName(serviceImage); + if (logger.isDebugEnabled()) { + logger.debug("ChoiceField : " + choiceField.getName()); + } Choice choice = choiceField.getChoice(); if (StringUtils.isNotEmpty(choice.getName())) { - poll.addChoice(choice); + if (logger.isDebugEnabled()) { + logger.debug("Add choice to poll : " + choice.getName()); + } + poll.addChoice(choice); } } poll = servicePoll.createPoll(poll, getLists()); Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-05-25 12:40:47 UTC (rev 3012) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/PollForm.java 2010-05-25 15:13:12 UTC (rev 3013) @@ -1,5 +1,6 @@ package org.chorem.pollen.ui.pages.poll; +import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.lang.StringUtils; import org.apache.tapestry5.Block; import org.apache.tapestry5.ComponentResources; @@ -520,52 +521,52 @@ @Inject private ServiceImage serviceImage; - @InjectComponent - private Zone choicesZone; - +// @InjectComponent +// private Zone choicesZone; +// @Inject - private Block choiceText; + private Block choiceTextBlock; @Inject - private Block choiceDate; + private Block choiceDateBlock; @Inject - private Block choiceImage; + private Block choiceImageBlock; +// +// @Property +// private ChoiceField choice; +// +// @Property +// private boolean refreshChoicesZone; - @Property - private ChoiceField choice; - - @Property - private boolean refreshChoicesZone; - /** * Get choices from poll if it exists or initialized 4 choices with the * default type : TEXT. * * @return a list of ChoiceDTO */ - public List<ChoiceField> getChoices() throws PollenBusinessException { - return getModel().getChoices(); - } - +// public List<ChoiceField> getChoices() throws PollenBusinessException { +// return getModel().getChoices(); +// } +// public Block getChoiceTypeBlock() { switch (getPoll().getChoiceType()) { case DATE: - return choiceDate; + return choiceDateBlock; case IMAGE: - return choiceImage; + return choiceImageBlock; default: - return choiceText; + return choiceTextBlock; } } - @Log - Object onChangeFromChoiceType(String value) { - ChoiceType type = ChoiceType.valueOf(value); - getPoll().setChoiceType(type); - refreshChoicesZone = true; - return choicesZone.getBody(); - } +// @Log +// Object onChangeFromChoiceType(String value) { +// ChoiceType type = ChoiceType.valueOf(value); +// getModel().setChoiceType(type); +// refreshChoicesZone = true; +// return choicesZone.getBody(); +// } /** ********************** NAVIGATION/SUBMISSION ************************ */ @@ -601,21 +602,53 @@ @Log void onSelected() { refreshListsZone = false; - refreshChoicesZone = false; +// refreshChoicesZone = false; } +// /** +// * ON_SELECTED:: Callback method for action on choiceStep submit buttons. +// * Will change the view and display the choice formFragment of the pollForm. +// * Note : maybe validations will be needed in this case (use edited flag). +// */ +// @Log +// void onSelectedFromChoiceStep(String choiceType) { +// ChoiceType type = ChoiceType.valueOf(choiceType); +// getModel().setChoiceType(type); +// step = PollStep.CHOICES; +// edited = true; +// } + /** - * ON_SELECTED:: Callback method for action on choiceStep submit button. Will - * change the view and display the choice formFragment of the pollForm. - * Note : maybe validations will be needed in this case (use edited flag). + * ON_SELECTED:: Callback method for action on choiceText submit button. */ @Log - void onSelectedFromChoiceStep() { + void onSelectedFromChoiceText() { + getModel().setChoiceType(ChoiceType.TEXT); step = PollStep.CHOICES; edited = true; } /** + * ON_SELECTED:: Callback method for action on choiceDate submit button. + */ + @Log + void onSelectedFromChoiceDate() { + getModel().setChoiceType(ChoiceType.DATE); + step = PollStep.CHOICES; + edited = true; + } + + /** + * ON_SELECTED:: Callback method for action on choiceImage submit button. + */ + @Log + void onSelectedFromChoiceImage() { + getModel().setChoiceType(ChoiceType.IMAGE); + step = PollStep.CHOICES; + edited = true; + } + + /** * ON_SELECTED:: Callback method for action on mainStep submit button. Will * change the view and display the main formFragment of the pollForm. * This is a previous action after being on choices. @@ -632,13 +665,31 @@ public boolean isMainStep() { return step.equals(PollStep.MAIN); - } + } +// @Log +// Object onUploadException(FileUploadException ex) { +// addError(ex.getMessage()); +// return this; +// } + @Log void onValidateForm() { if (!edited) { // Validate data ErrorReport report = getModel().validate(messages); + + + if (logger.isDebugEnabled()) { + for (ChoiceField choiceField : getModel().getChoices()) { + logger.debug("Choice type : " + choiceField.getChoiceType()); + logger.debug("Choice image : " + choiceField.getImage()); + logger.debug("Choice text : " + choiceField.getText()); + logger.debug("Choice date : " + choiceField.getDate()); + } + } + + // Record errors if report is not empty if (report.hasErrors()) { manager.recordFormErrors(componentSource, report, mainForm); Modified: trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties =================================================================== --- trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-05-25 12:40:47 UTC (rev 3012) +++ trunk/pollen-ui/src/main/resources/i18n/pollen-ui-fr_FR.properties 2010-05-25 15:13:12 UTC (rev 3013) @@ -93,7 +93,15 @@ groupName-label=Nom du groupe participantEmail-regexp=^([a-zA-Z0-9_.+-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$ participantEmail-regexp-message=Adresse email invalide. +date-pattern=dd/MM/yyyy HH:mm +choiceImageField-label=Image +choiceImageField-regexp=\\.(jpe?g|gif|png|JPE?G|GIF|PNG)$ +choiceImageField-regexp-message=L'image doit-\u00eatre au format JPG, GIF ou PNG. +choiceDateField-label=Date et heure +choiceDateField-regexp=\\d{2}\/\\d{2}\/\\d{4}( \\d{2}\\:\\d{2})? +choiceDateField-regexp-message=La date doit-\u00eatre au format 31/12/2000 23:59. + # FORM:: user firstName-label=Pr\u00e9nom lastName-label=Nom Added: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceDateForm.tml =================================================================== --- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceDateForm.tml (rev 0) +++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceDateForm.tml 2010-05-25 15:13:12 UTC (rev 3013) @@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<body xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" + xmlns:p="tapestry:parameter"> + + <div id="p-pollForm-choices"> + <fieldset> + <legend> + CHOICE_DATE + </legend> + <div t:type="loop" t:source="choices" t:value="choice" + t:volatile="true" class="clearfix"> + <div class="fleft choiceName"> + <label t:type="label" t:for="choiceDateField" />: + <input t:type="ck/dateTimeField" + t:id="choiceDateField" + value="choice.date" t:validate="regexp" + t:datePattern="message:date-pattern" + t:timePicker="true" + t:timePickerAdjacent="true" /> + <label t:type="label" t:for="choiceDescription" />: + </div> + <div class="fleft"> + <textarea t:type="textarea" cols="34" rows="1" + t:id="choiceDescription" + t:value="choice.description" /> + </div> + </div> + </fieldset> + </div> +</body> \ No newline at end of file Property changes on: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceDateForm.tml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceImageForm.tml =================================================================== --- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceImageForm.tml (rev 0) +++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceImageForm.tml 2010-05-25 15:13:12 UTC (rev 3013) @@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<body xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" + xmlns:p="tapestry:parameter"> + + <div id="p-pollForm-choices"> + <fieldset> + <legend> + CHOICE_IMAGE + </legend> + <div t:type="loop" t:source="choices" t:value="choice" + t:volatile="true" class="clearfix"> + <div class="fleft choiceName"> + <label t:type="label" + t:for="choiceImageField" />: + <input type="file" class="nameField" + t:type="upload" t:id="choiceImageField" + value="choice.image" /> + <label t:type="label" t:for="choiceDescription" />: + </div> + <div class="fleft"> + <textarea t:type="textarea" cols="34" rows="1" + t:id="choiceDescription" + t:value="choice.description" /> + </div> + </div> + </fieldset> + </div> +</body> \ No newline at end of file Property changes on: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceImageForm.tml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceTextForm.tml =================================================================== --- trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceTextForm.tml (rev 0) +++ trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceTextForm.tml 2010-05-25 15:13:12 UTC (rev 3013) @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<body xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" + xmlns:p="tapestry:parameter"> + + <div id="p-pollForm-choices"> + <fieldset> + <legend> + CHOICE_TEXT + </legend> + <div t:type="loop" t:source="choices" t:value="choice" + t:volatile="true" class="clearfix"> + <div class="fleft choiceName"> + <label t:type="label" t:for="choiceTextField" />: + <input type="text" class="nameField" + t:type="textfield" t:id="choiceTextField" + value="choice.text" /> + <label t:type="label" t:for="choiceDescription" />: + </div> + <div class="fleft"> + <textarea t:type="textarea" cols="34" rows="1" + t:id="choiceDescription" + t:value="choice.description" /> + </div> + </div> + </fieldset> + </div> +</body> \ No newline at end of file Property changes on: trunk/pollen-ui/src/main/resources/org/chorem/pollen/ui/components/ChoiceTextForm.tml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/pollen-ui/src/main/webapp/poll/PollForm.tml =================================================================== --- trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-05-25 12:40:47 UTC (rev 3012) +++ trunk/pollen-ui/src/main/webapp/poll/PollForm.tml 2010-05-25 15:13:12 UTC (rev 3013) @@ -367,74 +367,36 @@ </t:if> </div> </fieldset> - <p class="center"> - <input t:type="submit" t:id="choiceStep" value="CHOICE" /> - </p> </div> - </t:formFragment> - <t:formFragment t:id="choiceFormFragment" t:visible="choiceStep"> - - <!-- CHOICES --> - <div id="p-pollForm-choices"> - <fieldset> - <legend> - <label t:type="label" t:for="choiceType" />: - <select t:type="select" t:id="choiceType" - t:value="poll.choiceType" t:validate="required" - t:mixins="nuiton/zoneUpdater" t:event="change" - t:zone="p-pollForm-choices-zone" /> - </legend> - <t:zone t:id="choicesZone" id="p-pollForm-choices-zone"> - <t:subForm t:visible="refreshChoicesZone"> - <div t:type="loop" t:source="choices" t:value="choice" - t:volatile="true" class="clearfix"> - <div class="fleft choiceName"> - <t:delegate t:to="choiceTypeBlock" /> - <t:block t:id="choiceText"> - <label t:type="label" t:for="choiceTextField" />: - <input type="text" class="nameField" - t:type="textfield" t:id="choiceTextField" - value="choice.text" /> - </t:block> - <t:block t:id="choiceDate"> - <label t:type="label" t:for="choiceDateField" />: - <input t:type="ck/dateTimeField" - t:id="choiceDateField" - value="choice.date" t:validate="regexp" - t:datePattern="message:date-pattern" - t:timePicker="true" - t:timePickerAdjacent="true" /> - </t:block> - <t:block t:id="choiceImage"> - <label t:type="label" - t:for="choiceImageField" />: - <input type="file" class="nameField" - t:type="upload" t:id="choiceImageField" - value="choice.image" - t:validate="regexp" /> - </t:block> - <t:block t:id="choiceDisplay"> - ${choice.name} - </t:block> - - <t:label t:for="choiceDescription" /> - : - </div> - <div class="fleft"> - <t:textarea cols="34" rows="1" - t:id="choiceDescription" - t:value="choice.description" /> - </div> - </div> - </t:subForm> - </t:zone> - </fieldset> - </div> <p class="center"> - <input t:type="submit" t:id="mainStep" value="PREVIOUS" /> - <input t:type="submit" t:id="save" value="SAVE" /> + <input t:type="submit" t:id="choiceText" value="TEXT" /> + <input t:type="submit" t:id="choiceDate" value="DATE" /> + <input t:type="submit" t:id="choiceImage" value="IMAGE" /> </p> </t:formFragment> </form> + <t:if t:test="choiceStep"> + <!--<t:zone id="p-pollForm-choiceZone">--> + + <!--</t:zone>--> + <form t:type="form" t:id="choiceForm" action="tapestry"> + <t:errors /> + <!-- CHOICES - Formulaire différent car t:upload ne fonctionne pas en ajax --> + <t:delegate t:to="choiceTypeBlock" /> + <t:block t:id="choiceTextBlock"> + <t:choiceTextForm t:model="model" /> + </t:block> + <t:block t:id="choiceDateBlock"> + <t:choiceDateForm t:model="model" /> + </t:block> + <t:block t:id="choiceImageBlock"> + <t:choiceImageForm t:model="model" /> + </t:block> + <p class="center"> + <input t:type="submit" t:id="mainStep" value="PREVIOUS" /> + <input t:type="submit" t:id="save" value="SAVE" /> + </p> + </form> + </t:if> </t:zone> </html>