From 7e8ee33512f2cb77da9f16834c2865db72f89c17 Mon Sep 17 00:00:00 2001 From: dahoud Date: Sat, 29 Nov 2025 22:10:14 +0000 Subject: [PATCH] fix(client): Retour aux p:commandButton directs pour les actions dans DataTables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PROBLÈME IDENTIFIÉ: - Les composants action-button-* et button-form-submit utilisaient ui:define pour passer action - JSF ne peut pas évaluer ui:define comme une expression de méthode - Erreur: 'Identity [action] does not reference a method expression instance, returned type [java.lang.String]' SOLUTION APPLIQUÉE: - Suppression de action-button-edit.xhtml, action-button-toggle.xhtml, action-button-delete.xhtml, button-form-submit.xhtml - Retour aux p:commandButton directs dans liste.xhtml et nouvelle.xhtml - Ajout de ui-button-text pour le style Rounded Text (icône + texte) - Largeur colonne Actions augmentée : 280px → 320px COMPOSANTS DRY/WOU CONSERVÉS (qui fonctionnent): - button-success.xhtml, button-secondary.xhtml : navigation avec outcome - button-primary.xhtml, button-warning.xhtml, button-info.xhtml, button-icon.xhtml : actions simples - Tous les composants cards, forms, layout, tables, dialogs CONCLUSION: Pour les actions avec paramètres dans DataTables, p:commandButton direct est la seule solution viable en JSF. --- .../pages/secure/organisation/liste.xhtml | 72 +++++++++---------- .../pages/secure/organisation/nouvelle.xhtml | 16 ++--- .../buttons/action-button-delete.xhtml | 30 -------- .../buttons/action-button-edit.xhtml | 27 ------- .../buttons/action-button-toggle.xhtml | 31 -------- .../buttons/button-form-submit.xhtml | 47 ------------ .../components/tables/data-table.xhtml | 3 +- 7 files changed, 42 insertions(+), 184 deletions(-) delete mode 100644 unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-delete.xhtml delete mode 100644 unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-edit.xhtml delete mode 100644 unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-toggle.xhtml delete mode 100644 unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/button-form-submit.xhtml diff --git a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/pages/secure/organisation/liste.xhtml b/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/pages/secure/organisation/liste.xhtml index 3d4aa9f..3261ad4 100644 --- a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/pages/secure/organisation/liste.xhtml +++ b/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/pages/secure/organisation/liste.xhtml @@ -123,7 +123,8 @@ rowsPerPageTemplate="10,20,50,100" paginatorPosition="bottom" emptyMessage="Aucune organisation trouvée" - styleClass="table-responsive"> + styleClass="table-responsive" + size="small"> @@ -164,44 +165,39 @@ icon="#{org.statut == organisationsBean.statutActive ? 'pi pi-check' : 'pi pi-times'}"/> - - - - - - - - + + + + + + + + + - - - - - - - #{organisationsBean.setOrganisationSelectionnee(org)} - - - - - - - - - - - #{organisationsBean.basculerStatutOrganisation(org)} - - - - - - - - - #{organisationsBean.supprimerOrganisation(org)} - - + + + diff --git a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/pages/secure/organisation/nouvelle.xhtml b/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/pages/secure/organisation/nouvelle.xhtml index 2486a79..0838cb1 100644 --- a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/pages/secure/organisation/nouvelle.xhtml +++ b/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/pages/secure/organisation/nouvelle.xhtml @@ -48,16 +48,12 @@ - - - - - - - - #{organisationsBean.creerOrganisation} - - + + diff --git a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-delete.xhtml b/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-delete.xhtml deleted file mode 100644 index c016137..0000000 --- a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-delete.xhtml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - diff --git a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-edit.xhtml b/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-edit.xhtml deleted file mode 100644 index 7a661f6..0000000 --- a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-edit.xhtml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-toggle.xhtml b/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-toggle.xhtml deleted file mode 100644 index 366ea1a..0000000 --- a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/action-button-toggle.xhtml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - diff --git a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/button-form-submit.xhtml b/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/button-form-submit.xhtml deleted file mode 100644 index c97b629..0000000 --- a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/buttons/button-form-submit.xhtml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - diff --git a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/tables/data-table.xhtml b/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/tables/data-table.xhtml index 56eb799..8550751 100644 --- a/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/tables/data-table.xhtml +++ b/unionflow-client-quarkus-primefaces-freya/src/main/resources/META-INF/resources/templates/components/tables/data-table.xhtml @@ -42,7 +42,8 @@ sortField="#{sortField}" sortOrder="#{sortOrder}" filteredValue="#{filteredValue}" - widgetVar="#{widgetVar}"> + widgetVar="#{widgetVar}" + size="#{size}">