a4j:支持调用action方法,它没有在jsf 1.2和richfaces 3.3.3中给出任何错误

时间:2017-01-09 13:25:14

标签: jsf richfaces

我的片段如下:

<h:form id="formforautomanualmatch">

        <a4j:support id="manualMatchProductivityHigh" ajaxSingle="true"
                     style="visibility: hidden;height:0; width:0 " event="onchanged"
                     onbeforedomupdate="destroyDropdownStyle()"
                     oncomplete="drawHighChart(ManualMatchProductivity,#{automanualmatchbean.jsonDataProductivity})"
                     action="#{automanualmatchbean.chartData}"
                     reRender="ManualMatchProductivity">
        </a4j:support>

        <h:inputText id="jsonData"
                     value="#{automanualmatchbean.jsonDataProductivity}" />
        <rich:panel id="ManualMatchProductivity"
                    bodyClass="rich-laguna-panel-no-header">
            <h:inputText id="dateRanges" value="#{bean.selectedRange}" />
            <h:inputText id="fromDate"
                         value="#{automanualmatchbean.selectedStartDate}" />
            <h:inputText id="toDate" value="#{bean.to_date}" />
            <h:inputText id="dataBy" value="#{bean.dataByValue}" />
        </rich:panel>
</h:form>

我的动作方法没有被调用。我无法弄清问题是什么。我认为它应该从bean类中调用getChartdata方法。但由于某种原因,它并没有调用那种方法。当我将这个bean用于另一个XHTML页面的动作时,它正在调用该方法。

我的bean类如下:

@Controller("automanualmatchbean")
public class AutoManualMatchBean {

    private Logger logger = Logger.getLogger(this.getClass());

    private Date selectedStartDate;
    private Date selectedEndDate;
    private String selectedDataBy;
    private JSONArray jsonDataProductivity=new JSONArray();
    private String jsonDataRuleEffec = "{}";
    private String jsonDataRuleQuality = "{}";
    private String jsonDataRecDistribution = "{}";

    @Autowired
    AutoManualMatchImpl autoManualMatchImpl;

    // all standard getters and setters

    public void getChartData() {
        // Loading the Details of the Chart
        jsonDataProductivity.add("{12}");
        System.out.println("Inside AutoManualMatchBean getChartData");
        FacesContext context = FacesContext.getCurrentInstance();
        Map map = context.getExternalContext().getRequestParameterMap();

        String matchType = (String) map.get("matchType");
        String pFromDate = (String) map.get("parentFromDate");
        String ptoDate = (String) map.get("parentToDate");
        String pDataType = (String) map.get("parentDataBy");

        SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");

        try {
            selectedStartDate = formatter.parse(pFromDate);
            selectedEndDate = formatter.parse(ptoDate);
        } catch (ParseException e) {
            logger.error("Error while parsing the date in getChartData");
            e.printStackTrace();
        }
        logger.info("AutoManualMatchBean --> Start getChartData");

        jsonDataProductivity = autoManualMatchImpl.getChartDataProductivity(
            matchType, pFromDate, ptoDate, pDataType);
    }
}

0 个答案:

没有答案