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
sravanisravani 

Urgent:showing apex:input field in vf page but not visible in sites

Hi All,

    i wrote vf page for events.like this

public class eventsearch

{

public boolean cat{set;get;}

list<event> elist=new list<event>();

event e=new event();

public event getdates()

{

return e;

}

public void findevents()

{
cat=true;

if(e.startdate__c!==null)

{

date d=e.startdate__c;

for(event e:[select startdate__c from event where startdate__C>=:d])

{

elist.add(e);}
}

}

public list<event> getvalues()

{

return elist;

}

}

 

page like this:

 

<apex:page sidebar="false" controller="eventsearch"> 

<apex:form >

  <apex:inputfield value="{!dates.startdate__c}"/> 

<apex:commandButton action="{!findevents}" value="find"/> 

<apex:outputPanel rendered="{!cat}"> 

<apex:pageBlock > 

<apex:pageblocktable value="{!values}" var="ee"> 

<apex:column headerValue="from" value="{!ee.startdate__c}"/> 

</apex:pageblocktable> 

</apex:pageBlock> 

</apex:outputPanel> 

</apex:form>

</apex:page>

In the above code input field is displayed in vf page.but not visible in salesforce sites. But i did all CRUD and Field level security permissions for guest user. any one can u please help me.

 

Thanks in advance.

 

anu.....

jim@celestialcrm.comjim@celestialcrm.com

Hi,

 

I'm not sure why this is happening, but the input field will probably display if you either 1: make the start date as a required field or 2: create an accessor method for the start date instead of referencing the property via the dot notation.

 

-Jim

colemabcolemab

Is it possible that you created the field in question after creating the site?  If so, you will need to update the Field Level Security for the public profile to have read only permissions on this new field.  To do this, edit your site (name->setup->Develop->sites) and while editing your site click the "public access settings" to get to the profile for this site where you can then modify the FLS for this site.  Locate the object in question and then click on it to edit the FLS for that object. Find the 'missing' field. Then click edit, check the box next to the field, and save.

 

If you have changed the name of the site from upper to lower case without changing the actual content of the name, please post that on this thread as there is a bug between the profiles and the sites (one is stored in cAmEl case while the other is all lower case).

 

Let us know if this doesn't work.

 

EDIT: Jim is right that making it required on the object will display the field.  According to the documentation, if a field is required on the object level then it is displayed w/o checking the FLS for the user.  However, this applies to all users and may not be what you want.

EmplEmpl

Hi Colemab,

 

We are also facing the same issue.

 

We are trying to use apex:inputField to edit the field body of Standard Object "Question" in a visualforcepage.

Our problem is that the editor which renders with apex:inputField is visible when we look at the visualforce page inside SFDC.

But, it doesn't render when we call this page inside Salesforce site.

We need apex:inputField since we want to give user the ability to upload image while editing the post.

We have given permissions to all fields. 

 

Can you please help us with this?

 

Thanks,

Kp

colemabcolemab

@Empl when you say "we have given permissions to all fields" do you mean you have given these permissions to your user or the guest / site user?

 

Please see my instructions in the above post about how to set these permissions.

 

If you can see the field while logged in but not while on a public site (and the page renders w/o error on both), then the issue is most likley permissions related (as opposed to functionality related).

 

If the page gives an error, then you would want to make sure the apex class and page are enabled for that site user.  Also, if you are setting your record type in your controller or extension, you would want to make sure that record type and/or the default record type are enabled for the sites user as well.

AbhijitkAbhijitk

Its not showing in site because the fields that you created that should be required......then it shows on your force.site