Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I force a hard refresh (ctrl+F5)

Leandro VitaleDec 1 2016 — edited Dec 2 2016

How i can force a hard refresh in main page (Ctrl + F5) when return of one Popup.

I use this code, but didn't worked

        BindingContainer bindings = getBindings();

        OperationBinding operationBinding = bindings.getOperationBinding("Execute");

        operationBinding.execute();

Any idea? I use JDeveloper 12c.

This post has been answered by Timo Hahn on Dec 2 2016
Jump to Answer

Comments

Timo Hahn

User, can you describe what you try to archive. Executing an operation will just do that, executing it. If you want to refresh the UI you hae to issue a ppr. However, without more information it's hard to tell which way to go.

Timo

Leandro Vitale

i will use the hard refresh because my information of the TreeTable don't refresh adequately and need use Ctrl + F5 to working and obtain information last updated

Timo Hahn

Why does the info on hte tree table not refresh?

Timo

PaKo

Beside data model, which is refreshed as per your code snippet, you should also refresh view component (or entire page, which you do with Ctrl+F5). As I dont know how you wish to "trigger" refresh, I'll assume you are doing it from some button. Lets say command / action button which triggers some action in backing bean (doing something in database) so you wish to show updated state in a table. Then you have just to put partialTrigger on your af:table to be the action button (or multiple of them, look into doc for partialTrigger property). Then, after the model is refreshed (as per executing binding action) JSF will rerender also the table view and - you get your data updated!

Also, there is a way to grammatically force refresh of particular table from your code (instead using declarative partialTrigger approach). At the end of your code to refresh model, just add something like:

private RichTable tableBinding;

...

AdfFacesContext.getCurrentInstance().addPartialTarget(tableBinding);

Leandro Vitale

This is i don't know..

Timo Hahn

Well, if xou don't describe youe whole use case and we can only guess. My guess is as @PaKo already told you that you have to send a ppr to the table or the surrounding layout container (e.g. af:panelCollection). If the change of hte data is invoked by a button, you can do this decoratively by adding the id of hte button to the Table or layout container. If you do t his you should use the Edit option you get if you click on the  wheel on the right side of the partial trigger property. This will ensure that you get the right id including any naming containers.

Timo

Leandro Vitale

For example, I run the application that shows me a table in the database. If I modify this database physically, when refreshing the page do not see the changes reflected, I need to close the application and re-run. Is the information cached?

Timo Hahn
Answer

This works fro me without writing on line of code. I start with the emp table in the HR db as

pastedImage_0.png

in my sample it looks like

pastedImage_1.png

as you see equal. Then I change the DB to 24000 and commit to get

pastedImage_2.png

Now I hit the refresh declarative button

pastedImage_3.png

and get

pastedImage_4.png

So I see the new or changes data in the db in my table

All I did was to add a partialTrigger in the table pointing to the refreshButton!

<af:table value="#{bindings.EmployeesView1.collectionModel}" var="row" rows="#{bindings.EmployeesView1.rangeSize}"

                                  emptyText="#{bindings.EmployeesView1.viewable ? 'No data to display.' : 'Access Denied.'}" rowBandingInterval="0"

                                  selectedRowKeys="#{bindings.EmployeesView1.collectionModel.selectedRow}"

                                  selectionListener="#{bindings.EmployeesView1.collectionModel.makeCurrent}" rowSelection="single"

                                  fetchSize="#{bindings.EmployeesView1.rangeSize}" filterModel="#{bindings.EmployeesView1Query.queryDescriptor}"

                                  filterVisible="true" queryListener="#{bindings.EmployeesView1Query.processQuery}" varStatus="vs" id="t1"

                                  **partialTriggers="::b2"**\>

That's it.

Timo

Marked as Answer by Leandro Vitale · Sep 27 2020
Leandro Vitale

Thanks, is the solution

1 - 9
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 30 2016
Added on Dec 1 2016
9 comments
523 views