[ http://jira.codehaus.org/browse/DISPL-260?page=all ] fabrizio giustina closed DISPL-260: -----------------------------------
Resolution: Duplicate Fix Version: 1.1 duplicate of DISPL-49 - style of column cannot be dynamically changed > Ability to use java var in columntag attribute > ---------------------------------------------- > > Key: DISPL-260 > URL: http://jira.codehaus.org/browse/DISPL-260 > Project: DisplayTag > Type: Bug > Fix For: 1.1 > > > I try to use a java variable to define column class differently on each row > ------------------------------------------- > JSP code : > ------------------------------------------- > <bean:define id="isNew" name="<%=tableName%>" property="isNEW" > type="Boolean"/> > <% > String classeColonne="truc"; > if (isNew.booleanValue()) { > classeColonne="subscription_unread"; > } > %> > <display:column title=" " > sortable="true" sortProperty="TITLE4TRI" width="29%" align="left" > headerClass="subscription_tab_left" class="<%=classeColonne%>"> > classeColonne=<%=classeColonne%> - > <A href="<bean:write name="<%=tableName%>" > property="URL"/><bean:write name="<%=tableName%>" property="MASTER_FILE"/>"> > <bean:write name="<%=tableName%>" property="TITLE"/></A> > </display:column> > Attribute class="<%=classeColonne%>" is always remplaced by "truc" even in > rows, even if classeColonne has been affected "subscription_unread". > Oddly, my variable is correctly interpreted between <display:column> and > </display:column> > I do not understand why it works outside tag, and not into. > ------------------------------------------- > HTML result : > ------------------------------------------- > <td width="29%" class="truc" align="left"> > classeColonne=subscription_unread > ---------------------------------------------- > Piece of java Code generated by iPlanet 6.0 : > ---------------------------------------------- > // begin > [file="C:\\PCY00\\web\\jsp\\abonnement\\aff_abonnements.jsp";from=(111,7);to=(119,3)] > > String classeColonne="truc"; > if (isNew.booleanValue()) { > classeColonne="subscription_unread"; > } > Log.trace("isNew="+isNew); > Log.trace("classeColonne="+classeColonne); > pageContext.setAttribute("classeDeColonne",classeColonne); > > // end > // HTML // begin > [file="C:\\PCY00\\web\\jsp\\abonnement\\aff_abonnements.jsp";from=(119,5);to=(120,3)] > out.write("\r\n\t "); > // end > // begin > [file="C:\\PCY00\\web\\jsp\\abonnement\\aff_abonnements.jsp";from=(120,3);to=(120,187)] > /* ---- display:column ---- */ > org.displaytag.tags.ColumnTag _jspx_th_display_column_1 = new > org.displaytag.tags.ColumnTag(); > _jspx_th_display_column_1.setPageContext(pageContext); > _jspx_th_display_column_1.setParent(_jspx_th_display_table_0); > _jspx_th_display_column_1.setSortProperty("TITLE4TRI"); > _jspx_th_display_column_1.setTitle(" "); > _jspx_th_display_column_1.setSortable(true); > _jspx_th_display_column_1.setWidth("29%"); > _jspx_th_display_column_1.setClass(classeColonne); > _jspx_th_display_column_1.setHeaderClass("subscription_tab_left"); > _jspx_th_display_column_1.setAlign("left"); > try { > int _jspx_eval_display_column_1 = > _jspx_th_display_column_1.doStartTag(); > if (_jspx_eval_display_column_1 == Tag.EVAL_BODY_INCLUDE) > throw new JspTagException("Since tag handler class > org.displaytag.tags.ColumnTag implements BodyTag, it can't return > Tag.EVAL_BODY_INCLUDE"); > if (_jspx_eval_display_column_1 != Tag.SKIP_BODY) { > try { > if (_jspx_eval_display_column_1 != Tag.EVAL_BODY_INCLUDE) { > out = pageContext.pushBody(); > _jspx_th_display_column_1.setBodyContent((BodyContent) > out); > } > _jspx_th_display_column_1.doInitBody(); > do { > // end > // HTML // begin > [file="C:\\PCY00\\web\\jsp\\abonnement\\aff_abonnements.jsp";from=(120,187);to=(121,16)] > out.write("\r\n\t\tclasseColonne="); > // end > // begin > [file="C:\\PCY00\\web\\jsp\\abonnement\\aff_abonnements.jsp";from=(121,19);to=(121,32)] > out.print(classeColonne); > // end > // HTML // begin > [file="C:\\PCY00\\web\\jsp\\abonnement\\aff_abonnements.jsp";from=(121,34);to=(122,2)] > out.write("\r\n\t\t"); > taglib version (found in displaytag1.2.tld) > <tlib-version>1.0</tlib-version> > <jsp-version>1.2</jsp-version> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ displaytag-devel mailing list displaytag-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/displaytag-devel