AjaxRequestTarget.addComponent does not work after RequestCycle.setResponsePage was called

2010-08-25 Thread Vladimir Kovalyuk
Once setResponsePage is called the AjaxRequestTarget is pushed down in the list of request targets and AjaxRequestTarget won't be called anymore because AbstractRequestCycleProcessor.respond invokes the current request target only. My page has some ajax links that delegates handling to different

Re: Best practice for component interaction

2010-08-25 Thread Patrick Petermair
Igor Vaynberg schrieb: onclick(final AjaxRequestTarget target) { getPage().visitChildren(CaresAboutMyAjaxEvent.class, new IVisitorCaresAboutMyAjaxEvent () { Object visit(CaresAboutMyAjaxEent object) { object.onMyAjaxEvent(target); }}} Interesting. A colleague

Re: Best practice for component interaction

2010-08-25 Thread vladimir.kovalyuk
I don't like subscriptions implementation. Somewhen it becomes difficult to realize when to add/remove observers. It depends on the order of instantiations. Visitor pattern seems to be much more reliable. -- View this message in context:

Re: Best practice for component interaction

2010-08-25 Thread James Carman
What about if we modify this idea a bit? What if we use dynamic proxies to make it more generic? So, your onclick method would look like: public void onClick(AjaxRequestTarget target) { fire(MyCustomEventListener.class).someAjaxEvent(target); } Then, the fire() method would return an object

Re: Best practice for component interaction

2010-08-25 Thread Bilgin Ibryam
Not sure about the best practice, but instead of passing a reference I use getParent or getPage methods, then find the target component by its id. Bilgin On Tue, Aug 24, 2010 at 4:37 PM, Patrick Petermair patrick.peterm...@openforce.com wrote: Hi! Let's say I have a page with 2 panels.

Re: Cache key collisions (IMarkupCacheKeyProvider)

2010-08-25 Thread Martin Dietze
On Tue, August 24, 2010, Igor Vaynberg wrote: IMarkupCacheKeyProvider is for advanced users. you have to know what you are doing when you implement the interface. OK, that's fine with me. Why not add a comment to the interface stating just this plus a hint that in general adding the fully

Re: Best practice for component interaction

2010-08-25 Thread jcgarciam
Hi James, I like the idea of having a way of automatically includes components in the AjaxRequestTarget without the need to do it explicitly (target.add(..)), by using a Marking Interface and the Visitor, it really would make things easier when you want to add a new component to the current Ajax

Re: Best practice for component interaction

2010-08-25 Thread James Carman
Do you want an example of how it would work or are you confident in how to implement it yourself? On Wed, Aug 25, 2010 at 9:05 AM, jcgarciam jcgarc...@gmail.com wrote: Hi James, I like the idea of having a way of automatically includes components in the AjaxRequestTarget without the need to do

Re: Best practice for component interaction

2010-08-25 Thread MattyDE
Share your genius with us ;) For serious: I'am really looking forward to see and example implementation! :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Best-practice-for-component-interaction-tp2336888p2338213.html Sent from the Wicket - User mailing list

Re: Best practice for component interaction

2010-08-25 Thread jcgarciam
Thanks for expressing your help on this, im already working on it :-), since is not that hard to implement, but i would like to see this kind of functionality in the core . :) On Wed, Aug 25, 2010 at 10:09 AM, James Carman [via Apache Wicket]

Re: Best practice for component interaction

2010-08-25 Thread James Carman
So, submit a JIRA with a patch once you get it working. It would be good to have this on the Page class so that it's portable (no casting). On Wed, Aug 25, 2010 at 9:12 AM, jcgarciam jcgarc...@gmail.com wrote: Thanks for expressing your help on this, im already working on it :-), since is not

Re: Best practice for component interaction

2010-08-25 Thread James Carman
There's an issue in trunk where they nail down the type parameter to extend Component on the visitChildren() method. If you're looking for a listener interface, that's not possible, because Component is a class and your listener interface can't extend that. Why the restriction? On Wed, Aug 25,

Re: Best practice for component interaction

2010-08-25 Thread Igor Vaynberg
already done https://issues.apache.org/jira/browse/WICKET-1312 -igor On Wed, Aug 25, 2010 at 6:12 AM, jcgarciam jcgarc...@gmail.com wrote: Thanks for expressing your help on this, im already working on it :-), since is not that hard to implement, but i would like to see this kind of

Re: Best practice for component interaction

2010-08-25 Thread jcgarciam
James, taking Igor example why not providing simple marking interfaces in the Core and then something like this in the Page implementation, (i was thinking of the Dynamic Proxy approach you mention, but i'm not seeing why it would be needed here since all you want is to propagate the Component

Re: Best practice for component interaction

2010-08-25 Thread jcgarciam
Thanks Igor, i will review that Item. On Wed, Aug 25, 2010 at 11:46 AM, Igor Vaynberg-2 [via Apache Wicket] ml-node+2338351-880928828-65...@n4.nabble.comml-node%2b2338351-880928828-65...@n4.nabble.com wrote: already done https://issues.apache.org/jira/browse/WICKET-1312 -igor On Wed,

Re: Best practice for component interaction

2010-08-25 Thread James Carman
What if you have different event types that happen on a page? On Wed, Aug 25, 2010 at 10:47 AM, jcgarciam jcgarc...@gmail.com wrote: James, taking Igor example why not providing simple marking interfaces in the Core and then something like this in the Page implementation, (i was thinking of

Re: Best practice for component interaction

2010-08-25 Thread jcgarciam
Let see if this answer your question, in my example i have this Interface: [AjaxEventResponseListener] as root Event interface Then i have 2 more specifics interfaces named: [MyHomePageEvent1] and [MyHomePageEvent2] Now i have 2 panels component: 1-CounterPanel extends Panel implements

Re: Best practice for component interaction

2010-08-25 Thread James Carman
Not exactly. Here's how I would implement your example 1. You'd have three interfaces AjaxEventListener, MyHomePageListener1, MyHomePageListener2. 2. Then you'd have the panels that implement the interfaces. 3. Then, in your home page, you'd do: add(new AjaxLinkInteger(counterInc1) {

Re: Best practice for component interaction

2010-08-25 Thread jcgarciam
I guess we are targeting different things here, a) You want to control on each Interfaces implementation what component should be added by passing the [target] around b) I want to just add the component automatically to the ajax response if it just implement the Event Interface, imagine a Very

Re: Downloading generated PDF behavior different with apache in front of appserver

2010-08-25 Thread TahitianGabriel
Are you using IE? There are many troubles generating PDF over SSL. See for an example : http://eirikhoem.wordpress.com/2007/06/15/generated-pdfs-over-https-with-internet-explorer/ http://eirikhoem.wordpress.com/2007/06/15/generated-pdfs-over-https-with-internet-explorer/ If you google IE

Re: How to show any type of exception in feedbackpanel or in popup window

2010-08-25 Thread nino martinez wael
you could catch them in the request cycle? 2010/8/25 arunarapole arunakumm...@gmail.com Hi I have a Exception called Violation of UNIQUE KEY constraint 'UQ__usr__FE76F85348BAC3E5'. Cannot insert duplicate key in object abc table above Exception i have to display in same page

Re: How to show any type of exception in feedbackpanel or in popup window

2010-08-25 Thread Peter Ertl
put that around the code in your page that causes the exception: try { databaseMethodThatThrows(); } catch(DatabaseException x) { error(e.getMessage); } Am 25.08.2010 um 22:46 schrieb nino martinez wael: you could catch them in the request cycle? 2010/8/25 arunarapole