You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by im...@apache.org on 2007/03/03 17:01:11 UTC
svn commit: r514178 - in /myfaces/fusion/trunk/examples/src/main:
java/org/apache/myfaces/examples/ballot/backings/BallotTopic.java
webapp/ballot/Topic.jsp
Author: imario
Date: Sat Mar 3 08:01:10 2007
New Revision: 514178
URL: http://svn.apache.org/viewvc?view=rev&rev=514178
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/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=514178&r1=514177&r2=514178
==============================================================================
--- 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 08:01:10 2007
@@ -96,9 +96,9 @@
this.selectedItem = selectedItem;
}
- public boolean isNew()
+ public boolean isTopicEditable()
{
- return topicDao.isNew(getTopic());
+ return topicDao.isNew(getTopic()) || !getTopic().isStarted();
}
public String removeItemAction()
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=514178&r1=514177&r2=514178
==============================================================================
--- myfaces/fusion/trunk/examples/src/main/webapp/ballot/Topic.jsp (original)
+++ myfaces/fusion/trunk/examples/src/main/webapp/ballot/Topic.jsp Sat Mar 3 08:01:10 2007
@@ -51,7 +51,7 @@
<h:commandButton
value="Save"
action="#{ballotTopic.saveAction}"
- rendered="#{!ballotTopic.topic.started && ballotState.authenticated}"/>
+ rendered="#{ballotTopic.topicEditable && ballotState.authenticated}"/>
</h:panelGrid>
</f:facet>
@@ -74,10 +74,10 @@
value="#{ballotTopic.topic.name}"
size="80"
maxlength="200"
- rendered="#{!ballotTopic.topic.started && ballotState.authenticated}"/>
+ rendered="#{ballotTopic.topicEditable && ballotState.authenticated}"/>
<h:outputText
value="#{ballotTopic.topic.name}"
- rendered="#{ballotTopic.topic.started || !ballotState.authenticated}"/>
+ rendered="#{!ballotTopic.topicEditable || !ballotState.authenticated}"/>
<h:outputLabel
for="description"
@@ -87,13 +87,13 @@
value="#{ballotTopic.topic.description}"
cols="80"
rows="8"
- rendered="#{!ballotTopic.topic.started && ballotState.authenticated}">
+ rendered="#{ballotTopic.topicEditable && ballotState.authenticated}">
<f:validateLength maximum="1024" />
</h:inputTextarea>
<h:outputText
value="#{ballotTopic.topic.description}"
- rendered="#{ballotTopic.topic.started || !ballotState.authenticated}"/>
+ rendered="#{!ballotTopic.topicEditable || !ballotState.authenticated}"/>
<h:outputLabel
for="started"
@@ -101,7 +101,7 @@
<h:selectBooleanCheckbox
id="started"
value="#{ballotTopic.topic.started}"
- readonly="#{(!ballotTopic.new && ballotTopic.topic.started) || !ballotState.authenticated}" />
+ readonly="#{!ballotTopic.topicEditable || !ballotState.authenticated}" />
</h:panelGrid>
@@ -132,7 +132,7 @@
<h:commandLink
value="Remove item"
action="#{ballotTopic.removeItemAction}"
- rendered="#{!ballotTopic.topic.started && ballotState.authenticated}">
+ rendered="#{ballotTopic.topicEditable && ballotState.authenticated}">
<t:updateActionListener property="#{ballotTopic.selectedItem}" value="#{item}" />
@@ -142,7 +142,7 @@
</t:dataTable>
<h:panelGroup
- rendered="#{!ballotTopic.topic.started && ballotState.authenticated}">
+ rendered="#{ballotTopic.topicEditable && ballotState.authenticated}">
<s:subForm>
<h:inputText
value="#{ballotTopic.newItem.content}"