{"id":132,"date":"2008-08-28T16:43:48","date_gmt":"2008-08-29T00:43:48","guid":{"rendered":"http:\/\/www.antunkarlovac.com\/blog\/?p=132"},"modified":"2008-08-28T16:43:48","modified_gmt":"2008-08-29T00:43:48","slug":"empty-handlers-in-openlaszlo-41","status":"publish","type":"post","link":"https:\/\/www.antunkarlovac.com\/blog\/2008\/08\/28\/empty-handlers-in-openlaszlo-41\/","title":{"rendered":"Empty Handlers in OpenLaszlo 4.1"},"content":{"rendered":"<p>The current release of OpenLaszlo doesn&#8217;t like empty handler tags. If you compile the following code, you&#8217;ll get a compiler warning:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;canvas debug=&quot;true&quot;&gt;\r\n    &lt;handler name=&quot;oninit&quot;&gt;\r\n\r\n    &lt;\/handler&gt;\r\n&lt;\/canvas&gt;\r\n<\/pre>\n<p>The warning will say:<\/p>\n<blockquote><p>&#8220;Refusing to compile an empty handler, you should declare the event instead&#8221;<\/p><\/blockquote>\n<p>This wasn&#8217;t the case previously. The warning is intended to educate developers who continue to define empty handlers to &#8220;hack&#8221; a custom event. (This is an old practice that is no longer necessary, since there is now an &lt;event \/&gt; tag). If you&#8217;re intentionally writing empty handler tags (e.g. as stubs), those warnings may get in the way.<\/p>\n<p>To work around them, provide a comment in your empty handler:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;canvas debug=&quot;true&quot;&gt;\r\n    &lt;handler name=&quot;oninit&quot;&gt;\r\n        \/\/ Setup code for application.\r\n    &lt;\/handler&gt;\r\n&lt;\/canvas&gt;\r\n<\/pre>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>The current release of OpenLaszlo doesn&#8217;t like empty handler tags. If you compile the following code, you&#8217;ll get a compiler warning: The warning will say: &#8220;Refusing to compile an empty handler, you should declare the event instead&#8221; This wasn&#8217;t the case previously. The warning is intended to educate developers who continue to define empty handlers &hellip; <a href=\"https:\/\/www.antunkarlovac.com\/blog\/2008\/08\/28\/empty-handlers-in-openlaszlo-41\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Empty Handlers in OpenLaszlo 4.1<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/132"}],"collection":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":2,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/132\/revisions\/134"}],"wp:attachment":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/media?parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/categories?post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/tags?post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}