• raghavender k 7
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hello All,

This issue is really bugging me.
I have a visualforce page which is enabled in the force.com site and I have changed the permission set for guest profile to create,edit etc my custom obejct but still I am not seeing the controller class being run from visualforce page.

 

My visualforce page is
<apex:page sidebar="false" showHeader="true" standardStylesheets="false" standardController="Main_questionaire__c" extensions="QuestionnaireFieldsSite" recordSetVar="sitem" id="thePages" >

<apex:form id="templateForm">
<br></br>
<apex:actionFunction name="sectionStatusJS" action="{!sectionStatus}" reRender="buttonPanel"/>

<p style="text-align:center;font-size:18px">Assessment</p>
<apex:outputPanel id="buttonPanel">


<script>
window.onload=function()
{
sectionStatusJS();
setmyFlag(true);
};
</script>
</apex:outputPanel>

<apex:outputPanel rendered="{!myFlag}">
<apex:pageBlock >
<apex:pageBlockSection id="sectionBlock" title="Sections" columns="4">
<apex:repeat value="{!sectionsStatusLists}" var="section">
<apex:commandButton value=" {!section.Section_Template__r.Section_label__c}" style="text-align:center;">
<apex:param name="sectionId" value="{!section.Section_Template__r.id}"/>
<apex:param name="doRerender" value="true" assignTo="{!doRerender}"/>
</apex:commandButton>
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:outputPanel>

</apex:form>
</apex:page>


Apex class THIS CLASS'S IS NEVER CALLED.I SAW THE DEBUG IT DOESNT GET CALLED AT ALL ,NOT EVEN THE CONSTRUCTORS DEBUG STATEMENT

public with sharing class QuestionnaireFieldsSite
{

public List<Section_Template__c > sectionsLists{ get; set; }
public List<Main_questionaire__c> templateLists { get; set; }
public List<SectionStatus__c > sectionsStatusLists{ get; set; }

static integer ltoggle=0;
public Transient Boolean doRerender;
public Boolean getdoRerender(){return doRerender;}

public Boolean myFlag{get; set;}
public void setmyFlag(Boolean flags)
{this.myFlag=flags;}

public void setdoRerender(Boolean doRerender)
{
this.doRerender = doRerender;
System.debug('doRerender should be set here to true: doRerender = '+this.doRerender);
}

public QuestionnaireFieldsSite(ApexPages.StandardSetController controller) {
refreshPagePart=false; System.debug('----------initialized in sectionstatus'+myFlag);
}
public QuestionnaireFieldsSite(){System.debug('-2---------initialized in sectionstatus'+myFlag);}

public void
{myFlag=false;
theToggleVal =false;System.debug('----------initialized in sectionstatus'+myFlag);
if (!myFlag)
{
SectionStatus__c[] StatusLists=new SectionStatus__c[]{};
accountId=System.currentPageReference().getParameters().get('accId');

templateLists = [Select Id, Name from Main_questionaire__c limit 1];
if(templateLists!=NULL && templateLists.size()>=1)
{
templateName = templateLists.get(0).Name;
sectionsLists = [Select Id, Name,status__c,Section_label__c,Order_No__c from Section_Template__c where Questionnaire_Section__c=:templateLists.get(0).Id order by Order_No__c];
SectionStatus__c[] userSectionStatus=[Select id,Section_Template__c,Status__c,User__c,Account_to_SectionStatus__c from SectionStatus__c where Account_to_SectionStatus__c= :accountId] ;
if((userSectionStatus==null)||(userSectionStatus.size()==0))
{
System.debug('~~~~~~~~~~~~~COMES IN SECTION STATUS');
for(Section_Template__c res: sectionsLists )
{

SectionStatus__c stat=new SectionStatus__c();
stat.User__c=UserInfo.getUserId();

System.debug('~~~~~~~~~~~~~default controller------'+stat);
StatusLists.add(stat);

}
try
{
upsert StatusLists;
}
catch(DmlException e){System.debug('~~~~~~~~~~~~~EXCEPTION --'+e);}
}

}

}
sectionsStatusLists=[Select id,Section_Template__c,Section_Template__r.id,Section_Template__r.Section_Label__c from SectionStatus__c where Section_Template__c!=null ] ;

} myFlag=true;}
}

 

Please help.