Hey @AndyOfLinux , Welcome!
You probably want to use a Cell to fetch the data, and then build and populate the SelectField
in the Success
component. I have posted a couple of links below, but search the forums for “SelectField” or similar and you should find a list of similar questions to help you out.
BTW, the tutorial is fairly quick and dives into the general way that RW works. It is definately worth working through, if you have not yet.
Please let us know if you still need guidance.
Regards,
B
Hello
I have a Cell which generates a SelectField, which has the users it gets by a query as options.
I also pass field of an object as the value for the SelectField, which works fine.
export const Success = (
{ users }: CellSuccessProps<FindUsers>,
value,
label
) => {
return (
<SelectField
name="name"
defaultValue={value}
className="rw-input"
<UserSelectionCell value={props.note?.executorId} label="Test Label" />
My Problem is, I also have to pass the label…
Hi,
I want to enhance the generated RW Scaffolds (that are basically forms) and add ability to select an option for related data. ex. if User had a Favorite Movie assigned to the account that is Many to one relationship, but instead of displaying user.favoriteMoveId that RW would generate I want to display a list of all movies with default option pointing to currently selected one if it’s present.
If not I want the field to be a SelectField type with all possible ‘Movies’ as options.
The othe…
Hello
I’m fairly new to RedwoodJS and so far I really like it.
Right now I’m trying to get the SelectField form component to list the users which I get from a query.
<SelectField
name="executorId"
defaultValue={props.note?.executorId}
className="rw-input"
errorClassName="rw-input rw-input-error"
validation={{
required: true,
}}
>
{users.map((user) => (
<>
<option key={user.id} value={user.id}>
…