简体   繁体   中英

Should I use <h:form> in composite component or not

I would like to know whether I should use <h:form> tag in a composite component or not?

For example ;

<composite:implementation>
    <h:form>
        <h:message for="textPanel" style="color:red;" />
        <h:panelGrid columns="2" id="textPanel">
            #{cc.attrs.nameLable} : 
            <h:inputText id="name" value="#{cc.attrs.nameValue}" />
            #{cc.attrs.emailLable} : 
            <h:inputText id="email" value="#{cc.attrs.emailValue}" />
        </h:panelGrid>
        <h:commandButton action="#{cc.attrs.registerButtonAction}" 
            value="#{cc.attrs.registerButtonText}"
        />
    </h:form>
</composite:implementation>

I too had a same issue, I had included my form inside composite component and that did not work. But once I had taken in out from composite component, it worked like a charm. So my experience is that it would not work if you had included form inside composite component.

PS - This is for primefaces.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM