+ Start a Discussion
Dan HewDan Hew 

Rerender lead fields based on barcode


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" />


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

<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}"/>