IBM Support

Ajax enabled settings for jQuery mobile portlets

Question & Answer


Question

Why is ajaxEnabled attribute turned off for jQuery mobile portlets developed using IBM Rational Application Developer for WebSphere Software 9.0?

Cause

The jQuery mobile application includes a navigation system that loads pages into the Document Object Model (DOM) through Ajax; instead of default page request. This effects the navigation system of IBM WebSphere Portal application.

When you navigate to other portal pages from a page that contains jQuery mobile portlet, the Ajax navigation mechanism of the jQuery Mobile uses the page navigation reference link to formulate an Ajax request; instead of allowing the default link behavior of requesting the page reference link from the browser to load the page .

This causes portal pages to load incorrectly, where jQuery theme modules are copied to the non-jQuery mobile portal pages.

Answer

To override this behavior, $.mobile.ajaxEnabled attribute is set to false to load the pages completely.

Note:
This attribute change is done in the js_init.jspf file that is autogenerated when you create a jQuery enabled portlet project.

If you select the Generate in the portlet JSP option in the JavaScript Toolkit Settings in the Web 2.0 features dialog, while creating the jQuery enabled portlet project, then this setting is automatically applied in the portlet JSP file.

By turning off the ajaxEnabled attribute, form submissions and navigation using reference links are performed non-ajaxically. For more information on jQuery page navigation model, review the jQuery Mobile's navigation model page.

[{"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Portal \/ Portlet Development","Platform":[{"code":"PF033","label":"Windows"}],"Version":"9.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21636287