the key for event hanldling in JSF custom tag is the queueEvent() method of the Component.
1. for the input component, you can invoke
queueEvent(new ValueChangeEvent(this, previous, newValue));
such as dropdown list tag, in renderer class, you can set onchange="submint()"
writer.startElement("select", component);
writer.writeAttribute("name", alComp.getClientId(context), null);
writer.writeAttribute("id", alComp.getClientId(context), null);
writer.writeAttribute("onchange", "submit()", null);
writer.startElement("option", component);
writer.writeAttribute("value", "", null);
writer.write(unselectedLabel);
writer.endElement("option");
writer.endElement("select");
2. for command component, if you want action and actionListener make sense, you need to invoke
queueEvent(new ActionEvent(component));
in renderer class, you can set onclick="submit()"
such as commandLink
writer.startElement("a", component);
writer.writeAttribute("href", "#", null);
writer.writeAttribute("onclick", "submit()", null);
writer.write("CommandLink tag");
writer.endElement("a");
1. for the input component, you can invoke
queueEvent(new ValueChangeEvent(this, previous, newValue));
such as dropdown list tag, in renderer class, you can set onchange="submint()"
writer.startElement("select", component);
writer.writeAttribute("name", alComp.getClientId(context), null);
writer.writeAttribute("id", alComp.getClientId(context), null);
writer.writeAttribute("onchange", "submit()", null);
writer.startElement("option", component);
writer.writeAttribute("value", "", null);
writer.write(unselectedLabel);
writer.endElement("option");
writer.endElement("select");
2. for command component, if you want action and actionListener make sense, you need to invoke
queueEvent(new ActionEvent(component));
in renderer class, you can set onclick="submit()"
such as commandLink
writer.startElement("a", component);
writer.writeAttribute("href", "#", null);
writer.writeAttribute("onclick", "submit()", null);
writer.write("CommandLink tag");
writer.endElement("a");