Welcome to the nuBuilder Forums!

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

Detect lookup onchange Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
Giu
Posts: 87
Joined: Sat Jan 25, 2014 11:01 am
Has thanked: 9 times

Detect lookup onchange

Unread post by Giu »

Hi, based on the selection done on a lookup, I have to retrieve data from database related to the lookup selection, show it on screen, and use it on my form save. I guess I can use the Display object, but the query depends on the selection of the lookup and starts empty and can change and display must be refreshed.

There are some nuWay to do this? or just capture with javascript the lookup onchange, and fire a procedure with nuRunHiddenPhp+nuAddJavascript combo?
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Detect lookup onchange

Unread post by kev1n »

If the data is part of the lookup form, you can use nuSetFormValue().

Alternatively, you can use a Display object. After the lookup value is changed, call nuRefreshDisplayObject() to update the Display object accordingly.
Giu
Posts: 87
Joined: Sat Jan 25, 2014 11:01 am
Has thanked: 9 times

Re: Detect lookup onchange

Unread post by Giu »

kev1n wrote: Tue May 21, 2024 2:59 pm If the data is part of the lookup form, you can use nuSetFormValue().
Interesting, but is not shown in the lookup browse if this detail is important.
Alternatively, you can use a Display object. After the lookup value is changed, call nuRefreshDisplayObject() to update the Display object accordingly.
Yes, I noticed about this JS function 2 minutes ago, but is not working at all to me.
I have this SQL on my 'prm_negras' display object

Code: Select all

SELECT
 fichas_prm.prm

FROM
    fichas_prm

WHERE
    ((fichas_prm.usuario = '#oponente#'))
and my 'oponente' lookup object CC looks like this
uOrZ2lTVIZ.png
No errors in web console at all. I'm doing correctly?
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: Detect lookup onchange

Unread post by kev1n »

Add the JS code in the LUJS (Lookup JS) event of the lookup object.
Giu
Posts: 87
Joined: Sat Jan 25, 2014 11:01 am
Has thanked: 9 times

Re: Detect lookup onchange

Unread post by Giu »

Perfect!! Thanks.

(I just discovered the thanks and Accept answer buttons :D )
Post Reply