0

I would like that the form declared in composite:implementation tag will be aligned on center. I write the follwoing code:

Web Pages/resources/ccomp/cco.xhtml

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:composite="http://java.sun.com/jsf/composite">
    <h:head>
        <h:outputStylesheet library="css" name="newcss.css"/>
    </h:head>
    <composite:interface>
    </composite:interface>
    <composite:implementation>
             <h:form id="formdiv">
                <h:outputLabel value="Text"/>
                <h:inputText validator="#{loBean.validateL}"/>
            </h:form>
    </composite:implementation>
</html>

Web Pages/resources/css/newcss.css

#formdiv {
    width: 30%;
    margin: 150px auto;
    color: green;

}

Web Pages/index.xhtml

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:lpform="http://xmlns.jcp.org/jsf/composite/lpform"
      xmlns:h="http://xmlns.jcp.org/jsf/html">
    <h:head>
        <h:outputStylesheet library="css" name="newcss.css"/>
    </h:head>
    <form>
        <ccomp:cco id="formdiv"/>
    </form>
</html>

But it doesnt work. When i deploy and run this app composite component locate at the top-left angle.

0 Answers0