On 4/19/07, Jonathan Locke <[EMAIL PROTECTED]> wrote:
don't forget that a javascript decorator isa JavaScript, so you can nest them arbitrarily:
yeah, i think this is exactly what threw me off in the first place. all your examples were actually extending, but what you needed was an interface so you can wrap and return the same thing IWicketAjaxCall { // whatever initially returns this will be instanceof JavaScript as well JavaScript getOnSuccessScript(); JavaScript getOnFailureScript(); JavaScript getCallScript(); } now that a structure like that is defined i think you can start decorating things properly. this is exactly what IAjaxCallDecorator does, but all your examples with inheritance threw me off into thinking in a different direction. just have to take JavaScript at face value, a utility to manage a javascript string, nothing more. i kept thinking there is more to it. now if we also do: IWicketAjaxCall { // whatever initially returns this will be instanceof JavaScript as well interface ICallbackUrl { void addParam(String,String); } JavaScript getOnSuccessScript(); JavaScript getOnFailureScript(); JavaScript getCallScript(ICallbackUrl); } we should also be able to add arbitrary parameters to the callback url which will nicely link in with decoration. -igor