You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by schneidc <si...@gmx.de> on 2010/04/22 13:41:45 UTC

Re: [Trinidad] Use Dojo with Trinidad

Pretty old thread, though seems to be the best place for my question.

I've been playing around with Dojo and Trinidad, I tried Daniels sample page
but for reasons I don't understand (yet) it doesn't work. The html-elements
are there but nevertheless the page appears blank. 

But I got another example working:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<tr:document xmlns:ui="http://java.sun.com/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:tr="http://myfaces.apache.org/trinidad"
	title="Dojo Integration to Trinidad">

	<f:facet name="metaContainer">
		<script type="text/javascript" djConfig="parseOnLoad: true"
		
src="#{facesContext.externalContext.requestContextPath}/dojo-release-1.4.2/dojo/dojo.js.uncompressed.js"
/>
		<script>
       		dojo.require("dijit.form.DateTextBox");
		</script>
		<link rel="stylesheet" type="text/css"
		
href="#{facesContext.externalContext.requestContextPath}/dojo-release-1.4.2/dijit/themes/tundra/tundra.css"
/>
	</f:facet>

	<h:form>
		<input dojoType="dijit.form.DateTextBox" />
	</h:form>
</tr:document>

What I can't understand is that the tundra.css styles are being ignored, at
least partially. The input field for the date is decorated correctly but the
calendar itself looks pretty ugly.

Anybody an idea, why's that?

Thanks
Simon
-- 
View this message in context: http://old.nabble.com/-Trinidad--Use-Dojo-with-Trinidad-tp13968204p28327727.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: [Trinidad] Use Dojo with Trinidad

Posted by Werner Punz <we...@gmail.com>.
Am 23.04.10 12:10, schrieb schneidc:
>
> Sweet, setting the body style to "tundra" did the trick.
>
> And thanks for the link, I'll have a look at dojofaces.
>
> Simon
Feel free to ask questions regarding the low level dojo stuff here
(never used dojo faces though, Ganesh one of our committers is the main 
person behind that project)

I did quite a lot of integration work between Dojo and JSF, which 
unfortunately never saw the light of day.


Werner


Re: [Trinidad] Use Dojo with Trinidad

Posted by schneidc <si...@gmx.de>.
Sweet, setting the body style to "tundra" did the trick.

And thanks for the link, I'll have a look at dojofaces.

Simon
-- 
View this message in context: http://old.nabble.com/-Trinidad--Use-Dojo-with-Trinidad-tp13968204p28339538.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: [Trinidad] Use Dojo with Trinidad

Posted by Werner Punz <we...@gmail.com>.
Have you set your body styleClass to Tundra?

Classical problem if you apply dojo, that you forget
to add the style class to the body element.

Dijit usually works works over constructs like that stylewise

body.tundra ... .widgetType .subElement

etc....
Also highly recommendable if you have a load of controls on your page
do not use the dijit parsing system use the manual startup of the 
controls and push it into dojo.addOnLoad
example dojo.addOnLoad(function () {
	mydateWidget = new dijit.form.DateTextBox("myId", {<attributes>});	
});

Have in mind you can mix Dojo and Trinidad, I did that successfully in 
the past, but Dojo is highly sensitive on how and when you initialized 
its elements and also certain mixing combinations do not like each 
other, like the dialog and html editor.

Also there are some issues like if you want to use a dojo button with 
jsf, then you should combine it in JSF 2 with a component have the 
submit properly issued (or provide a simulation of what the standard 
buttons submit)

And at least back then you could not use a certain combination of widgets.
Also have a look at dojo faces http://www.dojofaces.org/

I have put my own dojo jsf components project on hold of it.
(among private reasons like having become a father and hence not being 
able to support a huge complib project in my sparetime)

That is mostly what you encounter if you use dojo with jsf.


Werner



Am 22.04.10 13:41, schrieb schneidc:
>
> Pretty old thread, though seems to be the best place for my question.
>
> I've been playing around with Dojo and Trinidad, I tried Daniels sample page
> but for reasons I don't understand (yet) it doesn't work. The html-elements
> are there but nevertheless the page appears blank.
>
> But I got another example working:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <tr:document xmlns:ui="http://java.sun.com/facelets"
> 	xmlns:h="http://java.sun.com/jsf/html"
> 	xmlns:f="http://java.sun.com/jsf/core"
> 	xmlns:tr="http://myfaces.apache.org/trinidad"
> 	title="Dojo Integration to Trinidad">
>
> 	<f:facet name="metaContainer">
> 		<script type="text/javascript" djConfig="parseOnLoad: true"
> 		
> src="#{facesContext.externalContext.requestContextPath}/dojo-release-1.4.2/dojo/dojo.js.uncompressed.js"
> />
> 		<script>
>         		dojo.require("dijit.form.DateTextBox");
> 		</script>
> 		<link rel="stylesheet" type="text/css"
> 		
> href="#{facesContext.externalContext.requestContextPath}/dojo-release-1.4.2/dijit/themes/tundra/tundra.css"
> />
> 	</f:facet>
>
> 	<h:form>
> 		<input dojoType="dijit.form.DateTextBox" />
> 	</h:form>
> </tr:document>
>
> What I can't understand is that the tundra.css styles are being ignored, at
> least partially. The input field for the date is decorated correctly but the
> calendar itself looks pretty ugly.
>
> Anybody an idea, why's that?
>
> Thanks
> Simon