Skip to end of metadata
Go to start of metadata

Ajax Improvements

Improvements to ActionField for Lightbox enhancements

1.    Add property 'displayResponseInLightbox' to display the response contents in a lightbox instead of the current window.

a. Add this property to the ActionField and add to data attributes
b. ajaxSubmitForm will pass this as returnType to ajaxSubmitFullOpts.
c. ajaxSubmitFullOpts will send this over to the server.
d. ftl check for returntype and add code for lightbox by wrapping with a div with appropriate handler name.



If I am wrapping this in ftl, how do I know if the request was to update page, view or component? I am not sure if we can use the return type as the model here. We would need to provide the original return type in ajaxRequest but also some how return to the browser the fact that the response has to be handled in a lightbox. I believe right now this is being done by setting a form property, but then if I am doing update component using ajax, how do I use the form Property. An alternate would be to set on the same div which has the update handler name, a data attribute indicating that the content has to be handled in a light box?

e. Add another handler to AjaxReturnTypes (displayInLightbox)
f. The handler will invoke showLighBoxContent() for content inside the above div.

Assumption: The content inside of the div with lightbox handler will be text/html.  I am asking this since there is a showLightboxUrl() too.

 2.   Add property 'showLightboxGroup' to display a group that have been configured to display in a lightbox. This would not trigger a server side call. - This will be taken care of by the work being done by Claus and Dan.

Improvements for Component Refresh

3.    Add 'refreshTimer' property to component base. The value will be a time in seconds that the component will automatically be refreshed. -
4.    Add support for refreshing multiple components at a time. Add 'alsoRefreshComponents' property that can be configured with a component that has a refresh condition.

a. Add this property to component base. It would be a list of components.
b. Pass this list as another parameter to setupOnChangeRefresh which in turn calls setupRefreshCheck(). Call retrieveComponent on each of the components passed in as the list.

Question: Will the method to call be the same for all the components or will we need to pass a map of componentIds and methodToCall from the ftl.

Smarter Ajax Returns

     To support things like the dialog box return, or navigating to other views we need to make our Ajax returns 'smarter'. This essentially means when sending back an ajax response, we need to write data that is used by the ajax call to determine how the response should be handled. The handling options needs are:
5.  Open in Lightbox - The content being returned should be opened in a lightbox - Same as 1.


  • No labels