[jboss-svn-commits] JBL Code SVN: r11969 - in labs/jbossforums/branches/forums101P22/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:11:01 EDT 2007


Author: unibrew
Date: 2007-05-19 21:11:00 -0400 (Sat, 19 May 2007)
New Revision: 11969

Modified:
   labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java
   labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml
   labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
   labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.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/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java	2007-05-20 01:10:19 UTC (rev 11968)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/action/PostAction.java	2007-05-20 01:11:00 UTC (rev 11969)
@@ -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/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	2007-05-20 01:10:19 UTC (rev 11968)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	2007-05-20 01:11:00 UTC (rev 11969)
@@ -616,13 +616,13 @@
             </label>
         </td>
         <td>
-            <input type="text" id="option_${idx.index+1}" name="option_${idx.index+1}"
+            <input type="text" id="option_${idx.index}" name="option_${idx.index}"
                    value="${optionRow}" style="width: 450px;" maxlength="255"/>
             &#160;
-            <h:commandButton action="#{editPost.updateOption}" value="${resource.Update}"
-                             styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
-            <h:commandButton action="#{editPost.deleteOption}" value="${resource.Delete}"
-                             styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
+            <h:commandButton id="UpdateOption_${idx.index}" action="#{editPost.updateOption}" value="${resource.Update}"
+                             styleClass="buttonMed" onclick="selectOption(${idx.index});"/>
+            <h:commandButton id="DeleteOption_${idx.index}" action="#{editPost.deleteOption}" value="${resource.Delete}"
+                             styleClass="buttonMed" onclick="selectOption(${idx.index});"/>
         </td>
     </tr>
     </c:forEach>
@@ -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/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	2007-05-20 01:10:19 UTC (rev 11968)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	2007-05-20 01:11:00 UTC (rev 11969)
@@ -611,13 +611,13 @@
             </label>
         </td>
         <td>
-            <input type="text" id="option_${idx.index+1}" name="option_${idx.index+1}"
+            <input type="text" id="option_${idx.index}" name="option_${idx.index}"
                    value="${optionRow}" style="width: 450px;" maxlength="255"/>
             &#160;
-            <h:commandButton action="#{newTopic.updateOption}" value="${resource.Update}"
-                             styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
-            <h:commandButton action="#{newTopic.deleteOption}" value="${resource.Delete}"
-                             styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>
+            <h:commandButton id="UpdateOption_${idx.index}" action="#{newTopic.updateOption}" value="${resource.Update}"
+                             styleClass="buttonMed" onclick="selectOption(${idx.index});"/>
+            <h:commandButton id="DeleteOption_${idx.index}" action="#{newTopic.deleteOption}" value="${resource.Delete}"
+                             styleClass="buttonMed" onclick="selectOption(${idx.index});"/>
         </td>
     </tr>
     </c:forEach>
@@ -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/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml	2007-05-20 01:10:19 UTC (rev 11968)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml	2007-05-20 01:11:00 UTC (rev 11969)
@@ -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>




More information about the jboss-svn-commits mailing list