question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CommandButton: when ajax=false, it doesn't work when used inside composite component with a form

See original GitHub issue

Describe the bug

When using a composite component which has a h:form inside and using cc:renderFacet to put a p:commandButton with ajax=false inside, that page won’t render with the following error:

FacesException: CommandButton : "j_id_7:j_id_8" must be inside a form element
    at org.primefaces.component.commandbutton.CommandButtonRenderer.buildRequest (CommandButtonRenderer.java:153)

I think this issue might be related to #8317

Reproducer

primefaces_test.7z

Expected behavior

Primefaces should be able to detect that the p:commandButton is inside a h:form already even though the h:form is inside the composite component

PrimeFaces edition

Community

PrimeFaces version

11.0.0

Theme

ALL?

JSF implementation

All

JSF version

ALL?

Browser(s)

ALL?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
mellowarecommented, May 20, 2022

Unfortunately as far as I can see that is the only workaround for now that would actually work.

0reactions
tandraschkocommented, May 20, 2022

Yeah Thats very hard, and If you find one, you are not sure If its really the parent one

Read more comments on GitHub >

github_iconTop Results From Across the Web

commandButton doesn't work in facets of composite components
i've got a problem with a p:commandButton in a facet which will be rendered in a h:form by the composite components feature.
Read more >
jsf 2 - PrimeFaces CommandButton Action not called inside ...
When you used the composite component, was it already placed in ... When you have nested forms, command button action isn't triggered.
Read more >
MenuItem: doesn't work when used inside composite ... - GitHub
Caused by: javax.faces.FacesException: MenuItem must be inside a form element at org.primefaces.renderkit.MenuItemAwareRenderer.
Read more >
Use a command button to start an action or a series of actions
Open the form in Design view by right-clicking the form in the Navigation Pane, and then clicking Design View Button image · In...
Read more >
Problem with primefaces monitorDownload - Forums - Liferay
1) The p:commandButton component with ajax="false" is executing a full page postback using the "action" attribute of the surrounding <form> element.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found