Регистрация  |  Вход

<apex:inputfile> с "rerender"

Привет всем!

Столкнулся с проблемой. Нужно сделать загрузку файла в объект. Использую <apex:inputfile>, но вот только он не работает с "rerender", а таких строк с rerender у меня много, а использовать <apex:actionRegion> не вариант.

Может как то можно через <input type="file" /> сделать?

<apex:page standardController="MbO_Form__c" cache="false" extensions="MbO_FormEdit_Extension" sidebar="{!showOld}" showHeader="true">
..........................................................
<apex:form id="lines" rendered="{!not(showOld)}" >
<apex:pageBlock title="Related MbO Lines:" >
<apex:pageBlockSection columns="1" >
<apex:pageBlockTable value="{!myLines}" var="item" id="wtable" >

<apex:column headerValue="Goal" width="40%" id="GoalsFocus" rendered="{!showG}">
<apex:inputField value="{!item.line.Goal__c}" id="goal" style=" width:95%">

<apex:inputFile filename="{!item.attachment.Name}" contentType="{!item.attachment.contentType}" size="50" value="{!item.attachment.body}" > </apex:inputFile>

</apex:inputField>
<apex:actionSupport event="onload" rendered="{!showG}" focus="goal"/>
</apex:column>


<apex:column headerValue="Goal %" style="text-align:center" width="5%" rendered="{!showG}">
<apex:inputField value="{!item.line.Goal_Percent__c}" style=" width:95%">
<apex:actionSupport event="onchange" rerender="lines,GA" /> <!-- rerender="lines,GA" -->
<apex:actionSupport event="onblur" rerender="lines,GA"/> <!-- rerender="lines,GA" -->
</apex:inputField>
</apex:column>
........................................
</apex:pageBlockTable>
</apex:pageBlockSection>
..........................................
</apex:form>
</apex:page>

Привет всем!

Столкнулся с проблемой. Нужно сделать загрузку файла в объект. Использую  <apex:inputfile>, но вот только он не работает с "rerender", а таких строк с rerender у меня много, а использовать <apex:actionRegion> не вариант.

Может как то можно через <input type="file" /> сделать?

[code]<apex:page standardController="MbO_Form__c" cache="false" extensions="MbO_FormEdit_Extension" sidebar="{!showOld}" showHeader="true">
..........................................................
<apex:form id="lines" rendered="{!not(showOld)}" >
  <apex:pageBlock title="Related MbO Lines:"  >
        <apex:pageBlockSection columns="1" >
            <apex:pageBlockTable value="{!myLines}" var="item" id="wtable" >
 
               <apex:column headerValue="Goal" width="40%" id="GoalsFocus" rendered="{!showG}">  
                   <apex:inputField value="{!item.line.Goal__c}" id="goal" style=" width:95%">   

<apex:inputFile filename="{!item.attachment.Name}"  contentType="{!item.attachment.contentType}"  size="50" value="{!item.attachment.body}"  > </apex:inputFile> 

                   </apex:inputField>                               
<apex:actionSupport event="onload" rendered="{!showG}" focus="goal"/>
               </apex:column> 
                       
            
                <apex:column headerValue="Goal %" style="text-align:center" width="5%"  rendered="{!showG}">   
                    <apex:inputField value="{!item.line.Goal_Percent__c}" style=" width:95%">
<apex:actionSupport event="onchange" rerender="lines,GA" /> <!-- rerender="lines,GA" --> 
<apex:actionSupport event="onblur" rerender="lines,GA"/> <!-- rerender="lines,GA" --> 
                    </apex:inputField>
                </apex:column> 
........................................
                </apex:pageBlockTable> 
          </apex:pageBlockSection>
..........................................
</apex:form>
</apex:page>[/code]

может я банально выскажусь А проблема то какая ? опиши более детально,я понял так что ты кудато чего то сохроняешь а потом оно не перерисовывается.

может я банально выскажусь А проблема то какая ? опиши более детально,я понял так что ты кудато чего то сохроняешь а потом оно не перерисовывается.

видать после ререндера у человека не отображается ранее выбранный файл)))) xD

видать после ререндера у человека не отображается ранее выбранный файл)))) xD

Странно, что никто из вас этого не знает, одна из самых распространенных проблем.
Первая ссылка в гугле - http://salesforce.stackexchange.com/questions/9267/how-to-resolve-a-inputfile-rerender-problem

Странно, что никто из вас этого не знает, одна из самых распространенных проблем.
Первая ссылка в гугле - http://salesforce.stackexchange.com/questions/9267/how-to-resolve-a-inputfile-rerender-problem

Кст, такие вещи часто спрашивают на собеседованиях.

Кст, такие вещи часто спрашивают на собеседованиях.