rjsf-team / react-jsonschema-form

A React component for building Web forms from JSON Schema.
https://rjsf-team.github.io/react-jsonschema-form/
Apache License 2.0
14.31k stars 2.19k forks source link

Dynamic dropdown from within form or from an external source #2228

Open mrehder opened 3 years ago

mrehder commented 3 years ago

Prerequisites

Description

A widget for a dynamic dropdown list - dynamic set of enums - from within the form data or from an external lookup would be vey useful for tying together difference datasets across forms.

The typeahead components from the Extras project is good for large lists and for where you have some idea of the content syntax. However this isn't a great UI for simple lists or for where the syntax of the values is unfamiliar to the user or for where seeing the complete set of options is useful.

Steps to Reproduce

Expected behavior

ui:field: dynamicPicklist dynamicPicklist: { formDataList: }

or

ui:field: dynamicPicklist dynamicPicklist: { url: search: }

Actual behavior

Version

mrehder commented 2 years ago

Further... For an internal lookup into the form data, there would be a path provided to the JSON data which holds a set of enum values. The path would ideally be a form of pointer which has relative reference values, which JSONata has (and JSON path doesn't). For example: ui:field: localDataPicklist { source: } where is something like JSONata syntax PostalInfo.Places.name PostalInfo.Places[type='Country'].name %.%.ISOCodes[countryName='Norway'].code (for the field PostalInfo.Places.ISOCode)

Options for excluding values, filtering values etc. could be added in the widget declaration.

stale[bot] commented 1 year ago

This issue has been automatically marked as possibly close because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.

nickgros commented 1 year ago

Maybe a duplicate of https://github.com/rjsf-team/react-jsonschema-form/issues/809 ?

mrehder commented 1 year ago

Yes, that would meet the requirements. Too bad there isn't effort to consolidate these contributed widgets (like those from the "extras" project).

From: Nick Grosenbacher @.> Sent: Friday, August 25, 2023 11:38 AM To: rjsf-team/react-jsonschema-form @.> Cc: Michael Rehder @.>; Author @.> Subject: Re: [rjsf-team/react-jsonschema-form] Dynamic dropdown from within form or from an external source (#2228)

CAUTION: This email is from an external source. Please do not open any unknown links or attachments.

Maybe a duplicate of #809https://github.com/rjsf-team/react-jsonschema-form/issues/809 ?

- Reply to this email directly, view it on GitHubhttps://github.com/rjsf-team/react-jsonschema-form/issues/2228#issuecomment-1693554918, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC44PZ77BIDXD6LLNJAMZQ3XXDBD7ANCNFSM4XJIGKTA. You are receiving this because you authored the thread.Message ID: @.**@.>> This email and the information contained herein is proprietary and confidential and subject to the Amdocs Email Terms of Service, which you may review at https://www.amdocs.com/about/email-terms-of-service https://www.amdocs.com/about/email-terms-of-service