Dialog Framework Basic

UI Components for JSF
Post Reply
codruth
Posts: 1
Joined: 23 Nov 2022, 17:12

23 Nov 2022, 17:29

Primefaces version: 10, jsf version: 2.3
I have a problem after close Dialog.
Error from broswer console:
core.js.jsf?ln=primefaces&v=10.0.0&e=10.0.0:18 Widget for var 'abc' not available!

<p:commandButton
action="#{detailsProductFile.openDialog('/admin/product/dialogs/dialog_logistics', item.packageType)}"
value="Editeaza" styleClass="ui-button-secondary"
icon="pi pi-pencil">
<p:ajax event="dialogReturn" update="dlg_log" />
</p:commandButton>

//this is the method from bean
public void openDialog(String dialogName, String tip) {
logger.debug("openDialog() - start dialogName {}, tip {}", dialogName, tip);
Map<String, Object> options = new HashMap<>();
options.put("widgetVar", "abc");
options.put("modal", true);
options.put("draggable", false);
options.put("closable", true);
options.put("resizable", false);
options.put("width", "96%");
options.put("contentWidth", "100%");
options.put("height", "90vh");
options.put("responsive", true);
options.put("contentHeight", "100%");
options.put("headerElement", "customHeader");
Map<String, List<String>> params = Map.of("tip", List.of(tip), "cid", List.of(conversation.getId().toString()));
PrimeFaces.current().dialog().openDynamic(dialogName, options, params);
logger.debug("openDialog() - end");
}

into the dialog I have:
<p:commandButton id="bconf" value="Confirmati"
action="#{logisticsBean.actionSaveProduct()}"
styleClass="p-mt-2 p-mr-2 p-mb-2 btn_conf" icon="pi pi-check" />

where I save an object
this is the save method

public void actionSaveProduct() {
logger.debug("actionSaveProduct() - start");
Product saveProduct = ndpAdminRestClient.saveProduct(detProdFile.getProduct(), false);
detProdFile.setProduct(saveProduct);
logger.debug("actionSaveProduct() - end bsonId {}", saveProduct != null ? saveProduct.getBsonId() : "");
PrimeFaces.current().dialog().closeDynamic(detProdFile);
}

I am trying to call jquery event after this process and I have the problem: Widget for var 'abc' not available!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests