Re: Supporting multiple devices, eg. browser + mobile + TV

2009-09-03 Thread Robin K.

myapp/components // the ordinatry
myapp/wap/components / the wap overwrites

We also already test this solution. It can be done for pages with not so
much pain. For components it was a lot more complex. We finally abandonned
this solution.



Sebastian Hennebrueder wrote:
> 
> The approach followed by Ramaze (a Ruby based framework) is to deliver 
> different content depending on the suffix.
> 
> I like the approach but Tapestry probably doesn't fit in very well with 
> such a concept as content is created by Java Code or templates both in 
> pages and components.
> 
> The idea to setup a separate application introduces a lot of redundant
> code.
> 
> What about a shadow directory structure holding components and templates 
> I would like to overwrite.
> 
> myapp/components // the ordinatry
> myapp/wap/components / the wap overwrites
> ...
> This allows to reuse what you can and replace what you need.
> 
> Depending on the request you dispatch to one namespace or another.
> 
> 
> Best Regards / Viele Grüße
> 
> Sebastian Hennebrueder
> -
> Software Developer and Trainer for Hibernate / Java Persistence
> http://www.laliluna.de
> 
> 
> 
> Komiwes Robin schrieb:
>> Hi,
>> 
>> We've done that here, and it wasn't a real pleasure party.
>> 
>> but yes, for each component and pages, we can use the same system than
>> localization: i.e. : index.tml, index_fr.tml, index_iphone_fr.tml
>> 
>> You've got to decorate a lot of internals services (PagePool,
>> ComponentTemplateSource), hack the locale and prey for no API changes in
>> the future. :-)
>> 
>> I agree with others comments, a web for desktop browser should never be
>> the same web than a web for SmartPhones. You should do a specific
>> app/page for other devices.
>> 
>> 
>> Robin K.
>> - Atos Worldline
>> 
>> 
>> -Message d'origine-
>> De : Christian Edward Gruber [mailto:christianedwardgru...@gmail.com]
>> Envoyé : jeudi 3 septembre 2009 06:04
>> À : Tapestry users
>> Objet : Re: Supporting multiple devices, eg. browser + mobile + TV
>> 
>> I'd go further - interfaces for the blind, for the hard of hearing -
>> these are still more clients.  If the user experience is going to be
>> substantially altered, then you can "convert" from some meta-interface
>> and have everything automatically expressed, but that often requires
>> that the framework make trade-off choices that are better handled by a
>> good User Experience designer.  A lot of what makes a good iPhone-
>> ready application is a different user-flow that's consistent with the
>> device's unique properties.  Shoe-horning a normal web-interface will
>> often result in a bad iPhone experience (though better than WAP
>> phones, to be sure).
>> 
>> cheers,
>> Christian.
>> 
>> On 2009-09-02, at 23:13 , Thiago H. de Paula Figueiredo wrote:
>> 
>>> Em Wed, 02 Sep 2009 20:36:21 -0300, Alfie Kirkpatrick
>>> >>> escreveu:
>>>> 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.
>>> What exactly could the framework do? There's a framework that does
>>> it: JSF. Then it got too complicated. Of course, we could be smarter
>>> than the JSF creators. :) But I agree with Howard: different devices
>>> with different capabilities, different frontends.
>>>
>>> --
>>> Thiago H. de Paula Figueiredo
>>> Independent Java consultant, developer, and instructor
>>> http://www.arsmachina.com.br/thiago
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>> 
>> Christian Edward Gruber
>> e-mail: christianedwardgru...@gmail.com
>> weblog: http://www.geekinasuit.com/
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
>> 
>> 
>> 
>> Ce message et les pièces jointes sont confidentiels et réservés à l'usage
>> exclusif de ses destinataires. Il peut également être protégé par 

Re: Global stylesheets and Javascripts documentation proposal

2009-08-07 Thread Robin K.

Hi!

Correct me if I'm wrong but the createAsset method seems to be a "no need"
because this job is already made by RenderSupport.

So, I think the following code is enough:


   /** 
 * Insert global stylesheets and JavaScript files 
 * @param configuration 
 * @param symbolSource 
 * @param assetSource 
 */
public void
contributeMarkupRenderer(OrderedConfiguration
configuration,

final SymbolSource symbolSource, final AssetSource assetSource)
{

MarkupRendererFilter injectDefaultStylesheet = new 
MarkupRendererFilter()
{
public void renderMarkup(MarkupWriter writer, MarkupRenderer 
renderer)
{
RenderSupport renderSupport = 
environment.peek(RenderSupport.class);


renderSupport.addStylesheetLink("de/laliluna/example/components/mystyles.css");

renderer.renderMarkup(writer);
}
};

MarkupRendererFilter injectDefaultJavaScripts = new 
MarkupRendererFilter()
{
public void renderMarkup(MarkupWriter writer, MarkupRenderer 
renderer)
{

RenderSupport renderSupport = 
environment.peek(RenderSupport.class);


renderSupport.addScriptLink("de/laliluna/example/components/myscript.js",
"de/laliluna/example/pages/input/myvalidators.js");

renderer.renderMarkup(writer);
}
};

configuration.add("InjectMyDefaultStyleheet", injectDefaultStylesheet,
"after:RenderSupport");
configuration.add("InjectMyDefaultJavaScripts", 
injectDefaultJavaScripts,
"after:RenderSupport");
}



Sebastian Hennebrueder wrote:
> 
> Hello,
> 
> I could not find documentation on how to add stylesheets and JavaScript 
> files to all pages.
> the wiki page 
> (http://wiki.apache.org/tapestry/Tapestry5HowToAddValidators)  is 
> questioning if this is possible as well.
> 
> 
> I build the following working solution from exploring the Tapestry code. 
> Can someone please review the code. I am not sure, if this is the 
> correct way. I would like to add it to the wiki. In my opinion it should 
> be in the default documentation as well.
> 
> Possible target pages in the wiki
> http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained
> 
> 
> Snippet from my AppModule
> 
> /**
>  * Insert global stylesheets and JavaScript files
>  * @param configuration
>  * @param symbolSource
>  * @param assetSource
>  */
> public void 
> contributeMarkupRenderer(OrderedConfiguration 
> configuration,
> 
>  final SymbolSource symbolSource, final AssetSource assetSource) {
> 
> MarkupRendererFilter injectDefaultStylesheet = new 
> MarkupRendererFilter() {
> public void renderMarkup(MarkupWriter writer, MarkupRenderer 
> renderer) {
> String globalCss[] = 
> {"de/laliluna/example/components/mystyles.css"};
> RenderSupport renderSupport = 
> environment.peek(RenderSupport.class);
> 
> List assets = createAssets(globalCss, 
> symbolSource, assetSource);
> 
> for (Asset stylesheet : assets) {
> renderSupport.addStylesheetLink(stylesheet, null);
> }
> 
> renderer.renderMarkup(writer);
> }
> };
> 
> MarkupRendererFilter injectDefaultJavaScripts = new 
> MarkupRendererFilter() {
> public void renderMarkup(MarkupWriter writer, MarkupRenderer 
> renderer) {
> String globalCss[] = 
> {"de/laliluna/example/components/myscript.js", 
> "de/laliluna/example/pages/input/myvalidators.js"};
> RenderSupport renderSupport = 
> environment.peek(RenderSupport.class);
> 
> List assets = createAssets(globalCss, 
> symbolSource, assetSource);
> for (Asset stylesheet : assets) {
> renderSupport.addScriptLink(stylesheet);
> }
> 
> renderer.renderMarkup(writer);
> }
> };
> 
> 
> configuration.add("InjectMyDefaultStyleheet", 
> injectDefaultStylesheet, "after:RenderSupport");
> configuration.add("InjectMyDefaultJavaScripts", 
> injectDefaultJavaScripts, "after:RenderSupport");
> }
> 
> private List createAssets(String[] globalCss, SymbolSource 
> symbolSource, AssetSource assetSource) {
> List assets = CollectionFactory.newList();
> 
> for (String path : globalCss) {
> String expanded = symbolSource.expandSymbols(path);
> Asset asset = assetSource.getAsset(null, expanded, null);
> assets.add(asset);
> }
> return assets;
> }
> 
> -- 
> Best Regards / Viele Grüße
> 
> Sebastian Hennebrueder
> -
> Software Developer and Trainer for Hibernate / Java Persistence
> http://www.laliluna.de
> 
> 
> 
> 
> ---

Re: [T5.1] change style of client side validation

2009-07-31 Thread Robin K.

I already made that.

We were trying to change the popup position , style and associated event.

You just have to create a news JS that will override some of the existing
Tapestry.js class and method.
Look the Tapestry.ErrorPopup class in particular.

You will need some Prototype functions:
- Object.extend(dest, src) -> alteredDest
 see: http://www.prototypejs.org/api/object/extend
- create([superclass][, methods...]) -> Class
see: http://www.prototypejs.org/api/class/create 



To automatically add a new JS file to all your pages, you've got to
contribute to MarkupRenderer:

public void
contributeMarkupRenderer(OrderedConfiguration
configuration, final Environment environment) {
MarkupRendererFilter myScriptGlobalSupport = new MarkupRendererFilter()
{
public void renderMarkup(MarkupWriter writer, MarkupRenderer
renderer) {
RenderSupport support = environment.peek(RenderSupport.class);
support.addClasspathScriptLink(new String[]
{"path/to/my/script.js","path/to/another/script.js"});
renderer.renderMarkup(writer);
}
};
configuration.add("myScriptGlobalSupport",
"myScriptGlobalSupport","after:RenderSupport");
}
 


Regards,

Robin K
-- Atos Worldline


Michał Jedynak wrote:
> 
> Hello! 
> 
> Is there an easy way to change style of client side validation? 
> I would like to have the same look as in server side (not a bubble), but I
> don't want to turn it off (by setting ' clientValidation="false" ').
> 
> --
> Michał
> 

-- 
View this message in context: 
http://www.nabble.com/-T5.1--change-style-of-client-side-validation-tp24755039p24755490.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Have a Master Checkbox For T5 Grid Component

2009-07-31 Thread Robin K.

Hi Sandeep,

You may try to use the  tag to customize the display of
your grid header cell.

Here is a small quote for the official documentation:
"The header for a column may be overridden in the same way, using a
parameter name of propertyheader . The parameter block will provide the
content inside the  element. The provided block is responsible for
providing any links or icons related to sorting."
http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html

Regards,

Robin K.
-- Atos Worldline



sandeepraj singh wrote:
> 
> Hi Guys,
> I wanted to have a master CheckBox while using the Grid Component. That
> CheckBox would be present at the Header Row of Grid Components, and allow
> to check the CheckBoxes below to be checked or unchecked.  
> Is there any way else to do it except for Copying the entire Grid
> Component Source Code to MYOWNGRID and then making changes to GridColoumn
> Component inside Grid Source Code that would be copied.
> 
> Any Pointers would be of great help
> 
> Thanks
> Sandy
> 

-- 
View this message in context: 
http://www.nabble.com/Have-a-Master-Checkbox-For-T5-Grid-Component-tp24752416p24752886.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org