6
I’m using the component FileUpload
of the first faces in the mode="simple"
and it’s run normal. But when I click the save button on a certain folder, it refreshes the whole page. There’s a way to take it out?
Below is my XHTML code:
<h:form enctype="multipart/form-data" id="form"><p:messages id="messages" showDetail="true" autoUpdate="true"
closable="true" />
<h:panelGrid columns="1" cellpadding="2" style="font-size: 10px" id="panelGrid1">
<h:panelGroup id="panelGroup1" >
<p:outputLabel for="nomeTexto" value="Nome do Texto: " rendered="#{parametrizacaoTagsControl.tipoTag == 1}" />
<p:inputText id="nomeTexto"
value="#{parametrizacaoTagsControl.nomeTexto}" rendered="#{parametrizacaoTagsControl.tipoTag == 1}" />
<p:fileUpload value="#{parametrizacaoTagsControl.file}"
mode="simple" skinSimple="true" rendered="#{parametrizacaoTagsControl.tipoTag == 2}" label="Escolher arquivo"/>
</h:panelGroup>
<p:separator />
<h:panelGrid columns="4" cellpadding="2" style="font-size: 10px" id="panelGrid2" >
<p:commandButton value="Incluir" ajax="false"
actionListener="#{parametrizacaoTagsControl.upload}"
disabled="#{!parametrizacaoTagsControl.habilitaBotoes}" />
</h:panelGrid>
</h:panelGrid>
</h:form>
Ever tried to use ajax?
– ptkato
it’s already working, I just don’t want it to keep giving refresh on the whole screen.
– Renato Romão
That’s exactly what @Patrick commented on. Use ajax. Leave the
ajax="true"
and update the<h:form>
withupdate="@form"
.– Luídne
If I leave as true the ajax it stops working.
– Renato Romão
You will have to change your code. ñ just put ajax. search on google: ajax primefaces upload
– uaiHebert