This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

jsf for mobile development

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I'm trying to use JSF for mobile view (not an app, just something friendly on the browser)

I'm currently using mojarra 2.2.19 and the standard html and core library. I realize when using something like

the code looks good on desktop, but terrible on mobile

is there a better jsf implementation to use? or how should I approach this ?
 
Saloon Keeper
Posts: 25459
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Used to be that mobile device screens were about 320x240 pixels and you had to design interfaces specifically for them. These days, we have phones the size of drive-in movie screens and it's less of a concern. Then again, so many websites don't concern themselves with the fact that between them, their traffic-trackers, ad-blocker-blockers, pop-up loud animations, last-minute insertions/refreshes that cause the entire display to bounce around like a ping-pong match etc. etc. etc that the whole site is a torment to use.

There are 2 approaches to making a webapp mobile-friendly and they're basically the same whether using JSF or not. One is to define alternative screens, depending on the display capabilities of the client. You can then select which version of a screen to present using JSF's View Navigation services.

The other is to strategically lay out the page using CSS so that it can adapt to different client displays. Key strategies for doing this are things like using relative positioning rather than absolute metrics (whether in pixels, cm, or inches). Also useful is to use flexible layout controls to allow for "packing". You can see this capability in action in the lowly HTML <TABLE> tag, where, if the table doesn't fit the display horizontally, it will attempt to re-arrange cell contents vertically. You can fine-tune stuff like this using things like CSS min-width and max-width attributes.

JSF is actually very good for stuff like this, although technically, it's not JSF that makes it good. What makes it good is that JSF doesn't attempt to do much control of the appearance of the page, but rather offloads that burden onto CSS. So if you're good with CSS, you can be good with JSF.
 
Ranch Hand
Posts: 45
2
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

what about using different renderers?

Maybe I am wrong, but I think this is one reason why they are existing?

Best regards and thank you,

Uwe
 
Tim Holloway
Saloon Keeper
Posts: 25459
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSF's plug-in renderer mechanism is designed to be the driver for view templates, so you'd have a set of renderers for HTML, a set for WAP, a set for PDF interactive forms-over-the-Internet or whatever.

You wouldn't use it to do variations on a single display protocol. It would inter-mix fine details about the UI with the general driver for the UI.
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic