PxPlus User Forum

Main Board => Discussions => Webster Plus => Topic started by: Zereliq on October 17, 2022, 09:19:34 AM

Title: Event within grid not triggering
Post by: Zereliq on October 17, 2022, 09:19:34 AM
I have a grid with multiple listboxes, the listboxes all look as followed:

[list project_code$ (_lock$) event=uren.pxp@update_col][data rowsep=/ valsep=: text=(project_tbl$)][/list]

they all have the same event so uren/pxp@update_col
but whenever i triggered one of the events, the other listboxes will not trigger the events anymore onchange.
(page starts loading on first change in listbox, doesnt load on change second time onchange listbox this include changing the same listbox twice doesnt work the second time)

Is there a different way of triggering these events onchange for a listbox?
Title: Re: Event within grid not triggering
Post by: Mike King on October 20, 2022, 10:21:13 AM
We were able to replicate this issue and have corrected the JavaScript libraries so if you have downloaded them you will need to re-download again otherwise simply refresh your forms (ctrl-F5 on most browsers) and the event should work.

In order to test this we did make a sample Webster application and I have attached a ZIP file to this message
Title: Re: Event within grid not triggering
Post by: Zereliq on October 25, 2022, 08:30:16 AM
Hey Mike,

First of all thanks for taking the time to look into this bug/issue, but sadly after updating my local libraries and using ctrl+f5 on the page with the issue i still get the same problem.  After triggering an event with a listbox it doesnt trigger any other listbox events after. (only after a refresh or trigger from another element will it work again)

Would love to hear your suggestions  ;D
Title: Re: Event within grid not triggering
Post by: Mike King on October 25, 2022, 10:04:33 AM
Did you try the setup I included in the zip file?

Also what release are you using? We addressed the issue for version 19 -- are you using v18?
Title: Re: Event within grid not triggering
Post by: Zereliq on October 25, 2022, 11:21:31 AM
Hey Mike,

Thanks for the suggestion I resolved some issues with our licensekey and checked for updates (updates which returned we're running on the latest version) inside pxplus.exe, however after having done that it seems that i can not update the library nor get the library on a fresh installation. It seems to stop after having some files added in the docroot > lib folder (see attachment two) and after a long while gives me a error #3 (see attachment one)
Title: Re: Event within grid not triggering
Post by: Mike King on October 25, 2022, 11:30:35 AM
That looks like perhaps the sysimage zip file did not come down cleanly.  Try deleting (or renaming to allow for restore if needed) the docroot/lib directory and try to download again.
Title: Re: Event within grid not triggering
Post by: Mike King on October 31, 2022, 03:50:31 PM
Were you able to get your list boxes inside a grid to fire events?
Title: Re: Event within grid not triggering
Post by: Zereliq on November 08, 2022, 05:46:58 AM
Hi Mike,

Sorry for the long awaited respons, I have gotten the listboxes to trigger events so that works fine now
although I have gotten repeated errors on trying to download the library locally so i decided to keep that globally.

May I make one more suggestion when it comes to grids in Webster+:
Whenever you edit/ update or remove a row it will reset the tabindex, therefor making it sometimes a bit annoying to work in a grid structure.
Now I have checked to fix this with some .JS but sadly without succes, maybe this would be a nice touch in the default webster.js

Thanks again  ;) ;D
Title: Re: Event within grid not triggering
Post by: Mike King on November 08, 2022, 10:31:54 AM
We will have a look at the issue with the tabindex and also checkout the download library. 
Just to confirm, what version PxPlus are you running?
Title: Re: Event within grid not triggering
Post by: Zereliq on November 09, 2022, 06:17:03 AM
running PxPlus 2022 (Version 19.10), as far as i know latest version (we updated when you released the webster updates)
Title: Re: Event within grid not triggering
Post by: Mike King on November 21, 2022, 05:11:48 PM
Can you advise what the issue is with tabindex?  We have tried a number of variations and it seemed to work for us.
Title: Re: Event within grid not triggering
Post by: Zereliq on November 23, 2022, 03:59:38 AM
Hey Mike,

Inside a grid; When adding or changing a value for example
Code: [Select]
WRITE ([grid],rec=[obj])
or
%WEBSTER'UPDATE(FIELD$,VALUE$,GRID$,ROW)
will both reset the tabindex back to the first column in the first row instead of staying where its suppost to be.

See the GIF attachment i have recorded what happends in the current situation.

Title: Re: Event within grid not triggering
Post by: Mike King on November 25, 2022, 08:08:26 AM
Okay, it appears the issue you are changing the cell contents for the cell that currently has focus?

Title: Re: Event within grid not triggering
Post by: Mike King on November 25, 2022, 09:51:19 AM
As a follow up, If you are updating the cell that currently has focus such that the cell (or row) has to be reloaded you generally will have to use the 'Focus(variable_name$) method to set the focus to the cell/control.

There is no easy way for the system to guess at where you want focus to go when making changes to control that currently has focus so when doing this is is a good idea to force focus.

When forcing focus to a grid cell the name of the variable will be GGGGG-RRR-VVVVV where GGGGG Is the name of the grid, RRR is the row number, and VVVVV is the variable name (e.g. "mygrid-3-accttype$")
Title: Re: Event within grid not triggering
Post by: Mike King on November 28, 2022, 02:15:52 PM
We made a small change to the webster JavaScript on our server.  Please refresh your browser (CTRL-F5) and see if that resolves your focus issue.
Title: Re: Event within grid not triggering
Post by: Zereliq on November 29, 2022, 03:10:34 AM
Hey Mike,

This seems to have changed some things positively, but still seem to have some odd behaviour,
It does now work when focussed on items like listbox and input, but still resets it when shifting focus from the changing grid-item to a button or link.
Maybe that still needs a touchup but other than that better than before!



Title: Re: Event within grid not triggering
Post by: Mike King on November 29, 2022, 01:42:20 PM
Are you changing the cell with focus to a button/link or changing another cell on the same row?

Also how are you changing the cell type?  If you are simply hiding one control in the cell and then making another visible, then the system would have no idea as to where to send focus since the control with focus still exists -- its just hidden.

The logic is designed such that if the control with focus gets deleted and re-created we put focus back on the control.  But if the control still exists and is hidden, then the system will try to put focus back on it.  So if you hide an input field in a grid cell and create (or make visible) a button to replace it, the system has no way to know where to send focus.
Title: Re: Event within grid not triggering
Post by: Zereliq on November 30, 2022, 02:53:10 AM
Hey Mike,

I have attached a gif that should show what i am talking about.

Whenever I change the cell content and tab once putting the tab focus from the changing cell to the
Code: [Select]
[link] in the next cell it doesn't keep the focus on set item,
but whenever i change the cell content and tab twice putting the tab focus from the changing cell to a
Code: [Select]
[list] two cells over it does work correctly.

As you can see, The focus does stay on the list item, but doesnt on the link (and or button has the same behaviour)

Thanks again for taking the time to look into this  ;D
Title: Re: Event within grid not triggering
Post by: Mike King on December 01, 2022, 09:32:26 AM
For others following along this thread.  We forwarded a minor change to the binding logic that addressed this loss of focus issue on buttons/links that reload the grid they are part of.  The change will included in our next update.