r3169 - branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll
Author: tchemit Date: 2012-03-07 18:10:58 +0100 (Wed, 07 Mar 2012) New Revision: 3169 Url: http://chorem.org/repositories/revision/pollen/3169 Log: create in lazy poll otherwise loose all his data on validation error Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java 2012-03-07 16:57:17 UTC (rev 3168) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java 2012-03-07 17:10:58 UTC (rev 3169) @@ -130,6 +130,11 @@ } public Poll getPoll() { + if (poll == null) { + // create poll + UserAccount userAccount = getPollenSession().getUserAccount(); + poll = getPollService().getNewPoll(userAccount); + } return poll; } @@ -237,10 +242,6 @@ @Override public void prepare() throws Exception { - // create poll - UserAccount userAccount = getPollenSession().getUserAccount(); - poll = getPollService().getNewPoll(userAccount); - pollTypes = decorateToName(PollType.values()); choiceTypes = decorateToName(ChoiceType.values()); voteCountingTypes = decorateToName(VoteCountingType.values());
participants (1)
-
tchemit@users.chorem.org