To display the Richfaces fileUpload component in a popupPanel.
the purpose is to hide the fileUpload component into the popupPanel, to make the page looks simpler. and only invoke the fileUpload component in the popupPanel when it is needed.
with the following codes
But there is a problem when using the popupPanel together with the fileUpload component.
Where the fileUploadListener is not being invoked, thus files are not uploaded.
the solution is pretty simple.
=> attach the popupPanel to "form" instead of "body"
the default domElementAttachment is body, thus, simply add the domElementAttachment="form"
Finally, test the fileUploadListener again.
Done.
the purpose is to hide the fileUpload component into the popupPanel, to make the page looks simpler. and only invoke the fileUpload component in the popupPanel when it is needed.
with the following codes
But there is a problem when using the popupPanel together with the fileUpload component.
Where the fileUploadListener is not being invoked, thus files are not uploaded.
the solution is pretty simple.
=> attach the popupPanel to "form" instead of "body"
the default domElementAttachment is body, thus, simply add the domElementAttachment="form"
Finally, test the fileUploadListener again.
Done.
No comments:
Post a Comment