<cssBindingSet> tags...necessary?
![](http://jazz.net/_images/myphoto/6adf7c5c4cde55c9d80de57a07eeba0a.jpg)
I see in the Web UI book the mention about defining relationships between Javascript and CSS modules through <cssBindingSet> tags. Is this a new requirement? Our code appears to be picking up the correct stylesheets without these definitions (our stylesheets have the same name as the Javascript file and is under the /templates subdirectory).
Also, the book mentions that the nls files should have this format...
({
'whomToGreet': "Whom to greet?",
'greeting': "Hello"
})
Are the parentheses necessary? I assume they're used so that the attributes are defined within their own namespace, but I haven't seen this particular convention used elsewhere in Dojo.
Also, the book mentions that the nls files should have this format...
({
'whomToGreet': "Whom to greet?",
'greeting': "Hello"
})
Are the parentheses necessary? I assume they're used so that the attributes are defined within their own namespace, but I haven't seen this particular convention used elsewhere in Dojo.
6 answers
![](http://jazz.net/_images/myphoto/6adf7c5c4cde55c9d80de57a07eeba0a.jpg)
Yes this is a new requirement. If you have CSS modules that need to be
loaded then they will have to have a CSSBinding defined that associates
them with a js module. Your code may appear to be still picking up the
CSS because there are CSSBindings provided for the Jazz reusable
components that you are using. Just by having a dojo.require() on these
widgets will ensure the CSS for them is loaded.
Take a look at the wiki topic to get more detail on what was changed
https://jazz.net/wiki/bin/view/Main/CssModularityProposal
Richard
jbognar wrote:
loaded then they will have to have a CSSBinding defined that associates
them with a js module. Your code may appear to be still picking up the
CSS because there are CSSBindings provided for the Jazz reusable
components that you are using. Just by having a dojo.require() on these
widgets will ensure the CSS for them is loaded.
Take a look at the wiki topic to get more detail on what was changed
https://jazz.net/wiki/bin/view/Main/CssModularityProposal
Richard
jbognar wrote:
I see in the Web UI book the mention about defining relationships
between Javascript and CSS modules through <cssBindingSet
tags. Is this a new requirement? Our code appears to be picking up
the correct stylesheets without these definitions (our stylesheets
have the same name as the Javascript file and is under the /templates
subdirectory).
Also, the book mentions that the nls files should have this format...
({
'whomToGreet': "Whom to greet?",
'greeting': "Hello"
})
Are the parentheses necessary? I assume they're used so that the
attributes are defined within their own namespace, but I haven't seen
this particular convention used elsewhere in Dojo.
![](http://jazz.net/_images/myphoto/6adf7c5c4cde55c9d80de57a07eeba0a.jpg)
James,
Regarding the nls files. All the nls files that dojo/dijit provide
wrapper with the parentheses. We have assumed that that is the convention.
Richard
jbognar wrote:
Regarding the nls files. All the nls files that dojo/dijit provide
wrapper with the parentheses. We have assumed that that is the convention.
Richard
jbognar wrote:
I see in the Web UI book the mention about defining relationships
between Javascript and CSS modules through <cssBindingSet
tags. Is this a new requirement? Our code appears to be picking up
the correct stylesheets without these definitions (our stylesheets
have the same name as the Javascript file and is under the /templates
subdirectory).
Also, the book mentions that the nls files should have this format...
({
'whomToGreet': "Whom to greet?",
'greeting': "Hello"
})
Are the parentheses necessary? I assume they're used so that the
attributes are defined within their own namespace, but I haven't seen
this particular convention used elsewhere in Dojo.
![](http://jazz.net/_images/myphoto/6adf7c5c4cde55c9d80de57a07eeba0a.jpg)
James,
Regarding the nls files. All the nls files that dojo/dijit provide
wrapper with the parentheses. We have assumed that that is the convention.
Richard
Yes...I've noticed this too. However, whenever bundle files are mentioned in documentation, parentheses are not shown (e.g. http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/i18n/globalization-guidelines/formatting-and-v#textoutput). And it works fine without parentheses.
Not a biggie. I've been unable to determine why they add parentheses to the bundle files. I saw you were doing it, and was hoping you could solve the mystery for me.
![](http://jazz.net/_images/myphoto/6adf7c5c4cde55c9d80de57a07eeba0a.jpg)
Yes this is a new requirement. If you have CSS modules that need to be
loaded then they will have to have a CSSBinding defined that associates
them with a js module. Your code may appear to be still picking up the
CSS because there are CSSBindings provided for the Jazz reusable
components that you are using. Just by having a dojo.require() on these
widgets will ensure the CSS for them is loaded.
Take a look at the wiki topic to get more detail on what was changed
https://jazz.net/wiki/bin/view/Main/CssModularityProposal
Richard
Hrm....that is not the behavior I'm now seeing. I have no cssBindingSet tags specified in my plugin.xml. But all of my CSS files are being picked up when I run our UI inside our development environment.
Now when we build our war file and deploy that into WAS, *THEN* the CSS files are not being picked up.
This is troubling behavior, because as we're developing, we may not know that we're missing cssBindingSet tags until we happen to build and deploy our war file and find that our UI is no longer working as expected.
![](http://jazz.net/_images/myphoto/6adf7c5c4cde55c9d80de57a07eeba0a.jpg)
The CSS should not be getting loaded unless you have CSSBindings
declared. This applies to both development and deployment.
Something sounds wrong with your development setup. If you increase the
logging level to TRACE for the "net.jazz.ajax.internal.style" you should
see alot more information that can help figure out what's going on.
Richard
jbognar wrote:
declared. This applies to both development and deployment.
Something sounds wrong with your development setup. If you increase the
logging level to TRACE for the "net.jazz.ajax.internal.style" you should
see alot more information that can help figure out what's going on.
Richard
jbognar wrote:
backhouswrote:
Yes this is a new requirement. If you have CSS modules that need to
be
loaded then they will have to have a CSSBinding defined that
associates
them with a js module. Your code may appear to be still picking up
the
CSS because there are CSSBindings provided for the Jazz reusable
components that you are using. Just by having a dojo.require() on
these
widgets will ensure the CSS for them is loaded.
Take a look at the wiki topic to get more detail on what was
changed
https://jazz.net/wiki/bin/view/Main/CssModularityProposal
Richard
Hrm....that is not the behavior I'm now seeing. I have no
cssBindingSet tags specified in my plugin.xml. But all of my CSS
files are being picked up when I run our UI inside our development
environment.
Now when we build our war file and deploy that into WAS, *THEN* the
CSS files are not being picked up.
This is troubling behavior, because as we're developing, we may not
know that we're missing cssBindingSet tags until we happen to build
and deploy our war file and find that our UI is no longer working as
expected.
![](http://jazz.net/_images/myphoto/6adf7c5c4cde55c9d80de57a07eeba0a.jpg)
The CSS should not be getting loaded unless you have CSSBindings
declared. This applies to both development and deployment.
Something sounds wrong with your development setup. If you increase the
logging level to TRACE for the "net.jazz.ajax.internal.style" you should
see alot more information that can help figure out what's going on.
Richard
Hrm...yea....ok.....
I have no idea what you're talking about. :P