Search code examples
javaoracle-adf

Self page call doesn't update


I'm trying to update a whole page in adf when you click on a link to go to the same page with new page parameters. If I open the link in a new tab, it works fine, but opening it in the same tab doesn't update.

I have a page that just displays the parameter value from the url, a link to the same page with a different parameter value, and an output text that displays the datetime. My taskflow starts by calling RetrieveDateTime() and then goes to refrestTest.jsff. The taskflow is a region on refresh.jsf page.

public class RefreshDC {

    private String dateTime;

    public RefreshDC() {
        super();
    }

    public void RetrieveDateTime() {
        System.out.println("DC RETRIEVEDATETIME");
        RefreshFacade rf = new RefreshFacade();
        this.dateTime = rf.getDate().getDatetime();
    }

    public void setDateTime(String dateTime) {
        this.dateTime = dateTime;
    }

    public String getDateTime() {
        return dateTime;
    }
}

The page fragment:

//refreshTest.jsff
<?xml version='1.0' encoding='UTF-8'?>
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" 
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
  <af:panelGroupLayout id="pgl1" layout="vertical">
    <af:outputText value="#{param.id}" id="ot1"/>
    <af:goLink text="RP PDTLS" id="gl1" destination="/faces/refresh.jsf? 
               id=1234567890"/>
    <af:outputText value="DateTime: #{bindings.dateTime.inputValue}" 
                   shortDesc="#{bindings.dateTime.hints.tooltip}" id="ot2"
                   partialTriggers="gl1"/>
  </af:panelGroupLayout>
</ui:composition>

The page:

//refresh.jsf
<f:view xmlns:f="http://java.sun.com/jsf/core" 
        xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:document title="refresh.jsf" id="d1">
        <af:form id="f1">
            <af:region value="#{bindings.refresh1.regionModel}" id="r1"/>
        </af:form>
    </af:document>
</f:view>

As i said, if you open the goLink in a new tab, it will update the dateTime, however if you open it in the same tab, dateTime remains the same. (The param.id does update in both cases)


Solution

  • I managed to solve this using the taskflow. Basically, I made the button go to a new page with a region. This region has a taskflow that reads the url parameters and if it matches my conditions, links back to the original page with new parameters (toDocumentsPage). Otherwise, goes to a different page (searchResults).Taskflow to refresh the page