can only add to first lookup field?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

can only add to first lookup field?

Post by D Oliveira » 2020-01-14 23:53

please look at this image:

https://i.imgur.com/92jyZvc.png

even if i try to "add new" from the second or third or forth... policy it always replace the policy #1, is that a problem with lookups? it only allows to add new to the first lookup field?

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: can only add to first lookup field?

Post by D Oliveira » 2020-01-16 20:02

running appgini 5.76 , just generated a sample from scratch without any of my custom code and this error still persists, it seems to be a bug, has anyone else experienced that?

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

Re: can only add to first lookup field?

Post by jsetzer » 2020-01-16 20:36

Hi,

I've not seen this behaviour before.

Actually, usually I normalize my tables to avoid such binding if possible. But there are projects in which I have tables with maximum 2 similar lookup bindings on the same parent field. This works well in both tables (child-table/parent-table). Honestly, I did not try with more than 2 similar lookups.
  • Did you verify database integrity with model in Admin-Area / "Rebuild fields"? All fields fine?
  • Can you please check if there are any Javascript errors in console tab and post them - if any.
  • You could consider normalizing the clients-table?
No more ideas right now, sorry!
Best,
Jan
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

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: can only add to first lookup field?

Post by D Oliveira » 2020-01-16 20:55

jsetzer wrote:
2020-01-16 20:36
Hi,

I've not seen this behaviour before.

Actually, usually I normalize my tables to avoid such binding if possible. But there are projects in which I have tables with maximum 2 similar lookup bindings on the same parent field. This works well in both tables (child-table/parent-table). Honestly, I did not try with more than 2 similar lookups.
  • Did you verify database integrity with model in Admin-Area / "Rebuild fields"? All fields fine?
  • Can you please check if there are any Javascript errors in console tab and post them - if any.
  • You could consider normalizing the clients-table?
No more ideas right now, sorry!
Best,
Jan
Hi! thanks for trying but I need to bind the client to the policies, there isnt any other structure that would actually fit that.

[*] Did you verify database integrity with model in Admin-Area / "Rebuild fields"? All fields fine?
yes, all good there

[*] Can you please check if there are any Javascript errors in console tab and post them - if any.
no javascript errors, even built a fresh application from the start without any js and this error still persists

[*] You could consider normalizing the clients-table?
tried, and unsucessful :(


here is the .axp file uploaded in case someone can figure it out: https://www.sendspace.com/file/xz4fzh

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

Re: can only add to first lookup field?

Post by jsetzer » 2020-01-16 21:13

Hmm, with AppGini 5.81 I cannot reproduce the reported error.

I can create new policies #1, #2 and #3 using any of the (+) buttons next to the dropdown. Afterwards the created policy exists in the dropdown as expected. After save, those values get restored as expected, too.
chrome_LOyOXZUTA6.png
chrome_LOyOXZUTA6.png (31.12 KiB) Viewed 4602 times
  • Maybe it's related to your outdated version?
  • Or maybe I did not get the problem.
I can only see a small, non-critical display bug:
When hovering over any of the (+) buttons, there is always the identical tooltip from the first combo:
chrome_CJ0XNQ57Hm.png
chrome_CJ0XNQ57Hm.png (27.19 KiB) Viewed 4602 times
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

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: can only add to first lookup field?

Post by D Oliveira » 2020-01-16 21:18

jsetzer wrote:
2020-01-16 21:13
Hmm, with AppGini 5.81 I cannot reproduce the reported error.

I can create new policies #1, #2 and #3 using any of the (+) buttons next to the dropdown. Afterwards the created policy exists in the dropdown as expected. After save, those values get restored as expected, too.

chrome_LOyOXZUTA6.png

  • Maybe it's related to your outdated version?
  • Or maybe I did not get the problem.
I can only see a small, non-critical display bug:
When hovering over any of the (+) buttons, there is always the identical tooltip from the first combo:
chrome_CJ0XNQ57Hm.png
I guess thats some good news, but before spending $ to upgrade I'll just wait to hear from Ahmed to see if there is an easy fix for that, thank you for confirming that info to me, much appreciated

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: can only add to first lookup field?

Post by D Oliveira » 2020-01-16 21:32

upgraded to 5.81, error still happening, but now console shows this:

https://imgur.com/YuKIp9H

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: can only add to first lookup field?

Post by D Oliveira » 2020-01-16 21:43

actually here is the full log:

https://imgur.com/22ZmiFg

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

Re: can only add to first lookup field?

Post by pbottcher » 2020-01-17 06:36

Hi,
I can confirm that this happens on 5.81 as well. Once a new entry for the lookup is created it defaults always to the first lookup for update as the id's for all lookup are identical and hence the first is picked.
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
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: can only add to first lookup field?

Post by onoehring » 2020-01-17 10:26

Hi D Oliveira,

I do not really understand, why you could not normalize your clients table as Jan suggested. IMHO AG provides an easy way to create nice looking pages with master-client records.
I tried to give you a hint by changing your provided file a little. When you generate this, you should be able to add policies as usual to a client (I did not test this).
You can also download the changed axp file here: https://dl.olaf-noehring.de/?t=109f03d4 ... 1349c90661

It looks now like this:
ec202003.png
ec202003.png (32.8 KiB) Viewed 4574 times
Olaf

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: can only add to first lookup field?

Post by D Oliveira » 2020-01-17 13:48

onoehring wrote:
2020-01-17 10:26
Hi D Oliveira,

I do not really understand, why you could not normalize your clients table as Jan suggested. IMHO AG provides an easy way to create nice looking pages with master-client records.
I tried to give you a hint by changing your provided file a little. When you generate this, you should be able to add policies as usual to a client (I did not test this).
You can also download the changed axp file here: https://dl.olaf-noehring.de/?t=109f03d4 ... 1349c90661

It looks now like this:
ec202003.png

Olaf
Thank you for that, I just added a clientID field to the policies table and binded it directly, awesome solution =)

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: can only add to first lookup field?

Post by onoehring » 2020-01-18 08:32

Hi D Oliviera,

great that it seems to work now. From experience I want to add, that if you use normalized tables you do yourself a favour in many places - so my tip: normalize :-)

Olaf

Post Reply