1

Here is the dialog code

<title><ui:insert name="title">#{msg['trip.bus.unsaved.warning']}</ui:insert></title>
    <h:outputStylesheet library="css" name="theme.css" />
</h:head>

<h:body>
    <ui:composition>
    <h:form id="unsavedBusValidationReturnToCharterForm" width="450px">
        <p:panelGrid columns="1">
            <p:row>
                <p:outputLabel value="#{msg['trip.bus.unsaved.validation.string1']}" style="color:red; font-weight:bold; font-size:12px;"/>
            </p:row>
            <p:row>
                <p:outputLabel value="#{msg['trip.bus.unsaved.validation.string2']}" style="color:red; font-weight:bold; font-size:12px"/>
            </p:row>
            <p:row>
                <p:outputLabel value="#{msg['trip.bus.unsaved.validation.string3']}" style="color:red; font-weight:bold; font-size:12px"/>          </p:row>
        </p:panelGrid>
        <p:commandButton value="#{msg['trip.bus.cancellation.button.ok']}" style="width:140px;" type="submit" onclick="PF('unsavedBusValidReturnToChartDialog').hide();"
        action="#{tripInformationController.returnToTripInfo}" update="busPg">
            <!-- <f:ajax listener="PF('unsavedBusValidReturnToChartDialog').hide();" /> -->
        </p:commandButton>
        <p:spacer width="4px"></p:spacer>
        <p:commandButton value="#{msg['trip.bus.cancellation.button.cancel']}" style="width:140px;"
        onclick="PF('unsavedBusValidReturnToChartDialog').hide();"></p:commandButton>
        </h:form>
    </ui:composition>
</h:body>
</html>

This is the dialog that includes that code

            <p:dialog widgetVar="unsavedBusValidReturnToChartDialog" showHeader="true" showEffect="clip" hideEffect="clip" appendToBody="true" width="auto"
                height="auto" resizable="true" draggable="true" modal="true"
                styleClass="customDialog dialogTitleNone">
                    <ui:include src="/charter/unsaved_bus_validation_return_to_charter.xhtml" />
            </p:dialog>

Then this method runs when I click on ok to navigate back one page.

public String returnToTripInfo() {
        logger.info("returnToTripInfo() entry");
        doRemoveUnsavedBus();

        if (getBusInfoListVo().size() > 0) {
            busbutton = "Edit Buses";
            List<FinancialDetailVo> tempFinancialDetails = busInfoSer.getFinancialDetails(tripInfoVo.getCharterId());
            if (tempFinancialDetails != null && tempFinancialDetails.size()>0 ) {
                tripInfoVo.setFinancialDetailVoSet(tempFinancialDetails);
                calculateFinancialtotalAmount();
            }
            else
            {
                tripInfoVo.setFinancialDetailVoSet(null);
                tripInfoVo.setFinancialTotalAmount(null);
                calculateFinancialtotalAmount();

            }

            if(getBusInfoVo().getSelectStatus()==4)
            {
                setDisableBus(false);
                setDisableCharges(false);
                setDisableBusStatus(false);
                setDisableBusSave(false);
            }
        }
        logger.info("returnToTripInfo() exit");
        return "Charter_information_tab.xhtml";
    }

When the dialog closes and navigates back one screen, the input field on that screen are acting as if they are disabled. I tried the appendToBody="true" and appendTo="@(body)". I am running primefaces version 6.

I just need the inputs on the navigated to screen to be editable after the dialog navigates and closes.

Chris
  • 23
  • 4

1 Answers1

0

The page was navigating before the hideEffect was able to finalize, so the dialog could not close before the page navigated. I took the hideEffect out, and the dialog was able to fully close before navigating.

<p:dialog widgetVar="unsavedBusValidReturnToChartDialog" showHeader="true" showEffect="clip" appendToBody="true" width="auto"
                height="auto" resizable="true" draggable="true" modal="true"
                styleClass="customDialog dialogTitleNone">
                    <ui:include src="/charter/unsaved_bus_validation_return_to_charter.xhtml" />
            </p:dialog>
Chris
  • 23
  • 4