I am using the fileUpload feature of PrimeFaces 4.0 to upload a .css file. The application then needs to load all of the stylesheet classes in the file. The application then should render a selectOneMenu
with the classes, one of which the user will choose, which will then apply to another element.
The problem is that I could not find a way to update the selectOneMenu
after having uploaded a file. I have the file upload even longer as loading the elements from selectOneMenu
ManageBean.
Here is upload.xhtml
:
<h:form id="Edit" enctype="multipart/form-data">
<p:fileUpload fileUploadListener="#{sintaxisWizard.handleFileUpload}"
mode="advanced"
update="growl productCode"
label="Escoge archivo css"
auto="true"
sizeLimit="10485760"
allowTypes="/(\.|\/)(css)$/"
invalidSizeMessage="El maximo tamaño del archivo es 10 Megabytes !"
invalidFileMessage="Unicamente se puede subir archivos css" />
</h:form>
And my selectOneMenu
<p:selectOneMenu id="combo" value="#{sintaxisWizard.animalSelected}">
<f:selectItem itemLabel="Select..." noSelectionOption="true"/>
<f:selectItems value="#{sintaxisWizard.allAnimals}" />
</p:selectOneMenu>