page refresh

Hi ,

I have a case where i need to reload a page when a button [which is in the same page]
is clicked .

This page which extends a verticalLayout is the main class of an application

What i am doing is calling a parametarized constructor of the same page in the button listener .

this parameterized constructor should load the page with different set of data.

when i check the log , the constructor is called , but the page is not refreshed.

What could be the problem ?

Please help.


Regards,
Niyas

There should never be a need to manually refresh - could you please provide a compact test-case?

Hi Joonas,

Attached is the screen shot of the test case .

The screen gives details of the request id ‘A35’ .

but when the link [which is a button with the style of a link ]
‘A36’ is clicked , the same screen should show the details

of it .

What i am doing is calling the parametrized constructor of the same class passing ‘A36’.

But it is not refreshing .


Regards,
Niyas
11332.jpg

Anybody can help me ???

Are you sure that you replace the old “page” extending VerticalLayout with the new constructed one properly in the containing layout? Is it the root layout of the main window?

The terminology “page” and “refresh” sound a bit confusing here. As far as I understood, you have
view
that displays some data record and then you change the view to display some other record.

Hi Marco,

I meant exactly what you said.

Please find atached the sample java file which explains my test case exactly.
11334.java (1.42 KB)

...
new Refresh(val);

Simply creating an object does not automatically assign it or otherwise put it in anywhere. This also applies to creating an object of the same class from within it; you can not “recreate” objects in Java.

It sounds a bit suspicious that you have a composite component called “Refresh”, which has some UI components and which refreshes itself, and you also have a “page” concept in your application. Such concepts are associated with the web page metaphor, which is common with traditional web applications, but not with Vaadin/AJAX. I don’t know what your application architecture is like, but I hope that it hasn’t any conceptual problems.