HowTo inject FeedbackPanel

2010-07-20 Thread Martin Makundi
Hi! I don't like passing feedbackpanel to subpanels and I don't like the idea using visitors/component-search for looking it up in page hierarchy because of its potential volatility... Has some of you pals come up with a nice way of injecting feedbackpanel references to children or something? Or

Re: HowTo inject FeedbackPanel

2010-07-20 Thread James Carman
I've struggled with this myself in the context of AJAX events that are handled completely by subpanels. I want only one feedback panel on the page, but the subpanels need to be able to add them to their AjaxRequestTarget. Perhaps you could override the default ajax request cycle handling in some

Re: HowTo inject FeedbackPanel

2010-07-20 Thread Martin Makundi
Hey, sounds nice! Maybe Martin will commit it soon to wicket core ;) 2010/7/20 James Carman ja...@carmanconsulting.com: I've struggled with this myself in the context of AJAX events that are handled completely by subpanels.  I want only one feedback panel on the page, but the subpanels need to

Re: HowTo inject FeedbackPanel

2010-07-20 Thread Igor Vaynberg
there is already IFeedback interface that tags all components like feedbackpanel. -igor On Tue, Jul 20, 2010 at 5:52 AM, James Carman ja...@carmanconsulting.com wrote: I've struggled with this myself in the context of AJAX events that are handled completely by subpanels.  I want only one

Re: HowTo inject FeedbackPanel

2010-07-20 Thread Igor Vaynberg
On Tue, Jul 20, 2010 at 5:44 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: and I don't like the idea using visitors/component-search for looking it up in page hierarchy because of its potential volatility... how so? -igor Has some of you pals come up with a nice way of

Re: HowTo inject FeedbackPanel

2010-07-20 Thread James Carman
Perhaps we could just register a AjaxRequestTarget.IListener and implement the onBeforeRespond() method? You would check to see if there are any messages to be shown (still looking for how to ask that question in the API). If there are, you'd make sure the requested page's

Re: HowTo inject FeedbackPanel

2010-07-20 Thread Igor Vaynberg
yes, you are on the right track. i just described this to someone in irc not a few days ago... override application.newajaxrequesttarget register your listener in listener onbeforerespond check if there are any messages - getsession().getfeedbackmessages().size()0 visit all components in the page

Re: HowTo inject FeedbackPanel

2010-07-20 Thread Martin Grigorov
What about org.apache.wicket.ajax.AjaxRequestTarget.addChildren(MarkupContainer, Class?) I.e.: target.addChildren(getPage(), IFeedback.class) ? 2010/7/20 Igor Vaynberg igor.vaynb...@gmail.com yes, you are on the right track. i just described this to someone in irc not a few days ago...

Re: HowTo inject FeedbackPanel

2010-07-20 Thread James Carman
On Tue, Jul 20, 2010 at 11:47 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: yes, you are on the right track. i just described this to someone in irc not a few days ago... override application.newajaxrequesttarget register your listener in listener onbeforerespond check if there are any

Re: HowTo inject FeedbackPanel

2010-07-20 Thread James Carman
On Tue, Jul 20, 2010 at 11:57 AM, Martin Grigorov mgrigo...@apache.org wrote: What about org.apache.wicket.ajax.AjaxRequestTarget.addChildren(MarkupContainer, Class?) I.e.: target.addChildren(getPage(), IFeedback.class) ? Even cooler!

Re: HowTo inject FeedbackPanel

2010-07-20 Thread Fernando Wermus
Martin, I would like to learn a little. Which is the use case? Why do you need to inject feedback panels? I don't get a case for this situation. thanks in advance. On Tue, Jul 20, 2010 at 9:44 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Hi! I don't like passing

Re: HowTo inject FeedbackPanel

2010-07-20 Thread jcgarciam
Wermus. www.linkedin.com/in/fernandowermus -- View message @ http://apache-wicket.1842946.n4.nabble.com/HowTo-inject-FeedbackPanel-tp2295430p2295772.html To unsubscribe from Apache Wicket, click herehttp://apache-wicket.1842946.n4.nabble.com/subscriptions

Re: HowTo inject FeedbackPanel

2010-07-20 Thread James Carman
On Tue, Jul 20, 2010 at 12:29 PM, jcgarciam jcgarc...@gmail.com wrote: I guess what Martin and James talk about is having a FeedbackPanel at the top and a lot component (panels) ajaxified which only update the FeedbackPanel  on their callbacks. Therefore they pass the FeedbackPanel on every

Re: HowTo inject FeedbackPanel

2010-07-20 Thread Martin Makundi
Yes! Igor's solution sounds very generic... could it be a swith/setting/option in the framework that can simply be turned on? ** Martin 2010/7/20 jcgarciam jcgarc...@gmail.com: I guess what Martin and James talk about is having a FeedbackPanel at the top and a lot component (panels)

Re: HowTo inject FeedbackPanel

2010-07-20 Thread James Carman
On Tue, Jul 20, 2010 at 12:38 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Yes! Igor's solution sounds very generic... could it be a swith/setting/option in the framework that can simply be turned on? I'm sure it could, very easily. But it'd have to be added to one of the

Re: HowTo inject FeedbackPanel

2010-07-20 Thread James Carman
On Tue, Jul 20, 2010 at 11:59 AM, James Carman ja...@carmanconsulting.com wrote: On Tue, Jul 20, 2010 at 11:57 AM, Martin Grigorov mgrigo...@apache.org wrote: What about org.apache.wicket.ajax.AjaxRequestTarget.addChildren(MarkupContainer, Class?) I.e.: target.addChildren(getPage(),

Re: HowTo inject FeedbackPanel

2010-07-20 Thread James Carman
This really does save me quite a bit of code! Everywhere that I was saving off a FeedbackPanel field to my page/component so that I could later use it to add to an AjaxRequestTarget, GONE! On Tue, Jul 20, 2010 at 1:49 PM, James Carman ja...@carmanconsulting.com wrote: Here's the actual code (it

Re: HowTo inject FeedbackPanel

2010-07-20 Thread Igor Vaynberg
no, if you are adding children you should already know that their ids are set -igor On Tue, Jul 20, 2010 at 10:03 AM, James Carman ja...@carmanconsulting.com wrote: On Tue, Jul 20, 2010 at 11:59 AM, James Carman ja...@carmanconsulting.com wrote: On Tue, Jul 20, 2010 at 11:57 AM, Martin

Re: HowTo inject FeedbackPanel

2010-07-20 Thread James Carman
I'm talking about that check you suggested, Igor, to see if the user has called setOuputMarkupId(true) on the IFeedback component. Should that be part of the AjaxRequestTarget.addChildren() method's implementation? On Tue, Jul 20, 2010 at 2:56 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:

Re: HowTo inject FeedbackPanel

2010-07-20 Thread Igor Vaynberg
right, like i said, no. if you try to add something and it doesnt have output markup id set to true it should throw an exception just like if you wouldve used addcomponent() -igor On Tue, Jul 20, 2010 at 11:59 AM, James Carman ja...@carmanconsulting.com wrote: I'm talking about that check you

Re: HowTo inject FeedbackPanel

2010-07-20 Thread James Carman
Ok, cool. Just checking. So, I can't use that code because I need to conditionally check to see if it's ajaxified. No big deal. It's already written and working. Thanks for the pointers. On Tue, Jul 20, 2010 at 4:24 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: right, like i said, no. if