struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sami Dalouche (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WW-2311) Dojo 1.0.0 support with Progressive Javascript Enhancement Plugin/Theme
Date Wed, 13 Feb 2008 18:53:39 GMT

    [ https://issues.apache.org/struts/browse/WW-2311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43207#action_43207
] 

Sami Dalouche commented on WW-2311:
-----------------------------------

BTW, I am wondering : what is the struts-preferred way to generate the JavaScript code that
is needed to create the widgets ? For instance, when writing the javascript manually, it is
often necessary to write stuff such as :

dijit.create(WidgetClass, { param1 : "bla", param2 : "bli" };

When generating this code with freemarker, I have found it much more easier (to avoid handling
the commas) to generate code such as :
params = {};
param.param1 = "bla";
param.param2 = "bli";

Which way do you guys prefer ? readable ftl files or readable generated JS ?

> Dojo 1.0.0 support with Progressive Javascript Enhancement Plugin/Theme
> -----------------------------------------------------------------------
>
>                 Key: WW-2311
>                 URL: https://issues.apache.org/struts/browse/WW-2311
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: Plugin - Dojo Tags
>            Reporter: Sami Dalouche
>             Fix For: Future
>
>         Attachments: dojo.tar.gz, funala.tar.gz
>
>
> It would be nice to have a set of Dojo taglib templates that :
> 1] are (X)HTML compliant (no non-standard dojoType=.. attribute)
> 2] follow the Progressive Javascript enhancement philosophy (http://domscripting.com/presentations/xtech2006/)
: the tags should fallback to pure HTML mechanisms without javascript
> I have attached what I consider the starting point of this : a few templates, based on
the css_xhtml theme on which I have added dojo/dijit programmatic calls to enhance the html
widgets.
> For instance, the textfield template (text.ftl) is exactly the same as css_xhtml's text.ftl,
except that it can "enhance" the HTML text field into :
> - a CurrencyTextBox
> - a NumberTextBox
> - a ValidationTextBox
> - a NumberSpinner
> (I currently use non documented taglib attributes to do that, so the templates are only
useable from Freemarker views...)
> So, you would create a number spinner  like that :
> <@s.textfield 
> 		theme="dojo"
> 		labelposition="left"
> 		label="%{getText('labelblabla')}"
> 		required="true"
> 		name="numberOfWhatever"
> 		dojoType="NumberSpinner"
> 		dojoMinConstraint="1" 
> 		/>
> What is currently missing :
> - a LOT of dijit's parameters are not exposed (constraints, etc)
> - a LOT of widjits are not exposed (tree, ajax grid, etc..)
> - the creation of dojo's overrides should probably be completly computer in Freemarker
/ Java to create a compact JS representation, instead of currently relying on javascript to
create this variable and progressively populate it
> Feel free to reuse this work under whatever license suits you. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message