1 Reply Latest reply on Sep 12, 2008 4:44 AM by thejavafreak

    In Custom Tag how to add h:commandbutton with action

    sannewuser123
      Hi, I created a custom tag, below is the code snippet

      <tag>
      <tag-name>customdiv</tag-name>
      <component>
      <component-type>customtag.MyCustomTag</component-type>
      <component-class>com.mydomain.testing.customtag.MyCustomTag</component-class>
      </component>
      </tag>

      In this class I am using ResponseWriter to generate the content.
      I am trying to add a button and associate action to it but it doesn't provide me any option to associate action to the commandbutton
      "<h:commandButton action="#{childdiv.addChildDiv}" value="add div"></h:commandButton>"
      Also the XHTML doesn't even recognize the h:commandbutton tag
      "HtmlCommandButton htmlCommandButton = new HtmlCommandButton();
      writer.startElement("h:commandButton", htmlCommandButton);
      writer.writeAttribute("value", "add div", "");
      writer.endElement("h:commandButton");"

      Please suggest