You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Entropy <bl...@gmail.com> on 2014/04/25 16:10:48 UTC

Feedback panel title area

Is it possible to put some HTML inside the feedback panel that isn't
messages?  Possibly for some formatting or a title/instructions?  The stuff
would become visible at the same time as the error panel, but is static
content otherwise outside the messages?  I tried just sticking some HTML in
there, but wicket overwrote it as expected.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Feedback-panel-title-area-tp4665580.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Feedback panel title area

Posted by Jesse Long <jp...@unknown.za.net>.
On 25/04/2014 18:30, Entropy wrote:
> I just tried putting some text inside the feedback panel's html like so:
>
> <div class="errorpanel" id="errorpanel" wicket:id="feedback">This is a
> test</div>
>
> That didn't work.  "This is a test" was overwritten when the feedback panel
> rendered.  Which is exactly what I expected it to do.
>

Hi,

The text between the tags is called the body. When a Panel is rendered, 
the body of the tags to which the panel was bound ("This is a test" in 
your example) is ignored, and the associated markup is rendered instead. 
Associated markup is the markup provided by the Panel, that is shipped 
in an HTML file with the same name as the Panel's class, or super class.

There is nothing preventing you from subclassing FeedbackPanel, and 
providing very similar associated markup, just including a <span 
wicket:id="myheading"></span>.

To override the associated markup provided by a Panel's parent (replace 
markup instead of extend it), you do this:

<wicket:panel>
here you must provide all the markup required by the Panel.
</wicket:panel>

ie. Use <wicket:panel> instead of <wicket:extend>.

So, to get what you want, create a subclass of FeedbackPanel, called 
MyFeedbackPanel. Then, in MyFeedbackPanel.html, copy all the HTML from 
FeedbackPanel.html, and insert the label that you want to add. Then, in 
MyFeedbackPanel#onInitialize(), add the label as you normally would.

Cheers,
Jesse

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


Re: Feedback panel title area

Posted by Entropy <bl...@gmail.com>.
I just tried putting some text inside the feedback panel's html like so:

<div class="errorpanel" id="errorpanel" wicket:id="feedback">This is a
test</div>

That didn't work.  "This is a test" was overwritten when the feedback panel
rendered.  Which is exactly what I expected it to do.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Feedback-panel-title-area-tp4665580p4665583.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Feedback panel title area

Posted by Martin Grigorov <mg...@apache.org>.
Hi,



On Fri, Apr 25, 2014 at 5:10 PM, Entropy <bl...@gmail.com> wrote:

> Is it possible to put some HTML inside the feedback panel that isn't
> messages?  Possibly for some formatting or a title/instructions?  The stuff
> would become visible at the same time as the error panel, but is static
> content otherwise outside the messages?  I tried just sticking some HTML in
> there, but wicket overwrote it as expected.
>

What did you try exactly ?


>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Feedback-panel-title-area-tp4665580.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>