I'm trying to generate dynamic forms from code.
My sample form has a commandButton like this:
Code: Select all
<p:commandButton value="Create"
actionListener="#{areaController.create}"
oncomplete="handleCreateRequest(xhr, status, args)"
update="createForm" />
Code: Select all
CommandButton cCreate = new CommandButton();
cCreate.setValue("Create");
cCreate.setValueExpression("actionListener",
FormUtil.createValueExpression("#{areaController.create}",
String.class));
cCreate.setUpdate("createDynamicForm");
cCreate.setOncomplete("handleCreateRequest(xhr, status, args)");
Can you help me?
Thanks!!