try
HtmlJQuery jq = (HtmlJQuery)application.createComponent(HtmlJQuery.COMPONENT_TYPE);
jq.setSelector("#widget1,#widget2");
jq.setId("hideme");
jq.setName("hide2");
jq.setTiming("onJScall");
jq.setQuery("hide()");
with
<h:graphicImage width="80" id="jap4" value="someimage.png" onmouseover="hide2()" />
(or the equivalent generated code)
Best regards
Leo