[richfaces-issues] [JBoss JIRA] (RF-13550) Refactor bridge-base so that it will allow bridges to extend widgets

Lukáš Fryč (JIRA) issues at jboss.org
Fri Feb 14 14:30:28 EST 2014


    [ https://issues.jboss.org/browse/RF-13550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12944840#comment-12944840 ] 

Lukáš Fryč commented on RF-13550:
---------------------------------

One of the caveats:
bridge is usually called on component root, but widget can be instantiated on inner element:

{code}
<div id="editor">
   <textarea id="editorInput"></textarea>
{code}

{code}
$('#editor').editorBridge(); ---> internally calls $("#editor" + 'Input').editor();
{code}
                
> Refactor bridge-base so that it will allow bridges to extend widgets
> --------------------------------------------------------------------
>
>                 Key: RF-13550
>                 URL: https://issues.jboss.org/browse/RF-13550
>             Project: RichFaces
>          Issue Type: Enhancement
>      Security Level: Public(Everyone can see) 
>          Components: component
>    Affects Versions: 5.0.0.Alpha3
>            Reporter: Lukáš Fryč
>
> This will allow bridges to extend widget API and make it more natural for JSF users, e.g.:
> Editor is now:
> {code}
> $.widget('rf.editorBridge', $.rf.bridgeBase,
> {code}
> but we want:
> {code}
> $.widget('rf.editorBridge', $.rich.editor,
> {code}
> On multiple inheritance in jQuery Widget Factory:
> https://forum.jquery.com/topic/how-to-extend-a-widget-factory-widget-with-multiple-base-widgets
> The way of extending API should be designed in that way that user calls e.g.:
> {code}
> #{r:component('editor')}.setValue();
> {code}
> but editor has (or rather should have) only a method which is named in jQuery Widget Factory style:
> {code}
> data('editor').value() / data('editor').value(newValue)
> editor('value') / editor('value', newValue)
> {code}
> So, we want bridge to add the setValue/getValue API:
> {code}
> $.extend(widget), { setValue: ..., getValue: ...};
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the richfaces-issues mailing list