• SFDC Developer A
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Hi Guys,

In visual force page, when user clicks on "Save" button ( that is command button with action function ), we are first validating input fields and then creating / deleting records using those fields.

Those fields are declared as "public getter /setter" ( i.e class variables with state ). Again there are many fields which are in "inner class" which act as wrapper class and that wrapper class is defined via class variable on outer class.

In our current implementation, when we encounter validation error, we are refreshing entire page.

Now, I wanted to change the behavior from "refreshing entire page" to "only refresh error MSG section" ( i.e partial refresh ).

Will that create any issues with regards to "state" of the variables ?

Will we face any issue regarding messed up state for member variables ( getter / setter )?

Please give your input.

Thanks !!
Hi,

We have installed package in production / test org. When we try to navigate from one visual force page to another visual force

page in "Sites", we see issue with binding input field.

Issue seems to be happening when we use external template page ( template which is not packaged in our package ) and not with

the template page which we ship.

We looked closely at external template for wrong Namespace use but doesn't found anything.

Also, when the page is loaded for the first time it's working fine, on click of "Save" button, we redirect page to another

visual force page and at that time the issue is coming.

When we submit ( save ), it try to reload the page and that's where it breaks with above error. On First load, it doesn't have

any issue with binding.

On that page, after doing some debugging, we understood that, it has some issue with the binding variable for Input field (i.e

if we use input text, input text area etc, it works fine ).

Here is what the Visual force error looks like ::

Could not resolve field 'Response__c' from value binding '{!RQR.RQResponse.Response__c}' in page portalresponseentry

We are using wrapper class and dynamically binding field using that wrapper class with "Input Field".

Above visual force page and controller are not changed since last release of our package. Between last relase and current

release of our product there has been release by salesforce. This issue seems to happen after latest salesforce ( spring )

release. Before that this page was working fine.

In non package environment, we couldn't reproduce the issue.

Please find below sample code with comments ::

===========================================================================================
/*
Controller class which extends portal base controller.
In Base controller, we have method to identify template.

Template page can be configured different for different production orgs.
It would be external template page for branding etc.

If external template is not specified, we use our internal tempalte page ( internal == shipped with package )
*/

public without sharing class EnterMultipleResponses extends PortalBaseController
{
    public List<ResponsesWrapper> m_prqdetails {get; set;}

    public List<ResponsesWrapper> getPortalResponses()
    {
        // This method creats list of wrapper class
    }

    // This method save and redirect
    public PageReference saveAndRedirect()
    {
        PageReference redirectPage = new PageReference(Page.PortalHomePageSelector.getUrl());
        redirectPage.setRedirect(true);
        return redirectPage;
    }

    // Inner class
    public class ResponsesWrapper implements Comparable
    {
        public Requirement_Question_Response__c RQResponse {get;set;}
    }
}

======== Page code =================================

<apex:page standardcontroller="Requirement_Question_Response__c" recordSetVar="allRQRs" extensions="EnterMultipleResponses"

sidebar="false" showHeader="false">
<apex:form >
 
  <!-- strTemplatePageName , comes from what is configured for that client -->
 
  <apex:composition template="{!strTemplatePageName}">
  <apex:define name="mainContents">
  
   <apex:repeat value="{!PortalResponses}" var="RS">
    <apex:pageBlockTable value="{!RS.m_prqdetails}" var="RQR">
     <apex:inputText value="{!RQR.RQResponse.Response__c}" />
    </apex:pageBlockTable>
   </apex:repeat>

  </apex:define>
  </apex:composition>
</apex:form>
</apex:page>

Thanks.