You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by Naresh Bhatia <NB...@sapient.com> on 2006/10/07 15:04:48 UTC

Using Dojo with Trinidad

Does anyone have any pointers or samples for using Dojo with Trinidad?

 

Thanks

Naresh


Re: Using Dojo with Trinidad

Posted by Rogers Reilly <ro...@s-rod.com>.
Awesome, thanks Adam.  This helps a lot.

Adam Winer wrote:

> TreeModel doesn't have to do that.  The default implementation
> of isContainerEmpty() is:
>
>  public boolean isContainerEmpty()
>  {
>    if (!isContainer())
>      return true;
>
>    enterContainer();
>    try
>    {
>      int kids = getRowCount();
>      if (kids < 0)
>      {
>        setRowIndex(0);
>        return !isRowAvailable();
>      }
>      return (kids == 0);
>    }
>    finally
>    {
>      exitContainer();
>    }
>  }
>
> ... which, like you say, gets the children to figure out whether
> there's > 0.  If your subclass of TreeModel overrides this to
> provide a more efficient implementation, then it won't get
> the children until expanded.
>
> BTW, we definitely need some Javadoc on this, because
> this is not at all obvious!
>
> -- Adam
>
>
>
> On 10/9/06, Rogers Reilly <ro...@s-rod.com> wrote:
>
>>
>> TreeTable definitely does lazy loading.
>>
>> On the subject, though, I've noticed that (in the build I've been using,
>> which is admittedly a bit stale- not the same webapp as my 1.2 project
>> :-) ) TreeTable does insist on fetching the children of visible
>> nodes--presumably to see whether or not it needs to render an
>> "expandable" node.  Problem is, (a) it seems to render the expandable
>> icon either way, and (b) there are times when I'd rather it not check
>> for this because those are expensive child nodes to build.
>>
>> To get around this, I've actually added dummy nodes to some of my
>> TableTrees:
>>
>> Node1
>> Node2
>> ...
>> NodeX
>>    |-Click to see drilldowns
>>          |-Logical SubNode1
>>          |-Logical SubNode2
>>
>> If I don't add the superfluous "Click to see drilldowns" subnode, my
>> TreeTable tries to load all of the SubNodes right away- again,
>> presumably to figure out if NodeX should be expandable.  I'd love to see
>> some kind of "prefetchChildren" attribute so I could disable this
>> behavior.
>>
>> Rogers
>>
>> Adam Winer wrote:
>>
>> > What do you mean by "does not do lazy loading"?  TreeTable
>> > definitely doesn't load all the data of the tree up front.
>> >
>> > -- Adam
>> >
>> >
>> > On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>> >
>> >> BTW, forgot to answer your other question. Yes, I do plan to create a
>> >> custom component in Dojo. (Specifically a TreeTable component - I 
>> know
>> >> there is one in Trinidad, but as far as I can tell it does not do 
>> lazy
>> >> loading and couple other requirements I have.)
>> >>
>> >> Naresh
>> >>
>> >> -----Original Message-----
>> >> From: Naresh Bhatia [mailto:NBhatia@sapient.com]
>> >> Sent: Saturday, October 07, 2006 6:28 PM
>> >> To: adffaces-user@incubator.apache.org
>> >> Subject: RE: Using Dojo with Trinidad
>> >>
>> >> jMaki is on my TODO list to review. A cursory look suggests that it
>> will
>> >> work with JSF (https://ajax.dev.java.net/usingFaces.html), but 
>> there is
>> >> no mention of ADF Faces or Trinidad. My question is specific to
>> >> Trinidad, because Trinidad seems to take over some of the events like
>> >> "onLoad" etc. thus potentially encroaching the Dojo turf. I am 
>> already
>> >> having several problems integrating Dojo with with Trinidad raw (see
>> >> some of my other posts today) - without using any frameworks, so I 
>> want
>> >> to be extra careful bringing other variables in. One thought that did
>> >> cross my mind is to NOT use Trinidad on pages where I want to use 
>> Dojo.
>> >> Anyway I am waiting on the experts in this group to enlighten me :-).
>> >>
>> >> Naresh
>> >>
>> >> -----Original Message-----
>> >> From: Clemens Schneider [mailto:clemens.schneider@gmail.com]
>> >> Sent: Saturday, October 07, 2006 5:02 PM
>> >> To: adffaces-user@incubator.apache.org
>> >> Subject: Re: Using Dojo with Trinidad
>> >>
>> >> Did you have a look at JMaki? Or are you searching for infos for 
>> custom
>> >> component development?
>> >>
>> >> -clem
>> >>
>> >> Naresh Bhatia wrote:
>> >> > Does anyone have any pointers or samples for using Dojo with
>> Trinidad?
>> >> >
>> >> >
>> >> >
>> >> > Thanks
>> >> >
>> >> > Naresh
>> >> >
>> >> >
>> >> >
>> >>
>> >
>> >
>>
>>
>>
>



Re: Using Dojo with Trinidad

Posted by Adam Winer <aw...@gmail.com>.
TreeModel doesn't have to do that.  The default implementation
of isContainerEmpty() is:

  public boolean isContainerEmpty()
  {
    if (!isContainer())
      return true;

    enterContainer();
    try
    {
      int kids = getRowCount();
      if (kids < 0)
      {
        setRowIndex(0);
        return !isRowAvailable();
      }
      return (kids == 0);
    }
    finally
    {
      exitContainer();
    }
  }

... which, like you say, gets the children to figure out whether
there's > 0.  If your subclass of TreeModel overrides this to
provide a more efficient implementation, then it won't get
the children until expanded.

BTW, we definitely need some Javadoc on this, because
this is not at all obvious!

-- Adam



On 10/9/06, Rogers Reilly <ro...@s-rod.com> wrote:
>
> TreeTable definitely does lazy loading.
>
> On the subject, though, I've noticed that (in the build I've been using,
> which is admittedly a bit stale- not the same webapp as my 1.2 project
> :-) ) TreeTable does insist on fetching the children of visible
> nodes--presumably to see whether or not it needs to render an
> "expandable" node.  Problem is, (a) it seems to render the expandable
> icon either way, and (b) there are times when I'd rather it not check
> for this because those are expensive child nodes to build.
>
> To get around this, I've actually added dummy nodes to some of my
> TableTrees:
>
> Node1
> Node2
> ...
> NodeX
>    |-Click to see drilldowns
>          |-Logical SubNode1
>          |-Logical SubNode2
>
> If I don't add the superfluous "Click to see drilldowns" subnode, my
> TreeTable tries to load all of the SubNodes right away- again,
> presumably to figure out if NodeX should be expandable.  I'd love to see
> some kind of "prefetchChildren" attribute so I could disable this
> behavior.
>
> Rogers
>
> Adam Winer wrote:
>
> > What do you mean by "does not do lazy loading"?  TreeTable
> > definitely doesn't load all the data of the tree up front.
> >
> > -- Adam
> >
> >
> > On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
> >
> >> BTW, forgot to answer your other question. Yes, I do plan to create a
> >> custom component in Dojo. (Specifically a TreeTable component - I know
> >> there is one in Trinidad, but as far as I can tell it does not do lazy
> >> loading and couple other requirements I have.)
> >>
> >> Naresh
> >>
> >> -----Original Message-----
> >> From: Naresh Bhatia [mailto:NBhatia@sapient.com]
> >> Sent: Saturday, October 07, 2006 6:28 PM
> >> To: adffaces-user@incubator.apache.org
> >> Subject: RE: Using Dojo with Trinidad
> >>
> >> jMaki is on my TODO list to review. A cursory look suggests that it
> will
> >> work with JSF (https://ajax.dev.java.net/usingFaces.html), but there is
> >> no mention of ADF Faces or Trinidad. My question is specific to
> >> Trinidad, because Trinidad seems to take over some of the events like
> >> "onLoad" etc. thus potentially encroaching the Dojo turf. I am already
> >> having several problems integrating Dojo with with Trinidad raw (see
> >> some of my other posts today) - without using any frameworks, so I want
> >> to be extra careful bringing other variables in. One thought that did
> >> cross my mind is to NOT use Trinidad on pages where I want to use Dojo.
> >> Anyway I am waiting on the experts in this group to enlighten me :-).
> >>
> >> Naresh
> >>
> >> -----Original Message-----
> >> From: Clemens Schneider [mailto:clemens.schneider@gmail.com]
> >> Sent: Saturday, October 07, 2006 5:02 PM
> >> To: adffaces-user@incubator.apache.org
> >> Subject: Re: Using Dojo with Trinidad
> >>
> >> Did you have a look at JMaki? Or are you searching for infos for custom
> >> component development?
> >>
> >> -clem
> >>
> >> Naresh Bhatia wrote:
> >> > Does anyone have any pointers or samples for using Dojo with
> Trinidad?
> >> >
> >> >
> >> >
> >> > Thanks
> >> >
> >> > Naresh
> >> >
> >> >
> >> >
> >>
> >
> >
>
>
>

Re: Using Dojo with Trinidad

Posted by Rogers Reilly <ro...@s-rod.com>.
TreeTable definitely does lazy loading.

On the subject, though, I've noticed that (in the build I've been using, 
which is admittedly a bit stale- not the same webapp as my 1.2 project 
:-) ) TreeTable does insist on fetching the children of visible 
nodes--presumably to see whether or not it needs to render an 
"expandable" node.  Problem is, (a) it seems to render the expandable 
icon either way, and (b) there are times when I'd rather it not check 
for this because those are expensive child nodes to build.

To get around this, I've actually added dummy nodes to some of my 
TableTrees:

Node1
Node2
...
NodeX
   |-Click to see drilldowns
         |-Logical SubNode1
         |-Logical SubNode2

If I don't add the superfluous "Click to see drilldowns" subnode, my 
TreeTable tries to load all of the SubNodes right away- again, 
presumably to figure out if NodeX should be expandable.  I'd love to see 
some kind of "prefetchChildren" attribute so I could disable this behavior.

Rogers  

Adam Winer wrote:

> What do you mean by "does not do lazy loading"?  TreeTable
> definitely doesn't load all the data of the tree up front.
>
> -- Adam
>
>
> On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>
>> BTW, forgot to answer your other question. Yes, I do plan to create a
>> custom component in Dojo. (Specifically a TreeTable component - I know
>> there is one in Trinidad, but as far as I can tell it does not do lazy
>> loading and couple other requirements I have.)
>>
>> Naresh
>>
>> -----Original Message-----
>> From: Naresh Bhatia [mailto:NBhatia@sapient.com]
>> Sent: Saturday, October 07, 2006 6:28 PM
>> To: adffaces-user@incubator.apache.org
>> Subject: RE: Using Dojo with Trinidad
>>
>> jMaki is on my TODO list to review. A cursory look suggests that it will
>> work with JSF (https://ajax.dev.java.net/usingFaces.html), but there is
>> no mention of ADF Faces or Trinidad. My question is specific to
>> Trinidad, because Trinidad seems to take over some of the events like
>> "onLoad" etc. thus potentially encroaching the Dojo turf. I am already
>> having several problems integrating Dojo with with Trinidad raw (see
>> some of my other posts today) - without using any frameworks, so I want
>> to be extra careful bringing other variables in. One thought that did
>> cross my mind is to NOT use Trinidad on pages where I want to use Dojo.
>> Anyway I am waiting on the experts in this group to enlighten me :-).
>>
>> Naresh
>>
>> -----Original Message-----
>> From: Clemens Schneider [mailto:clemens.schneider@gmail.com]
>> Sent: Saturday, October 07, 2006 5:02 PM
>> To: adffaces-user@incubator.apache.org
>> Subject: Re: Using Dojo with Trinidad
>>
>> Did you have a look at JMaki? Or are you searching for infos for custom
>> component development?
>>
>> -clem
>>
>> Naresh Bhatia wrote:
>> > Does anyone have any pointers or samples for using Dojo with Trinidad?
>> >
>> >
>> >
>> > Thanks
>> >
>> > Naresh
>> >
>> >
>> >
>>
>
>



RE: RE: Re: Using Dojo with Trinidad

Posted by Naresh Bhatia <NB...@sapient.com>.
Adam,

Thanks for the pointers - starting to look at javadocs for DataModel.

This has been a very useful thread for my JSF understanding - so thanks
again for helping me out.

Naresh

-----Original Message-----
From: Adam Winer [mailto:awiner@gmail.com] 
Sent: Tuesday, October 10, 2006 11:48 AM
To: adffaces-user@incubator.apache.org
Subject: Re: RE: Re: Using Dojo with Trinidad

On 10/9/06, Naresh Bhatia <NB...@sapient.com> wrote:
> Aha. These few sentences clarify the intent of TreeModel more that the
> entire javadoc for this class! Thanks so much, Adam. I was earlier
> thinking that TreeModel represents the entire tree and there must be
> something like "TreeNode" that would represent nodes in the tree. But
> now that you put it this way, it appears that TreeModel IS the node in
> the tree and, in a special case, could be the root of the tree. Is my
> understanding correct?

No, TreeModel is an entity that knows how to navigate around
an object hierarchy.  It isn't the object hierarchy itself.

Start by understanding JSF's DataModel class;  TreeModel is
a hierarchical extension of that class.

> If so, here's my follow up question (and this is the newbie speaking,
so
> please bear with me): It appears that the approach you mention below,
> will keep the tree's loaded state somewhere in the web container
> (probably session).

No, not entirely.  The expansion state will be saved using
JSF state saving.  But the TreeModel is as stateful as you
want it to be - if you create it at request scope, it's at
request scope.

> Does the TreeModel support the creation of a
> completely stateless implementation, i.e act as a passthrough to the
> client? If not, is this the real difference between TreeTable and
> perhaps a JavaScript/AJAX implementation that will keep the complete
> state on the client side?

The difference between an entirely DHTML table and a JSF
table is that an entirely DHTML table gives you relatively
little of a server-side programming model.

-- Adam

Re: RE: Re: Using Dojo with Trinidad

Posted by Adam Winer <aw...@gmail.com>.
On 10/9/06, Naresh Bhatia <NB...@sapient.com> wrote:
> Aha. These few sentences clarify the intent of TreeModel more that the
> entire javadoc for this class! Thanks so much, Adam. I was earlier
> thinking that TreeModel represents the entire tree and there must be
> something like "TreeNode" that would represent nodes in the tree. But
> now that you put it this way, it appears that TreeModel IS the node in
> the tree and, in a special case, could be the root of the tree. Is my
> understanding correct?

No, TreeModel is an entity that knows how to navigate around
an object hierarchy.  It isn't the object hierarchy itself.

Start by understanding JSF's DataModel class;  TreeModel is
a hierarchical extension of that class.

> If so, here's my follow up question (and this is the newbie speaking, so
> please bear with me): It appears that the approach you mention below,
> will keep the tree's loaded state somewhere in the web container
> (probably session).

No, not entirely.  The expansion state will be saved using
JSF state saving.  But the TreeModel is as stateful as you
want it to be - if you create it at request scope, it's at
request scope.

> Does the TreeModel support the creation of a
> completely stateless implementation, i.e act as a passthrough to the
> client? If not, is this the real difference between TreeTable and
> perhaps a JavaScript/AJAX implementation that will keep the complete
> state on the client side?

The difference between an entirely DHTML table and a JSF
table is that an entirely DHTML table gives you relatively
little of a server-side programming model.

-- Adam

RE: Re: Using Dojo with Trinidad

Posted by Naresh Bhatia <NB...@sapient.com>.
Aha. These few sentences clarify the intent of TreeModel more that the
entire javadoc for this class! Thanks so much, Adam. I was earlier
thinking that TreeModel represents the entire tree and there must be
something like "TreeNode" that would represent nodes in the tree. But
now that you put it this way, it appears that TreeModel IS the node in
the tree and, in a special case, could be the root of the tree. Is my
understanding correct?

If so, here's my follow up question (and this is the newbie speaking, so
please bear with me): It appears that the approach you mention below,
will keep the tree's loaded state somewhere in the web container
(probably session). Does the TreeModel support the creation of a
completely stateless implementation, i.e act as a passthrough to the
client? If not, is this the real difference between TreeTable and
perhaps a JavaScript/AJAX implementation that will keep the complete
state on the client side?

Naresh

-----Original Message-----
From: Adam Winer [mailto:awiner@gmail.com] 
Sent: Monday, October 09, 2006 10:52 PM
To: adffaces-user@incubator.apache.org
Subject: Re: Re: Using Dojo with Trinidad

The TreeTable only invokes the TreeModel as needed
for data.

ChildPropertyTreeModel is just one implementation - if
you need to load it dynamically, then a custom
implementation of TreeModel is needed - either
implementing it from scratch or by subclassing
ChildPropertyTreeModel.

-- Adam


On 10/9/06, Clemens Schneider <cl...@gmail.com> wrote:
> I think Adam meant, that TreeTable doesn't load all the data to the
> client, but instead fetches the required -fully initialized- data from
> the backing TreeModel, when a node is expanded. To lazy load parts of
> the TreeModel, you'll have to add (e.g.) proxy objects to the
TreeModel
> that fetch the data when required or subclass TreeModel to add lazy
> loading capabilities... Is it possible to use a ResultSet with
> TreeModel, too? Then this would be a possibility, too..
>
> -clem
>
> Naresh Bhatia wrote:
> > Well, by "lazy loading" I mean that the entire tree should not be
> > fetched from the service layer (or the data access layer) in one
shot.
> > Instead, only immediate child nodes should be fetched when a node is
> > expanded. I think that's what you mean too, but I just wanted to be
> > clear about it.
> >
> > Having said that, I did not readily see how lazy loading would work
in
> > TreeTable documentation. Here's my JSP code:
> >
> > <tr:treeTable var="node" value="#{treeTableBean.treeModel}"
> >
> > rowDisclosureListener="#{treeTableBean.processRowDisclosureEvent}"
> >         rendered="true"
> >         rowsByDepth="20"
> >         summary="Company">
> >     ....
> > </tr:treeTable>
> >
> > Here's my TreeTableBean:
> >
> > public class TreeTableBean {
> >     private TreeModel treeModel = null;
> >
> >     public TreeModel getTreeModel() {
> >         if (treeModel == null) {
> >             // Get the entire tree from the service layer
> >             TreeNodeVO root = getTreeService().getTree("Company");
> >             treeModel = new ChildPropertyTreeModel(root,
"children");
> >         }
> >
> >         return treeModel;
> >     }
> >     ...
> > }
> >
> > If getTreeModel() would just return a partial tree, I don't know how
> > TreeTable will ask for more nodes. The only interface I see in
> > <tr:treeTable> to fetch the tree is the value attribute, which in my
> > case is poining to a TreeModel. Given my current understanding,
please
> > let me know how I could lazy load the tree.
> >
> > Naresh
> >
> > -----Original Message-----
> > From: Adam Winer [mailto:awiner@gmail.com]
> > Sent: Monday, October 09, 2006 12:43 PM
> > To: adffaces-user@incubator.apache.org
> > Subject: Re: RE: Using Dojo with Trinidad
> >
> > What do you mean by "does not do lazy loading"?  TreeTable
> > definitely doesn't load all the data of the tree up front.
> >
> > -- Adam
> >
> >
> > On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
> >
> >> BTW, forgot to answer your other question. Yes, I do plan to create
a
> >> custom component in Dojo. (Specifically a TreeTable component - I
know
> >> there is one in Trinidad, but as far as I can tell it does not do
lazy
> >> loading and couple other requirements I have.)
> >>
> >> Naresh
> >>
> >> -----Original Message-----
> >> From: Naresh Bhatia [mailto:NBhatia@sapient.com]
> >> Sent: Saturday, October 07, 2006 6:28 PM
> >> To: adffaces-user@incubator.apache.org
> >> Subject: RE: Using Dojo with Trinidad
> >>
> >> jMaki is on my TODO list to review. A cursory look suggests that it
> >>
> > will
> >
> >> work with JSF (https://ajax.dev.java.net/usingFaces.html), but
there
> >>
> > is
> >
> >> no mention of ADF Faces or Trinidad. My question is specific to
> >> Trinidad, because Trinidad seems to take over some of the events
like
> >> "onLoad" etc. thus potentially encroaching the Dojo turf. I am
already
> >> having several problems integrating Dojo with with Trinidad raw
(see
> >> some of my other posts today) - without using any frameworks, so I
> >>
> > want
> >
> >> to be extra careful bringing other variables in. One thought that
did
> >> cross my mind is to NOT use Trinidad on pages where I want to use
> >>
> > Dojo.
> >
> >> Anyway I am waiting on the experts in this group to enlighten me
:-).
> >>
> >> Naresh
> >>
> >> -----Original Message-----
> >> From: Clemens Schneider [mailto:clemens.schneider@gmail.com]
> >> Sent: Saturday, October 07, 2006 5:02 PM
> >> To: adffaces-user@incubator.apache.org
> >> Subject: Re: Using Dojo with Trinidad
> >>
> >> Did you have a look at JMaki? Or are you searching for infos for
> >>
> > custom
> >
> >> component development?
> >>
> >> -clem
> >>
> >> Naresh Bhatia wrote:
> >>
> >>> Does anyone have any pointers or samples for using Dojo with
> >>>
> > Trinidad?
> >
> >>>
> >>> Thanks
> >>>
> >>> Naresh
> >>>
> >>>
> >>>
> >>>
> >
> >
>
>

Re: Re: Using Dojo with Trinidad

Posted by Adam Winer <aw...@gmail.com>.
The TreeTable only invokes the TreeModel as needed
for data.

ChildPropertyTreeModel is just one implementation - if
you need to load it dynamically, then a custom
implementation of TreeModel is needed - either
implementing it from scratch or by subclassing
ChildPropertyTreeModel.

-- Adam


On 10/9/06, Clemens Schneider <cl...@gmail.com> wrote:
> I think Adam meant, that TreeTable doesn't load all the data to the
> client, but instead fetches the required -fully initialized- data from
> the backing TreeModel, when a node is expanded. To lazy load parts of
> the TreeModel, you'll have to add (e.g.) proxy objects to the TreeModel
> that fetch the data when required or subclass TreeModel to add lazy
> loading capabilities... Is it possible to use a ResultSet with
> TreeModel, too? Then this would be a possibility, too..
>
> -clem
>
> Naresh Bhatia wrote:
> > Well, by "lazy loading" I mean that the entire tree should not be
> > fetched from the service layer (or the data access layer) in one shot.
> > Instead, only immediate child nodes should be fetched when a node is
> > expanded. I think that's what you mean too, but I just wanted to be
> > clear about it.
> >
> > Having said that, I did not readily see how lazy loading would work in
> > TreeTable documentation. Here's my JSP code:
> >
> > <tr:treeTable var="node" value="#{treeTableBean.treeModel}"
> >
> > rowDisclosureListener="#{treeTableBean.processRowDisclosureEvent}"
> >         rendered="true"
> >         rowsByDepth="20"
> >         summary="Company">
> >     ....
> > </tr:treeTable>
> >
> > Here's my TreeTableBean:
> >
> > public class TreeTableBean {
> >     private TreeModel treeModel = null;
> >
> >     public TreeModel getTreeModel() {
> >         if (treeModel == null) {
> >             // Get the entire tree from the service layer
> >             TreeNodeVO root = getTreeService().getTree("Company");
> >             treeModel = new ChildPropertyTreeModel(root, "children");
> >         }
> >
> >         return treeModel;
> >     }
> >     ...
> > }
> >
> > If getTreeModel() would just return a partial tree, I don't know how
> > TreeTable will ask for more nodes. The only interface I see in
> > <tr:treeTable> to fetch the tree is the value attribute, which in my
> > case is poining to a TreeModel. Given my current understanding, please
> > let me know how I could lazy load the tree.
> >
> > Naresh
> >
> > -----Original Message-----
> > From: Adam Winer [mailto:awiner@gmail.com]
> > Sent: Monday, October 09, 2006 12:43 PM
> > To: adffaces-user@incubator.apache.org
> > Subject: Re: RE: Using Dojo with Trinidad
> >
> > What do you mean by "does not do lazy loading"?  TreeTable
> > definitely doesn't load all the data of the tree up front.
> >
> > -- Adam
> >
> >
> > On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
> >
> >> BTW, forgot to answer your other question. Yes, I do plan to create a
> >> custom component in Dojo. (Specifically a TreeTable component - I know
> >> there is one in Trinidad, but as far as I can tell it does not do lazy
> >> loading and couple other requirements I have.)
> >>
> >> Naresh
> >>
> >> -----Original Message-----
> >> From: Naresh Bhatia [mailto:NBhatia@sapient.com]
> >> Sent: Saturday, October 07, 2006 6:28 PM
> >> To: adffaces-user@incubator.apache.org
> >> Subject: RE: Using Dojo with Trinidad
> >>
> >> jMaki is on my TODO list to review. A cursory look suggests that it
> >>
> > will
> >
> >> work with JSF (https://ajax.dev.java.net/usingFaces.html), but there
> >>
> > is
> >
> >> no mention of ADF Faces or Trinidad. My question is specific to
> >> Trinidad, because Trinidad seems to take over some of the events like
> >> "onLoad" etc. thus potentially encroaching the Dojo turf. I am already
> >> having several problems integrating Dojo with with Trinidad raw (see
> >> some of my other posts today) - without using any frameworks, so I
> >>
> > want
> >
> >> to be extra careful bringing other variables in. One thought that did
> >> cross my mind is to NOT use Trinidad on pages where I want to use
> >>
> > Dojo.
> >
> >> Anyway I am waiting on the experts in this group to enlighten me :-).
> >>
> >> Naresh
> >>
> >> -----Original Message-----
> >> From: Clemens Schneider [mailto:clemens.schneider@gmail.com]
> >> Sent: Saturday, October 07, 2006 5:02 PM
> >> To: adffaces-user@incubator.apache.org
> >> Subject: Re: Using Dojo with Trinidad
> >>
> >> Did you have a look at JMaki? Or are you searching for infos for
> >>
> > custom
> >
> >> component development?
> >>
> >> -clem
> >>
> >> Naresh Bhatia wrote:
> >>
> >>> Does anyone have any pointers or samples for using Dojo with
> >>>
> > Trinidad?
> >
> >>>
> >>> Thanks
> >>>
> >>> Naresh
> >>>
> >>>
> >>>
> >>>
> >
> >
>
>

Re: Using Dojo with Trinidad

Posted by Clemens Schneider <cl...@gmail.com>.
I think Adam meant, that TreeTable doesn't load all the data to the 
client, but instead fetches the required -fully initialized- data from 
the backing TreeModel, when a node is expanded. To lazy load parts of 
the TreeModel, you'll have to add (e.g.) proxy objects to the TreeModel 
that fetch the data when required or subclass TreeModel to add lazy 
loading capabilities... Is it possible to use a ResultSet with 
TreeModel, too? Then this would be a possibility, too..

-clem

Naresh Bhatia wrote:
> Well, by "lazy loading" I mean that the entire tree should not be
> fetched from the service layer (or the data access layer) in one shot.
> Instead, only immediate child nodes should be fetched when a node is
> expanded. I think that's what you mean too, but I just wanted to be
> clear about it.
>
> Having said that, I did not readily see how lazy loading would work in
> TreeTable documentation. Here's my JSP code:
>
> <tr:treeTable var="node" value="#{treeTableBean.treeModel}"
>  
> rowDisclosureListener="#{treeTableBean.processRowDisclosureEvent}"
>         rendered="true"
>         rowsByDepth="20"
>         summary="Company">
>     ....
> </tr:treeTable>
>
> Here's my TreeTableBean:
>
> public class TreeTableBean {
>     private TreeModel treeModel = null;
>
>     public TreeModel getTreeModel() {
>         if (treeModel == null) {
>             // Get the entire tree from the service layer
>             TreeNodeVO root = getTreeService().getTree("Company");
>             treeModel = new ChildPropertyTreeModel(root, "children");
>         }
>
>         return treeModel;
>     }
>     ...
> }
>
> If getTreeModel() would just return a partial tree, I don't know how
> TreeTable will ask for more nodes. The only interface I see in
> <tr:treeTable> to fetch the tree is the value attribute, which in my
> case is poining to a TreeModel. Given my current understanding, please
> let me know how I could lazy load the tree.
>
> Naresh
>
> -----Original Message-----
> From: Adam Winer [mailto:awiner@gmail.com] 
> Sent: Monday, October 09, 2006 12:43 PM
> To: adffaces-user@incubator.apache.org
> Subject: Re: RE: Using Dojo with Trinidad
>
> What do you mean by "does not do lazy loading"?  TreeTable
> definitely doesn't load all the data of the tree up front.
>
> -- Adam
>
>
> On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
>   
>> BTW, forgot to answer your other question. Yes, I do plan to create a
>> custom component in Dojo. (Specifically a TreeTable component - I know
>> there is one in Trinidad, but as far as I can tell it does not do lazy
>> loading and couple other requirements I have.)
>>
>> Naresh
>>
>> -----Original Message-----
>> From: Naresh Bhatia [mailto:NBhatia@sapient.com]
>> Sent: Saturday, October 07, 2006 6:28 PM
>> To: adffaces-user@incubator.apache.org
>> Subject: RE: Using Dojo with Trinidad
>>
>> jMaki is on my TODO list to review. A cursory look suggests that it
>>     
> will
>   
>> work with JSF (https://ajax.dev.java.net/usingFaces.html), but there
>>     
> is
>   
>> no mention of ADF Faces or Trinidad. My question is specific to
>> Trinidad, because Trinidad seems to take over some of the events like
>> "onLoad" etc. thus potentially encroaching the Dojo turf. I am already
>> having several problems integrating Dojo with with Trinidad raw (see
>> some of my other posts today) - without using any frameworks, so I
>>     
> want
>   
>> to be extra careful bringing other variables in. One thought that did
>> cross my mind is to NOT use Trinidad on pages where I want to use
>>     
> Dojo.
>   
>> Anyway I am waiting on the experts in this group to enlighten me :-).
>>
>> Naresh
>>
>> -----Original Message-----
>> From: Clemens Schneider [mailto:clemens.schneider@gmail.com]
>> Sent: Saturday, October 07, 2006 5:02 PM
>> To: adffaces-user@incubator.apache.org
>> Subject: Re: Using Dojo with Trinidad
>>
>> Did you have a look at JMaki? Or are you searching for infos for
>>     
> custom
>   
>> component development?
>>
>> -clem
>>
>> Naresh Bhatia wrote:
>>     
>>> Does anyone have any pointers or samples for using Dojo with
>>>       
> Trinidad?
>   
>>>
>>> Thanks
>>>
>>> Naresh
>>>
>>>
>>>
>>>       
>
>   

RE: RE: Using Dojo with Trinidad

Posted by Naresh Bhatia <NB...@sapient.com>.
Well, by "lazy loading" I mean that the entire tree should not be
fetched from the service layer (or the data access layer) in one shot.
Instead, only immediate child nodes should be fetched when a node is
expanded. I think that's what you mean too, but I just wanted to be
clear about it.

Having said that, I did not readily see how lazy loading would work in
TreeTable documentation. Here's my JSP code:

<tr:treeTable var="node" value="#{treeTableBean.treeModel}"
 
rowDisclosureListener="#{treeTableBean.processRowDisclosureEvent}"
        rendered="true"
        rowsByDepth="20"
        summary="Company">
    ....
</tr:treeTable>

Here's my TreeTableBean:

public class TreeTableBean {
    private TreeModel treeModel = null;

    public TreeModel getTreeModel() {
        if (treeModel == null) {
            // Get the entire tree from the service layer
            TreeNodeVO root = getTreeService().getTree("Company");
            treeModel = new ChildPropertyTreeModel(root, "children");
        }

        return treeModel;
    }
    ...
}

If getTreeModel() would just return a partial tree, I don't know how
TreeTable will ask for more nodes. The only interface I see in
<tr:treeTable> to fetch the tree is the value attribute, which in my
case is poining to a TreeModel. Given my current understanding, please
let me know how I could lazy load the tree.

Naresh

-----Original Message-----
From: Adam Winer [mailto:awiner@gmail.com] 
Sent: Monday, October 09, 2006 12:43 PM
To: adffaces-user@incubator.apache.org
Subject: Re: RE: Using Dojo with Trinidad

What do you mean by "does not do lazy loading"?  TreeTable
definitely doesn't load all the data of the tree up front.

-- Adam


On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
> BTW, forgot to answer your other question. Yes, I do plan to create a
> custom component in Dojo. (Specifically a TreeTable component - I know
> there is one in Trinidad, but as far as I can tell it does not do lazy
> loading and couple other requirements I have.)
>
> Naresh
>
> -----Original Message-----
> From: Naresh Bhatia [mailto:NBhatia@sapient.com]
> Sent: Saturday, October 07, 2006 6:28 PM
> To: adffaces-user@incubator.apache.org
> Subject: RE: Using Dojo with Trinidad
>
> jMaki is on my TODO list to review. A cursory look suggests that it
will
> work with JSF (https://ajax.dev.java.net/usingFaces.html), but there
is
> no mention of ADF Faces or Trinidad. My question is specific to
> Trinidad, because Trinidad seems to take over some of the events like
> "onLoad" etc. thus potentially encroaching the Dojo turf. I am already
> having several problems integrating Dojo with with Trinidad raw (see
> some of my other posts today) - without using any frameworks, so I
want
> to be extra careful bringing other variables in. One thought that did
> cross my mind is to NOT use Trinidad on pages where I want to use
Dojo.
> Anyway I am waiting on the experts in this group to enlighten me :-).
>
> Naresh
>
> -----Original Message-----
> From: Clemens Schneider [mailto:clemens.schneider@gmail.com]
> Sent: Saturday, October 07, 2006 5:02 PM
> To: adffaces-user@incubator.apache.org
> Subject: Re: Using Dojo with Trinidad
>
> Did you have a look at JMaki? Or are you searching for infos for
custom
> component development?
>
> -clem
>
> Naresh Bhatia wrote:
> > Does anyone have any pointers or samples for using Dojo with
Trinidad?
> >
> >
> >
> > Thanks
> >
> > Naresh
> >
> >
> >
>

Re: RE: Using Dojo with Trinidad

Posted by Adam Winer <aw...@gmail.com>.
What do you mean by "does not do lazy loading"?  TreeTable
definitely doesn't load all the data of the tree up front.

-- Adam


On 10/7/06, Naresh Bhatia <NB...@sapient.com> wrote:
> BTW, forgot to answer your other question. Yes, I do plan to create a
> custom component in Dojo. (Specifically a TreeTable component - I know
> there is one in Trinidad, but as far as I can tell it does not do lazy
> loading and couple other requirements I have.)
>
> Naresh
>
> -----Original Message-----
> From: Naresh Bhatia [mailto:NBhatia@sapient.com]
> Sent: Saturday, October 07, 2006 6:28 PM
> To: adffaces-user@incubator.apache.org
> Subject: RE: Using Dojo with Trinidad
>
> jMaki is on my TODO list to review. A cursory look suggests that it will
> work with JSF (https://ajax.dev.java.net/usingFaces.html), but there is
> no mention of ADF Faces or Trinidad. My question is specific to
> Trinidad, because Trinidad seems to take over some of the events like
> "onLoad" etc. thus potentially encroaching the Dojo turf. I am already
> having several problems integrating Dojo with with Trinidad raw (see
> some of my other posts today) - without using any frameworks, so I want
> to be extra careful bringing other variables in. One thought that did
> cross my mind is to NOT use Trinidad on pages where I want to use Dojo.
> Anyway I am waiting on the experts in this group to enlighten me :-).
>
> Naresh
>
> -----Original Message-----
> From: Clemens Schneider [mailto:clemens.schneider@gmail.com]
> Sent: Saturday, October 07, 2006 5:02 PM
> To: adffaces-user@incubator.apache.org
> Subject: Re: Using Dojo with Trinidad
>
> Did you have a look at JMaki? Or are you searching for infos for custom
> component development?
>
> -clem
>
> Naresh Bhatia wrote:
> > Does anyone have any pointers or samples for using Dojo with Trinidad?
> >
> >
> >
> > Thanks
> >
> > Naresh
> >
> >
> >
>

RE: Using Dojo with Trinidad

Posted by Naresh Bhatia <NB...@sapient.com>.
BTW, forgot to answer your other question. Yes, I do plan to create a
custom component in Dojo. (Specifically a TreeTable component - I know
there is one in Trinidad, but as far as I can tell it does not do lazy
loading and couple other requirements I have.)

Naresh

-----Original Message-----
From: Naresh Bhatia [mailto:NBhatia@sapient.com] 
Sent: Saturday, October 07, 2006 6:28 PM
To: adffaces-user@incubator.apache.org
Subject: RE: Using Dojo with Trinidad

jMaki is on my TODO list to review. A cursory look suggests that it will
work with JSF (https://ajax.dev.java.net/usingFaces.html), but there is
no mention of ADF Faces or Trinidad. My question is specific to
Trinidad, because Trinidad seems to take over some of the events like
"onLoad" etc. thus potentially encroaching the Dojo turf. I am already
having several problems integrating Dojo with with Trinidad raw (see
some of my other posts today) - without using any frameworks, so I want
to be extra careful bringing other variables in. One thought that did
cross my mind is to NOT use Trinidad on pages where I want to use Dojo.
Anyway I am waiting on the experts in this group to enlighten me :-).

Naresh

-----Original Message-----
From: Clemens Schneider [mailto:clemens.schneider@gmail.com] 
Sent: Saturday, October 07, 2006 5:02 PM
To: adffaces-user@incubator.apache.org
Subject: Re: Using Dojo with Trinidad

Did you have a look at JMaki? Or are you searching for infos for custom 
component development?

-clem

Naresh Bhatia wrote:
> Does anyone have any pointers or samples for using Dojo with Trinidad?
>
>  
>
> Thanks
>
> Naresh
>
>
>   

RE: Using Dojo with Trinidad

Posted by Naresh Bhatia <NB...@sapient.com>.
jMaki is on my TODO list to review. A cursory look suggests that it will
work with JSF (https://ajax.dev.java.net/usingFaces.html), but there is
no mention of ADF Faces or Trinidad. My question is specific to
Trinidad, because Trinidad seems to take over some of the events like
"onLoad" etc. thus potentially encroaching the Dojo turf. I am already
having several problems integrating Dojo with with Trinidad raw (see
some of my other posts today) - without using any frameworks, so I want
to be extra careful bringing other variables in. One thought that did
cross my mind is to NOT use Trinidad on pages where I want to use Dojo.
Anyway I am waiting on the experts in this group to enlighten me :-).

Naresh

-----Original Message-----
From: Clemens Schneider [mailto:clemens.schneider@gmail.com] 
Sent: Saturday, October 07, 2006 5:02 PM
To: adffaces-user@incubator.apache.org
Subject: Re: Using Dojo with Trinidad

Did you have a look at JMaki? Or are you searching for infos for custom 
component development?

-clem

Naresh Bhatia wrote:
> Does anyone have any pointers or samples for using Dojo with Trinidad?
>
>  
>
> Thanks
>
> Naresh
>
>
>   

Re: Using Dojo with Trinidad

Posted by Clemens Schneider <cl...@gmail.com>.
Did you have a look at JMaki? Or are you searching for infos for custom 
component development?

-clem

Naresh Bhatia wrote:
> Does anyone have any pointers or samples for using Dojo with Trinidad?
>
>  
>
> Thanks
>
> Naresh
>
>
>