primefaces / primefaces

Ultimate Component Suite for JavaServer Faces
http://www.primefaces.org
MIT License
1.81k stars 763 forks source link

CommandButton: combined with datatable and tabView with dynamic tabs #10396

Open ybendek opened 1 year ago

ybendek commented 1 year ago

Describe the bug

Hi.

I have a case where I'm trying to combine dynamic tabs displayed from a collection of objects (in the attached reproduced project List), each of these objects has a collection of items displayed inside of each tab as a tabular data using the table component (List).

For each row of this table I have a CommandButton, the action of the button redirect to another page. Everything works as it should, until the user use the filter for the column of the table.

-if you leave the table's data without filtering then the button works. OK chrome_2NSn83VwES

-But, if you try to filter the data, then the button stops working and does not redirect when pressed. BUG chrome_ZXXrxYWRTi

As far as I tested, this scenario only fails when you use dynamic tabs combined with the tables.

This scenario had been working before with PF 6.2

Reproducer

Attached is a reproducer project with the source code to see the error

reproducerIssue.zip

The project should be just executed

  1. call main page http://localhost/reproducerIssue/testIssues.jsf
  2. select one of the tabs displayed (MasterTab1, MasterTab2)
  3. use the filter for the table displayed.
  4. press the commandButton "AnotherPage" for one of the rows displayed
  5. The action button is not redirecting the user

In the other hand if you don't use the filter the button works as it should

Expected behavior

The commandButton (or any component with a redirection action), should redirect the page as soon as it's pressed, no matters if the table's data is filtered or not

PrimeFaces edition

Elite

PrimeFaces version

12.0.5

Theme

We are using Rain, but the bug is not related with the theme

JSF implementation

Mojarra

JSF version

2.2

Java version

11

Browser(s)

No response

melloware commented 1 year ago

Any chance you have tried this with the 13.0.0 final release?

ybendek commented 1 year ago

Yes, the same bug with 13.0.0

Rapster commented 1 year ago

Can't run your reproducer, please make it based on primefaces-test

melloware commented 1 year ago

@Rapster here you go: pf-10396.zip

Rapster commented 1 year ago

Thank you @melloware !

ybendek commented 1 year ago

Hello Guys, any news about this bug? or workaround that I can use?

melloware commented 1 year ago

I have only verified your issue but have not had any time to investigate the issue.

Rapster commented 1 year ago

I don't have much time lately, but I think the issue is that TabView#var is not exposed at that specific moment which makes impossible to decode the commandButton. Unless someone wish to work on it, i'll only be able to look at it at the end of month after holidays