Dojo 0.9.0 and JSF

View: New views
3 Messages — Rating Filter:   Alert me  

Dojo 0.9.0 and JSF

by Scott-181 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
All,
 
I am trying to get a tree control to display on a page.  I am using Facelets, along with JSF 1.2, so my extension is .xhtml. 
 
The same exact page, that I will show below, if viewed as HTML, loads and displays a tree.  I view it as xhtml (thus having it processed by JSF and the facelets view handler), the control will not render.  I just get a blank screen.
 
I'm hoping someone here on this list has tried to do something similar and can tell me what I need to do.  Here is the page:
 
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Sample Tree Control</title>
    <link rel="stylesheet" href="/js/dojo-0.9.0/dijit/themes/tundra/tundra.css" type="text/css"/>
    <link rel="stylesheet" href="/js/dojo-0.9.0/dojo/resources/dojo.css" type="text/css"/>
    <script type="text/javascript" src="/js/dojo-0.9.0/dojo/dojo.js" djConfig="parseOnLoad: true, isDebug: true">
    </script>
    <script type="text/javascript">
          dojo.require( "dojo.data.ItemFileWriteStore" );
          dojo.require( "dijit.Tree" );
</script>
</head>
<body class="tundra">
<div dojoType="dojo.data.ItemFileWriteStore" jsId="mailStore" url="mail/mail.json"></div>
<div dojoType="dijit.Tree" id="mailTree" store="mailStore" labelAttr="label" childrenAttr="folders" query="{type:'folder'}">
</div>
</body>
</html>
 
 
And here is the json data found in mail.json (which I know is being found and loaded). 
 
{
 identifier: 'id',
 label: 'label',
 items: [
  // Hierarchy of folders
  { type: 'folder', id: 'mailbox', label:'Mail Folders', folders: [
   { type: 'folder', id: 'inbox', label:'Inbox', icon:'mailIconFolderInbox' },
   { type: 'folder', id: 'deleted', label:'Trash Can', icon:'mailIconTrashcanFull' },
   { type: 'folder', id: 'save', label:'Save',  folders:[
    { id: 'work', label:'stuff for work'},
    { id: 'fun', label:'stuff for fun'}
   ]}
  ]}
 ]
}
Again, the same page not preprocessed by JSF and facelets displays a tree.  What is going on?
 

Re: Dojo 0.9.0 and JSF

by noah-22 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Add <f:view contentType="text/html"> around your template.  Firefox
ignores the non-standard attributes dojo uses when it gets served
xhtml, which is the default for Facelets.

On 10/11/07, Scott <jackett_dad@...> wrote:

>
> All,
>
> I am trying to get a tree control to display on a page.  I am using
> Facelets, along with JSF 1.2, so my extension is .xhtml.
>
> The same exact page, that I will show below, if viewed as HTML, loads and
> displays a tree.  I view it as xhtml (thus having it processed by JSF and
> the facelets view handler), the control will not render.  I just get a blank
> screen.
>
> I'm hoping someone here on this list has tried to do something similar and
> can tell me what I need to do.  Here is the page:
>
>
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
>     <title>Sample Tree Control</title>
>     <link rel="stylesheet"
> href="/js/dojo-0.9.0/dijit/themes/tundra/tundra.css"
> type="text/css"/>
>     <link rel="stylesheet" href="/js/dojo-0.9.0/dojo/resources/dojo.css"
> type="text/css"/>
>     <script type="text/javascript" src="/js/dojo-0.9.0/dojo/dojo.js"
> djConfig="parseOnLoad: true, isDebug: true">
>     </script>
>     <script type="text/javascript">
>           dojo.require( "dojo.data.ItemFileWriteStore" );
>           dojo.require( "dijit.Tree" );
> </script>
> </head>
> <body class="tundra">
> <div dojoType="dojo.data.ItemFileWriteStore" jsId="mailStore"
> url="mail/mail.json"></div>
> <div dojoType="dijit.Tree" id="mailTree" store="mailStore" labelAttr="label"
> childrenAttr="folders" query="{type:'folder'}">
> </div>
> </body>
> </html>
>
>
> And here is the json data found in mail.json (which I know is being found
> and loaded).
>
> {
>  identifier: 'id',
>  label: 'label',
>  items: [
>   // Hierarchy of folders
>   { type: 'folder', id: 'mailbox', label:'Mail Folders', folders: [
>    { type: 'folder', id: 'inbox', label:'Inbox', icon:'mailIconFolderInbox'
> },
>    { type: 'folder', id: 'deleted', label:'Trash Can',
> icon:'mailIconTrashcanFull' },
>    { type: 'folder', id: 'save', label:'Save',  folders:[
>     { id: 'work', label:'stuff for work'},
>     { id: 'fun', label:'stuff for fun'}
>    ]}
>   ]}
>  ]
> }
>
> Again, the same page not preprocessed by JSF and facelets displays a tree.
> What is going on?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Parent Message unknown Re: Dojo 0.9.0 and JSF

by Scott-181 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Noah,
 
That is exactly the problem.  It's working great now.
 
Thanks!
 
Scott

----- Original Message ----
From: noah <iamnoah@...>
To: users@...
Sent: Thursday, October 11, 2007 8:18:40 PM
Subject: Re: Dojo 0.9.0 and JSF

Add <f:view contentType="text/html"> around your template.  Firefox
ignores the non-standard attributes dojo uses when it gets served
xhtml, which is the default for Facelets.

On 10/11/07, Scott <jackett_dad@...> wrote:

>
> All,
>
> I am trying to get a tree control to display on a page.  I am using
> Facelets, along with JSF 1.2, so my extension is .xhtml.
>
> The same exact page, that I will show below, if viewed as HTML, loads and
> displays a tree.  I view it as xhtml (thus having it processed by JSF and
> the facelets view handler), the control will not render.  I just get a blank
> screen.
>
> I'm hoping someone here on this list has tried to do something similar and
> can tell me what I need to do.  Here is the page:
>
>
> <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
> <head>
>     <title>Sample Tree Control</title>
>     <link rel="stylesheet"
> href="/js/dojo-0.9.0/dijit/themes/tundra/tundra.css"
> type="text/css"/>
>     <link rel="stylesheet" href="/js/dojo-0.9.0/dojo/resources/dojo.css"
> type="text/css"/>
>     <script type="text/javascript" src="/js/dojo-0.9.0/dojo/dojo.js"
> djConfig="parseOnLoad: true, isDebug: true">
>     </script>
>     <script type="text/javascript">
>           dojo.require( "dojo.data.ItemFileWriteStore" );
>           dojo.require( "dijit.Tree" );
> </script>
> </head>
> <body class="tundra">
> <div dojoType="dojo.data.ItemFileWriteStore" jsId="mailStore"
> url="mail/mail.json"></div>
> <div dojoType="dijit.Tree" id="mailTree" store="mailStore" labelAttr="label"
> childrenAttr="folders" query="{type:'folder'}">
> </div>
> </body>
> </html>
>
>
> And here is the json data found in mail.json (which I know is being found
> and loaded).
>
> {
>  identifier: 'id',
>  label: 'label',
>  items: [
>   // Hierarchy of folders
>   { type: 'folder', id: 'mailbox', label:'Mail Folders', folders: [
>    { type: 'folder', id: 'inbox', label:'Inbox', icon:'mailIconFolderInbox'
> },
>    { type: 'folder', id: 'deleted', label:'Trash Can',
> icon:'mailIconTrashcanFull' },
>    { type: 'folder', id: 'save', label:'Save',  folders:[
>     { id: 'work', label:'stuff for work'},
>     { id: 'fun', label:'stuff for fun'}
>    ]}
>   ]}
>  ]
> }
>
> Again, the same page not preprocessed by JSF and facelets displays a tree.
> What is going on?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

LightInTheBox - Buy quality products at wholesale price