myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ali Ok <>
Subject [GSOC-HTML5] ClientBehavior and ClientBehaviorHolder's attributes
Date Sat, 15 May 2010 00:02:14 GMT

I am trying to write some prototypes about DnD support. I want to use
ClientBehaviors for this issue.

I wonder if a code like

<xx:somePanel ...>
<fx:dragSupportClientBehavior  .../>      <!-- This is A ClientBehavior -->

can produce

<div *draggable="true"*
ondragstart="return dragStart(event)"
ondragend="return dragEnd(event)">

What I need is, having a ClientBehavior setting an HTML5 element's
"draggable" attribute set to "true".

Thanks to ClientBehaviors, I can easily set 'ondragstart' and 'ondragend'

(in the FaceletHandler of my <fx:dragSupportClientBehavior> using
clientBehaviorHolder.addClientBehavior("dragstart", clientBehavior);)

However, producing "draggable=true" is not that straightforward. On
<xx:somePanel>, I need to check if there is a <fx:dragSupportClientBehavior>

At the components that I cannot modify, things got worse. I can never set
"draggable=true" on them:

<fx:dragSupportClientBehavior  .../>

And, I don't want to use something like:

        <xx:somePanel draggable="true" ...>
<fx:dragSupportClientBehavior  .../>

since the information about the component being draggable is written twice.

Anyway, is this possible without parent component checking children?

It would be nice if we have a chance allowing ClientBehaviors to set some
allowed logical and plain attributes just like the events. Any discussions
about something like that on jsr314-open or elsewhere?


My Blog:

View raw message