}
@Override
protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException
{
UISelectDate selectDate = (UISelectDate) component;
UIComponent forComponent = selectDate.findComponent(selectDate.getFor());
if (forComponent==null)
{
throw new IllegalStateException("could not find component with id: " + selectDate.getFor());
}
writeScript(context, selectDate);
writer.startElement("span", selectDate);
writer.writeAttribute("onclick", "__selectDate('" + forComponent.getClientId(context)
+ "', '" + forComponent.getClientId(context) + "');", null);