not working with

后端 未结 1 976
攒了一身酷
攒了一身酷 2021-01-25 13:51

I have a template, in which a is defined. This is used all over the application for the CRUD pages of entities.

S

相关标签:
1条回答
  • 2021-01-25 14:48

    The reference pages for h:form does not mention enctype facet. I don't think it is valid facet for h:form. However, there is attribute enctype.

    If you want to define content type of the form in specific pages then use template parameters like shown below.

    Template would look then:

    <h:form id="main-form" enctype="#{myenctype}">
    
        <ui:insert name="buttons"/><p/>
        <ui:insert name="content"/><p/>
        <ui:insert name="buttons"/>
        <ui:insert name="additionalHelper"/>
    
    </h:form>
    

    and specific page has to define <ui:param name="myenctype" value="multipart/form-data"/>:

    <ui:composition template="template.xhtml">
        <ui:param name="myenctype" value="multipart/form-data"/>
        <!-- other stuff like <ui:define ...> -->
    </ui:composition>
    

    If you want to provide default value for the parameter use ternary operator like described in this question.

    0 讨论(0)
提交回复
热议问题