Bug #922

Problem with Swap Tag when specifying a "height" in Collection Tag [Abdelati]

Added by Old User about 14 years ago. Updated 22 days ago.

Status:Nouveau Start date:
Priority:Major Due date:
Assignee:Old User % Done:


Target version:-


The test has been done with the DemoServeurDeNews.war.
I just add the the height="100" in the template/discover.jsp file :

<% taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
taglib uri="/WEB-INF/struts-layout.tld" prefix="layout" >
@ page import="fr.improve.struts.taglib.layout.util.LayoutUtils" %>

<layout:form action="/discover" styleClass="FORM" reqCode="send">

&lt;layout:message key="discover.step.1" styleClass="LABELLEFT"/&gt;
&lt;layout:swap property="id,id" formProperty="ids1,ids2" selectedStyleClass="FORMSWAP"&gt;
&lt;layout:collection name="list1" styleClass="FORM" height="100"&gt;
&lt;layout:collectionItem title="news.title" property="title"/&gt;
&lt;layout:collectionItem title="news.subject" property="subject.name"/&gt;
&lt;layout:collection name="list2" styleClass="FORM" height="100"&gt;
&lt;layout:collectionItem title="news.title" property="title"/&gt;
&lt;layout:collectionItem title="news.subject" property="subject.name"/&gt;
&lt;layout:message key="discover.step.2" styleClass="LABELLEFT"/&gt;
&lt;layout:text key="discover.email" property="email" styleClass="LABEL"/&gt;
&lt;layout:message key="discover.step.3" styleClass="LABELLEFT"/&gt;
&lt;layout:submit&gt;&lt;bean:message key="discover.action"/&gt;&lt;/layout:submit&gt;


The problem is : the two list are misaligned


Updated by Old User almost 14 years ago

The problem is due to the internal invisible combo (hiddenSelect) and the 'div'.
It can be solved putting the internal combo inside the div, just after the </table> tag and before the </div> tag.

Updated by Old User almost 14 years ago

Can't believe it!!!
More simple than this: between </table> and </div> put some tag.. for example  .
This can be done in method doEndPanel of BasicCollection...just put:

buffer.append(" </div>");

instead of


Updated by Old User over 13 years ago

[Unknown user]
about bug id 0000067 -> I solved this modifying the BasicCollectionTag.java.
In fact, when you specify the "height" attribute in the CollectionTag, a <div> tag was created before the definition of two tables even if the scrollable one is the second table, containing the collectionItems. When the 'swap' javascript function is executed, on the "insertBefore" instruction the two tables become misaligned.
SOLUTION: The solution was to post-pone the div tag before the second table. Note that this must be done in both doStartPanel and doEndPanel. If you want the code write to me at

Updated by Perry Peyton about 1 month ago

There is a huge complication on the site of redmine and the code is 922. It is named the problem with swap tag. It is one of the issues that people often face and are unable to solve it. This also becomes the reasons when people are unable to complete their tasks on time. I also want to know about rushessay review and i think this site is good for those who want to learn coding.

Updated by Tripp Lennon 26 days ago

Really good write-up, Appreciate it intended for giving That expertise. Excellently published document, but only if many blog writers made available identical higher level of information since you, the online world is a significantly better area. You need to thanks!
Crawley Accountants

Updated by Pierce Warren 22 days ago

Excellent publish, Thanks with regard to discussing This particular understanding. Wonderfully created post, if perhaps just about all writers provided exactly the same degree of content material while you, the web will be a far better location. Make sure you continue the good work!
Tax Accountants

Also available in: Atom PDF