[jboss-svn-commits] JBL Code SVN: r11968 - in labs/jbossforums/branches/forums101P24/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:19 EDT 2007


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

Modified:
   labs/jbossforums/branches/forums101P24/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java
   labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml
   labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
   labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml
   labs/jbossforums/branches/forums101P24/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/forums101P24/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java
===================================================================
--- labs/jbossforums/branches/forums101P24/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java	2007-05-20 01:10:04 UTC (rev 11967)
+++ labs/jbossforums/branches/forums101P24/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java	2007-05-20 01:10:19 UTC (rev 11968)
@@ -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)
         {
@@ -619,6 +627,7 @@
         {
             int attachmentIndex = Integer.parseInt(ForumUtil.getParameter(Constants.p_attachment));
             
+            attachmentIndex--;
             ((ArrayList)this.attachments).remove(attachmentIndex);
         }
         catch(Exception e)

Modified: labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	2007-05-20 01:10:04 UTC (rev 11967)
+++ labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	2007-05-20 01:10:19 UTC (rev 11968)
@@ -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>
@@ -733,17 +733,17 @@
             </label>
         </td>
         <td>
-            <h:inputTextarea id="attachment_${idx.index}" value="#{attachRow.comment}" rows="3" cols="35" styleClass="post"/>
+            <h:inputTextarea id="attachment_${idx.index+1}" value="#{attachRow.comment}" rows="3" cols="35" styleClass="post"/>
         </td>
     </tr>
     <tr class="PostViewUnderline">
         <td></td>
         <td>
-            <h:commandButton action="#{editPost.updateAttachment}" value="${resource.Update_comment}"
-                         styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+            <h:commandButton id="UpdateAttachment_${idx.index+1}" action="#{editPost.updateAttachment}" value="${resource.Update_comment}"
+                         styleClass="buttonMed" onclick="selectAttachment('${idx.index+1}');"/>
             &#160;
-            <h:commandButton action="#{editPost.deleteAttachment}" value="${resource.Delete_attachment}"
-                             styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+            <h:commandButton id="DeleteAttachment_${idx.index+1}" action="#{editPost.deleteAttachment}" value="${resource.Delete_attachment}"
+                             styleClass="buttonMed" onclick="selectAttachment('${idx.index+1}');"/>
         </td>
     </tr>
     </c:forEach>

Modified: labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	2007-05-20 01:10:04 UTC (rev 11967)
+++ labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	2007-05-20 01:10:19 UTC (rev 11968)
@@ -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>
@@ -726,17 +726,17 @@
             </label>
         </td>
         <td>
-            <h:inputTextarea id="attachment_${idx.index}" value="#{attachRow.comment}" rows="3" cols="35" styleClass="post"/>
+            <h:inputTextarea id="attachment_${idx.index+1}" value="#{attachRow.comment}" rows="3" cols="35" styleClass="post"/>
         </td>
     </tr>
     <tr class="PostViewUnderline">
         <td></td>
         <td>
-            <h:commandButton action="#{newTopic.updateAttachment}" value="${resource.Update_comment}"
-                         styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+            <h:commandButton id="UpdateAttachment_${idx.index+1}" action="#{newTopic.updateAttachment}" value="${resource.Update_comment}"
+                         styleClass="buttonMed" onclick="selectAttachment('${idx.index+1}');"/>
             &#160;
-            <h:commandButton action="#{newTopic.deleteAttachment}" value="${resource.Delete_attachment}"
-                             styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+            <h:commandButton id="DeleteAttachment_${idx.index+1}" action="#{newTopic.deleteAttachment}" value="${resource.Delete_attachment}"
+                             styleClass="buttonMed" onclick="selectAttachment('${idx.index+1}');"/>
         </td>
     </tr>
     </c:forEach>

Modified: labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml	2007-05-20 01:10:04 UTC (rev 11967)
+++ labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml	2007-05-20 01:10:19 UTC (rev 11968)
@@ -628,17 +628,17 @@
             </label>
         </td>
         <td>
-            <h:inputTextarea id="attachment_${idx.index}" value="#{attachRow.comment}" rows="3" cols="35" styleClass="post"/>
+            <h:inputTextarea id="attachment_${idx.index+1}" value="#{attachRow.comment}" rows="3" cols="35" styleClass="post"/>
         </td>
     </tr>
     <tr class="PostViewUnderline">
         <td></td>
         <td>
-            <h:commandButton action="#{replyTopic.updateAttachment}" value="${resource.Update_comment}"
-                         styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+            <h:commandButton id="UpdateAttachment_${idx.index+1}" action="#{replyTopic.updateAttachment}" value="${resource.Update_comment}"
+                         styleClass="buttonMed" onclick="selectAttachment('${idx.index+1}');"/>
             &#160;
-            <h:commandButton action="#{replyTopic.deleteAttachment}" value="${resource.Delete_attachment}"
-                             styleClass="buttonMed" onclick="selectAttachment('${idx.index}');"/>
+            <h:commandButton id="DeleteAttachment_${idx.index+1}" action="#{replyTopic.deleteAttachment}" value="${resource.Delete_attachment}"
+                             styleClass="buttonMed" onclick="selectAttachment('${idx.index+1}');"/>
         </td>
     </tr>
     </c:forEach>

Modified: labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml	2007-05-20 01:10:04 UTC (rev 11967)
+++ labs/jbossforums/branches/forums101P24/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml	2007-05-20 01:10:19 UTC (rev 11968)
@@ -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