tree control : populate instance on demand?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

tree control : populate instance on demand?

Adrian Baker-2
This is probably a bit premature, but we've been playing with the new
tree control - it's pretty cool. We've been vacillating between
implementing an XML backed tree based search screen manually (using the
Yahoo control + HTML & Javascript) and implementing it using XForms.

Is it possible to trigger an xforms:submission to update instance data
as the tree is explored? Is there an event is fired when node is
expanded that can have a listener implemented to do an <xforms:send> ?
Obviously this is a bit limited by not being able to do a partial
replace on submission, but perhaps using the insert/delete events you
could simulate this, otherwise replacing the whole document isn't so
bad, since it doesn't get send to the client anyway.

If there isn't, perhaps it wouldn't be too difficult instrument the
yahoo tree widget to fire custom xxforms tree expand events (since I
can't see which standard XForms event would be appropriate).. ?

Adrian

 



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: tree control : populate instance on demand?

Erik Bruchez
Administrator
Adrian Baker wrote:

> This is probably a bit premature, but we've been playing with the new
> tree control - it's pretty cool. We've been vacillating between
> implementing an XML backed tree based search screen manually (using the
> Yahoo control + HTML & Javascript) and implementing it using XForms.
>
> Is it possible to trigger an xforms:submission to update instance data
> as the tree is explored? Is there an event is fired when node is
> expanded that can have a listener implemented to do an <xforms:send> ?
> Obviously this is a bit limited by not being able to do a partial
> replace on submission, but perhaps using the insert/delete events you
> could simulate this, otherwise replacing the whole document isn't so
> bad, since it doesn't get send to the client anyway.
>
> If there isn't, perhaps it wouldn't be too difficult instrument the
> yahoo tree widget to fire custom xxforms tree expand events (since I
> can't see which standard XForms event would be appropriate).. ?
Currently the tree is really an xforms:select or xforms:select1 control
without anything fancy. There are a few limitations at the moment, as
you suggest:

o You can't modify the structure of the data that backs the tree.
However, this could definitely be implemented.

o There are no events other than xforms-value-changed. Again, and Alex
could probably confirm this, this could be improved.

Note that (and this is early access too) there is also an xxforms:menu
appearance :-)

-Erik

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: tree control : populate instance on demand?

Alessandro  Vernet
Administrator
On 6/23/06, Erik Bruchez <[hidden email]> wrote:
> o There are no events other than xforms-value-changed. Again, and Alex
> could probably confirm this, this could be improved.

Adrian,

Yes, this is correct. Right now the only useful event is
xforms-value-changed. The main limitation of the tree/menu is that
once the page is loaded, the tree/menu structure is not updated when
the data you point to in your <xforms:itemset> changes. Implementing
dynamic updates of the tree/menu structure is likely to take us some
more time. But if you see anything else that would be nice to handle
within the boundaries of a static structure, please let us know.

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: tree control : populate instance on demand?

Erik Bruchez
Administrator
In reply to this post by Adrian Baker-2
Adrian,

> Is it possible to trigger an xforms:submission to update instance data
> as the tree is explored? Is there an event is fired when node is
> expanded that can have a listener implemented to do an <xforms:send> ?
> Obviously this is a bit limited by not being able to do a partial
> replace on submission, but perhaps using the insert/delete events you
> could simulate this, otherwise replacing the whole document isn't so
> bad, since it doesn't get send to the client anyway.

Thinking about this a little more:

We could have two new events to handle tree events, e.g.:

   xxforms-expanded
   xxforms-collapsed

Now the question is how you identify the instance node (related to the
tree branch) being collapsed or expanded.

The events would likely target the xforms:item, xforms:choice, or
xforms:itemset depending on how the tree is actually defined. But when
you use xforms:itemset (likely a very common scenario), we would
probably need to pass the instance node in an event context.

XForms 1.1 is currently putting in place a mechanism for event context.
When that is stable, we should be able to use it to pass such
information (although this will also involve new client-side code).

Any other idea?

-Erik

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: tree control : populate instance on demand?

Adrian Baker-2
Erik Bruchez wrote:

> Adrian,
>
>> Is it possible to trigger an xforms:submission to update instance
>> data as the tree is explored? Is there an event is fired when node is
>> expanded that can have a listener implemented to do an <xforms:send>
>> ? Obviously this is a bit limited by not being able to do a partial
>> replace on submission, but perhaps using the insert/delete events you
>> could simulate this, otherwise replacing the whole document isn't so
>> bad, since it doesn't get send to the client anyway.
>
> Thinking about this a little more:
>
> We could have two new events to handle tree events, e.g.:
>
>   xxforms-expanded
>   xxforms-collapsed
>
> Now the question is how you identify the instance node (related to the
> tree branch) being collapsed or expanded.
>
> The events would likely target the xforms:item, xforms:choice, or
> xforms:itemset depending on how the tree is actually defined. But when
> you use xforms:itemset (likely a very common scenario), we would
> probably need to pass the instance node in an event context.
>
> XForms 1.1 is currently putting in place a mechanism for event
> context. When that is stable, we should be able to use it to pass such
> information (although this will also involve new client-side code).
>
> Any other idea?
>
> -Erik
This sounds good.

One other problem with dynamic tree in XForms is that you have to
(a) communicate to the user than the subtree can be expanded (with the
plus icon), and
(b) when they click on it, you have to do something to let them know
that it's loading.

I'm not sure how you'd handle (a), because as far as the instance data
will be concerned, before the xxforms-expanded event is fired, a tree
branch may have no children, therefore it will assume the plus icon
shouldn't be offered. You almost need some sort of explicit
@ui:expandable attribute on the instance data to drive this.

The Yahoo widget provides a mechanism for (b), but I'm not sure how
straightforward hooking this in would be - perhaps the widget could show
it's loading icon until the response from the server's xxforms-expanded
method is handled?? This might affect the experience of a purely static
tree though.

Adrian



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: tree control : populate instance on demand?

Alessandro  Vernet
Administrator
On 6/27/06, Adrian Baker <[hidden email]> wrote:

> One other problem with dynamic tree in XForms is that you have to
> (a) communicate to the user than the subtree can be expanded (with the
> plus icon), and
> (b) when they click on it, you have to do something to let them know
> that it's loading.
>
> I'm not sure how you'd handle (a), because as far as the instance data
> will be concerned, before the xxforms-expanded event is fired, a tree
> branch may have no children, therefore it will assume the plus icon
> shouldn't be offered. You almost need some sort of explicit
> @ui:expandable attribute on the instance data to drive this.

Adrian,

One way around this is to always have in the instance one more level
than what is already open.

The downside is that the instance would need to contain more data than
what is strictly needed to display the tree, and the upside is that
doing things this way we wouldn't need to add anything special to the
tree appearance to enable one to implement a tree where data is loaded
incrementally.

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet