You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Piotr <kr...@gmail.com> on 2008/04/14 18:06:43 UTC

Re: iframe and saveState

Hi,

I just got answer from Martin, regarding Orchestra clustering, who asked me
to post it here.
So here it goes:

"this is only true if you use the JPA-support of Orchestra - if you do
not use JPA, you can certainly run Orchestra in a clustered
environment as well."



Piotr wrote:
> 
> any ideas please.
> 
> 
> 
> Piotr wrote:
>> 
>> Hi users,
>> 
>> I'm trying to do file upload functionality kind of similar to gmail one.
>> I thought that it could be done using iframe and saveState from tomahawk
>> but I'm facing some problems.
>> 
>> In my page main page I have nested iframe component:
>> ...
>> <h:form>
>> 
>>   .. some input fields etc.
>> 
>>     <div id="attachments">
>>         <iframe src="attachments.html" frameborder="0" scrolling="no"
>> width="90%" height="60" ></iframe>
>>     </div>
>> 
>>   <h:commandLink action="#{someMBean.save} value="save" />
>> 
>> </h:form>
>> ...
>> 
>> 
>> page nested in the iframe:
>> ...
>>   <t:saveState id="uploadedFiles"
>> value="#{someBean.uploadedAttachements}"/>
>> 
>> ...some data table to display uploaded files
>> 
>>   <h:form enctype="multipart/form-data">
>>       <h:panelGrid columns="2">
>>           <t:inputFileUpload value="#{someMBean.attachment}"
>>               storage="file" accept="*/*" required="true" size="30"/>
>>           <h:commandButton value="upload" action="#{
>> someMBean.uploadAttachement}"/>
>>       </h:panelGrid>
>>   </h:form>
>> ....
>> 
>> Now the issue is that when I upload the files, with the iframe nested
>> page,
>> they are stored between request with "saveState" tag as they should,
>> I can see them listed in the data table.
>> The problem is that when I try to save the whole item (some input fields
>> and
>> uploaded attachment files), with previously uploaded attachments,
>> using the form in my main page (the one in which iframe is nested) the
>> uploaded attachments collection is empty.
>> Placing <t:saveState id="uploadedFiles" value="#{
>> someBean.uploadedAttachements}"/> in the main page doesn't change
>> situation.
>> Is there a way to keep state of some variable between requests generated
>> from iframe and my main page?
>> Maybe I'm following wrong way to do this upload, do you have any other
>> proposals?
>> 
>> Please note that I don't want to store anything in session scope.
>> 
>> 
>> Thanks in advance.
>> Piotr
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/iframe-and-saveState-tp15981711p16678808.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.