myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r514177 - in /myfaces/fusion/trunk/examples/src/main: java/org/apache/myfaces/examples/ballot/backings/BallotTopic.java java/org/apache/myfaces/examples/ballot/dao/TopicDao.java webapp/ballot/Topic.jsp
Date Sat, 03 Mar 2007 15:57:30 GMT
Author: imario
Date: Sat Mar  3 07:57:30 2007
New Revision: 514177

URL: http://svn.apache.org/viewvc?view=rev&rev=514177
Log:
avoid starting a new topic

Modified:
    myfaces/fusion/trunk/examples/src/main/java/org/apache/myfaces/examples/ballot/backings/BallotTopic.java
    myfaces/fusion/trunk/examples/src/main/java/org/apache/myfaces/examples/ballot/dao/TopicDao.java
    myfaces/fusion/trunk/examples/src/main/webapp/ballot/Topic.jsp

Modified: myfaces/fusion/trunk/examples/src/main/java/org/apache/myfaces/examples/ballot/backings/BallotTopic.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/examples/src/main/java/org/apache/myfaces/examples/ballot/backings/BallotTopic.java?view=diff&rev=514177&r1=514176&r2=514177
==============================================================================
--- myfaces/fusion/trunk/examples/src/main/java/org/apache/myfaces/examples/ballot/backings/BallotTopic.java
(original)
+++ myfaces/fusion/trunk/examples/src/main/java/org/apache/myfaces/examples/ballot/backings/BallotTopic.java
Sat Mar  3 07:57:30 2007
@@ -96,6 +96,11 @@
 		this.selectedItem = selectedItem;
 	}
 
+	public boolean isNew()
+	{
+		return topicDao.isNew(getTopic());
+	}
+
 	public String removeItemAction()
 	{
 		if (topic.getItems() != null)

Modified: myfaces/fusion/trunk/examples/src/main/java/org/apache/myfaces/examples/ballot/dao/TopicDao.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/examples/src/main/java/org/apache/myfaces/examples/ballot/dao/TopicDao.java?view=diff&rev=514177&r1=514176&r2=514177
==============================================================================
--- myfaces/fusion/trunk/examples/src/main/java/org/apache/myfaces/examples/ballot/dao/TopicDao.java
(original)
+++ myfaces/fusion/trunk/examples/src/main/java/org/apache/myfaces/examples/ballot/dao/TopicDao.java
Sat Mar  3 07:57:30 2007
@@ -77,4 +77,9 @@
 	{
 		entityManager.persist(topic);
 	}
+
+	public boolean isNew(Topic topic)
+	{
+		return !entityManager.contains(topic);
+	}
 }

Modified: myfaces/fusion/trunk/examples/src/main/webapp/ballot/Topic.jsp
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/examples/src/main/webapp/ballot/Topic.jsp?view=diff&rev=514177&r1=514176&r2=514177
==============================================================================
--- myfaces/fusion/trunk/examples/src/main/webapp/ballot/Topic.jsp (original)
+++ myfaces/fusion/trunk/examples/src/main/webapp/ballot/Topic.jsp Sat Mar  3 07:57:30 2007
@@ -101,7 +101,7 @@
 				<h:selectBooleanCheckbox
 					id="started"
 					value="#{ballotTopic.topic.started}"
-					readonly="#{ballotTopic.topic.started || !ballotState.authenticated}" />
+					readonly="#{(!ballotTopic.new && ballotTopic.topic.started) || !ballotState.authenticated}"
/>
 
 			</h:panelGrid>
 



Mime
View raw message