2012-06-29 3 views
0

위젯, 아약스, jquery를 사용합니다. 양식 (날짜에 대해 두 개의 필드가 있음) 제출시 사용자는 파일 다운로드 팝업을받습니다. 처리를 표시하는 데 시간이 걸리므로 아약스 및 jquery에서 작동합니다. 이제 문제는 회 전자가 없지만 보고서 다운로드 작업이 정상적으로 작동하지만 정상적인 wicket 제출 버튼을 사용할 때입니다. 그러나 ajaxbutton을 사용할 때 스피너가 나타나지만 열린/저장 팝업이 없습니다.jquery 파일 다운로드 용 아약스 버튼

다음 코드는 잘 작동 오픈 제공

add(new SubmitLink("runReport") { 

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

    *//** 
    * 
    *//* 
    @Override 
    public void onSubmit() { 
    HashMap<String, Object> map = new HashMap<String, Object>(); 
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); 
    map.put("reportStartDate", formatter.format(getReportStartDate())); 

    // Add a day to the end date to include the date entered by the user. 
    Calendar cal = Calendar.getInstance(); 
    cal.setTime(getReportEndDate()); 
    cal.add(Calendar.DATE, 1); 

    map.put("reportEndDate", formatter.format(cal.getTime())); 
    generateReport(map,"ecommerceReport.rptdesign"); 
    } 
} 
.add(RelativePathPrefixHandler.RELATIVE_PATH_BEHAVIOR) 
); 

다음 코드는 아약스와 같은 스피너를 보여줍니다 더 아약스 액션이 없기 때문에이 스피너를 표시하지 않습니다하지만 /, 팝업을 저장하지만 열기/저장 팝업이 없다

AjaxButton runReportButton = new AjaxButton("runReport", this) { 
    private static final long serialVersionUID = 10008L; 

    @Override 
    public void onSubmit(AjaxRequestTarget target, Form<?> form) { 
     HashMap<String, Object> map = new HashMap<String, Object>(); 
     SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); 
     map.put("reportStartDate", formatter.format(getReportStartDate())); 

     // Add a day to the end date to include the date entered by the user. 
     Calendar cal = Calendar.getInstance(); 
     cal.setTime(getReportEndDate()); 
     cal.add(Calendar.DATE, 1); 

     map.put("reportEndDate", formatter.format(cal.getTime())); 
     generateReport(map,"ecommerceReport.rptdesign"); 
     target.addComponent(form); 
    } 
}; 

runReportButton.add(RelativePathPrefixHandler.RELATIVE_PATH_BEHAVIOR); 
runReportButton.add(new SimpleAttributeModifier("onmouseup", "showPopup();")); 

add(runReportButton); 

도 다음 코드는 작동하지 않습니다

add(new AjaxFallbackButton("runReport", this) { 
    @Override 
    protected void onSubmit(AjaxRequestTarget target, Form<?> form) { 
     HashMap<String, Object> map = new HashMap<String, Object>(); 
     SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); 
     map.put("reportStartDate", formatter.format(getReportStartDate())); 

     // Add a day to the end date to include the date entered by the user. 
     Calendar cal = Calendar.getInstance(); 
     cal.setTime(getReportEndDate()); 
     cal.add(Calendar.DATE, 1); 

     map.put("reportEndDate", formatter.format(cal.getTime())); 
     generateReport(map,"ecommerceReport.rptdesign"); 
     target.addComponent(form); 
    } 
}); 

그는 어떤 내가 잘못

답변