> -----Original Message----- > From: Jason Pyeron [mailto:jpye...@pdinc.us] > Sent: Tuesday, May 10, 2011 23:47 > To: 'Struts Developers List' > Subject: RE: I am taking a sledgehammer to > http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/ > main/resources/template/simple/fielderror.ftl > > > > > -----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. > > <snip/> > > 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 -->
Looking at line 973 in http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apac he/struts2/components/UIBean.java [protected void populateComponentHtmlId(Form form)] it seems that if the tag does not have a name attribute populated, but it is in a form, then it gets the form id + an _. It should check for the presence of name before calculating an id. > > -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 > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org For additional commands, e-mail: dev-h...@struts.apache.org