This content has been marked as final.
Show 5 replies
-
1. Re: <a4j:aroundInvoke ? or something else ?
nimo22 Dec 6, 2009 5:53 PM (in response to nimo22)The component
<a4j:aroundInvoke bind="fileUpload.xhtml" action="#{
myBean.uploadGif}" var="uploadFiles">
</a4j:aroundInvoke>
would then produce this jsf-tree... <a4j:outputPanel> <h:form> <rich:fileUpload .. /> <!-- the 'action-method' depends on the site, in which fileUpload.xhtml is embeeded, so the var 'uploadFiles' of 'a4j:aroundInvoke' injects the right method--> <a4j:support event="onuploadcomplete" action="#{myBean.uploadGif}"/> </rich:fileUpload> </h:form> </a4j:outputPanel> ..
Is this idea sensefull? Or exists another simpler way? -
2. Re: <a4j:aroundInvoke ? or something else ?
ilya_shaikovsky Dec 7, 2009 3:29 AM (in response to nimo22)try please
<ui:composition> <a4j:outputPanel> <h:form> <rich:fileUpload id="uploadTracks" styleClass="#{styleUploadFiles}" .. /> <a4j:support event="onuploadcomplete" action="#{uploadFilesBean.uploadFiles}"/> </rich:fileUpload> </h:form> </a4j:outputPanel> </ui:composition>
and<a4j:outputPanel> <ui:include src="uploadFiles.xhtml"> <ui:param name="uploadFilesBean" value="#{myBean}" /> </ui:include> </a4j:outputPanel>
so you passing object reference which should implement upload method. -
3. Re: <a4j:aroundInvoke ? or something else ?
nbelaevski Dec 7, 2009 6:15 AM (in response to nimo22)Hi,
JSF2 is capable of passing method expressions into composite components, so it's not necessary. We've implemented solution for the problem in photoalbum application, you can check it. -
4. Re: <a4j:aroundInvoke ? or something else ?
nimo22 Dec 7, 2009 6:33 AM (in response to nimo22)hello ilya,
thank you, this works:<ui:composition> <a4j:outputPanel> <h:form> <rich:fileUpload id="uploadTracks" styleClass="#{styleUploadFiles}" .. /> <a4j:support event="onuploadcomplete" action="#{uploadFilesBean.uploadFiles}"/> </rich:fileUpload> </h:form> </a4j:outputPanel> </ui:composition> <ui:include src="components/uploadTracks.xhtml"> <ui:param name="uploadFilesBean" value="#{mySessionBean}" /> </ui:include>
however, I have to create two objects which I want to avoid - but nice to know this!
hey nick,JSF2 is capable of passing method expressions into composite components
this is exactly what I need - I will check the "photoalbum application" (however, I guess, I have to wait till jsf2 and rf4 is out, so I cannot use it yet, am I right?). -
5. Re: <a4j:aroundInvoke ? or something else ?
ilya_shaikovsky Dec 8, 2009 8:36 AM (in response to nimo22)I have been able to google some solutions in facelets related blogs some time ago.. but not stored the links.. :( Try search more for it.. just search the facelets related solutions and not RF related.