|
If you must use AbstractComponent as subclass, try something
like: public abstract class MyComponent extends AbstractComponent implements IDirect { ... public void renderComponent(...) { writer.begin("a");
writer.attribute("href", getLink(cycle));
writer.attribute("onmouseover", "hideAllButThis('pm_" + menu.getName()+"Menu', none');");
// or use an equivalent dojo event listener - it is much more 4.1-style ;)
writer.begin("span");
writer.print(menu.getName());
writer.end(); //end span
writer.end(); // end a
}// All below are copied from DirectLink public ILink getLink(IRequestCycle cycle) { Object[] serviceParameters = constructServiceParameters(getParameters()); DirectServiceParameter dsp = new DirectServiceParameter(this, serviceParameters); return getEngine().getLink(isStateful(), dsp); } ... [some other methods of DirectLink] } where getLink() is the same as you find in DirectLink.java (of course you would need some supporting methods of the same class). As you realized, writer outputs the final markup, so you cannot create dynamic components (writing "jwcid" attribute will just result in a "jwcid" attribute in the final HTML). As I said, all the code above is only a sample implementation because your component (and most compound components) is easier to implement using a BaseComponent: .jwc <component id="link" type="DirectLink"> <binding name="listener">...</binding> <binding name="parameters">...</binding> <binding name="onmouseover">...</binding> <-- or use dojo events by a Script component </component> <component id="insertMenuName" type="Insert"> <binding name="value">menu.name</binding> </component> .html <a jwcid="link"><span><span jwcid="insertMenuName" /></span></a> I hope this helps. Regards, Norbi jake123 wrote: Norbert Sándor wrote: --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] |
