2012-12-06 2 views
0

가능한 중복 :
h:commandLink/h:commandButton is not being invokedJSF있는 명령 아무튼 호출 액션

나는 Command Button은과 같이 선언이 다음`CreateResourceDialogController 클래스에서

  <p:panel> 
      <h:commandButton 
       id="addBtn" 
       value="Add" 
       action="#{createResourceDialogController.add()}" 
       disabled="#{!createResourceDialogController.enableAddButton}"/> 
     </p:panel> 
     </p:dialog> 
    </h:form> 

, 내가 가지고 함수는 다음과 같이 delcared 된 add라고합니다 :

/** 
* Called to handle the upload of the resource. 
*/ 
public void add() 
{ 
    Resource resource = new Resource(); 
    resource.setCompanyOwner(getAccount().getCompany()); 
    resource.setCreatedBy(getAccount()); 
    resource.setCreatedOn(new Date()); 
    resource.setLastModified(new Date()); 
    resource.setName(name); 
    resource.setResourceBinaryList(null); 
    resource.setUserOwner(getAccount()); 
    setType(resource); 
    setOwnerType(resource); 
    setLocation(resource); 
    setGroups(resource); 

    createNewResource(resource); 
} 

명령 단추를 누르면 아무 일도 일어나지 않습니다. 또한 add 함수에 중단 점을 넣었지만 아무 일도 일어나지 않습니다. 페이지에 다른 액션 리스너가 있습니다. 모두 잘 작동합니다. 이 명령 단추에 대해서는 작동하지 않을 수도 있습니다.

누구에게 아이디어가 있습니까?

답변

0

알아 냈어. 그것은 형식과 관련이 있습니다. 대화 상자는 2 가지 형식으로되어 있습니다.