+ Start a Discussion
woodmanzeewoodmanzee 

help creating a VF page for a custom object backed by a standard controller

So I know that Salesforce creates a standard controller for custom objects, and I'm trying to use that to make a visualforce page to display all of the custom object records of that type. Problem is, I can't figure out how to display or get the records since Salesforce has NO documentation showing what methods I can use for the custom object. 

 

For example, I have:

 

<apex:page standardController="Custom_Item__c">
      
        <apex:form>
            <apex:pageBlock >
                <div id="itemListing">
                    
                    <apex:repeat value="{!Custom_Item__c}" var="item" id="itemList">
                        {!item.Name}
                    </apex:repeat>
                  
                </div>
            </apex:pageBlock>
        </apex:form>
  
</apex:page>

 

But this doesn't return anything when I look at the VF page. Any help?
Does anybody know what methods I can call for the custom object? I just don't know how to access any of the records.

Thanks 

aballardaballard

The standardController for a custom object is exactly the same as the standardController for a standard object . 

 

Generally, you use it with an id query parameter to specify the object to be processed (or with a recordSetVar attribute if you want to use the standar list controller). 

 

The methods available for actions are the same as for standard objects. 

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_controller_std_actions.htm

 

 

woodmanzeewoodmanzee

So is there a way I can delete the items in the repeat loop? 

Adding a 

<apex:commandLink action="{!delete}" value="Delete" />

 doesnt even show up, though the VF page saves without errors.

 

I also need to be able to create an object that is the child of a repeat object - so in that loop i need to be able to use one of those as the parent to create a new object