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 way that looks at the page for an
interface (FeedbackContainer) or something.  If there are any
messages, then it adds the feedback panel to the target automatically?

On Tue, Jul 20, 2010 at 8:44 AM, Martin Makundi
martin.maku...@koodaripalvelut.com wrote:
 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 even better some
 direct refrence? Should I only allow one (particular) feedbackpanel
 per session and re-use it from session?

 **
 Martin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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 be able to add them to their
 AjaxRequestTarget.  Perhaps you could override the default ajax
 request cycle handling in some way that looks at the page for an
 interface (FeedbackContainer) or something.  If there are any
 messages, then it adds the feedback panel to the target automatically?

 On Tue, Jul 20, 2010 at 8:44 AM, Martin Makundi
 martin.maku...@koodaripalvelut.com wrote:
 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 even better some
 direct refrence? Should I only allow one (particular) feedbackpanel
 per session and re-use it from session?

 **
 Martin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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 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 way that looks at the page for an
 interface (FeedbackContainer) or something.  If there are any
 messages, then it adds the feedback panel to the target automatically?

 On Tue, Jul 20, 2010 at 8:44 AM, Martin Makundi
 martin.maku...@koodaripalvelut.com wrote:
 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 even better some
 direct refrence? Should I only allow one (particular) feedbackpanel
 per session and re-use it from session?

 **
 Martin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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 injecting
 feedbackpanel references to children or something? Or even better some
 direct refrence? Should I only allow one (particular) feedbackpanel
 per session and re-use it from session?

 **
 Martin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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 (requestTarget.getPage()) feedback panel component gets added
to the AjaxRequestTarget that's passed in.

On Tue, Jul 20, 2010 at 11:23 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 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 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 way that looks at the page for an
 interface (FeedbackContainer) or something.  If there are any
 messages, then it adds the feedback panel to the target automatically?

 On Tue, Jul 20, 2010 at 8:44 AM, Martin Makundi
 martin.maku...@koodaripalvelut.com wrote:
 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 even better some
 direct refrence? Should I only allow one (particular) feedbackpanel
 per session and re-use it from session?

 **
 Martin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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 and look for IFeedback and add them
to the target if they have setoutputmarkupid(true) - too late to force
it to true at this point.

-igor

On Tue, Jul 20, 2010 at 8:34 AM, James Carman
ja...@carmanconsulting.com wrote:
 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 (requestTarget.getPage()) feedback panel component gets added
 to the AjaxRequestTarget that's passed in.

 On Tue, Jul 20, 2010 at 11:23 AM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 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 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 way that looks at the page for an
 interface (FeedbackContainer) or something.  If there are any
 messages, then it adds the feedback panel to the target automatically?

 On Tue, Jul 20, 2010 at 8:44 AM, Martin Makundi
 martin.maku...@koodaripalvelut.com wrote:
 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 even better some
 direct refrence? Should I only allow one (particular) feedbackpanel
 per session and re-use it from session?

 **
 Martin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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...

 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 and look for IFeedback and add them
 to the target if they have setoutputmarkupid(true) - too late to force
 it to true at this point.

 -igor

 On Tue, Jul 20, 2010 at 8:34 AM, James Carman
 ja...@carmanconsulting.com wrote:
  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 (requestTarget.getPage()) feedback panel component gets added
  to the AjaxRequestTarget that's passed in.
 
  On Tue, Jul 20, 2010 at 11:23 AM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
  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 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 way that looks at the page for an
  interface (FeedbackContainer) or something.  If there are any
  messages, then it adds the feedback panel to the target automatically?
 
  On Tue, Jul 20, 2010 at 8:44 AM, Martin Makundi
  martin.maku...@koodaripalvelut.com wrote:
  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 even better some
  direct refrence? Should I only allow one (particular) feedbackpanel
  per session and re-use it from session?
 
  **
  Martin
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




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 messages -
 getsession().getfeedbackmessages().size()0
 visit all components in the page and look for IFeedback and add them
 to the target if they have setoutputmarkupid(true) - too late to force
 it to true at this point.


Very cool!  This will clean up some of my code.  Guess I should have
dug a bit more when I wrote it the first time. :)  Then again, I was
probably just a young (er) Wicketeer way back then.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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!

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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 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 even better some
 direct refrence? Should I only allow one (particular) feedbackpanel
 per session and re-use it from session?

 **
 Martin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: HowTo inject FeedbackPanel

2010-07-20 Thread jcgarciam

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 Panel constructor.

Martin, James am i right?

On Tue, Jul 20, 2010 at 1:08 PM, Fernando Wermus-3 [via Apache Wicket] 
ml-node+2295772-688142619-229...@n4.nabble.comml-node%2b2295772-688142619-229...@n4.nabble.com
 wrote:

 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 
 [hidden email] http://user/SendEmail.jtp?type=nodenode=2295772i=0
 wrote:

  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 even better some
  direct refrence? Should I only allow one (particular) feedbackpanel
  per session and re-use it from session?
 
  **
  Martin
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=2295772i=1
  For additional commands, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=2295772i=2
 
 


 --
 Fernando 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/Unsubscribe.jtp?code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDExOTE5MDc4OTQ=.





-- 
Sincerely,
JC

Work smarter, not harder!.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/HowTo-inject-FeedbackPanel-tp2295430p2295809.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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 Panel constructor.

 Martin, James am i right?


You're exactly right for my specific usecase.  Consider this example.
I've got a Person class which contains an address property of type
Address.  Now, Address is re-used in my domain model in a lot of
places (Vendor, Customer, etc.).  So, everywhere we want to edit an
Address, we want it to use the same interface.  So, I create an
AddressEditorPanel which to re-use on any form which contains an
Address object.  So, now consider a page which is for editing a Person
object.  I create a FormPerson and on that I put an
AddressEditorPanel which will be used to edit the person's address
(new AddressEditorPanel(address) if using a CPM).  Let's say the
AddressEditorPanel does some AJAX-based validation (for the zip code
perhaps).  I want all my errors on that page to show up on the
FeedbackPanel located at the top of the page.  If I have a validation
error on the zip code, I need to tell the AjaxRequestTarget that I
want the feedback panel updated via AJAX, but how do I do that?  I
need a reference to the FeedbackPanel.  Where do I get it?  Well, I
either have it passed in to me or I look up my hierarchy and do it
that way.  Using the auto-add feature (with a listener), it's handled
for me automagically!

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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) ajaxified which only update the
 FeedbackPanel  on their callbacks. Therefore they pass the FeedbackPanel on
 every Panel constructor.

 Martin, James am i right?


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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 settings objects (PageSettings, perhaps).  What would the property
be called automaticAjaxFeedback?  I wouldn't mind putting together
the patch if we can agree on the naming of the setting and where it
would go (and of course if this sort of thing belongs in core or
not).  Perhaps we just create a listener implementation and let folks
add it to the AjaxRequestTarget manually if they want?

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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(), IFeedback.class) ?

 Even cooler!


The only problem with this approach is there is no check in
addChildren() to see if setOutputMarkupId() is turned on or not.
Should that be part of the functionality?

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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 works in our application)...

   �...@override
    public AjaxRequestTarget newAjaxRequestTarget(Page page)
    {
        AjaxRequestTarget target = super.newAjaxRequestTarget(page);
        target.addListener(new AjaxRequestTarget.IListener()
        {
           �...@override
            public void onBeforeRespond(MapString, Component map,
 final AjaxRequestTarget target)
            {
                if (!Session.get().getFeedbackMessages().isEmpty())
                {
                    target.getPage().visitChildren(IFeedback.class,
 new Component.IVisitorComponent()
                    {
                        public Object component(Component component)
                        {
                            if(component.getOutputMarkupId())
                            {
                                target.addComponent(component);
                            }
                            return CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER;
                        }
                    });
                }
            }

           �...@override
            public void onAfterRespond(MapString, Component map,
 AjaxRequestTarget.IJavascriptResponse response)
            {
                // Do nothing.
            }
        });
        return target;
    }

 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 messages -
 getsession().getfeedbackmessages().size()0
 visit all components in the page and look for IFeedback and add them
 to the target if they have setoutputmarkupid(true) - too late to force
 it to true at this point.

 -igor

 On Tue, Jul 20, 2010 at 8:34 AM, James Carman
 ja...@carmanconsulting.com wrote:
 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 (requestTarget.getPage()) feedback panel component gets added
 to the AjaxRequestTarget that's passed in.

 On Tue, Jul 20, 2010 at 11:23 AM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 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 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 way that looks at the page for an
 interface (FeedbackContainer) or something.  If there are any
 messages, then it adds the feedback panel to the target automatically?

 On Tue, Jul 20, 2010 at 8:44 AM, Martin Makundi
 martin.maku...@koodaripalvelut.com wrote:
 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 even better some
 direct refrence? Should I only allow one (particular) feedbackpanel
 per session and re-use it from session?

 **
 Martin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, 

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 Grigorov mgrigo...@apache.org 
 wrote:
 What
 about org.apache.wicket.ajax.AjaxRequestTarget.addChildren(MarkupContainer,
 Class?)

 I.e.: target.addChildren(getPage(), IFeedback.class) ?

 Even cooler!


 The only problem with this approach is there is no check in
 addChildren() to see if setOutputMarkupId() is turned on or not.
 Should that be part of the functionality?

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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:
 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 Grigorov mgrigo...@apache.org 
 wrote:
 What
 about org.apache.wicket.ajax.AjaxRequestTarget.addChildren(MarkupContainer,
 Class?)

 I.e.: target.addChildren(getPage(), IFeedback.class) ?

 Even cooler!


 The only problem with this approach is there is no check in
 addChildren() to see if setOutputMarkupId() is turned on or not.
 Should that be part of the functionality?

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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 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:
 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 Grigorov mgrigo...@apache.org 
 wrote:
 What
 about 
 org.apache.wicket.ajax.AjaxRequestTarget.addChildren(MarkupContainer,
 Class?)

 I.e.: target.addChildren(getPage(), IFeedback.class) ?

 Even cooler!


 The only problem with this approach is there is no check in
 addChildren() to see if setOutputMarkupId() is turned on or not.
 Should that be part of the functionality?

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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 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 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:
 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 Grigorov mgrigo...@apache.org 
 wrote:
 What
 about 
 org.apache.wicket.ajax.AjaxRequestTarget.addChildren(MarkupContainer,
 Class?)

 I.e.: target.addChildren(getPage(), IFeedback.class) ?

 Even cooler!


 The only problem with this approach is there is no check in
 addChildren() to see if setOutputMarkupId() is turned on or not.
 Should that be part of the functionality?

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org