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
Dan HewDan Hew 

Rerender lead fields based on barcode

Hi,

I am creating a VF page which sets focus to a barcode textbox and automatically displays the Lead company name and address containing that barcode.

I am having trouble rerendering the section.

Please help


<apex:page standardController="Lead" >

<apex:form >


<apex:inputfield id="barcode" value="{!Lead.Barcode__c}" style="width:200px" required="true" >

    <apex:actionSupport event="onchange" rerender="refresh" />

</apex:inputField>


<script>
     document.getElementById("barcode").focus();    //see the id for account field below
</script>


<apex:pageBlock title="Bad Address" id="badAddress">  

<apex:outputPanel id="refresh" >  
                      
      <apex:pageblocksection rendered="{!IF(Lead.Barcode__c != null,false,true)}">  
             
            <apex:outputField value="{!Lead.Company}"/>
            <apex:outputField value="{!Lead.Street}"/>
            <apex:outputField value="{!Lead.City}"/>
            <apex:outputField value="{!Lead.State}"/>
            <apex:outputField value="{!Lead.Country}"/>
            <apex:outputField value="{!Lead.PostalCode}"/>

                                                      
       </apex:pageblocksection>  
                      
</apex:outputPanel>

</apex:pageBlock>