Ok, I think the ScriptConnector might be possible now. The code used to bind the formatters to the component is very generic. It's actually a render contribution, only easier, hehe. Right now it's used to bind scripts to components, like this:

<input jwcid="[EMAIL PROTECTED]"
         formatter="something,param1=value1,param2=value2"
         ... />

As in the translator approach, the "something" is used as a key to look for a bean in a Hivemind service. Right now it's this:

 <contribution configuration-id="JsFormatters">
   <bean name="number" class="NumberJsFormatter">
   </bean>
   <!-- <bean name="date" class="DateJsFormatter"/>
   <bean name="mask" class="MaskJsFormatter"/>-->
 </contribution>

Adding contributions to this, we could do something like this:

 <contribution configuration-id="JsFormatters">
    <bean name="something" class="SomeContributor" />
 </contribution>

The JsFormatter interface has this method:

public interface JsFormatter {

   void renderContributions(
       IRequestCycle cycle, IScriptSource scriptSource,
       IComponent comp, String uniqueId);

}

But I actually think it could be far simpler (only the IComponent and uniqueId), as the other params should be able to be injected. I just haven't tried yet :P
So, that would leave us with something like this:

   void renderContributions(IComponent comp, String uniqueId);

Which is basically a contribution engine (not only a script connection engine!)

--
Ing. Leonardo Quijano Vincenzi
DTQ Software


[EMAIL PROTECTED] wrote:
Actually, this class needs a bit of refactoring.
For instance, linkFieldObservers() + linkFormatter() methods add a dependency to AjaxWebRequest + AjaxEventSubmit.
This results in circular package dependencies (mainly because of 
AjaxEventSubmit. ).
They should be eliminated - perhaps move those methods
in package net.sf.tacos.ajax.components, in a new class...
ConnectUtils ? ComponentUtils?
It could even become a service, ScriptConnector?

From Leonardo Quijano Vincenzi <[EMAIL PROTECTED]>:




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to