rich:calendar不会在变量中设置

时间:2017-04-26 13:19:21

标签: java jsf richfaces

我使用的是RichFaces 3.3.3,这就是问题:当我在rich:calendar中选择一个日期并点击aj4:按钮让动作变为富:日历不会做设置,我检查了aj4:form,h:panelGrid,ajaxSubmit值,a4j:commandButton中的ajaxSubmit值,但它不起作用。没有解决方案,我找到了工作。

这是代码:

<rich:modalPanel id="inspectionRequestPanel" width="1000" height="600"
    style="overflow: scroll;" autoSized="true">
        <h:panelGrid colums="1" cellspacing="2">
          <a4j:form id="inspectionRequestPanelForm" ajaxSubmit="true">
            <rich:panel
                rendered="#{inspecctrl.inspectionRequest.stateInspection != null and inspecctrl.inspectionRequest.stateInspection.id == 1}">
            <h:panelGrid columns="8">                   
                    <h:panelGrid columns="2">
                        <h:outputText value="#{msg.datetimevisitlabel}" />
                        <h:panelGrid columns="4">
                            <rich:calendar id="investigationdate" popup="true"
                                datePattern="dd/MM/yyyy" enableManualInput="true" size="12"
                                value="#{inspecctrl.inspectionRequest.investigationDate}"
                                required="true">
                                <f:validator validatorId="dateValidator" />
                                <f:validator validatorId="dayBeforeValidator" />
                                <f:validator validatorId="dateNotMoreThanThirtyDaysValidator" />
                            </rich:calendar>
                            <a4j:support event="onchanged" ajaxSingle="true"/>
                            <s1:message for="investigationdate" />
                            <h:graphicImage value="#{resource['img:warning-required.png']}" />
                        </h:panelGrid>
                    </h:panelGrid>
             </h:panelGrid>
             </rich:panel>
             <h:panelGrid columns="1" cellspacing="5"
                rendered="#{inspecctrl.inspectionRequest.stateInspection != null}">
                <a4j:commandButton id="finishtaskbutton" value="Enviar Solicitud"
                    action="#{inspecctrl.saveInspectionRequest()}" ajaxSingle="true"
                    reRender="cesviInvestigation, inspectionRequestPanelForm, viewreportInclude"
                    onclick="this.disabled=true;Richfaces.showModalPanel('idwaitpanel');"
                    oncomplete="this.disabled=false;Richfaces.hideModalPanel('idwaitpanel');Richfaces.hideModalPanel('inspectionRequestPanel')">
                </a4j:commandButton>
                <s1:message for="finishtaskbutton" />
            </h:panelGrid>
        </a4j:form>
    </h:panelGrid>
 </rich:modalPanel>

这是bean中的代码:

@ManagedBean(name = "inspecctrl")
@ViewScoped
public class InspectionController extends AbstractTasksController implements Serializable {

/**
 * 
 */
private static final long serialVersionUID = 7687625106417690199L;

//Vars for request inspection
private CesviInspectionRequest inspectionRequest = new CesviInspectionRequest();

public CesviInspectionRequest getInspectionRequest() {
    return inspectionRequest;
}
public void setInspectionRequest(CesviInspectionRequest inspectionRequest) {
    this.inspectionRequest = inspectionRequest;
}

模型中的代码:

public abstract class InspectionRequest {

    private Date investigationDate;

    public Date getInvestigationDate() {
        return investigationDate;
    }

    public void setInvestigationDate(Date investigationDate) {
        this.investigationDate = investigationDate;
    }

感谢任何人的帮助。

0 个答案:

没有答案