5.94 dropdown value selected if field is set to required

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
User avatar
aarlauskas
Veteran Member
Posts: 127
Joined: 2019-04-28 18:03
Location: Medway, UK

5.94 dropdown value selected if field is set to required

Post by aarlauskas » 2021-02-07 23:34

Hi, I have upgraded from 5.84 to 5.94. I have many tables with simple dropdown fields (not lookups) like Status (Complete;;Incomplete or Collected;;Returned). These fields are set as Required and when adding new record these fields has no default value, means user is forced to select the value or no record is saved. After upgrade to 5.94 all of these fields now display first dropdown field value already which totally messing up the processing of the form. Users arent prompted to select correct value and simply saves the record with wrong status... Can you advise please?

User avatar
aarlauskas
Veteran Member
Posts: 127
Joined: 2019-04-28 18:03
Location: Medway, UK

Re: 5.94 dropdown value selected if field is set to required

Post by aarlauskas » 2021-02-08 20:19

Anybody has any advise on this please?

pfrumkin
Veteran Member
Posts: 157
Joined: 2020-02-18 17:58
Location: Albuquerque, New Mexico USA

Re: 5.94 dropdown value selected if field is set to required

Post by pfrumkin » 2021-02-09 17:31

Hi,

I am not seeing a difference between 5.84 and 5.94 in this respect.

I just played with it a little, I could see a difference if the last entry in the dropdown list had a ;; delimiter. For instance, my list is

Code: Select all

In Good Standing;;Conditionally Banned;;Lifetime Banned;;
As it is here, it defaults to empty. If I remove the ;; after Lifetime Banned, the default is the first value.

Hope that helps.

~Paul

User avatar
aarlauskas
Veteran Member
Posts: 127
Joined: 2019-04-28 18:03
Location: Medway, UK

Re: 5.94 dropdown value selected if field is set to required

Post by aarlauskas » 2021-02-09 19:44

Hi, thanks for your reply. I have tried delimeters in all possible ways to no avail. It works fine if I dont tick this field as 'Required' in AG, then the field is blank by default. If I tick 'Required' then it writes the first value of the dropdown field without asking.

I also tried to generate the new application without any custom code and it does exactly the same..

Also tried changing from Drop-Down to Radio Button with 'Required' field ticked, this then doesnt have any value selected, but if I select the value with the Radio button, I keep getting popup message stating this field is required, even with the value already selected......!! Oh dear.

Can developers please confirm this is now the case in your new 5.9X range? is there a fix available? Please dont ignore, I need to get this working..

User avatar
aarlauskas
Veteran Member
Posts: 127
Joined: 2019-04-28 18:03
Location: Medway, UK

Re: 5.94 dropdown value selected if field is set to required

Post by aarlauskas » 2021-02-09 20:26

Just to add to my last message, I have downgraded back to 5.84 and it works as it should.. this just confirms the bug with 5.94.

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: 5.94 dropdown value selected if field is set to required

Post by SkayyHH » 2021-02-10 07:36

Hi,

I can confirm that.

An entry of the list is automatically stored.

It is not necessarily the first one in the list. There is an alphabetical sorting. But the first one, which is stored in appgini in the list values. In the app, this can also be in a different place in the list if it is not the first alphabetically.

This is only the case when the field is required.


For now you can use a work around yourself.

Start the list in appgini with a space and ;;

Code: Select all

 ;;first;;second
This works for me.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: 5.94 dropdown value selected if field is set to required

Post by jsetzer » 2021-02-10 07:59

Hi,

I have seen that the search for that specific solution has already taken a lot of time and there seems to be no progress. So this is just an idea for solving the problem by using a different approach.

Do you require multi-select?

If not, replace that static options list by an additional lookup table. This can be done in 5 minutes and you get additional value like possibility of sorting, filtering, localization, colors, icons, customization of labels.

Usually my lookup-tables for such situations look like this:

Example

task_states
  • id
  • code
    This matches the values of your option-list and can be used for comparison or finding a status by code later on.
    Having a separate column next to name allows internationalization (i18n)
    Why having an additional "code" column instead of using the primary key? Much more flexibility and maintainability of your code. "id" might be different in a different database but "code" can be customized easily - well, "id" can also be changed later on but this is not as easy as just changing the "code" value
  • name
    Localized / Customized text. Sometimes (from my experience) customers have special wording. So for example they may not want so see "CONFIRMED" but "Approved". You can easily customize the displayed caption the that status without changing the options-list in your project and generate and deploy by just renaming the status record.
  • description
    (optional) You can use this to indicate what this status is for
  • position
    (optional) for sorting in advanced SQL query of the lookup
  • is_enabled
    (optional) This allows you to remove items from the list without deleting them in advanced SQL query of the lookup
  • color
    (optional)
    and
  • background_color
    (optional) You can use the color-fields for rendering badges like traffic-light.
    I sometimes include those fields in an additional "label" field (calculated field) for rendering an indicator using mySQL concat in the calculation: <span class="label label-default" style="background-color: green;">Confirmed</span>
Just my 5cents. Trying to help you getting forward with that bug even before there will be a fixed version. Writing this answer here probably took more time than replacing the static options list by a lookup.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: 5.94 dropdown value selected if field is set to required

Post by SkayyHH » 2021-02-10 11:52

This is also certainly the better way. With my solution you would have a mandatory field where you could select an empty option (the blanc field). Then the mandatory field makes no sense anymore ;-)

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: 5.94 dropdown value selected if field is set to required

Post by pbottcher » 2021-02-10 15:23

Hi Arni,

are you sure you do not have set a dafault value in AppGini, or using any code to handle the dropdown?

I could not reproduce your problem.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

User avatar
aarlauskas
Veteran Member
Posts: 127
Joined: 2019-04-28 18:03
Location: Medway, UK

Re: 5.94 dropdown value selected if field is set to required

Post by aarlauskas » 2021-02-10 21:00

Many Thanks for your replies! Appreciate that. Jan, I always value your detailed advice, thanks. The solution is flexible of course, just worried how will this affect the records, the existing status fields that are already on DB. I guess its only one way to find out. Will deal with it later in a week.

Hi Pascal, definitely no defaults set. I’ve generated the app into new location without any custom code in there just to test, still the same. Works fine if don’t set the field as required. Also tried deleting the field completely and creating new one in 5.94. My .axps created with earlier versions up to 5.84 and never had an issue. I did not try creating app from scratch with 5.94 and see the behavior, will just stick with above suggestions. That would be too much if I had to rebuild my apps from scratch...

Thanks Kai for your advice, appreciate that buddy, I'll give it a try.

Post Reply