10

I know Button.command is the theme ID for normal buttons and I can set properties for it. And I know eventHandlers don't have a theme ID by default. So to set properties of an eventHandler centrally, I've historically added what I've had this in my theme:

<control>
        <name>Button.EventHandler</name>
        <property mode="override">
            <name>onStart</name>
            <value>loading();</value>
        </property>
        <property mode="override">
            <name>onError</name>
            <value>stoploading();</value>
        </property>
        <property mode="override">
            <name>onComplete</name>
            <value>stoploading();</value>
        </property>
    </control>

But I then need to add the themeId Button.EventHandler to each eventHandler.

Is there a way to set properties in a theme for children, so set properties on all eventHandlers that are children of Button.Command controls?

Paul Stephen Withers
  • 15,699
  • 1
  • 15
  • 33

1 Answers1

0

I cannot help You with solving Your theme problem, but perhaps I can give You solution to general problem.

I assume that what You try to achieve is to attach some nice loader to all partial refresh events. This can be done on a lower level by using dojo.subscribe API: http://dojotoolkit.org/reference-guide/1.6/dojo/subscribe.html

Example code:

// we need to activate io events
dojo.config.ioPublish = true
dojo.subscribe("/dojo/io/send", function(/*dojo.Deferred*/dfd){
    loading();
});
dojo.subscribe("/dojo/io/stop", function(){
    stoploading();
});

This code has to be run on application start (onClientLoad event will do just fine)

W_K
  • 868
  • 4
  • 9