Hi Pedro

thanks a lot for your ongoing feedback ;)

I hadn't dig too much into ComponentFeedbackPanel, but I've now done it.

So, my current impressions:
- extra markup required. A bit annoying, I don't need or want that. On top of that I would like some design which circles the faulty input, and I couldn't do something like:
<div wicket:id="stringEditFeedback">
<div wicket:id="stringEdit">
</div>
</div>
(I may have misses something though, I'm a ComponentFeedbackPanel newbe !)
It 's as well annoying for reusable components: this feedback can't be simply added from the outside to inner components, it has to be there in the markup as well

- ordering of component addition in the container matters
I first had this ordering:
creation of the form
addition of the form to the parent container
creation of the input field
addition of the input field to the form
creation of the ComponentFeedbackPanel
addition of the ComponentFeedbackPanel to the form
creation of the feedback panel filtering on already rendered messages
addition of the feedback panel to the parent container

in this order the messages of the input field weren't rendered twice

Then I went for creating and adding the feedback panel to the parent container as the first action: the messages of the input field were rendered twice...

This could be workaround with a Filter similar to the one I used for the behavior, meaning the feedback panel shouldn't display messages which are linked to a component having a ComponentFeedbackPanel. However I'm not sure it's so easy to achieve: the link is from the ComponentFeedbackPanel to the Component, not the other way around, whereas the feedbackmessage goes at the component...

As such, overall, AFAIK, I don't think that a ComponentFeedbackPanel would do it in my use case.

Please let me know if I'm missing something.

Thanks again for your input !

best
joseph


On 01/03/2011 01:05 PM, Pedro Santos wrote:
You are testing the behaviors types of reporter, but if two components with
an FeedbackHighlightBehavior report an feedback you break the functionality
A - no message should be rendered twice

On Wed, Dec 29, 2010 at 12:05 PM, joseph.pachod<j...@thomas-daily.de>  wrote:

Hi Pedro Santos

I hadn't seen your answer, sorry.

In between, I had time again to look into my issue.

Actually, the root of it was about not displaying the feedback message
twice: once in the general feedback panel and once close from the
generating
component.

As such, while helpful, your solution didn't help there.

But I now found this "workaround" for this:
  add(new FeedbackPanel("plainFeedback", new IFeedbackMessageFilter()
            {

                @Override
                public boolean accept(final FeedbackMessage message)
                {
                    List<IBehavior>  behaviors =
message.getReporter().getBehaviors();
                    for (IBehavior behavior : behaviors)
                    {
                        if (behavior instanceof FeedbackHighlightBehavior)
                        {
                            return false;
                        }
                    }
                    return true;
                }
            }));

=>  the feedback panel doesn't display the message twice :)

I have yet to put this change in production, where maybe I would have to do
extra check (like to check that the reporter component is effectively
visible in order to be sure of the feedback message display), but at least
I've found a way to go.

:)

++
joseph


--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Display-component-feedback-message-once-safety-net-renders-them-always-before-tp3068969p3167130.html
Sent from the Users forum mailing list archive at Nabble.com.

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





--
Joseph Pachod
IT

THOMAS DAILY GmbH
Adlerstraße 19
79098 Freiburg
Deutschland
T  + 49 761 3 85 59 506
F  + 49 761 3 85 59 550
E  joseph.pac...@thomas-daily.de
www.thomas-daily.de

Geschäftsführer/Managing Directors:
Wendy Thomas, Susanne Larbig
Handelsregister Freiburg i.Br., HRB 3947

Registrieren Sie sich unter https://www.thomas-daily.de/user/sign-in für die TD 
Morning News, eine kostenlose Auswahl aktueller Themen aus TD Premium, morgens 
ab 9:15 in Ihrer Mailbox.

Aktuelle Presseinformationen für die TD Morning News und TD Premium nimmt 
unsere Redaktion unter redakt...@thomas-daily.de entgegen.
Redaktionsschluss für die TD Morning News ist täglich um 8:45.

Register free of charge at https://www.thomas-daily.de/user/sign-in to have the 
TD Morning News, a selection of the latest topics from TD Premium, delivered to 
your mailbox from 9:15 every morning.

Our editorial department receives the latest press releases for the TD Morning 
News and TD Premium at redakt...@thomas-daily.de. The editorial deadline for 
the TD Morning News is 8.45am daily.


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

Reply via email to