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
Developer.mikie.Apex.StudentDeveloper.mikie.Apex.Student 

Ajax re-render on a tabbed VF through inline editing

Hey there,

I have a tabbed Visualforce page, i will post the important section of the tab below. On my new record page, should the picklist field payment method be selected as 'Commission Deduction', a lookup field will render (will also post below). This all works perfectly, My question is:

Is it possible to make it so that my Tabbed visualforce detail page, can be altered to have a ajax re-rendering attribute similar to my New record page but through inline editing. E.G. Someone changes field payment method to 'Commission Deduction' and the lookup field will render.

Here is my new record page with Re-rendering code bolded:

<apex:page standardController="Office_Invoice__c" extensions="extSaveOffInvButton">
<apex:sectionHeader title="New Office Invoice" subtitle="{!Office_Invoice__c.name}"/>
<apex:form >
<apex:pageBlock title="New Office Invoice" mode="Detail">
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Save" action="{!SaveOfficeInvoice}"/>
<apex:commandButton value="Save&New" action="{!saveNewOfficeInvoice}"/>
<apex:commandButton value="Cancel" rendered="{!Office_Invoice__c.Office_Name__c != Null}" action="{!cancelOfficeInvoice}"/>
<apex:commandButton value="Cancel" rendered="{!Office_Invoice__c.Office_Name__c == Null}" immediate="true" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Office Invoices Information" columns="2">
<apex:inputField value="{!Office_Invoice__c.Office_Invoice_Amount__c}"/>
<apex:inputField value="{!Office_Invoice__c.Office_Invoice_GST_Amount__c}"/>
<apex:inputField value="{!Office_Invoice__c.Office_Invoice_Description__c}"/>
<apex:inputField value="{!Office_Invoice__c.Office_Invoice_Type__c}"/>
<apex:inputField value="{!Office_Invoice__c.Office_Name__c}"/>
<apex:inputField value="{!Office_Invoice__c.Office_Invoice_Date__c}"/>
</apex:pageBlockSection>

<apex:pageBlockSection title="Office Invoice Payment" columns="2">        
<apex:inputField value="{!Office_Invoice__c.Payment_Date__c}"/>
<apex:PageBlockSectionItem >
<apex:outputLabel value="Payment Method"/>
<apex:actionRegion >
<apex:inputField label="Payment Method" value="{!Office_Invoice__c.Payment_Method__c}">
<apex:actionSupport event="onchange" reRender="ajaxrequest" />
</apex:inputField>
</apex:actionRegion>
</apex:PageBlockSectionItem>
</apex:PageblockSection>
<apex:outputPanel id="ajaxrequest">
<apex:pageBlockSection rendered="{!Office_Invoice__c.Payment_Method__c=='Commission Deduction'}" title="Office Commission" >
<apex:inputField value="{!Office_Invoice__c.Office_Commission__c}"/>
</apex:pageBlockSection>
</apex:outputPanel>

</apex:pageBlock>


</apex:form>
</apex:page>


Here is my section of my Tabbed visualforce page:

apex:tab label="Office Invoice" rendered="{!$ObjectType.Office_Invoice__c.Accessible}" name="Office Invoice" id="tabOfficeInvoice" >
<apex:pageBlock title="Office Invoices" >
<apex:form >
<div align="Left">
<apex:commandbutton value="New Office Invoice" onclick="window.location='/a0P/e?CF00N90000008oaTS={!Office__c.name}&CF00N90000008oaTS_lkid= {!Office__c.id}'; return false;"/>
</div>

<apex:pageBlockTable value="{!Office__c.Office_Invoices__r}" var="OffInv" cellPadding="4"  border="4">



<apex:column headerValue="Office Invoices"  >
<apex:commandLink rerender="OffInvdetails" oncomplete="highlightElem(this);"> {!OffInv.Name}
<apex:param name="Invid" value="{!OffInv.id}"/>
</apex:commandLink>
</apex:column>
<apex:column value="{!OffInv.Office_Invoice_Amount__c}"  />
<apex:column value="{!OffInv.Office_Invoice_Date__c}" />

<apex:column value="{!OffInv.Office_Invoice_Type__c}" />
<apex:column value="{!OffInv.Office_Invoice_GST_Amount__c}" />
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
<apex:outputPanel id="OffInvdetails">
<apex:detail subject="{!$CurrentPage.parameters.Invid}" relatedList="False" inlineEdit="True" title="false"/>
</apex:outputPanel>
</apex:tab>

Thank you in advance for any help or advice you can give to me
Ashish_SFDCAshish_SFDC
Hi Mikie, 


Try this tag, 

<apex:detail inlineEdit="true" rerender="{!Opportunity.id}" >

See more in the link below, 

https://developer.salesforce.com/forums/ForumsMain?id=906F000000097ZPIAY


All of the inline edit-enabled picklists are wrapped in the <apex:outputPanel> component. The <apex:outputPanel> rerenders when the <apex:commandButton> action method fires.

http://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_inline_editing.htm


Regards,
Ashish
Developer.mikie.Apex.StudentDeveloper.mikie.Apex.Student
Thank you for your reply Ashish, however I think that you misunderstood the question. To re-iterate, my question is:

Is it possible in my tabbed visualforce page, which renders the detail view of office_invoice__c, from a pageblocktable. Then to take that render detail view ---<apex:detail subject="{!$CurrentPage.parameters.OffComid}" relatedList="True" inlineEdit="True" title="false"/>----- and should a user select something on the picklist it will render the lookup field below the detail view?

Thank you for your time