Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Default values (select type field) Topic is solved

Questions related to using nuBuilder Forte.
uzlander_ya
Posts: 5
Joined: Thu Apr 24, 2025 8:00 pm
Has thanked: 2 times

Default values (select type field)

Unread post by uzlander_ya »

Hi community! Recently stumbled upon a need to set defaults to (or rather preserve/save the value) in the select field.
Originally the select field gets its value pairs from an sql statement (just pull id|someName from other entities) and as the whole record(row with other fields as well) is saved, navigating to list view i see all the fields there filled as expected but now clicking the row (back to editing) i see all in place except for that select field which is empty. PhpMyAdmin shows the value persisted ok.
First I was thinking about some js workaround to fill the value back on (edit)form load, but probably there should be some more elegant solution to this issue.
Please people help, i'll give screenshots or some more details if needed
steven
Posts: 369
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 52 times
Been thanked: 52 times

Re: Default values (select type field)

Unread post by steven »

Hi uzlander_ya,

Can you show us some screenshots?


Steven
A short post is a good post.
Uzlander
Posts: 36
Joined: Sat Jul 08, 2023 10:21 am
Has thanked: 1 time
Been thanked: 2 times

Re: Default values (select type field)

Unread post by Uzlander »

Sure, the screenshot - about the select field sql source, and then - short video
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Default values (select type field)

Unread post by kev1n »

statia is an object on the form or how is it set?
Uzlander
Posts: 36
Joined: Sat Jul 08, 2023 10:21 am
Has thanked: 1 time
Been thanked: 2 times

Re: Default values (select type field)

Unread post by Uzlander »

'statia' is kindof CATEGORIES option list (radio buttons above) which filters out SUBCATEGORIES (select field, which derives its value list from say 'Categories' table). Its just i saw radio buttons bo be more inuitive/nicer looking to represent top level categories
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Default values (select type field)

Unread post by kev1n »

Ensure that the value of 'statia' is also set for existing records, or save it to a nuBuilder object/table with the ID 'statia', since it appears that the hash cookie does not retain the value when the form is reloaded.
Uzlander
Posts: 36
Joined: Sat Jul 08, 2023 10:21 am
Has thanked: 1 time
Been thanked: 2 times

Re: Default values (select type field)

Unread post by Uzlander »

red underlined field (screenshot) represents the id for each radio button, which in turn filters out my Subcategories select.
On radio change there's a little uneditable field indicating current radio id.
Arranged a bit tangled way sorry))
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Default values (select type field)

Unread post by kev1n »

Would it be possible for you to either export your database (with any confidential data removed) or just share the form using the cloner tool, along with the associated tables?
Uzlander
Posts: 36
Joined: Sat Jul 08, 2023 10:21 am
Has thanked: 1 time
Been thanked: 2 times

Re: Default values (select type field)

Unread post by Uzlander »

Sure i can export it (all the data is dummy), i believe its Database->Backup generated sql file, shall i attach it below or better to email.. ?
So i reviwed the names/variables i've messed so far (renamed #statia# to #kateg#) brought it to consistency as much as i could.
But my utmost suspicion now is the following:
My radio buttons (representing Categories) are not in the db table, they're kinda just on the frontend to fill out 'kateg' text field(which in turn exists in its underlying db table). And i've configured (by scripting, on edit/add form load) to check the one in accordance to 'kateg' field value existing (there's #kateg# hash of course) or in case of adding new record there's still default one to be checked via javascript, so the the Subcategories select always has some #kateg# to have its list filtered out.
Having observed that upon (Category)radio change the prior selected Subcategory clears(renewing its value list), it seems like my empty select issue is result of that script flawed side effect
Uzlander
Posts: 36
Joined: Sat Jul 08, 2023 10:21 am
Has thanked: 1 time
Been thanked: 2 times

Re: Default values (select type field)

Unread post by Uzlander »

dump file
You do not have the required permissions to view the files attached to this post.
Post Reply