Nghia Do
Nghia Do

Reputation: 2658

Primefaces Button submit entire page unexpected

I'm using Primefaces 6.x and JSF 2.x

I have a 'breadCrumb' and then I have put a CommandButton for 'Options' facet.

I'm seeing the button is generated with 'type=submit' instead of 'type=button' and cuz of it the form is getting submitted when the button is click.

Could you please advice why it is happening like that?

If I put the button outside of breadcrumb, the button is rendered as expected.

Thanks,

Upvotes: 0

Views: 55

Answers (1)

Jens Piegsa
Jens Piegsa

Reputation: 7485

Is your button wrapped by a form in both cases? Maybe this makes the difference.

To explicitly reduce the processing to the given button, you can set its process attribute:

<p:commandButton ... process="@this" />

See also:

Upvotes: 1

Related Questions