0

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

Trips
  • 35
  • 8
  • What have you tried ? What kind of problems you have faced ? – martin-g Nov 05 '19 at 07:04
  • @martin-g , I have tried with feedback panel of webmarkupcontainer.But the problem i am facing here to display in some sort of order.As this attribute is displaying at the top of the screen which i don't want, instead the remaining input fields will be as it is..and the result should display at the bottom in read area of screen. – Trips Nov 05 '19 at 07:14

2 Answers2

0

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);
 }
martin-g
  • 17,243
  • 2
  • 23
  • 35
0

I have used "span wicket:id" and it serve my purpose.thank you all.

Trips
  • 35
  • 8