> -----Original Message----- > From: Jason Pyeron [mailto:jpye...@pdinc.us] > Sent: Tuesday, May 10, 2011 21:42 > To: 'Struts Developers List' > Subject: I am taking a sledgehammer to > http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/ > main/resources/template/simple/fielderror.ftl > > Does anyone have input on this? > <snip/> > > The only question I have so far is about the id generation. > What is it? Why is > it? Compare it to the textfield id generation. Every invocation of the > fielderror tag produces a ul with the same id value, which is bad. > > Changes to the id logic, could / would break existing DOM reliance. >
Setting id as follows <!-- A --><s:fielderror id=""/><!-- Z --> results in: <!-- A --><ul class="errorMessage"><li><span>foo is required</span></li><li><span>err</span></li><li><span>err</span></li><li><span> err</span></li><li><span>err</span></li></ul><!-- Z --> Or assigning a value ot id as in <s:form action="ledger" theme="simple" validate="true"><!-- A --><s:fielderror id="xyzzy" /><!-- Z --> results in: <form id="ledger" name="ledger" action="/multirowform/ledger.action" method="post"><!-- A --><ul id="xyzzy" class="errorMessage"><li><span>foo is required</span></li><li><span>err</span></li><li><span>err</span></li><li><span> err</span></li><li><span>err</span></li></ul><!-- Z --> But, leaving off the id attribute assigns a weird value, which seems to be the action followed by an underscore as is show next: Leaving id blank as follows <s:form action="ledger" theme="simple" validate="true"><!-- S --><s:fielderror><s:param>ledger.foo</s:param></s:fielderror><!-- E --> results in <form id="ledger" name="ledger" action="/multirowform/ledger.action" method="post"><!-- S --><ul id="ledger_" class="errorMessage"><li><span>foo is required</span></li></ul><!-- E --> -Jason > -Jason > > -- > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > - - > - Jason Pyeron PD Inc. http://www.pdinc.us - > - Principal Consultant 10 West 24th Street #100 - > - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 - > - - > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > This message is copyright PD Inc, subject to license 20080407P00. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org > For additional commands, e-mail: dev-h...@struts.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org For additional commands, e-mail: dev-h...@struts.apache.org