Foundset ChangeListeners in grid.

Forum to discuss the new web client version of Servoy.

Foundset ChangeListeners in grid.

Postby jay.rao » Mon Jul 23, 2018 10:08 am

Hi,

I wanted to know how exactly the bootstrap-components Table works without the foundset change listeners. I had a look at the component but did not find any specific code related to foundset change listeners in bootstrap table like we have it in servoyextra components table.
There is a specific scenario where I face a problem in our custom grid component, I have two grid placed on a form where the top grid contains foundset 1 and grid 2 contains relatedFoundset. When the dataprovider in one of the foundset is changed the dataprovider in relatedFoundset should change as well(this means reflection in the grid component), it works as expected but I wanted to know that when the foundset of the grid is changed the foundsetListeners specifically returns foundsetTypeConstants.NOTIFY_VIEW_PORT_ROW_UPDATES_RECEIVED while at the same time when it comes to 2nd grid with related foundset it returns foundsetTypeConstants.NOTIFY_VIEW_PORT_ROWS_COMPLETELY_CHANGED. So even if the data now has been updated in both the foundsets is there a reason why 2nd foundset says rows_completely_changed instead of row_updates.


Thanks in advance
jay.rao
 
Posts: 59
Joined: Mon Apr 10, 2017 1:32 pm

Re: Foundset ChangeListeners in grid.

Postby jay.rao » Tue Aug 21, 2018 11:40 am

Hi,
I am facing issues with our custom components with listeners. I want to know what is it that I am doing wrong with the listener implementation. I have forms which use our custom component, I update the data the component refreshes and updates our data as well although in this specific form it doesn't work well. I added servoyextra-table and I works normally, I am attaching ss which shows my issue.
Foundsetjs.PNG


Here in the servoyextra-table we get this update in the foundset and the listener works with VIEWPORTROWS_UPDATED while in our component we don't get this serverJSONValue and hence listener doesn't know about any update. On other forms, it works with all the listeners as at works in servoyextra-table but there are some rare scenarios where it fails.
Can you please shed the light on how does it works and how can I improve the situation?
You do not have the required permissions to view the files attached to this post.
jay.rao
 
Posts: 59
Joined: Mon Apr 10, 2017 1:32 pm

Re: Foundset ChangeListeners in grid.

Postby Andrei Costescu » Tue Aug 21, 2018 1:09 pm

About the first message: was the column that changed it's content used when declaring the relation?
If you attach a small sample I could look into it a bit to see if there is a reason or if it is something that could be improved...

About the second message: in that img. I see you receive a granular update of type change for viewport index 2. That means that data changed in row 2 of viewport. The component should then update the equivalent in the UI of the second row in the viewport. Not sure what doesn't work correctly or what happens differently sometimes from what you described. Can you try to make it clearer? Maybe also with a small sample or with what exactly happens vs. what you think should happen and why?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Foundset ChangeListeners in grid.

Postby jay.rao » Tue Aug 21, 2018 1:37 pm

Hi Andrei,

Thank you for the response. Actually, the screenshot that is attached is from servoyextra-table where it works fine while in our component we don't receive this serverJSONvalue or any update for exactly the same form(change listener is not destroyed). Although when we update something on other forms it works normally same as it works in servoyextra-table.
I would try to create a sample solution meanwhile that can simulate exactly this situation.
jay.rao
 
Posts: 59
Joined: Mon Apr 10, 2017 1:32 pm

Re: Foundset ChangeListeners in grid.

Postby Andrei Costescu » Tue Aug 21, 2018 1:44 pm

Yes, that would be best.
In the exact same situation the foundset property should send the same notifications.
But it could be that it has different viewport bounds for example (that row is no longer in the property's viewport) or something like that.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 1 guest