Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datatable: Input validation inside row-expander when expandedRow attribute #8310

Closed
afd0174 opened this issue Jan 20, 2022 · 2 comments
Closed
Assignees
Labels
🐞 defect Bug...Something isn't working workaround A workaround has been provided
Milestone

Comments

@afd0174
Copy link

afd0174 commented Jan 20, 2022

Hi,

I've encountered an issue upgrading from PrimeFace 8 to PrimeFaces 11 when including a required text input inside of a p:rowExpander (itself inside of a p:dataTable) that is expanded via satisfying the EL condition given by the p:dataTable's expandedRow attribute.

Expected behavior: When intentionally not supplying a value for the required text input and submitting the form via p:commandButton click, I expect to see "text input failed validation: text input required" messaging.

Observed behavior: On the first click of the p:commandButton, nothing happens on the page. Via browser console, I can see that there is a network request and response, but again, on the page there is no observable change. Clicking the p:commandButton a second time yields the expected "text input failed validation: text input required" messaging in the view. If it's helpful, this issue does not present itself with PrimeFaces 8.

Steps to reproduce: I've attached a modified version of the prime faces-test project (as a *.tar.gz file). Build and run this project. On the expanded row in the datable (the row for "Data2"), intentionally leave the p:textInputarea blank and click the "Update" button. Observe that nothing happens. Click the "Update" button a second time and observe the expected "Validation Error: Value is required" messaging.

Just to say it, if you remove the expandedRow attribute from the p:dataTable and rebuild the project, expanding the "Data2" row manually and clicking the "Update" button with a blank p:textInputarea, gives the expected failed validation messaging on the first click (making the expandedRow attribute the culprit).

Please let me know if I can provide any additional information.

Thanks,

-Andy
primefaces-rowexpansion-bug.tar.gz

@afd0174 afd0174 added the 🐞 defect Bug...Something isn't working label Jan 20, 2022
@melloware melloware changed the title Defect for input validation inside row-expander when p:dataTable expandedRow attribute is used. Datatable: Input validation inside row-expander when expandedRow attribute Jan 21, 2022
@afd0174
Copy link
Author

afd0174 commented Jan 27, 2022

Hi - I've attached a simplified example that sees the "failed UI validation on first click" bug eliminated based on whether or not the data table is enclosed in an outer form (bug occurs) or if the form is placed inside the row expansion (bug does not occur). Any ideas on what would cause this behavior? I'm exploring whether or not the affected view in my project can be refactored to move the form from outside the data table to inside, but there are some other UI input dependencies outside of those contained in the data table that make this difficult.
primefaces-rowexpansion-bug-simple.tar.gz

@melloware
Copy link
Member

OK so I think the issue might be related to all the refactoring for RowExpansion in tickets #7431, #2728

So I was able to fix your issue "I think" by changing the button process value
pf-8310-workaround.zip

Attached is a working reproducer where I put a p:outputPanel in your expander like:

<p:rowExpansion>
	<p:outputPanel id="pnlExpander">

And then change your button to process="@this pnlExpander". Let me know if that fixes your issue

@melloware melloware added the workaround A workaround has been provided label Jan 29, 2022
@tandraschko tandraschko self-assigned this Feb 15, 2022
@tandraschko tandraschko added this to the 12.0.0 milestone Feb 15, 2022
tandraschko added a commit that referenced this issue Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 defect Bug...Something isn't working workaround A workaround has been provided
Projects
None yet
Development

No branches or pull requests

3 participants