-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
React ValidatedField wrapping to Row, Col for multi column view #17926
Comments
Currently I made a small example to show how to make the form from your screenshot work: emilpaw/jhipster-react-nested-form-inputs-example@78edc39 It might be possible to make nested inputs work out of the box. |
Thanks emilpaw, this works like a charm and we are able to arrange the layout as needed based on slight twist as per your sample. appreciated your effort and help. |
The wrappers are just utilities to reduce duplicated code, for any additional usecase please use the library directly as its already integrated and will work seamlessly |
@DanielFran, is it something going to be fixed in Jhipster's future release so we don't need to change the code on each auto-generated page to arrange the fields in multiple columns? I've tested with release 7.9.3 and it seems we still cannot add Row and Col tags inside the ValidatedForm. |
Can you please take a look at this future PR? #19560 Best |
I'm not the react expert but I would say with basic functionality like arranging form in multiple columns which were working fine in previous releases of Jhipster has been removed on the latest version is definitely a concern. I have tried the solution provided by @emilpaw but I've recently found that automated code generated for entities is not the same as the user management module where @emilpaw has provided the reference code. I'm having numerous difficulties like when we arrange the form in multiple columns, and when we click on View or Edit from the list page and when we go back and click on "New", the state is not cleared and it always shows the previously viewed or edited value on the new form. This is definitely a huge change on each of the Jhipster-generated front-end pages if we need this basic re-arranging functionality, which I believe does not make any sense. I would appreciate it if anyone provides the reference for entity-generated pages and the entity would be simple like first name, last name, and address where first name and last name are arranged in a 50 percent column on first raw. |
Overview of the issue
If we try to arrange form fields in column view in other words if we wrap ValidatedField to Row and Col tag, the field values are not populated during Edit mode of the page and the same is true for insert mode. On the existing user management page, we are trying to see Last Name and First Name in one row, and we are unable to see the value or update the value if we realign these fields in multiple columns views. A screenshot of the sample view and code is attached to the following stackoverflow link.
https://i.stack.imgur.com/VfJ2R.png
Motivation for or Use Case
We were able to arrange the fields and wrap them into Row, Col as needed on the earlier version of Jhipster, and it seems that we are not able to arrange the form layout anymore with ValidatedForm and ValidatedField.
Reproduce the error
Under the user management page update TSX file, try to wrap Last Name and First Name in one row with two columns as like on the screenshot attached to the StackOverflow link provided.
Related issues
I've searched on Stackoverflow and couldn't find any related issue.
Suggest a Fix
It seems that ValidatedForm is not considering Row as a child in React-jhipster and only looking for direct child ValidatedField, hence any element wrapped on
JHipster Version(s)
7.3.1
JHipster configuration
.yo-rc.json file
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryNo error on entity creation.
Browsers and Operating System
Windows 11, Google Chrome, Edge
The text was updated successfully, but these errors were encountered: