Now I'm wondering if this is a bug somewhere in the pageinit javascript? Every time the Alerts component renders an individual alert, tapestry uses the javascript alert function (in alert.js) like so...
1) (from Alerts.java) javaScriptSupport.require("t5/core/alert").with(alert.toJSON()); I don't see anything wrong in alert.js, it's working like you'd expect. The problem is this javascript alert function is being invoked TWICE for each and every "require/with" thing from Alerts.java like I've shown in my 1) above. As I've stated, there seems to be no problem in alert.js >From what I can gather from the javascript call stack, it might have something to do with double calls from pageinit.js I am operating under the assumption that 1) alert.js is not broken 2) require.js is not broken 3) jquery is not broken the weird thing is that the alerts are being displayed the 2nd time in REVERSE ORDER?? Anyhow, all I really want to know is, is anyone else testing the beta3 seeing this same problem? Presently it's a bit of a show stopper for me. I was hoping to get this simple project done today and it's all done but the Alerts issue. Is this a bug? Surely someone has either 1) seen it or 2) sees an error in what i wrote, and can shout me down as a dunce. Also, did my image attachment make it to the list last time? I can see why people might be ignoring me as being to vague w/o seeing the image. Please and thank you for any forthcoming illuminations. On Fri, Apr 11, 2014 at 6:39 AM, Jon Williams <williams.jonat...@gmail.com>wrote: > hi, > > Why is my alerts component rendering all alerts twice, first in order then > once again in reversed order? > > w/ tap 5.4 beta 3, my tapestry alerts component is rendering all the > org.apache.tapestry5.alerts.Alert objects twice. 1st in the correct order, > and then once again in the reverse order. So if I register 3 alert objects, > as in my page class example below, i end up with twice as many alerts in my > UI than I need/want (see attached screenshot for clarity) > > anyone notice anything obvious that I might have done wrong? > thanks > > Template > ------------- > <t:zone t:id="formZone"> > <form t:type="form" t:id="registerForm" > class="form-horizontal text-left" zone="^"> > <t:alerts /> > <fieldset> > <div class="form-group"> > <t:label for="emailAddress" > class="col-lg-4 control-label">enter your email address</t:label> > <div class="col-lg-8"> > <input t:type="textfield" > t:id="emailAddress" value="emailAddress" placeholder="Type your email > address here"/> > </div> > </div> > <button t:type="submit" t:id="register" > class="btn btn-default btn-lg" value="Register for Download"/> > </fieldset> > </form> > </t:zone> > > Page Class > ---------------- > ... private Object onSelectedFromRegister() { > if (registerForm.getHasErrors()) { > return this; > } > > alertManager.alert(Duration.SINGLE, Severity.SUCCESS, > messages.format("success", emailAddress)); > alertManager.alert(Duration.SINGLE, Severity.INFO, > messages.format("success", emailAddress)); > alertManager.alert(Duration.SINGLE, Severity.ERROR, > messages.format("success", emailAddress)); > > emailAddress = null; > return formZone; > } > } > >