[Data Grid] [Bug] Refreshing breaks auto generated columns

Forge Component
(32)
Published on 4 Dec (6 days ago) by OutSystems R&D
32 votes
Published on 4 Dec (6 days ago) by OutSystems R&D

Hey guys,

When using the auto generate columns option, when I refresh the table (for when the user changes input for the rest web service) I lose all the columns (but I do have the correct number of pages/results in the footer). There's just no columns/data visible in the table.

Is this an Ajax Refresh?

And can you clarify what "when the user changes input for the rest web service" means? Are you saying the user changes a parameter that's sent to the REST service?

Yeah that's correct it's an ajax refresh.

I'm sending an ID field with the rest webservice, so the input for RestURL (GridContainer) looks like this:

"https://myserver.com/Module/rest/Demo/GetData?RecordId="+RecordId

I'm using a dropdown, which on change will display a list of records matching on the selection of the dropdown (like a master-detail relationship). 

The GridContainer is located in a webblock, this webblock receives the RecordId as an input, when changing the dropdown (which is in the webscreen itself), I refresh the entire webblock to refresh the RecordId.

I'm running on P10 by the way, perhaps I'm doing something wrong here?

Hey Joey,

Can you please show us an app (plus resources needed) where the issue is happening? :) 

Hey Rita, 

I will try to reproduce it in P11, currently running on P10 enterprise, so I can't really share that module :(

Ok so I was able to reproduce :) 

Take a look:

https://claring.outsystemscloud.com/DemoDataGrid/WebScreen1.aspx?StaticAId=1

Try changing the dropdown on screen to see what happens.

https://claring.outsystemscloud.com/DemoDataGrid/WebScreen1.aspx?StaticAId=2

When entering the screen with another input it does show that there is data present and that this is working, but for some reason the columns are not generated.

I added the OML to this post.

Hey Joey,

Sorry for the delay, I've looked at the issue. I can't see to be able to give you a simple and easy work around. We're adding this to our backlog and hopefully provide a fix soon.

Thank you so much for the OML and for reporting it!

Rita Dias wrote:

Hey Joey,

Sorry for the delay, I've looked at the issue. I can't see to be able to give you a simple and easy work around. We're adding this to our backlog and hopefully provide a fix soon.

Thank you so much for the OML and for reporting it!


Thanks alot!

If I come across a easy workaround I'll post it here in the meantime.
Hope it gets fixed soon :)

Joey Moree wrote:

Rita Dias wrote:

Hey Joey,

Sorry for the delay, I've looked at the issue. I can't see to be able to give you a simple and easy work around. We're adding this to our backlog and hopefully provide a fix soon.

Thank you so much for the OML and for reporting it!


Thanks alot!

If I come across a easy workaround I'll post it here in the meantime.
Hope it gets fixed soon :)

Hi Joey,

I have the same trouble, have you solved it now? I really need help.

thank you.


Wang Jiaqin wrote:

Joey Moree wrote:

Rita Dias wrote:

Hey Joey,

Sorry for the delay, I've looked at the issue. I can't see to be able to give you a simple and easy work around. We're adding this to our backlog and hopefully provide a fix soon.

Thank you so much for the OML and for reporting it!


Thanks alot!

If I come across a easy workaround I'll post it here in the meantime.
Hope it gets fixed soon :)

Hi Joey,

I have the same trouble, have you solved it now? I really need help.

thank you.



Hey Wang,


I did come across a sort of workaround...

I wrapped it inside an iframe and refreshed the iframe.

Hi,

Can we please bump this a bit on the backlog, I'm also having the same issue with just normal fields, not even auto generated fields. Data loads at start, but if contained in a tab widget and switching tabs, the data disappears, or even contained in a web block and the web block gets refreshed.

Thanks

Hi Guys. 

We're also having this issue. We have page filters which should filter this table, so need to ajax refresh it after changing the data, but this appears to be killing it also..

Can we get an update on when this may be implemented?

Joey Moree wrote:

Wang Jiaqin wrote:

Joey Moree wrote:

Rita Dias wrote:

Hey Joey,

Sorry for the delay, I've looked at the issue. I can't see to be able to give you a simple and easy work around. We're adding this to our backlog and hopefully provide a fix soon.

Thank you so much for the OML and for reporting it!


Thanks alot!

If I come across a easy workaround I'll post it here in the meantime.
Hope it gets fixed soon :)

Hi Joey,

I have the same trouble, have you solved it now? I really need help.

thank you.



Hey Wang,


I did come across a sort of workaround...

I wrapped it inside an iframe and refreshed the iframe.


I just ran into this same issue and have the same use case.   When our users change selections we call the REST with updated parameters but the Data Grid is empty.  (except for the counts)   I'm not entirely sure how to wrap a web block in an Iframe, any hints on how you made that work?

Hi all, can we have an update on this. We face the same issues as described above.

Or is there an easy workaround to fix this problem?

Wieger Kloppenburg wrote:

Hi all, can we have an update on this. We face the same issues as described above.

Or is there an easy workaround to fix this problem?

Not sure this is a good work-around, but works for my use case.   

We have multiple grids hidden or displayed with a series of If statements which are controlled by the report type selected.   I created session variables for the report type and input parameters that feed the API that provides the data, then the search button reloads the current page vs using the Ajax refresh.   The screen prep updates the REST URL via a switch statement controlled by the report type, and the report type session param controls which grid is actually displayed.   This way only one grid/API is called vs pulling back data for a bunch of grids that aren't displayed.


Josh Herron wrote:

Wieger Kloppenburg wrote:

Hi all, can we have an update on this. We face the same issues as described above.

Or is there an easy workaround to fix this problem?

Not sure this is a good work-around, but works for my use case.   

We have multiple grids hidden or displayed with a series of If statements which are controlled by the report type selected.   I created session variables for the report type and input parameters that feed the API that provides the data, then the search button reloads the current page vs using the Ajax refresh.   The screen prep updates the REST URL via a switch statement controlled by the report type, and the report type session param controls which grid is actually displayed.   This way only one grid/API is called vs pulling back data for a bunch of grids that aren't displayed.


Hi Josh, thanks for your reply. So if I only refresh / updates the REST url the datagrid will refresh? Or is that not the case? If I do a hard reset on the page; the grid will update but will start over from the beginning on the list instead of the position were I was. Is there an option to do this?

Wieger Kloppenburg wrote:

Josh Herron wrote:

Wieger Kloppenburg wrote:

...

Or is there an easy workaround to fix this problem?

Not sure this is a good work-around, but works for my use case.   

...   This way only one grid/API is called vs pulling back data for a bunch of grids that aren't displayed.


Hi Josh, thanks for your reply. .... Is there an option to do this?

It really depends on your use case.   If you have a single Datagrid on your page and it needs to be updated as users select different options, you can use the option below.   

In my case I have 5 grids that are contained in the page,and displayed or hidden based on Session.ReportType.  

So when a user changes some filters I Ajax refresh only the container that holds the report filters.   As each filter gets changed by the user the filter value is stored in a session variable.   (so it will remain in scope after the page is reloaded)   When the user clicks the "Load Report" button I fire a Javascript that reloads the entire page.   

When the page loads the preparation runs and a switch statement determines which URL should be updated.   (if Session.ReportType = CallReport then we update the URL for that Datagrid)  then when the page is rendered the If condition for the CallReport is true and that DataGrid uses the updated URL to pull the proper data from the REST service.

It's not an elegant solution, but it gets me around the Ajax refresh breaking the Datagrid.

Ah thanks for your update! The last picture made it clear what you do and I think that will also suit my case. 

Another question, is it possible to refresh the data but that the grid will stay on the row which was edited? So it will not auto scroll to the top of the grid?