Re: Possible BUG - discrepancy in component.onBeforeRender and IBehavior.beforeRender.
and what is a good name? :) On Fri, May 23, 2008 at 4:03 PM, Matej Knopp <[EMAIL PROTECTED]> wrote: > Hi, > > beforeRender on behavior has different semantics than onBeforeRender > on component. I agree that this is confusing and it i think it should > be improved in 1.4. > > beforeRender and afterRender can be used to render markup before > component and after component output. Currently there is no method in > IBehavior that is invoked when component's onBeforeRender is called. > > -Matej > > On Thu, May 22, 2008 at 5:43 PM, gumnaam23 <[EMAIL PROTECTED]> wrote: > > > > The following statement > > > > if (!component.isAuto() && getFlag(FLAG_RENDERING)) > > > > in Component-> checkHierarchyChange() > > > > returns false when a Behavior is added to the Component.onBeforeRender() > > phase, but returns true if > > a Behavior is added by another Behavior as part of it's beforeRender() > > phase. > > > > So > > new Component () { > > onBeforeRender() { > >add(some behavior); > > } > > > > Works. > > > > but > > new Component().add(new AbstractBehavior() { > > > > beforeRender(Component c) { > > c.addBehavior(some behavior); > > } > > > > } > > > > doesn't work, as the getFlag(FLAG_RENDERING) returns false in the first > case > > and true in the next case. > > So in the second case, I get an Exception. > > > > Is this an expected behavior or a possible bug ? > > > > > > > > > > -- > > View this message in context: > http://www.nabble.com/Possible-BUG---discrepancy-in-component.onBeforeRender-and-IBehavior.beforeRender.-tp17407123p17407123.html > > Sent from the Wicket - User mailing list archive at Nabble.com. > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: Possible BUG - discrepancy in component.onBeforeRender and IBehavior.beforeRender.
Hi, beforeRender on behavior has different semantics than onBeforeRender on component. I agree that this is confusing and it i think it should be improved in 1.4. beforeRender and afterRender can be used to render markup before component and after component output. Currently there is no method in IBehavior that is invoked when component's onBeforeRender is called. -Matej On Thu, May 22, 2008 at 5:43 PM, gumnaam23 <[EMAIL PROTECTED]> wrote: > > The following statement > > if (!component.isAuto() && getFlag(FLAG_RENDERING)) > > in Component-> checkHierarchyChange() > > returns false when a Behavior is added to the Component.onBeforeRender() > phase, but returns true if > a Behavior is added by another Behavior as part of it's beforeRender() > phase. > > So > new Component () { > onBeforeRender() { >add(some behavior); > } > > Works. > > but > new Component().add(new AbstractBehavior() { > > beforeRender(Component c) { > c.addBehavior(some behavior); > } > > } > > doesn't work, as the getFlag(FLAG_RENDERING) returns false in the first case > and true in the next case. > So in the second case, I get an Exception. > > Is this an expected behavior or a possible bug ? > > > > > -- > View this message in context: > http://www.nabble.com/Possible-BUG---discrepancy-in-component.onBeforeRender-and-IBehavior.beforeRender.-tp17407123p17407123.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Possible BUG - discrepancy in component.onBeforeRender and IBehavior.beforeRender.
The following statement if (!component.isAuto() && getFlag(FLAG_RENDERING)) in Component-> checkHierarchyChange() returns false when a Behavior is added to the Component.onBeforeRender() phase, but returns true if a Behavior is added by another Behavior as part of it's beforeRender() phase. So new Component () { onBeforeRender() { add(some behavior); } Works. but new Component().add(new AbstractBehavior() { beforeRender(Component c) { c.addBehavior(some behavior); } } doesn't work, as the getFlag(FLAG_RENDERING) returns false in the first case and true in the next case. So in the second case, I get an Exception. Is this an expected behavior or a possible bug ? -- View this message in context: http://www.nabble.com/Possible-BUG---discrepancy-in-component.onBeforeRender-and-IBehavior.beforeRender.-tp17407123p17407123.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]