Discussions

Web tier: servlets, JSP, Web frameworks: How to develop cumstom JSF tag to use existing UIComponents

  1. I try to write a custome JSF tag to use directly existing JSF UIComponents, but failed, part of my code :

    . . . . . .
    ResponseWriter jw = context.getResponseWrite();
    ... reqObj = (my object)((HttpSession)context.getExternalContext().getSession(
    false)).getAttribute("customerSearch");

    jw.write("TestForEach");

    int j = reqObj.getObjectList().size();

    for(int i=0; i<j; i++){

    jw.write("<h:panelGroup styleClass=...\"");
    jw.write("<h:panelGroup rendered=\"true\">");
    jw.write( "<h:commandLink action=\"#{...}\">");
    jw.write(
    "<h:outputText value=\"#{...}\"></h:outputText>");
    jw.write( "<h:outputText value=\"test" + i + "\"></h:outputText>");
    jw.write( "<f:param name=\"seq\" value=\""+i+ "\"></f:param>");
    jw.write(
    "</h:commandLink>");
    jw.write(
    "</h:panelGroup>");
    }

    How to use directly the exisiting UIComponent in the custome tag?
    are there examples?

  2. my code does not work[ Go to top ]

    my code does not work:

    JspWriter jw =
    pageContext.getOut();
    jw.println("TestForEach");
    int j = ...getList().size();
    for(int i=0; i<j; i++){
    jw.println(
    "<h:panelGroup styleClass=...\"");
    jw.println("<h:panelGroup rendered=\"true\">");
    jw.println( "<h:commandLink action=\"#{...}\">");
    jw.println(
    "<h:outputText value=\"#{...}\"></h:outputText>");
    jw.println( "<h:outputText value=\"test" + i + "\"></h:outputText>");
    jw.println( "<f:param name=\"seq\" value=\""i "\"></f:param>");
    jw.println(
    "</h:commandLink>");
    jw.println(
    "</h:panelGroup>");
    }

    How to use directly the exisiting UIComponent in the custome tag?
    are there examples?