using <ace:fileEntry>
with a series of <h:commandButton> markup as follows:
<ice:form>
<ace:fileEntry id="fileEntryComp"
relativePath="/files/"
maxFileSize="6291456"
maxFileSizeMessage="Submitted file is too large."
maxTotalSize="18874368"
maxTotalSizeMessage="Total size of submitted files is too large."
required="true"
requiredMessage="The file is required to submit this form."
useOriginalFilename="true"
fileEntryListener="#
{conversationBean.upload}
">
</ace:fileEntry>
<h:commandButton id="submitBtn" value="PlainSubmit" type="submit"/>
<h:commandButton id="cmdAttr" value="submitWithAttr" type="submit">
<f:attribute name="convIdAttribute" value="#
{javax.enterprise.context.conversation.id}"/>
</h:commandButton>
<br />
<h:commandButton value="UPLOAD THAT LOSES CID ON THE WAY"
action="#{conversationBean.uploadAction}">
</h:commandButton>
<h:commandButton
value="UPLOAD THAT RETAINS CID, BUT NEVER RUNS THE ACE:FILEENTRY LISTENER METHOD"
action="#{conversationBean.uploadAction}">
<f:param name="cid"
value="#{javax.enterprise.context.conversation.id}
" />
</h:commandButton>
</ice:form>
using 3.0.0.RC2...
none of the first 3 h:commandButton's will fire until after I have used the last one (???? is there something that limits only one submit per form now?).
Last one, retains the cid, but the File is empty for the upload (even when it is not)....has this component been tested with <f:param>?? Anyways, get the File is required for this component message, so no file is created when using f:param in this use-case.
All the other options (only working once I have used the last button on the form)....have problems with the conversation being null. Tested and it is null at the very beginning of the fileListener method. (checked it first thing). I would imagine that the context may be cleaned out
.
it is stored in javax.enterprise.context.conversation which becomes null as soon as you trigger the method for the fileListener.
Files are all uploaded successfully with first 3 options, but conversation is null (problem for weld/CDI).
using ICEfaces-2.0.2 release:-
(package name changed for the file entry classes between this version and 3.0.0.RC2).
I don't have to fire the last button, I can fire any of them and they will work as above.
Again, the conversation is lost for the first three but not the last, but the file is empty for the last one.
question....
how do we want this to work??? Should whatever is in the request context (like conversation) be kept as this component moves through it's processing, or do we want to allow the use of <f:param> to ensure they can maintain their parameters
. Either way, neither is working at this time, but probably should decide what is going to be supported for items like conversation id propagation.
using <ace:fileEntry>
with a series of <h:commandButton> markup as follows:
{conversationBean.upload}<ice:form>
<ace:fileEntry id="fileEntryComp"
relativePath="/files/"
maxFileSize="6291456"
maxFileSizeMessage="Submitted file is too large."
maxTotalSize="18874368"
maxTotalSizeMessage="Total size of submitted files is too large."
required="true"
requiredMessage="The file is required to submit this form."
useOriginalFilename="true"
fileEntryListener="#
">
</ace:fileEntry>
<h:commandButton id="submitBtn" value="PlainSubmit" type="submit"/>
{javax.enterprise.context.conversation.id}"/><h:commandButton id="cmdAttr" value="submitWithAttr" type="submit">
<f:attribute name="convIdAttribute" value="#
</h:commandButton>
<br />
<h:commandButton value="UPLOAD THAT LOSES CID ON THE WAY"
action="#{conversationBean.uploadAction}">
</h:commandButton>
<h:commandButton
value="UPLOAD THAT RETAINS CID, BUT NEVER RUNS THE ACE:FILEENTRY LISTENER METHOD"
action="#{conversationBean.uploadAction}">
<f:param name="cid"
value="#{javax.enterprise.context.conversation.id}
" />
</h:commandButton>
</ice:form>
using 3.0.0.RC2...
none of the first 3 h:commandButton's will fire until after I have used the last one (???? is there something that limits only one submit per form now?).
Last one, retains the cid, but the File is empty for the upload (even when it is not)....has this component been tested with <f:param>?? Anyways, get the File is required for this component message, so no file is created when using f:param in this use-case.
All the other options (only working once I have used the last button on the form)....have problems with the conversation being null. Tested and it is null at the very beginning of the fileListener method. (checked it first thing). I would imagine that the context may be cleaned out
.
it is stored in javax.enterprise.context.conversation which becomes null as soon as you trigger the method for the fileListener.
Files are all uploaded successfully with first 3 options, but conversation is null (problem for weld/CDI).
using ICEfaces-2.0.2 release:-
(package name changed for the file entry classes between this version and 3.0.0.RC2).
I don't have to fire the last button, I can fire any of them and they will work as above.
Again, the conversation is lost for the first three but not the last, but the file is empty for the last one.
question....
. Either way, neither is working at this time, but probably should decide what is going to be supported for items like conversation id propagation.
how do we want this to work??? Should whatever is in the request context (like conversation) be kept as this component moves through it's processing, or do we want to allow the use of <f:param> to ensure they can maintain their parameters