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
Mark YoungMark Young 

VF Functionality Changed / BUG? - Components & InputFields

Hi all,
 
VisualForce functionality appears to have changed today (20th EST) (tested on na2 and tapp0) in regards to multi-layered components and input fields.  This functionality definately used to work and now definately doesn't.  Repro is below:  Am I doing something wrong, or has a patch been rolled out?
 
We have quite a few areas where functionality within pages is encapsulated into components with the main object passed into these components.
What is happening below is that the field that is wrapped by the outputBlock is not returning the object value or saving it on postback.  So when clicking the button below this field will become blank, while the field that isn't wrapped will display correctly.
 
If we remove the attribute from the test component below and retrieve the value from a component controller it works fine.  However, this goes against much of this component structure.
 
 
Component 1 (OutputBlock):
Code:
<apex:component > 
    <apex:componentBody > 
    </apex:componentBody> 
</apex:component>

 

Component 2 (TestOutputBlockComponent):  This is the component that does most of the work:

Code:
<apex:component >
    <apex:attribute name="contact" type="Contact" description="Contact object passed from parent" required="true" />
    
    <apex:pageBlock title="Inputs">
        <apex:pageBlockButtons>
            <apex:commandButton value="save" />
        </apex:pageBlockButtons>
 
        <apex:pageBlockSection title="Fields with Validation" columns="1">
            <apex:pageBlockSectionItem>
                <apex:outputLabel value="First Name" for="firstname" />
                <c:OutputBlock>
                    <apex:inputField value="{!contact.FirstName}" id="firstname" />
                </c:OutputBlock>
            </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
 
        <apex:pageBlockSection title="Fields without Validation" columns="1">
            <apex:inputField value="{!contact.LastName}" />
        </apex:pageBlockSection>
    </apex:pageBlock>
        
    <apex:pageBlock title="Values">
        {!contact.FirstName}<br />
        {!contact.LastName}
    </apex:pageBlock>
</apex:component>


Page:

Code:
<apex:page standardController="Contact">
    <apex:form>
        <c:TestOutputBlockComponent contact="{!contact}" />
    </apex:form>
</apex:page>


 
 


 
 
 
 


Message Edited by Mark Young on 08-20-2008 09:15 PM
dchasmandchasman
We are investigating this now - there was a patch released in that time frame.
Mark YoungMark Young

Thanks Doug,

FYI I've been able to work around it by assigning the attribute to a variable in the controller then binding to that controller property instead of the component attribute.  Not sure if that helps.

 

Mark

jwetzlerjwetzler
Mark can you try this again?
Mark YoungMark Young

Hi Jill,

Thanks, this seems to be working now.

Cheers,

Mark

jwetzlerjwetzler
Thanks Mark.  Sorry for the inconvenience, we really appreciate your patience.