+ Start a Discussion
sunil316sunil316 

Issue related to Dependent Filtered Lookup used in VF Page.

Hi,

 

Here, I have an object, in which there are 2 lookup fields, Account and CustomObject__c. CustomObject__c is a filtered lookup and its value depends on the value of Account Lookup value.

 

I am using both Account and Filtered Lookup in VF page. Because of the CustomObject__c field, if I perform any AJAX call from the VF page irrespective of the rerender attribute, whole page gets rerendered and focus always goes back to first input field.

 

How can I eliminate rerendering of the whole page and focus change?

 

Thanks,

Sunil

Shashikant SharmaShashikant Sharma

Could you please share code of your VFP. Then it would be easier to answer it.

sunil316sunil316

Following is the code snippet,

<apex:form>
    <apex:pageBlock title="Opportunity Edit" id="pb">
        <apex:pageBlockSection title="Opportunity Information" columns="2" collapsible="false">            
            <apex:inputField  value="{!objOpp.Name}"  />
            <apex:inputField  value="{!objOpp.AccountId}" />   Account Lookup
            <apex:inputField  value="{!objOpp.CustomObject__c}"  />  //Filtered lookup
        </apex:pageBlockSection>
    </apex:pageBlock>    
    <apex:outputPanel rerender="op">
        <apex:inputText    value="{!strText}"/>
        <apex:commandButton value="Search" action="{!btnSearch}" rerender="op"/>
        <apex:datatable>
            <--Table Data-->
        </apex:datatable>
    </apex:outputPanel>
</apex:form>   

 

For above code, on click of Search button, I rerendered "op" only, but it will rerendered the whole page, and focus is getting back to the first element of the page that is {!objOpp.Name}. It works similarely for any Ajax call from this page.

 

NOTE: If I remove the Filtered lookup field from the VF page, it works as expected.

dev401hasdev401has

Hi Sunil,

 

You figured out any solution related to this issue?

If so can you please share the same. I am also facing the same issue regarding rendering due to look up filter.

 

Thanks

Saurabh DhobleSaurabh Dhoble

You need to say <apex:outputPanel rerender ID="op">

 

nashnessnashness

I don't think that solves it. I'm facing the same problem. Any kind of rerendering is shifting focus to the first input field on the page. Let me know if anyone was able to solve it. 

dev401hasdev401has

This seems to be a bug from Salesforce end.

We have raised case in Salesforce and it escalated to higher level and they are investigating the issue.

Hope to find some solution from their end.

 

I will post if i get some clear solution from them