Reputation: 45
I want to display some records in the read area of GUI screen after performing some action. I have some input fields in the screen which should be entered by users and based on the entry, I am calling a function from database which is displaying the result correctly as a feedback message on the screen.
But i want to have this result in the read area of screen. Any help is appreciated.Something like below
-----------Input fields--------
Name :
Department :
City :
Rank :
Submit Button(this will call my logic based on input)
-----------------------This i call as Read Area after the submit button(Expectation)------------------
Name : XYZ
Department : ABC
City : YYY
Rank : 4
Upvotes: 0
Views: 51
Reputation: 17533
You can use a Wicket Panel for the result.
Initially this Panel will be invisible:
ResultPanel resultPanel = new ResultPanel("resultPanel", new Model<Result>()); // null model object
resultPanel.setVisible(false);
resultPanel.setOutputMarkupPlaceholderTag(true);
Later after successfully saving into the database you will make it visible:
@Override public void onSubmit(AjaxRequestTarget target) {
Result result = saveInDB(...);
resultPanel.setModelObject(result);
resultPanel.setVisible(result != null);
target.add(resultPanel);
}
Upvotes: 0