[jboss-svn-commits] JBL Code SVN: r11967 - in labs/jbossforums/branches/forums101P26/forums/src: resources/portal-forums-war/views/topics and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat May 19 21:10:05 EDT 2007


Author: unibrew
Date: 2007-05-19 21:10:04 -0400 (Sat, 19 May 2007)
New Revision: 11967

Modified:
   labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java
   labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml
   labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
   labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml
   labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml
Log:
[JBFORUMS-240] After terribly long and annoying fight with JSF I finally repaired all indexing for polls and attachments.

Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java	2007-05-20 01:09:45 UTC (rev 11966)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java	2007-05-20 01:10:04 UTC (rev 11967)
@@ -494,6 +494,14 @@
         {
             String optionIndex = ForumUtil.getParameter(Constants.p_option);
             this.options.remove(optionIndex);
+            Iterator it = this.options.keySet().iterator();
+            Map temporary = new TreeMap();
+            byte counter = 1;
+            while (it.hasNext())
+            {
+                temporary.put(Byte.toString(counter++), this.options.get(it.next()));
+            }
+            this.options = temporary;
         }
         catch(Exception e)
         {

Modified: labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	2007-05-20 01:09:45 UTC (rev 11966)
+++ labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	2007-05-20 01:10:04 UTC (rev 11967)
@@ -619,9 +619,9 @@
             <input type="text" id="option_${idx.index+1}" name="option_${idx.index+1}"
                    value="${optionRow}" style="width: 450px;" maxlength="255"/>
             &#160;
-            <h:commandButton action="#{editPost.updateOption}" value="${resource.Update}"
+            <h:commandButton id="UpdateOption_${idx.index+1}" action="#{editPost.updateOption}" value="${resource.Update}"
                              styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
-            <h:commandButton action="#{editPost.deleteOption}" value="${resource.Delete}"
+            <h:commandButton id="DeleteOption_${idx.index+1}" action="#{editPost.deleteOption}" value="${resource.Delete}"
                              styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
         </td>
     </tr>
@@ -739,10 +739,10 @@
     <tr class="PostViewUnderline">
         <td></td>
         <td>
-            <h:commandButton action="#{editPost.updateAttachment}" value="${resource.Update_comment}"
+            <h:commandButton id="UpdateAttachment_${idx.index}" action="#{editPost.updateAttachment}" value="${resource.Update_comment}"
                          styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
             &#160;
-            <h:commandButton action="#{editPost.deleteAttachment}" value="${resource.Delete_attachment}"
+            <h:commandButton id="DeleteAttachment_${idx.index}" action="#{editPost.deleteAttachment}" value="${resource.Delete_attachment}"
                              styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
         </td>
     </tr>

Modified: labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	2007-05-20 01:09:45 UTC (rev 11966)
+++ labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	2007-05-20 01:10:04 UTC (rev 11967)
@@ -614,9 +614,9 @@
             <input type="text" id="option_${idx.index+1}" name="option_${idx.index+1}"
                    value="${optionRow}" style="width: 450px;" maxlength="255"/>
             &#160;
-            <h:commandButton action="#{newTopic.updateOption}" value="${resource.Update}"
+            <h:commandButton id="UpdateOption_${idx.index+1}" action="#{newTopic.updateOption}" value="${resource.Update}"
                              styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
-            <h:commandButton action="#{newTopic.deleteOption}" value="${resource.Delete}"
+            <h:commandButton id="DeleteOption_${idx.index+1}" action="#{newTopic.deleteOption}" value="${resource.Delete}"
                              styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
         </td>
     </tr>
@@ -732,10 +732,10 @@
     <tr class="PostViewUnderline">
         <td></td>
         <td>
-            <h:commandButton action="#{newTopic.updateAttachment}" value="${resource.Update_comment}"
+            <h:commandButton id="UpdateAttachment_${idx.index}" action="#{newTopic.updateAttachment}" value="${resource.Update_comment}"
                          styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
             &#160;
-            <h:commandButton action="#{newTopic.deleteAttachment}" value="${resource.Delete_attachment}"
+            <h:commandButton id="DeleteAttachment_${idx.index}" action="#{newTopic.deleteAttachment}" value="${resource.Delete_attachment}"
                              styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
         </td>
     </tr>

Modified: labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml	2007-05-20 01:09:45 UTC (rev 11966)
+++ labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml	2007-05-20 01:10:04 UTC (rev 11967)
@@ -634,10 +634,10 @@
     <tr class="PostViewUnderline">
         <td></td>
         <td>
-            <h:commandButton action="#{replyTopic.updateAttachment}" value="${resource.Update_comment}"
+            <h:commandButton id="UpdateAttachment_${idx.index}" action="#{replyTopic.updateAttachment}" value="${resource.Update_comment}"
                          styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
             &#160;
-            <h:commandButton action="#{replyTopic.deleteAttachment}" value="${resource.Delete_attachment}"
+            <h:commandButton id="DeleteAttachment_${idx.index}" action="#{replyTopic.deleteAttachment}" value="${resource.Delete_attachment}"
                              styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
         </td>
     </tr>

Modified: labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml	2007-05-20 01:09:45 UTC (rev 11966)
+++ labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml	2007-05-20 01:10:04 UTC (rev 11967)
@@ -46,7 +46,7 @@
                         <tr>                           
             			   <forums:isAllowed fragment="acl://votePoll" contextData="#{poll}"> 
                            <td>                           		
-                           		<input type="radio" name="vote" value="#{(status.index)-1}"/>
+                           		<input type="radio" name="vote" value="#{(status.index)}"/>
                            		&#160;
                            </td>
                            </forums:isAllowed>




More information about the jboss-svn-commits mailing list