Hi,
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 -->
</xx:somePanel>
can produce
<div *draggable="true"*
ondragstart="return dragStart(event)"
ondragend="return dragEnd(event)">
</div>
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>
child.
At the components that I cannot modify, things got worse. I can never set
"draggable=true" on them:
<h:inputText>
<fx:dragSupportClientBehavior .../>
</h:inputText>
And, I don't want to use something like:
<xx:somePanel draggable="true" ...>
<fx:dragSupportClientBehavior .../>
</xx:somePanel>
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?
Greetings,
Ali
--
My Blog: http://blog.aliok.com.tr
Twitter: http://twitter.com/aliok_tr