-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Allow marking complete form as disabled / read only #854
Comments
I don't have a strong opinion about this. The standard HTML form controls support |
I'm also interested in this, it's useful for displaying whole form with only some fields enabled based on various conditions. Maybe hide it behind some |
Now thinking about it again I think that I agree that it would make sense to not implement it like this but instead make it easier to generate a |
I am trying to make a view mode which displays the data but does not allow editing. So far I've gone with something like this,
I think going beyond standard HTML controls is necessary because the whole form is getting rendered by this component. Unless there is a way to disable or remove the 'Submit' button that I am not seeing. IMO having a readonly attribute on the form could remove the submit button and set all the inner controls to readonly as well sort of like a display mode. |
For anyone looking into this in the future, the originally desired behavior (that of making the entire form readonly) can easily be accomplished, as follows: |
@comwt Does that remove the submit button? |
I tried it and it didn't disable or remove submit button. Also trying to figure out a way to do so... |
This got implemented eventually anyhow as #1056. |
@eberkund @YingXue If you need to remove the submit button, you can just pass an empty div to the |
Prerequisites
Description
I would like to be able to render a complete form
readonly
ordisabled
. This is to show it to users later as a validation step. As far as I can tell this is not possible right now and I would have to add the respective property (ui:disabled
/ui:readonly
) for each input in theUISchema
.Would you agree that it might be useful to just set this globally on the form? If so I'd start preparing a pull request for it.
The text was updated successfully, but these errors were encountered: