<div dir="ltr">One of the solutions could be as follows:<div><br></div><div>RichFaces components API will be exposed on Bridges instead of components:</div><div><br></div><div>var bridge = ...;</div><div>var autocomplete = this.input.data(&#39;autocomplete&#39;)<br>

</div><div>$.each(autocomplete, function(key, value) {</div><div>  // for public methods</div><div>  if (key.indexOf(&#39;_&#39;) !== 0) {</div><div>    bridge[key] = function() {</div><div>      autocomplete[key].apply(autocomplete, arguments);</div>

<div>    }</div><div>   }</div><div>}</div><div><br></div><div>This could be even generalizes to bridge-base.js.</div><div><br></div><div>Then, once we reference public methods from widget and expose them to bridge,</div>

<div>we could simplify RichFaces.component method.</div><div><br></div><div>Finally, we could expose JSF-facing JavaScript API methods on the bridge:</div><div><br></div><div>{</div><div>    setValue : function(value) {</div>

<div>       autocomplete.input.val(value);</div><div>    }</div><div>}</div><div><br></div><div>~ Lukas</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 27, 2013 at 3:20 PM, Lukáš Fryč <span dir="ltr">&lt;<a href="mailto:lukas.fryc@gmail.com" target="_blank">lukas.fryc@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey guys,<div><br></div><div>I have found a following issue:</div><div><br></div><div>we expose public JSF component API for Widget Factory based component by allowing to reference widget reference (i.e. call methods directly on widget instance):</div>


<div><br></div><div>#{rich:component(&#39;autocomplete&#39;)}.close();</div><div><br></div><div>It will make sure that e.g. following methods can be invoked:</div><div><a href="http://www.richwidgets.io/api/classes/autocomplete.html" target="_blank">http://www.richwidgets.io/api/classes/autocomplete.html</a><br>


</div><div><br></div><div>But those methods doesn&#39;t have to be as rich as JSF component we had in RF4.</div><div><br></div><div>E.g. in Autocomplete, we had methods getValue() and setValue().</div><div><br></div><div>


Those methods doesn&#39;t do anything else than setting an appropriate value to the input field. In order to allow unified API, we could expose those methods for RF5 Autocomplete as well, which will be just syntactic sugar in terms of Widget Factory -based API.</div>


<div><br></div><div>WDYT?</div><div><br></div><div><br></div><div>~ Lukas</div></div>
</blockquote></div><br></div>