ShowTable of Contents
One of the best ways to troubleshoot AJAX and Smart Refresh issues is to recreate the problem with Firebug (or similar browser debugger) enabled.
Watch the browser debugger console for messages from the JS that supports Smart Refresh / Partial Page Refresh
Watch for other JS on the page causing errors.
A full page refresh (where partial is intended) is often accompanied by a console message that an unexpected response was received, after which it will refresh the entire browser page in an attempt to recover from the situation.
This can happen if a portal session times out (and the full page refresh should then take you to the portal login page)
This can happen if the portlet sent back a page other than what the UI control was expecting to receive back
This can happen if the portlet action encountered an unhandled exception and did not return an HTML page (or returned a default error page)
Look at the browser debugger's network tab (check "persist" if necessary/available, in the network tab) to see what the response was, to help determine what went wrong.
Look in the WEB-INF/logs/event.log in the deployed WAR, and/or Portal/WAS SystemOut.log and SystemErr.log for more indications of errors.
Another technique that can be used is to to add a client event handler to the model.
You can configure the builder to run a script that displays a console message when it hits an AJAX event.
The builder has the following events available:
Smart Refresh and Model Container
If you're using model containers and you find that the contained model is not refreshing as you expect, there are a couple of ways to fix this.
The first is to fire an event to be handled by the parent. The parent handles this with a client event handler to refresh the model container.
The second way to do this is to set the action builder (button, link, html event action, image button, etc) to break containment. The break containment setting is a check box that can be found in the advanced section of the builder.
Partial Page Refresh breaks after an upgrade
If you've upgraded your application from an older version of Portlet Factory to a newer version of Portlet Factory or Web Experience Factory and you find that your Partial Page Refresh (PPR) is not working properly, there are two approaches your can take.
The first is to set a property in override.properties. You can find the file override.properties in your project under WEB-INF/config. If you don't have a copy, create a new text file in that location and save it with the name override.properties.
Add the property:
This will cause the application to use the older servlet design for PPR.
The other approach is to update your application to use smart refresh instead. This will be much more time consuming but will allow the application to use the better refresh option of smart refresh. To do this, you will need to update the port-action behavior of each action builder (links, buttons, image buttons, html event actions, etc) and set it to default or smart refresh. When your application is upgraded the default theme will not have smart refresh configured, so you will need to edit the theme and add smart refresh. This way you won't need to set smart refresh for action builders with a post-action behavior that is set to "default". For new applications, smart refresh will be used by default, so it's not necessary to set each action builder to use it.
NOTE: You should avoid using PPR and Smart Refresh in the same application. This can break the refreshing of the application.
Smart Refresh and paging cause portlet to take over the portal page
If you're using paging links or buttons and this causes the portal page to lose its theme and essentially the portlet takes over the portal page there are two things to check.
Ensure that the page has a tag that encloses the data page tag and the paging tag.
Ensure that the data page tag and the paging tag are wrapped by a tag. The smart refresh code looks to find a common parent tag for these two tags. If one cannot be found, then the resulting behavior is that the portlet takes over the portal page.