myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Ray" <julianj...@yahoo.com>
Subject RE: Need web pages for both PCs and palms... (JSF? ADF?...)
Date Mon, 15 May 2006 15:29:56 GMT
Hi Ivan,

We use value bindings where possible to affect how common JSF components
work and where not possible, we provide two (or more) sets of features and
render the appropriate one on a switch. Note that each JSP has a backing
bean and we push as much of the logic into abstract classes to simplyfy the
code and automate the functionality.

Here is some code from our backing beans base classes. Note that the
listener gets the request before the JSF servlet and injects parameters into
the request. This could probably be done with a PhaseListener as well.

    /*
     * Returns the browser capability which is set via the
BrowserCapabilityFilter filter.
     */
    protected Integer getBrowserCapability() {
		Integer browserCapability =
Constants.BROWSER_FULL_CAPABILITY;
		if
(getContext().getExternalContext().getSessionMap().containsKey("BROWSER_CAPA
BILITY")) {
			browserCapability = (Integer)
getContext().getExternalContext().getSessionMap().get("BROWSER_CAPABILITY");
		}
		return browserCapability;
    }


    /*
     * Returns the maximum number of rows to display on a page. Value
     * depends on the browser type
     */
    public Integer getMaxRows() {
    	if
(Constants.BROWSER_FULL_CAPABILITY.equals(getBrowserCapability())) {
    		return new Integer(MAX_ROWS_FULL);
    	} else {
    		return new Integer(MAX_ROWS_LIMITED);
    	}
    }

-----Original Message-----
From: I. Venuti [mailto:i.venuti@caribel.it] 
Sent: Monday, May 15, 2006 11:11 AM
To: MyFaces Discussion
Subject: Re: Need web pages for both PCs and palms... (JSF? ADF?...)


> Our services use a listener to determine (actually make a best guess) 
> at the browser client and then loads stylesheets optimized for the 
> browser (using tomahawk's stylesheet control) and turns on/off 
> functionality in the pages and adjusts client/server updates etc.
>
>   
very interesting!
I think that the listener is looking for a specific infos in the request
header for guessing the browser client type, isn't it?

Also the stylesheet control allows different rendering for different
clients.
What isn't very clear id the client/server updates and on/off
dunctionalities.
I think that these actions are setted before the page is rendered; so how
you can achieve it?
Maybe using a different navigation path?

Thank a lot also to the other feedbacks!

Have a nice day

Ivan


Mime
View raw message