AjaxRefresh Plangrid

AjaxRefresh Plangrid

  
I want to use the plangrid from the community in my application. Due to the fact that this component is rather old and upgrade from a version before 4.2 it does not support Ajax refresh. But when using this plangrid in a 5.1 environment I want only refresh the grid and not the whole page. Is there a way to refactor the plangrid so it accepts ajaxrefresh? I tried to do this but when I use the AjaxRefresh, the plangrid dissapears and does not come back. keeps presenting the word "loading".

Any idea how to get this working?

Thanks,

Dick Dokter

Hi Dick,

Have you tried refreshing a Container that you place around the plangrid? Does it still not work?

If that's the case, I would recommend creating a simple eSpace/solution that represents the problem, and post it here, so that someone can look into it. I would expect it to work, so if it doesn't work, and there doesn't seem to be something wrong, it could very well be a bug, or something that needs to be changed in the Plangrid.

Regards,

Paulo tavares
Hi,
The component is probably using the page onload event to perform some initializations. If the content is being retrieved by ajax, this won't work... You should be able to confirm this by searching the demo source code for 'onload' or 'registerEvent'...

If that's the case, you should perform this initialization in another way, not dependent on the onload event - probably you should return in your ajax content an expression containing the <script> code needed to perform the initialization.

Hope this helps.
Thanks Both Paulo's for your suggestions.

First I tried to refresh the container around the plangrid. Without succes.

What Paulo Ramos is suggesting that there is a script that initialises the grid is true.
there is a Init script with :

// OnLoad
registerEvent(window, 'load', PlanGrid_FireUp" + GridCode + ");


So the problem is clear, this onload event is not triggered after an AjaxRefresh.
My problem is, I am not that familiair with using Javasript in Outsystems.

@ Paulo Ramos: Can you explain more specific how I can get the plangrid working with AjaxRefresh.

@ Paulo Tavares: You could do me a graet favor, and not only me I think, if the plangrid component in the download section will be modified to work with AjaxRefresh.

Thanks in advance,

Dick Dokter
Hi,

Try adding an expression (with Escape Content = No) to the end of the contained being refreshed (not sure about the GridCode parameter, but it should be the same being used in the plangrid webblock):

"<script language='javascript'>

PlanGrid_FireUp" + GridCode + "();

</script>"
Hi Dick,

Did Paulo's suggestion do the trick?

Regards,

Paulo Tavares
Hi,

Unfortunately Paulo's suggestion did not do the trick. I am still not able to use the plangrid with AjaxRefresh.

any other suggestions?

Greetings,

Dick Dokter
Hi Dick,

Try using the "RunJavascript" action right after your Ajax Refresh. It is a public action from the HttpRequestHandler extension that runs javascript on the browser after/during an Ajax request

Thanks all for your help, espacially Gonçalo.

The RunJavaScript is doing the trick.

Regards,

Dick Dokter
Now I have a simular problem with AjaxRefreshing the treeview which is available as component in the community.

Just runnig the javascript to initialize seems not enough. The problem here is that the TreeviewWidget Javascript is dynamicly injecting a variable varNodes into the Javascript of the webpage which contains al the nodes of the tree.

Any suggestion how to overcome this problem.

Best Regards,

Dick Dokter