function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cedgcedg 

rerender only one block and actionStatus disappear instantly

Hi 

I've a page with some blocks repeated, as i don't know at the creation how many they are. First blocks have some dropdowns, following blocks contain a upload file. 

 
<apex:outputPanel rendered="true" layout="block" style="width:440px;margin-left:auto;margin-right:auto;">
  <apex:repeat value="{!ad.advantageCafOptionList}" var="ado">
    <apex:outputPanel id="OtherOption" rendered="{!ado.selected && ado.hasSizeColor}">
	  <apex:repeat value="{!ado.advOrderingInfosList}" var="advoi">
		<apex:outputPanel layout="block" styleClass="myFormBudgetFieldset" >
		  <div style="margin-top:5px;margin-bottom:5px;">
			<apex:outputText >{!ado.Option_Displayed_Name}</apex:outputText>
			<apex:outputLabel style="padding-left:3px;" for="sizeBikeSelected">Taille:</apex:outputLabel>
			<apex:selectList style="margin:0px 5px;" id="sizeBikeSelected" value="{!advoi.sizeBike}" size="1">
			  <apex:selectOptions value="{!ado.selectOptionSizeBike}"/>
			</apex:selectList>
		  </div>
		</apex:outputPanel>
	  </apex:repeat>
	</apex:outputPanel>
	<apex:outputPanel id="uploadOption" rendered="{!ado.selected && ado.hasNoFixedPrice}">
	  <apex:repeat value="{!ado.advNoFixedPriceOfferList}" var="advnfpo">
		<apex:actionRegion>
		  <apex:outputPanel layout="block" styleClass="myFormBudgetFieldset" >
			<div style="margin-top:5px;margin-bottom:5px;">
			  <apex:outputText >{!ado.Option_Displayed_Name}</apex:outputText>
			  <div style="padding-left:15px;padding-top:5px;">
				<apex:outputPanel id="uploadFile">
				  <apex:actionStatus id="refreshStatus" startText=" (Uploading...) " stopText=" "/>
				  <apex:outputText rendered="{!not(advnfpo.attachDone)}">
				    <apex:outputLabel value="File" for="file"/>
					<apex:inputFile value="{!advnfpo.attach.body}" filename="{!advnfpo.attach.name}" id="file" />
					<apex:commandButton action="{!advnfpo.upload}" value="Upload">
					  <apex:actionSupport event="onclick" rerender="{!$Component.uploadFile}" status="refreshStatus"/>
					</apex:commandButton>
				  </apex:outputText>
				  <apex:outputText rendered="{!advnfpo.attachDone}">
					Attachment already uploaded
				  </apex:outputText>
				</apex:outputPanel>
			  </div>
			</div>
		  </apex:outputPanel>
		</apex:actionRegion>
	  </apex:repeat>
	</apex:outputPanel>
  </apex:repeat>
</apex:outputPanel>

 

I've 2 problems:

1/ when uploading one attachment, i would like to refresh only the block where is the upload file, and not all the blocks. Currently, if I select the values in the dropdowns of the first blocks, and then upload a file, all the values of the dropdowns are lost after the refresh. I tried the <apex:actionRegion> as i saw on another topic, but it doesn't work. I used also the {!$Component.uploadFile} to determine which id of the loop should be rerendered, but without success.

 

2/ when uploading the file, i would like to display a message "uploading ..". I used the <apex:actionStatus> but it disappear almost instantly. At the end of the upload, i switch the <ouputText> to be displayed. This happens much later the actionStatus disappear. I don't understand why.

 

Thanks for your help.

Ced