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
Bshealey786Bshealey786 

Trouble with tutorial: Adding a Controller

So i'm going through the workbook tutorial located here: http://www.salesforce.com/us/developer/docs/workbook/index.htm

 

I've been going through it fine, but now I have run into a problem.  On Tutorial #9, Step 4 it is adding a controller to the page, and the code provided is not working.  On the previous step, I had the following:

 

<apex:page standardStylesheets="false" showHeader="false" sidebar="false"> 

<apex:stylesheet value="{!URLFOR($Resource.styles, 'styles.css')}" />

<h1>Inventory Count Sheet</h1> 

</apex:page>

 That worked fine, but now that I have gotten to step 4, I have this:

 

<apex:page standardStylesheets="false" showHeader="false" sidebar="false" standardController="Merchandise__c"recordSetVar="products">

<apex:stylesheet value="{!URLFOR($Resource.Styles, 'styles.css')}" />

<h1>Inventory Count Sheet</h1> 

</apex:page>

 However when I try to save this I get the error:

 Error: CountSheet line 1, column 110: Element type "apex:page" must be followed by either attribute specifications, ">" or "/>" 
ErrorError: Element type "apex:page" must be followed by either attribute specifications, ">" or "/>".


In the tutorial it says to edit the first <apex:page> tag, which is what I beleive I did.  And the error I am not quite getting because I have included attribute specifications and it ends with a >.  Any help would be greatly appreciated.  Thanks in advance

   
  
Best Answer chosen by Admin (Salesforce Developers) 
aballardaballard

You are missing a space between "Merchandise__c" and recordSetVar, so that looked like an invalid attribute.   (Error message is not exactly great...)

All Answers

aballardaballard

You are missing a space between "Merchandise__c" and recordSetVar, so that looked like an invalid attribute.   (Error message is not exactly great...)

This was selected as the best answer
Bshealey786Bshealey786

ha wow, that cleared it right up.  Thanks for the help :)

Jeff JobsJeff Jobs

I'm having trouble, in a completely different way, with this same tutorial.

 

I'm using Safari 6.0.2 on a Macbook Pro.  The tutorial, found here: http://www.salesforce.com/us/developer/docs/workbook/index.htm, specifically tutorial #9, step #3, discusses how to add a custom CSS file to stylize the visualForce page.  I am performing each tutorial in my Org sandbox, not sure if that matters but I've been able to do each tutorial without incident so far.

 

I download the file from the instructions link, and it downloads unzipped as a folder.  I right-click and compress the folder which creates a zip file on my desktop.  I then follow the instructions to upload the zip file as a static resource into my SalesForce sandbox, setting the Cache Control to "Public" etc.

 

I then copy and paste the code below into my VisualForce page:

 

<apex:page standardStylesheets="false" showHeader="false" sidebar="false"  standardController="Merchandise__c" recordsetVar="products">
   <apex:stylesheet value="{!URLFOR($Resource.styles, 'styles.css')}"/>
   <h1>Inventory Count Sheet</h1> 
   <apex:form>
      <apex:dataTable value="{!products}" var="pitem" rowClasses="odd,even"> 
         <apex:column headerValue="Product">
            <apex:outputText value="{!pitem.name}"/>
         </apex:column>
         <apex:column headerValue="Inventory">
            <apex:outputField value="{!pitem.Total_Inventory__c}">
               <apex:inlineEditSupport event="ondblclick" showOnEdit="update"/>
            </apex:outputField>
         </apex:column>
      </apex:dataTable>
      <br/>
      <apex:commandButton id="update" action="{!quicksave}" value="Update Counts"  styleclass="updateButton"/>
   </apex:form>
</apex:page>

 The result does not look anything like the workbook says it should.  In fact, when I delete line 3 from the code it does not change the visual look at all.  This tells me that, clearly, I am not accessing the CSS file that the code wants me to.  

 

Please help!  Thanks in advance :)