Possible Duplicate:
h:commandLink / h:commandButton is not being invoked
I have a Command Button
declared like so:
<p:panel>
<h:commandButton
id="addBtn"
value="Add"
action="#{createResourceDialogController.add()}"
disabled="#{!createResourceDialogController.enableAddButton}"/>
</p:panel>
</p:dialog>
</h:form>
In the `CreateResourceDialogController class, I have a function called add that is delcared like so:
/**
* 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);
}
I click the command button and nothing happens. I also put break points in the add function and nothing happens. I have other action listeners on the page, and they all work fine. There is something about this command button that is casuing it not to work.
Does anyone have any ideas?