I tried to follow your suggestions, but it is still not displaying messages
in the panel.
nanotech wrote:
>
> I believe you want to display the feedback message in "TestPage".
>
Yes, that's correct. TestPage extends BaseTemplate, which contains this:
BaseTemplate.java:
MessagePanel messagePanel = new MessagePanel("messages") {
private static final long serialVersionUID = 1L;
public boolean isVisible()
{
return anyMessage();
}
};
add(messagePanel);
BaseTemplate.html:
<div wicket:id="messages" style="width: 600px; margin-left: 100px;">This is
the spot for error/info messages</div>
<wicket:child>This is where TestPage is included</wicket:child>
MessagePanel trivially extends FeedbackPanel:
MessagePanel.java:
public abstract class MessagePanel extends FeedbackPanel
{
public MessagePanel(final String id)
{
super(id);
}
}
nanotech wrote:
>
> If so, do something like this:
> 1. make sure you have feedback panel added on the page where you will be
> landing after redirect.
>
If I understand Wicket inheritance, that is taken care of with what I showed
above.
nanotech wrote:
>
> 2. Then you can get hold of the feedback panel in the current page like
> shown below:
>
> FeedbackPanel feedback = (FeedbackPanel)
> responsePage.get("responsePage-feedbackPanel");
> getSession().info("You pased the test");
>
Here's how I tried to implement your advice. I wasn't clear on what you
meant by "responsePage.get("responsePage-feedbackPanel")", so I tried
instantiating TestPage for that, as you can see below. I'm afraid it didn't
work, though:
if (isTestPassed()) {
...
} else {
TestPage testPage = new TestPage();
MessagePanel feedback = (MessagePanel)testPage.get("messages");
info("You didn't pass the test...");
setResponsePage(TestPage.class);
}
Can you tell me what I'm doing wrong? Thanks for your time and help.
--
View this message in context:
http://www.nabble.com/Feedback-messages-disappearing-before-display-tp18932342p18933293.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]