[jboss-svn-commits] JBL Code SVN: r11964 - in labs/jbossforums/branches/forums26/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:08:51 EDT 2007


Author: unibrew
Date: 2007-05-19 21:08:51 -0400 (Sat, 19 May 2007)
New Revision: 11964

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

Modified: labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	2007-05-20 01:04:39 UTC (rev 11963)
+++ labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	2007-05-20 01:08:51 UTC (rev 11964)
@@ -501,12 +501,12 @@
 		      <td class="row1"><span class="gen"><b>${resource.Poll_option}</b></span></td>
 		      <td class="row2">
 		      		<span class="genmed">
-			            <input type="text" id="option_${idx.index}" name="option_${idx.index}" value="${optionRow}" size="50" class="post" maxlength="255"/>
+			            <input type="text" id="option_${idx.index+1}" name="option_${idx.index+1}" value="${optionRow}" size="50" class="post" maxlength="255"/>
 		            </span>&#160;            
-		            <h:commandButton action="#{editPost.updateOption}" value="${resource.Update}" styleClass="liteoption"
-                            onclick="selectOption(${idx.index});"/>
-		            <h:commandButton action="#{editPost.deleteOption}" value="${resource.Delete}" styleClass="liteoption"
-		            onclick="selectOption(${idx.index});"/>            
+		            <h:commandButton id="UpdateOption_${idx.index+1}" action="#{editPost.updateOption}" value="${resource.Update}" styleClass="liteoption"
+                            onclick="selectOption(${idx.index+1});"/>
+		            <h:commandButton id="DeleteOption_${idx.index+1}" action="#{editPost.deleteOption}" value="${resource.Delete}" styleClass="liteoption"
+		            onclick="selectOption(${idx.index+1});"/>            
 		      </td>
 		   </tr>
 		</c:forEach>
@@ -609,9 +609,9 @@
 			      <td class="row1"><span class="gen"><b>${resource.Options}</b></span></td>
 			      <td class="row2"><span class="genmed">			 	   	
 						&#160; 			
-						<h:commandButton action="#{editPost.updateAttachment}" value="${resource.Update_comment}" styleClass="liteoption"	
+						<h:commandButton id="UpdateAttachment_${idx.index}" action="#{editPost.updateAttachment}" value="${resource.Update_comment}" styleClass="liteoption"	
 						onclick="selectAttachment('${idx.index}');"/> &#160; 			
-						<h:commandButton action="#{editPost.deleteAttachment}" value="${resource.Delete_attachment}" styleClass="liteoption" 
+						<h:commandButton id="DeleteAttachment_${idx.index}" action="#{editPost.deleteAttachment}" value="${resource.Delete_attachment}" styleClass="liteoption" 
 						onclick="selectAttachment('${idx.index}');"/>            		
 			       </span>
 			      </td>

Modified: labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	2007-05-20 01:04:39 UTC (rev 11963)
+++ labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	2007-05-20 01:08:51 UTC (rev 11964)
@@ -504,12 +504,12 @@
 		      <td class="row1"><span class="gen"><b>${resource.Poll_option}</b></span></td>
 		      <td class="row2">
 		      		<span class="genmed">
-			            <input type="text" id="option_${idx.index}" name="option_${idx.index}" value="${optionRow}" size="50" class="post" maxlength="255"/>
+			            <input type="text" id="option_${idx.index+1}" name="option_${idx.index+1}" value="${optionRow}" size="50" class="post" maxlength="255"/>
 		            </span>&#160;            
-		            <h:commandButton action="#{newTopic.updateOption}" value="${resource.Update}" styleClass="liteoption"
-                            onclick="selectOption(${idx.index});"/>
-		            <h:commandButton action="#{newTopic.deleteOption}" value="${resource.Delete}" styleClass="liteoption"
-		            onclick="selectOption(${idx.index});"/>            
+		            <h:commandButton id="UpdateOption_${idx.index+1}" action="#{newTopic.updateOption}" value="${resource.Update}" styleClass="liteoption"
+                            onclick="selectOption(${idx.index+1});"/>
+		            <h:commandButton id="DeleteOption_${idx.index+1}" action="#{newTopic.deleteOption}" value="${resource.Delete}" styleClass="liteoption"
+		            onclick="selectOption(${idx.index+1});"/>            
 		      </td>
 		   </tr>
 		</c:forEach>
@@ -606,10 +606,10 @@
 		      <td class="row1"><span class="gen"><b>${resource.Options}</b></span></td>
 		      <td class="row2"><span class="genmed">			 	   	
 					&#160; 			
-					<h:commandButton action="#{newTopic.updateAttachment}" value="${resource.Update_comment}" styleClass="liteoption"
+					<h:commandButton id="UpdateAttachment_${idx.index}" action="#{newTopic.updateAttachment}" value="${resource.Update_comment}" styleClass="liteoption"
                                         onclick="selectAttachment('${idx.index}');"/>	
 					&#160; 			
-					<h:commandButton action="#{newTopic.deleteAttachment}" value="${resource.Delete_attachment}" styleClass="liteoption" 
+					<h:commandButton id="DeleteAttachment_${idx.index}" action="#{newTopic.deleteAttachment}" value="${resource.Delete_attachment}" styleClass="liteoption" 
 					onclick="selectAttachment('${idx.index}');"/>            		
 		       </span>
 		      </td>

Modified: labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml
===================================================================
--- labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml	2007-05-20 01:04:39 UTC (rev 11963)
+++ labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml	2007-05-20 01:08:51 UTC (rev 11964)
@@ -515,10 +515,10 @@
 		      <td class="row1"><span class="gen"><b>${resource.Options}</b></span></td>
 		      <td class="row2"><span class="genmed">			 	   	
 					&#160; 			
-					<h:commandButton action="#{replyTopic.updateAttachment}" value="${resource.Update_comment}" styleClass="liteoption"
+					<h:commandButton id="UpdateAttachment_${idx.index}" action="#{replyTopic.updateAttachment}" value="${resource.Update_comment}" styleClass="liteoption"
 					onclick="selectAttachment('${idx.index}');"/>	
 					&#160; 			
-					<h:commandButton action="#{replyTopic.deleteAttachment}" value="${resource.Delete_attachment}" styleClass="liteoption" 
+					<h:commandButton id="DeleteAttachment_${idx.index}" action="#{replyTopic.deleteAttachment}" value="${resource.Delete_attachment}" styleClass="liteoption" 
 					onclick="selectAttachment('${idx.index}');"/>            		
 		       </span>
 		      </td>

Modified: labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml
===================================================================
--- labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml	2007-05-20 01:04:39 UTC (rev 11963)
+++ labs/jbossforums/branches/forums26/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_ballot.xhtml	2007-05-20 01:08:51 UTC (rev 11964)
@@ -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