Re: ListenerInvocationNotAllowedException question / help

2015-11-17 Thread Wayne W
Hi Sven, yes it was something else in the hierarchy - many thanks for the help. On Mon, Nov 16, 2015 at 8:52 PM, Martin Grigorov wrote: > OK, I see. > You are right! > > > On Mon, Nov 16, 2015 at 9:48 PM, Sven Meier wrote: > > > Hi Martin, > > > > to my

ListenerInvocationNotAllowedException question / help

2015-11-16 Thread Wayne W
Hi, I have a org.apache.wicket.markup.html.link.Link within a page this is visible only if a certain criteria is met. If user A visits this page the changes the criteria the link is visible. The user can then click on the link for some other functionality. However I'm finding is User B (in a

Re: ListenerInvocationNotAllowedException question / help

2015-11-16 Thread Sven Meier
Hi, >Would it be because wicket is checking boolean isVisible() when >making this decision? (as we override the links isVisible() indeed. You should override #onConfigure() and call #setVisible() instead of overriding #isVisible(). Regards Sven On 16.11.2015 16:59, Wayne W wrote: Hi, I

Re: ListenerInvocationNotAllowedException question / help

2015-11-16 Thread Wayne W
Hi Sven, I tried overriding : @Override protected void onConfigure() { setVisible(documentModel.getObject().isLocked()); super.onConfigure(); } and removing the isVisible() override but I still get the same exception.

Re: ListenerInvocationNotAllowedException question / help

2015-11-16 Thread Sven Meier
Hi, this should work. Do you have #isVisible() or #isEnabled() overridden in one of the component's parents? Have fun Sven On 16.11.2015 18:08, Wayne W wrote: Hi Sven, I tried overriding : @Override protected void onConfigure() { setVisible(documentModel.getObject().isLocked());

Re: ListenerInvocationNotAllowedException question / help

2015-11-16 Thread Martin Grigorov
Hi, Actually org.apache.wicket.Component#canCallListenerInterface() is responsible for the ACTION phase. #onConfigure() is called in the RENDER phase, i.e. after onClick(). Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Nov 16, 2015 at 7:27 PM, Sven Meier

Re: ListenerInvocationNotAllowedException question / help

2015-11-16 Thread Sven Meier
Hi Martin, I didn't understand your comment. Do you think Wayne might have overriden #canCallListenerInterface()? Regards Sven On 16.11.2015 19:32, Martin Grigorov wrote: Hi, Actually org.apache.wicket.Component#canCallListenerInterface() is responsible for the ACTION phase. #onConfigure()

Re: ListenerInvocationNotAllowedException question / help

2015-11-16 Thread Sven Meier
Hi Martin, to my knowledge the usual pattern is to override #onConfigure() and set up the visibility and enabling of the component for the next rendering *and* the following 'ACTION phase': http://wicketinaction.com/2011/11/implement-wicket-component-visibility-changes-properly/ Usually I

Re: ListenerInvocationNotAllowedException question / help

2015-11-16 Thread Martin Grigorov
Hi Sven, What I'm saying is that Wicket uses Component#canCallListenerInterface() to decide whether the listener interface method could be executed or not. See https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/RequestListenerInterface.java#L207 So

Re: ListenerInvocationNotAllowedException question / help

2015-11-16 Thread Martin Grigorov
OK, I see. You are right! On Mon, Nov 16, 2015 at 9:48 PM, Sven Meier wrote: > Hi Martin, > > to my knowledge the usual pattern is to override #onConfigure() and set up > the visibility and enabling of the component for the next rendering *and* > the following 'ACTION phase':