JSF Primefaces And html input

1

For reasons of requirement, I have to combine components of primefaces and an input file in pure html. Now my question is, can I have the html input inside a JSF form? And that practically the whole view is with PrimeFaces and from a bean to process the file to be loaded with the input file component. Example of what I intend:

<p:panel header="Subir TXT" id="panelDwn" style="border: none;" >
    <h:panelGrid columns="1" cellpadding="5" style="border: none;">
        <h:outputLabel style="color: #545454; font-size: 16px;" value="Seleccione el archivo a validar TXT:" />
    </h:panelGrid>
    <h:panelGrid id="panelDes" columns="2" cellpadding="5" style="border: none;">
        <!-- INPUT FILE  HTML -->
        <input type="file" name="archivoupload"/>
        <h:outputLabel id="lblStatus" style="color: #545454; font-size: 16px;" value="#{uploadFileBean.status}" />                          
        <!--h:outputLabel style="color: #545454; font-size: 16px;" value="#{uploadFileBean.statusDownload}" /-->
    </h:panelGrid>
    <br />
    <h:panelGrid columns="2" cellpadding="5" style="border: none;">
        <p:commandButton styleClass="basicbtngobmx" value="Regresar" actionListener="#{captchaComponent.reset}" ajax="false" />
        <p:commandButton id="comdDwn" value="Descargar archivo" actionListener="#{uploadFileBean.resetValida}" ajax="false" disabled="#{uploadFileBean.status ==null or captchaComponent.statusBtnDescargarArchivo ==null}" update="fileUp">
            <p:fileDownload value="#{uploadFileBean.file}" ajax="false" />                           
        </p:commandButton>
    </h:panelGrid>                          
</p:panel>

Behind from a bean invoke a servlet to upload and process the file and output a processed txt. I only have my question for this functionality.

In the code, I try to exemplify that the inputFile will be html and the rest of the components of primefaces.

    
asked by Ventur 23.05.2016 в 19:13
source

2 answers

1

If it is by request, there is no other but I do not recommend what you are saying.

But to solve what you say, use this tag

  <f:view contentType="text/html">

         tu código html

 </f:view>

with this jsf you can compile your html code if problems greetings

    
answered by 26.05.2016 / 18:54
source
0

It can be done without any prisma, what jsf does is generate that html and primefaces you also generate HTML, with jquery, I would choose to do it with jquery instead of pure html, since you could give it a call ajax, if you do it only with html, you will have to send the form to be processed with the servlet.

Greetings

    
answered by 27.09.2016 в 00:03