I've got a component on my form (id="theDocument") that I want to render differently under certain circumstances.
If 'myBean.theDocument' exists, I want it to render as a p:commandLink, but if it doesn't exist, I want it to render as plain text e.g. h:outputText.
This condition will change after a file upload (after the upload, myBean.theDocument will exist, so I want it to render as the p:commandLink).
So on my p:fileUpload, I have this kind of thing:
<p:fileUpload fileUploadListener="#{myBean.handleFileUpload}" update="theDocument">
I've been using rendered="...", and update works fine for refreshing the value of an existing component. But how do I change the type of the component after an ajax update (or do I need to refresh the whole page and make the decision to render as text or a link in a more general way?
Thanks