multi-client web application

Janez Novak

Ranch Hand

Posts: 31

posted 6 years ago

Hi All,

JSF based web application has more than one presentation that is one for desktop browsers and one for mobile devices. Searching web and this forum i found two approaches how to accomplish this:
- Use a framework which will handle mobile UI components (MyFaces Trinidad, PrimeFaces)
- Create new or use existing Rendering kit for mobile devices

Because web application will use ajax my current choice is to use for example PrimeFaces for mobile web application. Intention here is to reuse as much as possible.
I understand that since web application uses ajax those component will not be able to render automatically to mobile web application. Plan is to reuse model and controller in JSF and create new view for mobile devices.

Please suggest if this is good approach or any other best practices regarding mobile web application using JSF.

AJAX only indirectly has to do with rendering. AJAX is mostly about data transfer. However, some mobile devices have only limited JavaScript functionality, so AJAX isn't 100% guaranteed to work.

The ideal approach is definitely to use client-friendly renderkits. The problem, as you've discovered, is that a lot of JSF controlsets only include a desktop HTML renderkit. If you need to support code on mobile devices, ideally you'd have a renderkit that could fall back to non-AJAX solutions when AJAX wasn't availablee.