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
SFDC Developer ASFDC Developer A 

Issue with Input field binding on sites when external template being used

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.
Eli Flores, SFDC DevEli Flores, SFDC Dev
do both pages share the same controller and extensions?