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
anu123anu123 

plcaing <apex:input field > tag of standard objects (event) in sites

Hi All, 

  i develop a page for event object search functionality. in that fo searching events based on from date and to date.For that we need to enter the dates like From:---------------

   To:-------------.these field are visible in vf page. but not visible in sites.But i did all CRUD settings and field level security settings.whats wrong in my code.I hope. any  one can resolve my problem.

 

 

 

My site url is:      https://sravani-developer-edition.ap1.force.com/Eventpage 

 

 

 

Page is:  

 

<apex:page Controller="eventpage"  sidebar="false">  <apex:form ><apex:pageBlock title="Search for an event">Location:<apex:inputText value="{!location}"/><br/>Category:<apex:inputText value="{!Category}"/><br/><br/><b>Daterange:</b><br/><br/>From:<apex:inputField value="{!dates.startdate__c}"/><br/>To: <apex:inputField value="{!dates.enddate__c}"/><br/><br/>
<apex:commandButton value="Find Events" action="{!findevents}"/><apex:outputPanel rendered="{!cat}">  <apex:pageBlock >  <apex:pageBlockTable value="{!events}" var="acc">  <apex:column headerValue="Event name" value="{!acc.Whoid}"/>  <apex:column headerValue="Location" value="{!acc.Location}"/>  <apex:column headerValue="FromDate" value="{!acc.startdate__c}"/>  <apex:column headerValue="ToDate" value="{!acc.enddate__c}"/>  <apex:column headerValue="Category" value="{!acc.Category__c}"/></apex:pageBlockTable></apex:pageBlock>  </apex:outputPanel>      </apex:pageBlock>     </apex:form>     </apex:page>

 

 

controller is:

 

public class eventpage{public string fromdate1{set;get;}public string location{set;get;}public string category{set;get;}public boolean cat{set;get;}event edate=new event();
public void setedate(event ed){edate=ed;
}public event getedate(){return edate;}public list<Event> elist=new list<Event>();
public void findevents(){elist.clear();if(location!=''&& category==''&& edate.startdate__c==null && edate.enddate__c==null){string s=location+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where location like:s]) { elist.add(e); system.debug('+++++++'+elist); }}else if(category!=''&&location==''&& edate.startdate__c==null && edate.enddate__c==null){string s1=category+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where category__C like:s1]) { elist.add(e);  }}else if(location!=''&&category!=''&& edate.startdate__c==null && edate.enddate__c==null){string s=location+'%';string s1=category+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where category__C like:s1 and Location like:s]) { elist.add(e);  }}else if(location==''&&category=='' && edate.startdate__c!=null && edate.enddate__c!=null  ){Date s2=edate.startdate__c;Date s3=edate.enddate__c;
for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where startdate__c >=:s2 AND enddate__c<=:s3]) { elist.add(e); System.debug('++++++++======'+elist);  }}

else if(location==''&&category=='' && edate.startdate__c!=null && edate.enddate__c==null  ){Date s2=edate.startdate__c;
for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where startdate__c >=:s2 ]) { elist.add(e); System.debug('++++++++======'+elist);  }}
else if(location==''&&category=='' && edate.startdate__c==null && edate.enddate__c!=null  ){
Date s3=edate.enddate__c;
for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where enddate__c <=:s3 ]) { elist.add(e); System.debug('++++++++======'+elist);  }}

else if(edate.startdate__c!=null && edate.enddate__c!=null&&location!=''&&category==''){Date s2=edate.startdate__c;Date s3=edate.enddate__c;String s4=location+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where startdate__c >=:s2 AND enddate__c<=:s3 AND location like:s4]) { elist.add(e);  }}else if(edate.startdate__c!=null && edate.enddate__c==null&&location!=''&&category==''){Date s2=edate.startdate__c;//Date s3=edate.enddate__c;String s4=location+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where startdate__c >=:s2  AND location like:s4]) { elist.add(e);  }}else if(edate.startdate__c==null && edate.enddate__c!=null&&location!=''&&category==''){//Date s2=edate.startdate__c;Date s3=edate.enddate__c;String s4=location+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where  enddate__c<=:s3 AND location like:s4]) { elist.add(e);  }}


else if(edate.startdate__c!=null && edate.enddate__c!=null&&location==''&&category!=''){Date s2=edate.startdate__c;Date s3=edate.enddate__c;
String s4=category+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where startdate__c >=:s2 AND enddate__c<=:s3 AND category__c like:s4]) { elist.add(e);  }}else if(edate.startdate__c!=null && edate.enddate__c==null&&location==''&&category!=''){Date s2=edate.startdate__c;//Date s3=edate.enddate__c;
String s4=category+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where startdate__c >=:s2  AND category__c like:s4]) { elist.add(e);  }}else if(edate.startdate__c==null && edate.enddate__c!=null&&location==''&&category!=''){//Date s2=edate.startdate__c;Date s3=edate.enddate__c;
String s4=category+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where  enddate__c<=:s3 AND category__c like:s4]) { elist.add(e);  }}



elseif(edate.startdate__c!=null &&edate.enddate__c!=null&&location!=''&&category!=''){Date s2=edate.startdate__c;Date s3=edate.enddate__c;
String s4=category+'%';String s5=location+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where startdate__c >=:s2 AND enddate__c<=:s3 AND category__c like:s4 AND location like:s5]) { elist.add(e);  }}
elseif(edate.startdate__c!=null &&edate.enddate__c==null&&location!=''&&category!=''){Date s2=edate.startdate__c;//Date s3=edate.enddate__c;
String s4=category+'%';String s5=location+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where startdate__c >=:s2  AND category__c like:s4 AND location like:s5]) { elist.add(e);  }}

elseif(edate.startdate__c==null &&edate.enddate__c!=null&&location!=''&&category!=''){//Date s2=edate.startdate__c;Date s3=edate.enddate__c;
String s4=category+'%';String s5=location+'%';for(event e:[select id,whoid,startdate__c,enddate__c,Location,Category__C from Event where  enddate__c<=:s3 AND category__c like:s4 AND location like:s5]) { elist.add(e);  }}
}public list<event> getevents(){cat=true;return elist;}public event getdates(){event e=new event();return e;}}

 

Thanks in advance.

anu...

jim@celestialcrm.comjim@celestialcrm.com

Check out the response on this ticket:  http://boards.developerforce.com/t5/Force-com-Sites/Urgent-showing-apex-input-field-in-vf-page-but-not-visible-in/td-p/332039

 

For some reason input fields with a value of a property of an object are not displaying.  I'm not sure why!  But this could get you around the issue.

 

-Jim