While I don't have a lot of experience in this I agree that different devices have wildly different CSS and Javascript support and simple CSS adaptation will rarely be enough, but a component could adapt its markup for different devices in some scenarios.
I had the same thought amount a similar approach to localization using tml names. Did you look into this? I think there may be a lot of issues due to page caching in T5 and other subtleties. For example, using the API you can locate a specific block in a page by name. How would it know which tml to use in this case? So I think T5 helps separate concerns and assists in building multi-device apps (ie. it's a decent framework to do this in), but the framework itself could do more if this becomes something many web developers end up having to build for in future. Regards, Alfie. -----Original Message----- From: Carl Crowder [mailto:[email protected]] Sent: 02 September 2009 22:36 To: Tapestry users Subject: Re: Supporting multiple devices, eg. browser + mobile + TV Thiago H. de Paula Figueiredo wrote: > Em Wed, 02 Sep 2009 18:10:56 -0300, Alfie Kirkpatrick > <[email protected]> escreveu: > >> Am wondering about ways to support this scenario cleanly in T5, where >> visual layout is very different per device but the page classes could be >> quite similar (clearly this depends to a large extent on whether devices >> have radically different page flows and layouts). > > CSS solves most of the solution. Take a look at media queries > (http://www.w3.org/TR/css3-mediaqueries/). > Regarding Tapestry itself, for issues that can't be solved by using CSS > itself, I would take advantage of the layout component pattern (some > parts of the template could be omitted or replaced) and having a service > and a component to tell me what kind of device did the request. This really isn't true unless you only support more modern phones. We do a similar thing and we've steered away from Tapestry to support lower end phones because they all have their own crap browser with their own stupid CSS misinterpretations. We have a list as long as your arm of idiotic things blackberry browsers do. I once tried to work out how best to do this. My main ideas were something similar to localisation where we had a "Home_nokia.tml" type thing. Also, overriding MarkupWriter to write DIVs with a certain class instead of P tags. I still believe Tapestry is the best framework to do it in based on the few I've encountered. It's something that is so fiddly for the crappier phones that however you choose to do it will be a pain in the arse. Alfie: let me know how you get on. We may be trying something similar in the future. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
