• Patrick Dixon
  • NEWBIE
  • 74 Points
  • Member since 2011

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 73
    Replies

I can't figure out how to save updated records back with a StandardSetController and an extension to paginate the (filtered) set of data.  I'm obviously missing the mechanism to get the filtered data set back to the standard set controller 'save' function, but I can't figure out how to add it.

 

VF page is:

 

<apex:page standardController="Orphan__c" extensions="OrphanBulkReportsWithPagination" recordSetVar="orphans">
    <apex:form >
        <apex:sectionHeader title="Bulk {!ReportType} Reports"/>
        <apex:pageBlock mode="edit">
            <apex:pageMessages />

            <apex:pageBlockSection title="Print {!ReportType}" collapsible="false">
                <apex:inputField value="{!Orphan__c.Biodata_Report_Sent__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Selected Orphans"  columns="1">
                <apex:pageblocktable value="{!PaginatedOrphans}" var="orphan" id="list">
                    <apex:column value="{!orphan.Name}"/>
                    <apex:column headerValue="Orphan Name">
                        <apex:outputText value="{!orphan.First_Name__c
                            & ' '
                            & orphan.Last_Name__c}"/>
                    </apex:column>
                    <apex:column value="{!orphan.Country__c}"/>
                    <apex:column value="{!orphan.IRP_Country__c}"/>
                    <apex:column headerValue="Biodata">
                        <apex:inputField value="{!orphan.Biodata_Report_Sent__c}"/>
                    </apex:column>
                </apex:pageblocktable>
            </apex:pageBlockSection>
            
            <apex:panelGrid columns="2">
                <apex:commandLink action="{!previous}">Previous</apex:commandlink>
                <apex:commandLink action="{!next}">Next</apex:commandlink>
            </apex:panelGrid>
            
            <apex:pageBlockButtons location="bottom">

                <apex:commandButton value="Save" action="{!saveOrphans}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

And controller extension is:-

 

public with sharing class OrphanBulkReportsWithPagination {

    Apexpages.StandardSetController controller;

    public OrphanBulkReportsWithPagination(ApexPages.StandardSetController c) {
        ReportType = ApexPages.currentPage().getParameters().get('rpt');
        Country = ApexPages.currentPage().getParameters().get('loc');
        controller = c;
    }    
    
    public ApexPages.StandardSetController orphanRecords {
        get {
            if(orphanRecords == null) {
                return new ApexPages.StandardSetController(
                         Database.getQueryLocator(
                [SELECT Id, name, First_Name__c, Last_Name__c, Country__c, IRP_Country__c, Biodata_Report_Sent__c FROM Orphan__c
                WHERE Biodata_Report_Sent__c = false
                And (Status__c = 'Available' OR Status__c = 'Sponsored')
                AND Id NOT IN (SELECT Orphan__c FROM Annual_Progress_Report__c where Sent_to_Donor__c = true)
                ]));
            }
            return orphanRecords;
        }
        private set;
    }

    public List<Orphan__c> getPaginatedOrphans() {
        return (List<Orphan__c>) orphanRecords.getRecords();
    }

}

 

Many thanks!

The standard list controller seems to be filtered using the last selected filter for the object, even if it's not applied explicitly in the VF page using the SLC.

 

Is there a way to force it to use a specified filterId when the VF page is called - without having the user select it in the page, or having the last used filter (which could be anything) affect the record set?

I have a wrapper class within an apex controller:


    public list<sidebarWrapper> getSidebars() {
        list<sidebarWrapper> sidebars = new list<sidebarWrapper>();
        
        
            for (Sidebar_Element__c sidebar :
                [Select id, Name, Order_On_Page__c, Page_Layout__c, Content_Item__c, Content_Type__c,
                Twitter_Feed__c, No_of_Tweets__c, Keyword__c, No_of_Items__c, Synopsis_Length__c,
                Content_Item__r.Heading__c, Content_Type__r.Title__c, Content_Type__r.View_All__c, Content_Type__r.View_All_Dest__c,
                Content_Type__r.List_Length__c, Content_Type__r.Synopsis_Length__c
                From Sidebar_Element__c where Page_Layout__c = :pgId order by Order_On_Page__c asc]) {
                                
                sidebars.add(new sidebarWrapper(sidebar));
            }
        return sidebars;
   }

    // Wrapper Class for sidebar  
    public class sidebarWrapper {
        public Sidebar_Element__c sel {get; set;}
        public Content_Item__c sci;
        public list<Content_Item__c> scl;

        // constructor method
        
        public sidebarWrapper (Sidebar_Element__c thisSel) {
            sel = thisSel;
        }
        
        public Content_Item__c getItem()
        {
            if (null==sci)
            {
                try {
                    sci =
                        [select Id, URL_Link__c, Image__c, Synopsis__c, Release_Date__c, Name, Heading__c,
                        Attachment__c, (Select Id From Attachments limit 1),
                        Content_Type__r.Image_Position__c, Content_Type__r.Image_Border__c, Content_Type__r.Show_Date__c,
                        Content_Type__r.Read_More__c, Content_Type__r.Read_More_Dest__c,
                        (select Name, Content_Item__c, Description_Text__c from Contents__r order by name)
                        From Content_Item__c
                        where Id in (Select Content_Item__c From Sidebar_Element__c where id = :sel.id)
                        order by Release_Date__c desc];
                }
                catch(QueryException e) {
                    return null;
                }
            }
            return sci;
        }
    
        public List<Content_Item__c> getList()
        {
            if (null==scl && sel.no_of_items__c >= 1)
            {
                try {
                    string sKey;
                    if (sel.keyword__c != null) sKey = '%' + sel.keyword__c + '%';
                    else sKey ='%';
                    scl =
                        [Select URL_Link__c, Image__c, Synopsis__c, Release_Date__c, Name, Heading__c, Content_Type__c,
                        Internal_Link_Prefix__c, Keywords__c,
                        Attachment__c, (Select Id From Attachments limit 1),
                        (Select Id From Contents__r limit 1),
                        Content_Type__r.Id, Content_Type__r.Title__c, Content_Type__r.Show_Date__c,
                        Content_Type__r.Image_Position__c, Content_Type__r.Image_Border__c,
                        Content_Type__r.Read_More__c, Content_Type__r.Read_More_Dest__c,
                        Content_Type__r.List_Style__c, Content_Type__r.Searchable__c,
                        (Select Page_Layout__c From Sidebar_Elements__r) From Content_Item__c
                        where Content_Type__c in (select Content_Type__c From Sidebar_Element__c where id = :sel.id)
                        and Keywords__c like :sKey
                        order by Release_Date__c desc limit :sel.no_of_items__c.IntValue()];
                }
                catch(QueryException e) {
                    return null;
                }
            }
              return scl;
        }
        
    }
    // End Wrapper

}


and I'm trying to write a test:

 

<!--- SET SOME TEST DATA UP -->


        string pgl = 'testPage';
        string fl = 'testflash';
        
        ApexPages.currentPage().getParameters().put('pgl', pgl);
        ApexPages.currentPage().getParameters().put('mov', fl);

        // Instantiate a new controller  
        PageRenderer pr = new PageRenderer();
        list<sidebarWrapper> s = new list<sidebarWrapper>();


        string nl1 = pr.getNav_Level_1();
        string nl2 = pr.getNav_Level_2();
        boolean bb = pr.getBack_Button();
        Page_Layout__c ap = pr.getActivePage();
        list<Page_Element__c> el = pr.getElements();
        s = pr.getSidebars();
        list<Sidebar_Element__c> sel = s.sel();
        list<Content_Item__c> ci = pr.getContentItems();
        list<Content_Item__c> sci = s.getItem();
        list<Content_Item__c> cl = pr.getContentList();
        list<Content_Item__c> scl = s.getList();
        Content__c c = pr.getPageContent();
        string flash = pr.getFlash();

        ApexPages.StandardController sc = new ApexPages.standardController(pe[0]);

        PageElementExtension pee = new PageElementExtension(sc);
        ci = pee.getContentItems();
        cl = pee.getContentList();

        ApexPages.StandardController sc2 = new ApexPages.standardController(se[0]);

        SidebarElementExtension see = new SidebarElementExtension(sc2);
        ci = see.getsContentItems();
        cl = see.getsContentList();

 

But I just get:


Save error: Invalid type: sidebarWrapper    TestPageRender.cls    /fusionai.com/src/classes    line 59    Force.com save problem

 

So why can't it see the Wrapper Class??

 

I have a VF page with a 2-level nested apex:repeat structure with separate SOQL queries for each loop.  The outer loop returns (amongst other things) a list of strings which I want to use as filter terms in the inner loop's SOQL.  The list is saved as a list variable in the controller (keywords[]), along with an index integer (iKey) for the inner loop.

 

However, although I can see from the logs that the list of filter terms is all build correctly, the debug loop seems to show that the inner loop's SOQL is only run once and hence it only seems to use the first of the filter terms to get results.

 

Here's what the debug log looks like:-

 

 

18:58:54.115|CODE_UNIT_STARTED|[EXTERNAL]|01pA0000002NfKZ|PageRenderer get(sContentList)
18:58:54.115|CODE_UNIT_STARTED|[EXTERNAL]|01pA0000002NfKZ|PageRenderer invoke(getsContentList)
18:58:54.115|METHOD_ENTRY|[155]|LIST.size()
18:58:54.115|METHOD_EXIT|[155]|LIST.size()
18:58:54.115|METHOD_ENTRY|[156]|System.debug(ANY)
18:58:54.115|USER_DEBUG|[156]|DEBUG|%all%
18:58:54.115|METHOD_EXIT|[156]|System.debug(ANY)
18:58:54.115|METHOD_ENTRY|[155]|LIST.size()
18:58:54.115|METHOD_EXIT|[155]|LIST.size()
18:58:54.115|METHOD_ENTRY|[156]|System.debug(ANY)
18:58:54.115|USER_DEBUG|[156]|DEBUG|%
18:58:54.115|METHOD_EXIT|[156]|System.debug(ANY)
18:58:54.115|METHOD_ENTRY|[155]|LIST.size()
18:58:54.116|METHOD_EXIT|[155]|LIST.size()
18:58:54.116|METHOD_ENTRY|[156]|System.debug(ANY)
18:58:54.116|USER_DEBUG|[156]|DEBUG|%
18:58:54.116|METHOD_EXIT|[156]|System.debug(ANY)
18:58:54.116|METHOD_ENTRY|[155]|LIST.size()
18:58:54.116|METHOD_EXIT|[155]|LIST.size()
18:58:54.116|METHOD_ENTRY|[156]|System.debug(ANY)
18:58:54.116|USER_DEBUG|[156]|DEBUG|%fractal%
18:58:54.116|METHOD_EXIT|[156]|System.debug(ANY)
18:58:54.116|METHOD_ENTRY|[155]|LIST.size()
18:58:54.116|METHOD_EXIT|[155]|LIST.size()
18:58:54.116|SOQL_EXECUTE_BEGIN|[159]|Aggregations:3|Select URL_Link__c, Image__c, Synopsis__c, Release_Date__c, Name, Heading__c, Content_Type__c,
Internal_Link_Prefix__c, Keywords__c,
Attachment__c, (Select Id From Attachments limit 1),
(Select Id From Contents__r limit 1),
Content_Type__r.Id, Content_Type__r.Title__c, Content_Type__r.Show_Date__c,
Content_Type__r.Image_Position__c, Content_Type__r.Image_Border__c,
Content_Type__r.Read_More__c, Content_Type__r.Read_More_Dest__c,
Content_Type__r.List_Length__c, Content_Type__r.Synopsis_Length__c,
Content_Type__r.List_Style__c, Content_Type__r.Searchable__c,
(Select Page_Layout__c From Sidebar_Elements__r) From Content_Item__c
where Content_Type__c in (select Content_Type__c From Sidebar_Element__c where Page_Layout__c = :pgId)
and Keywords__c like :keywordList[iKey++]
order by Release_Date__c desc
18:58:54.143|SOQL_EXECUTE_END|[159]|Rows:3
18:58:54.143|METHOD_ENTRY|[172]|System.debug(ANY)
18:58:54.143|USER_DEBUG|[172]|DEBUG|1
18:58:54.143|METHOD_EXIT|[172]|System.debug(ANY)
18:58:54.143|METHOD_ENTRY|[173]|System.debug(ANY)
18:58:54.143|USER_DEBUG|[173]|DEBUG|%
18:58:54.143|METHOD_EXIT|[173]|System.debug(ANY)
18:58:54.143|CODE_UNIT_FINISHED|PageRenderer invoke(getsContentList)
18:58:54.143|CODE_UNIT_FINISHED|PageRenderer get(sContentList)

The filter terms %all%, %, %, %fractal% are correct, but the SOQL query should execute 4 times ... and must do as I get 4 results on the VF page.

 

So what's going on?

 

I have the following VF page using custom objects and a custom controller to generate the page content:-

 

<apex:page showHeader="false" controller="PageRenderer" title="FusionExperience" >
<apex:stylesheet value="{!URLFOR($Resource.fusionexperience, 'css/reset.css')}" />
<apex:stylesheet value="{!URLFOR($Resource.fusionexperience, 'css/style.css')}" />
<apex:stylesheet value="{!URLFOR($Resource.fusionexperience, 'css/type.css')}" />

<!-- CONTENT -->
<div id="content">

    <!-- PAGE ELEMENTS (PASSED THROUGH PGL PAGE PARAM) -->
    <apex:outputPanel rendered="{!NOT(elements.size=0)}">
        <apex:repeat var="el" value="{!elements}" >

            <!-- (LIST OF) CONTENT TYPE -->

            <apex:variable var="clRender" value="{!NOT(ISNULL(el.Content_Type__c))}" />
            <apex:outputPanel rendered="{!clRender}" layout="block" styleClass="box">
                <div class="viewdiv {!el.Box_Size__c}">
                    <!-- BOX TITLE -->
                    <!-- uses content type title -->
                    <div class="latestnews headline">
                        <h3>{!el.content_type__r.Title__c}</h3>
                    </div>
                    
                    <!-- //BOX TITLE -->
                    
                    <!-- OUTLINED BOX -->
                    <div class="latestnews content">
                        <ul class="latestnews">
                            <apex:variable var="noItems" value="{!el.content_type__r.List_Length__c}" />
                            <apex:repeat var="cl" value="{!ContentList}" >
 
                                <!-- Only list content of THIS content type -->
                                <apex:variable var="clRender" value="{!AND(noItems>0, cl.Content_Type__c=el.Content_Type__c)}" />
                                <apex:outputPanel rendered="{!clRender}" >
                        
                                    <!-- IMAGE/URL -->
                        
                                    <apex:variable var="isPDF" value="{!IF(cl.Attachment__c='pdf', cl.Use_Attachment__c, false)}"/>
                                    <apex:variable var="isFlash" value="{!IF(cl.Attachment__c='flash', cl.Use_Attachment__c, false)}"/>
                                    <apex:variable var="readMore" value="{!IF(cl.content_type__r.Read_More__c,true,false)}" />

                                    <!-- establish pdf string -->
                                    <apex:variable var="pdfLink" value="{!IF(isPDF, IF(cl.Attachments.size=0, '', cl.Attachments[0].id), '')}"/>
                                    <apex:variable var="pdfLink" value="/servlet/servlet.FileDownload?file={!pdfLink}" />
                                
                                    <!-- establish flash string -->
                                    <apex:variable var="flashLink" value="{!IF(isFlash, IF(cl.Attachments.size=0, '', cl.Attachments[0].id), '')}"/>
                                    <apex:variable var="flashLink" value="fe?id={!cl.Content_Type__r.Read_More_Dest__c}&mov={!flashLink}" />
                        
                                    <!-- establish URL string for new page view -->
                                    <apex:variable var="itmLink" value="{!IF(cl.Contents__r.size=0, '', cl.Contents__r[0].id)}" />
                                    <apex:variable var="itmLink" value="fe?id={!cl.Content_Type__r.Read_More_Dest__c}&itm={!itmLink}" />
                                    <apex:variable var="itmLink" value="{!IF(cl.Contents__r.size=0, '', itmLink)}" />

                                     <apex:variable var="link" value="{!IF(readMore, IF(isPDF, pdfLink, IF(isFlash, flashLink, itmLink)), cl.URL_Link__c)}" />


                                     <!-- TEXT BLOCK -->
                                    <li class="latestnews">
                                        <a href="{!link}" class="latestnews">{!cl.Heading__c}<br /></a>
                                        <apex:variable var="sRender" value="{!NOT(cl.Content_Type__r.Synopsis_Length__c=0)}" />
                                        <apex:outputText rendered="{!sRender}" escape="false" styleClass="latestintro" value="{!LEFT(cl.Synopsis__c,cl.Content_Type__r.Synopsis_Length__c)}..." />
                                    </li>
                                    <apex:variable var="noItems" value="{!noItems-1}" />
                                </apex:outputPanel>
                            </apex:repeat>
                        </ul>
                    </div>
                </div>
             </apex:outputPanel>
 
              <!-- //CONTENT TYPE -->
                     
        </apex:repeat>
    </apex:outputPanel>

<!-- //CONTENT -->

</div>
</apex:page>

 

However, it's not formatting correctly in the browser, and when looking at the html code produced:

 

(see here) http://www.yatecourtbarn.adsl24.co.uk/images/test.html

 

It seems to be producing code that is missing the closing </div> tags, and hence screwing-up the css layout.

 

AFAICS, it has opening nested <div> tags for 'box', 'box-left viewdiv', and 'content latestnews', but only closes two of them before the next opening sequence.

 

Has anyone come across this before and/or can anyone offer a solution?

 

Thanks.

 

I have a VF page including:

 

        <apex:form >
            <apex:pageBlock mode="edit" id="searchText">

                <apex:pageMessages />
                <apex:pageBlockSection >
                    <apex:pageBlockSectionItem >
                        <apex:panelGroup >
                            <apex:inputText id="searchTerm" value="{!searchTerm}"/>
                            <apex:commandButton value="Search" action="{!search}" rerender="results" status="status"/>

                        </apex:panelGroup>
                    </apex:pageBlockSectionItem>
                </apex:pageBlockSection>

            </apex:pageBlock>
         </apex:form>

        <apex:actionStatus id="status">
            <apex:facet name="start">
                <apex:outputText styleClass="searchword inputbox" value="searching... for '{!searchTerm}'"/>
            </apex:facet>
            <apex:facet name="stop">
            
            <apex:outputPanel id="results">


          ............displays the search results here................


        </apex:outputPanel>

        </apex:facet>
    </apex:actionStatus>
<br/>
debug -- {!searchTerm}<br/>

 

and a controller

 

public with sharing class SearchController {

    public SearchController() {
        searchResultLists = new List<Content_Item__c>();
        searchTerm = 'search...';
    }

    public List<Content_Item__c> searchResultLists { get; set; }

    public String searchTerm { get; set; }

    public void search() {
        for(List<Content_Item__c> results : search.query('find :searchTerm in all fields returning Content_Item__c'))
            searchResultLists = [select id, name, synopsis__c,
                URL_Link__c, Image__c, Release_Date__c, Heading__c, Content_Type__c,
                content_type__r.name,
                Content_Type__r.Id, Content_Type__r.Title__c, Content_Type__r.Show_Date__c,
                Content_Type__r.Image_Position__c, Content_Type__r.Image_Border__c,
                Content_Type__r.Read_More__c, Content_Type__r.Read_More_Dest__c,
                Content_Type__r.List_Length__c, Content_Type__r.Synopsis_Length__c,
                Content_Type__r.List_Style__c,
                Use_Attachment__c, Attachment__c, (Select Id From Attachments limit 1),
                (select id from Contents__r limit 1) from Content_Item__c where id in :results];
    }


}

 

I also have the following in a header component that renders through the template for the page:

 

       <apex:form >
        <div class="clearfix search">
             <div class="search-box">
                 <apex:inputText id="searchTerm" alt="search..." styleClass="searchword inputbox" value="{!searchTerm}" maxlength="20"/>
                 <apex:commandButton action="{!search}" styleClass="button" rerender="searchText" status="status"
                     image="{!URLFOR($Resource.fusionexperience, 'images/searchButton.gif')}" />
           </div>
       </div>
    </apex:form>

 

Both the page and the component reference the (same) custom controller in their header.


Now I'm getting two problems:


The first is that although entering the search text in the header component and clicking the command button triggers the controller action, the input text never seems to be passed to the controller and so the search fails.


The second is that although entering the search text in the main page and clicking its command button, does pass the search text and return the correct results, the debug line at the bottom of the page and the searching message in the facet don't return the expected  {!searchTerm} string - it's always the intialised value 'search...'


So what am I doing wrong?

I'm building a site using force sites and I need a simple search facility to search my custom objects.  Unfortunately the field I need to search on is a text area and SOQL won't search text areas AFAIU.  So I figure I need to use SOSL, but the problem is that I can't figure out the syntax of what I need to do.

 

I understand the search bit:

 

String searchquery='FIND\'%'+searchText+'%\'IN ALL FIELDS RETURNING Content_Item__c (id,name), Content__c';
list<list<Content_Item__c>> searchList = search.query(searchquery);

 

but I don't understand what to do next or how to render the results in a VF page using a standard controller.

 

Can anybody point me at an example?  This must be a really common requirement for a web site, but I can seem to find any examples to get me started.

I have custom objects that I'm rendering in a vf page using a custom controller. I'm making tentative steps towards a wrapper class as I've found that nothing else is going to work.

 

I'm trying to render all the 'content' objects that are details of 'content_item' objects, that are referenced in the 'page_layout object ... via a page_element object - which is a detail of page_layout and a child of content_item.  I've seperately proven the SOQL to give the required set of content records.

 

Here's my class and getter:

 

// Wrapper Class for contents
    public list<cWrapper> contents {get;set;}
    
    public class cWrapper {
        public list<Content__c> content {get;set;}
        // constructor method    
        public cWrapper(list<Content__c> c) {
            content = c;
        }
    }
// End Wrapper
    
    public list<cWrapper> getContents() {
        String pgId = ValidatePageName();
        contents = new list<cWrapper>();    // Initialise wrapper class variable

        for (Content_Item__c c: [select Id,
            (select Name, Content_Item__c, URL_Link__c, Image__c, Description_Text__c from Contents__r order by name)
            From Content_Item__c
            where Id in (Select Content_Item__c From Page_Element__c where Page_Layout__c = :pgId)
            order by Release_Date__c desc]) {
            // Add each set of contents records to the wrapper class variable
            contents.add(new cWrapper(c.contents__r));
            
        }
        return contents;
    }


But the problem is that I can't seem to access any of the results in the vf page.

 

<apex:repeat var="c" value="{!contents}" >

    {!c.content.Content_Item_c}

</apex:repeat>

 

gives

Save error: Unknown property 'VisualforceArrayList.Content_Item__c'

 

and

 

{!contents[0].content.Content_Item__c}

 

renders as a blank on the vf page.

 

Any suggestions as to what I'm doing wrong?

 

I have three custom objects: page_element, content_Item and content. element is a lookup child of content_item and content is a master-detail child of content_item.

 

I'm trying to render these on a vf page in 3 nested apex:repeats - element (outer) - content_item - content (inner).  I  have this code in a custom controller extension:

 

    public list<Page_Element__c> getElements() {
        String pgId = ValidatePageName();
        list<Page_Element__c> elements =
            [Select Name, Order_On_Page__c, Box_Size__c, Page_Layout__c, Content_Item__c, Content_Type__c
            From Page_Element__c where Page_Layout__c = :pgId order by Order_On_Page__c asc];
        return elements;
   }
    
    public list<Content_Item__c> getContentItems() {
        String pgId = ValidatePageName();
        
        list<Content_Item__c> contentItems;

        // Create a list of account records from a SOQL query  
        list<Page_Element__c> elements =
            [Select Name, Order_On_Page__c, Box_Size__c, Page_Layout__c, Content_Item__c, Content_Type__c
            From Page_Element__c where Page_Layout__c = :pgId order by Order_On_Page__c asc];
            
        // Loop through the list and generate another SOQL query using the Contact Item referenced
        for (Page_Element__c e : elements) {
            string ciID = e.Content_Item__c;
            contentItems = [select Id, URL_Link__c, Synopsis__c, Release_Date__c, Name, Heading__c,
                (select Name, Content_Item__c, URL_Link__c, Image__c, Description_Text__c
                from Contents__r order by name)
                From Content_Item__c where Id = :ciID order by Release_Date__c desc];
        }
        return contentItems;
    }

 

and this in a VF page:

 

    <apex:panelGroup layout="inlined" rendered="{!NOT(ISNULL(elements.size))}">
        {!elements.size} <br/>
        <apex:repeat var="el" value="{!elements}" >

        <apex:panelGroup layout="inlined" rendered="{!NOT(ISNULL(contentItems.size))}">
            <apex:repeat var="ci" value="{!contentItems}" >
                <div class="clearfix contentpage">
                    <h2 class="clearfix contentheading">
                        <a href="{!ci.URL_Link__c}" class="contentpagetitle">{!ci.Heading__c}</a>
                    </h2>

                     <div class="article-content">
                        <apex:panelGroup layout="inlined" rendered="{!NOT(ISNULL(ci.contents__r.size))}">
                            <apex:repeat var="c" value="{!ci.contents__r.}" >
                                <a class="logo" href="{!c.URL_Link__c}" target="_blank">
                                    <apex:outputText escape="false" styleClass="logosize"  style="float:left" value="{!c.Image__c}" />
                                </a>
                                 <apex:outputText escape="false" style="float:left" value="test {!c.Description_Text__c}" />
                            </apex:repeat>
                         </apex:panelGroup>
                      </div>
                    <br/>
 
                 </div>
             </apex:repeat>
        </apex:panelGroup>
 
        </apex:repeat>
     </apex:panelGroup>

 

The first problem I have is that the {!elements.size} returns 4 (which is what I'd expect), whilst {!contentitems.size} returns just 1 - even though it's using the exact same query as control for the for loop as 'getElements', and  {!elements.Content_Item__c} returns 4 different valid ids for Content_Item__c.

 

The second problem I have is that the vf page won't save with the inner loop using {!ci.contents__r}  - it gives me


Save error: Unknown property 'VisualforceArrayList.'

 

unless I comment out the inner loop.

 

So what am I doing wrong here, and how can I do it better?

 

Many thanks.

 

 

I have custom objects and a custom controller

 

content_Body__c is a child of content__c  There can be multiple children.

 

The controller get method looks like this:

 

    public Content__c getContent() {
        Content__c content =
            [select id, Name, Release_Date__c, Heading__c, Synopsis__c,
                (select Name, Content__c, URL_Link__c, Image__c, Description_Text__c
                from Content_Body__r order by name)
            from Content__c where id = :thisContent LIMIT 1];
        return content;
    }


and in a vf page this

 

            {!content.Name}<br/>
            {!content.Release_Date__c}<br/>
            {!content.Heading__c}<br/>
            {!content.Synopsis__c}<br/>
            <div class="article-content">
                <apex:outputText escape="false" value="{!content.content_body__r[0].Image__c}" />
                <apex:outputText escape="false" value="{!content.content_body__r[0].URL_Link__c}" />
                <apex:outputText escape="false" value="{!content.content_body__r[0].Description_Text__c}" />
             </div>


renders fine.

 

But I want to display all the related content_body__c elements, so I'm using apex:repeat, and this

 

        <apex:repeat var="cb" value="{!content.content_body__r}" >
            <div class="article-content">
                <apex:outputText escape="false" value="{!cb.Description_Text__c}" />
            </div>
        </apex:repeat>

 

gives a run-time error of

 

List has no rows for assignment to SObject
An unexpected error has occurred. Your development organization has been notified.


What am I doing wrong here?  How can there be no rows when the explicit [0] reference finds one???

Has this bug been re-introduced again?

 

This worked in a dev organisation a few weeks ago:-

 

<apex:outputText value=" {0,date,dd MMMM yyyy}" >
     <apex:param value="{!content[0].Release_Date__c}" />
</apex:outputText>

 

But in a new dev org now gives a save error:

 

The value attribute on <apex:outputText> is not in a valid format. It must be a positive number, and of type Number, Date, Time, or Choice.

 

{!content[0].Release_Date__c}<br/>
{!content[0].CreatedDate}<br/>
 <apex:outputText value=" {0}" >
     <apex:param value="{!content[0].Release_Date__c}" />
</apex:outputText><br/>

 

displays:-

 

Thu Mar 24 00:00:00 GMT 2011
Thu Mar 24 12:12:06 GMT 2011
3/24/11 12:00 AM

 

and they are definitely date fields in a custom object.

 

How does one raise a bug?

OK, this is driving me nuts.

 

I have a series of custom objects related in various ways - some master/data some lookup.  I'm trying to access these in a sites VF page and I can't seem to do it with the standard controller, so I have a custom extension ... but that doesn't seem to work either.

 

This query works in the Eclipse schema

SELECT name,  (Select Box_Size__c, Content__c from Page_Element__r)  FROM Page_Layout__c where name = 'capabilities'

 

and returns 'name' and page_element__r which if I click on gives me Box_Size__c and the ID of Content__c (a lookup detail of page_element)

 

So here's my controller get:-

 

    public Page_Layout__c getElement() {
        string pgl =ApexPages.currentPage().getParameters().get('pgl');
        if (pgl == NULL) pgl = 'home';    // default to home page if no pgl not set
        Page_Layout__c element = [select name, (select Box_Size__c, Content__c from Page_Element__r) from Page_Layout__c where name = :pgl];
        Return element;
    }

And here's the VF page snippet:-

 

<apex:repeat var="elements" value="{!element}" >
{!elements.Page_Element__r.Box_Size__c}<br/>

</apex:repeat>

 

... which fails with the  "Save error: "Unknown property 'VisualforceArrayList.Box_Size__c' "

 

So what am I doing wrong?  ... and is there a reference on relationships between custom objects and SOQL for them that someone can point me to so that I can try not to make the same mistakes again?

 

Many thanks.

Hi

 

I want to return a custom object  record based on a query using the name of the VF page.  I can do it using an id with :ApexPages.currentPage().getParameters().get('id') ... but that's not what I want.

 

Please can someone fill in the ?????s below for me?

 

public with sharing class PageRenderer {

    public Page_Layout__c[] getPageLayout() {
         return [select Name,
             nav_level_1__c,
             nav_level_2__c,
             page_title__c
            
             from Page_Layout__c
             where name = ??????];
     }
}

Trying to book an on-line exam through the webassessor site, and the booking site is completely broken!  No response to an email to salesforce ...

 

This is what worries me most about the cloud - it's all very well not having your in-house IT staff break stuff, but at least they answer emails and you get them to sort stuff out, whereas with salesforce, stuff gets broken and nobody seems to care.

This ought to be simple, but I can't figure out how to do it - I want to pass an integer number from a VF page to a custom controller to use in a SOQL query.

 

Something like this-

 

     public News_Item__c[] getHeadlines() {
         String recordsCount = ApexPages.currentPage().getParameters().get('recordsCount');
         Integer irecordsCount = integer.valueof(recordsCount);
         return [select Name,
             id,
            Release_Date__c,
            Title__c,
            Synopsis__c,
            Item__c from News_Item__c order by Release_Date__c desc limit :irecordsCount];
     }

 

However, the recordsCount String/Integer needs to be set statically in the VF page so that I can call different numbers of records using the same controller method in different situations.

 

I don't seem to be able to use apex:param, because I'm not clicking any buttons or inputing anything - I just want to set the variable in the page markup.

 

Thanks in advance.

Running through the Recruitment app creation in the Force.com Platform Fundamentals I have come across a problem.

 

Using the Mass Update Button created on the Job Applications related list, I find that pressing cancel produces an error message:-

core.apexpages.exceptions.ApexPagesHandledException: Filter Id value 00BA0000005siUC is not valid for the Job_Application__c standard controller

 

Obviously the Job_application__c standard controller is system generated, and the VF page is:-

 

<apex:page standardController="Job_Application__c" recordSetVar="applications">
    <apex:sectionHeader title="Mass Update the Status of Job Applications"/>
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Status Update" collapsible="false">
                <apex:inputField value="{!Job_Application__c.Status__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Selected Job Applications" columns="1">
                <apex:pageBlockTable value="{!selected}" var="application">
                    <apex:column value="{!application.name}"/>
                    <apex:column value="{!application.position__r.name}"/>
                    <apex:column headerValue="Candidate Name">
                        <apex:outputText value="{!application.candidate__r.First_Name__c &
                            ' ' &
                            application.candidate__r.Last_Name__c}"/>
                    </apex:column>
                    <apex:column value="{!application.Status__c}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

- ie as per the salesforce documment.

 

So what's going on?  Is this a salesforce bug, or am I doing something wrong here (not correctly invoking the 'cancel' method)?

Sorry but I'm a complete newbie.

 

I have written a simple controller for a custom object which just allows me to return the objects in various formats to a Visualforce page for display.

 

This is the Controller code:-

 

public with sharing class NewsController {
    
    public PageReference handleNewItemClick() {
         PageReference pageRef= new PageReference('/apex/newsedit');
         pageRef.setredirect(true);
         return pageRef;
    }

    public News_Item__c[] getHeadlines() {
         return [select Name, id, CreatedDate, CreatedBy.Name, Item__c from News_Item__c order by LastModifiedDate desc limit 3];
     }

    public News_Item__c[] getItems() {
         return [select Name, id, CreatedDate, CreatedBy.Name, Item__c from News_Item__c];
     }

    public News_Item__c getNewsEntry() {
     id id = ApexPages.currentPage().getParameters().get('id');
     if (id == null)
          return [select Name, id, CreatedDate, CreatedBy.Name, Item__c from News_Item__c order by CreatedDate desc limit 1];
     else
          return [select Name, id, CreatedDate, CreatedBy.Name, Item__c from News_Item__c where id = :ApexPages.currentPage().getParameters().get('id')];
      }
}

 

First off, I'm not sure how or if I should be testing this (what should I aim to be testing as all the code does is return data to a VF page - no triggers, no data updates or insertions or anything?).  But I've cobbled together a test class:-

 

@isTest
private class TestNewsController {
    static testMethod void testNewsDisplay() {
        
        News_Item__c[] items = new News_Item__c[] {
            new News_Item__c(Name = 'Headline 1', Item__c = 'News item 1 test text'),
            new News_Item__c(Name = 'Headline 2', Item__c = 'News item 2 test text'),
            new News_Item__c(Name = 'Headline 3', Item__c = 'News item 3 test text'),
            new News_Item__c(Name = 'Headline 4', Item__c = 'News item 3 test text')
        };
        

        insert items;
        
        Test.startTest();
        update items;
        News_Item__c LastItem = new News_Item__c();
        LastItem = NewsEntry();
        Test.stopTest();
        System.assert(LastItem.Name == 'Headline 4');
        

    }
}

 

I get the Method does not exist error on the LastItem = NewsEntry(); line (I'm just trying  to return a News_Item__c within Apex - I  use {!NewsEntry} in the VF page without any problem.

 

So how should I be testing this controller (or shouldn't I bother)? and what syntax am I breaking with LastItem = NewsEntry(); ?

 

Thanks.

I have some pdfs which I'd like visitors to be able to download from my site.  I've zipped them up and included them in a static resources file and my code is:

 

<p><a href="{!URLFOR($Resource.attunes, 'pdfs/parts%20list_2.pdf')}">ALWSR parts list (pdf 12KB)</a></p>

But the pdfs never get downloaded. Is this possible - what am I doing wrong?

I now have a free developer account and I have registered a domain name which has successfully propagated through DNS.

 

However, when I now log in, I click setup>create>sites and I only get the option to check availablity and register a new domain.  So how do I access the page which allows me to setup the domain (site) that I already have?

Trying to install the IDE to solve the problem caused by saleforce code bugs.

 

It terminates with the following:-

 

http://www.yatecourtbarn.adsl24.co.uk/images/force_IDE.JPG

 

Is it just me, or is this all a heap of crap?

Probably its just me, because I do not see anybody complaining about this. I have a simple VF page with pageblock referencing to a wrapper object. I need to display text from that wrapper object in headerValue for a column, but cannot do that, After trying for almost half a day, I have given up. 

 

Please look at column 2, dynamic referencing cannot be simple that this. It is just calling a string field, objType from the wrapper class. If one argues, that it has to be sObject field, please look at column 3. I am typecasting it with hardcoded 'ListPrice' field, but it still won't work. 

 

What is most frustrating, inputText values within those 2 columns which is replica of 'headerValue' works just fine, I can see ObjectType and field Lable in 2nd and 3rd column respt. 

 

Please help me , am I missing something here? are 'headerValues' exception to dynamic binding. I am sure someone might have come across this in the past. 

 

VF page:

<apex:pageBlock >
 <apex:pageBlockTable id="tbl1" value="{!wObjs}" var="wObj">                  
  <apex:column headerValue="Select">   
    <apex:inputCheckbox value="{!wObj.selected}" required="true" />
  </apex:column>               
  <apex:column headerValue="{!wObj.objType}">   
    <apex:inputText value="{!wObj.objType}" required="true" /> 
  </apex:column>              
  <apex:column headerValue="{!$ObjectType[wObj.objType].Fields.ListPrice.Label}">   
    <apex:inputText value="{!$ObjectType[wObj.objType].Fields['ListPrice'].Label}" required="true" /> 
  </apex:column>                             
 </apex:pageBlockTable>
</apex:pageBlock>

 Apex class (wrapper object):

public class wObj{
 public sObject sObj {get; set;}
 public string objType {get; set;}
 public Boolean selected {get; set;}
		        
 public wObj(sObject childObjRecord, boolean selected){
   this.sObj = childObjRecord; 
   this.objType = childObjRecord.getSObjectType().getDescribe().getName(); 
   this.selected = selected;
 }
}

 

If I see something like the following code:

 

public class wrapper {

    private String string1;

    private Integer int2;

 

   public wrapper {

        this.String1 = 'abc';

        this int2 = 123';

    }

 

   public String getString1() {

        return this.String1;

    }

 

   public Integer getInt2() {

        return this.Int2;

    }

}

 

What do the 'this.'es signify and why would I need them?  Wouldn't the code work the same without them?

 

Thanks in advance.

 

 

 

 

  • December 21, 2011
  • Like
  • 0

I can't figure out how to save updated records back with a StandardSetController and an extension to paginate the (filtered) set of data.  I'm obviously missing the mechanism to get the filtered data set back to the standard set controller 'save' function, but I can't figure out how to add it.

 

VF page is:

 

<apex:page standardController="Orphan__c" extensions="OrphanBulkReportsWithPagination" recordSetVar="orphans">
    <apex:form >
        <apex:sectionHeader title="Bulk {!ReportType} Reports"/>
        <apex:pageBlock mode="edit">
            <apex:pageMessages />

            <apex:pageBlockSection title="Print {!ReportType}" collapsible="false">
                <apex:inputField value="{!Orphan__c.Biodata_Report_Sent__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Selected Orphans"  columns="1">
                <apex:pageblocktable value="{!PaginatedOrphans}" var="orphan" id="list">
                    <apex:column value="{!orphan.Name}"/>
                    <apex:column headerValue="Orphan Name">
                        <apex:outputText value="{!orphan.First_Name__c
                            & ' '
                            & orphan.Last_Name__c}"/>
                    </apex:column>
                    <apex:column value="{!orphan.Country__c}"/>
                    <apex:column value="{!orphan.IRP_Country__c}"/>
                    <apex:column headerValue="Biodata">
                        <apex:inputField value="{!orphan.Biodata_Report_Sent__c}"/>
                    </apex:column>
                </apex:pageblocktable>
            </apex:pageBlockSection>
            
            <apex:panelGrid columns="2">
                <apex:commandLink action="{!previous}">Previous</apex:commandlink>
                <apex:commandLink action="{!next}">Next</apex:commandlink>
            </apex:panelGrid>
            
            <apex:pageBlockButtons location="bottom">

                <apex:commandButton value="Save" action="{!saveOrphans}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

And controller extension is:-

 

public with sharing class OrphanBulkReportsWithPagination {

    Apexpages.StandardSetController controller;

    public OrphanBulkReportsWithPagination(ApexPages.StandardSetController c) {
        ReportType = ApexPages.currentPage().getParameters().get('rpt');
        Country = ApexPages.currentPage().getParameters().get('loc');
        controller = c;
    }    
    
    public ApexPages.StandardSetController orphanRecords {
        get {
            if(orphanRecords == null) {
                return new ApexPages.StandardSetController(
                         Database.getQueryLocator(
                [SELECT Id, name, First_Name__c, Last_Name__c, Country__c, IRP_Country__c, Biodata_Report_Sent__c FROM Orphan__c
                WHERE Biodata_Report_Sent__c = false
                And (Status__c = 'Available' OR Status__c = 'Sponsored')
                AND Id NOT IN (SELECT Orphan__c FROM Annual_Progress_Report__c where Sent_to_Donor__c = true)
                ]));
            }
            return orphanRecords;
        }
        private set;
    }

    public List<Orphan__c> getPaginatedOrphans() {
        return (List<Orphan__c>) orphanRecords.getRecords();
    }

}

 

Many thanks!

The standard list controller seems to be filtered using the last selected filter for the object, even if it's not applied explicitly in the VF page using the SLC.

 

Is there a way to force it to use a specified filterId when the VF page is called - without having the user select it in the page, or having the last used filter (which could be anything) affect the record set?

Hi,

 

 I created a custom List Button on Accounts ,which i placed it on Accounts View. when i Click that  i call a VF page

 

PAGE:

---------

 

<apex:page standardController="Account" contentType="text/csv#Contact.csv" cache="true" recordSetVar="Accounts"  extensions="Accounts_export">
Customer Name,
"Phone",
"Email Id",
"Billing Street",
"City",
"Billing State/Province",
"Zip/Postal Code"
<apex:repeat value="{!Accounts}" var="a">  
{!a.Name},
"{!a.Phone}",
"{!a.Business_Email__c}",
"{!a.BillingStreet}",
"{!a.BillingState}",
"{!a.BillingCity}",
"{!a.BillingPostalCode}"   
    
</apex:repeat>
</apex:page>
                 

 

and MY controller :

-----------------------

 

public class Accounts_export {

 

    public Accounts_export(ApexPages.StandardSetController controller) {

controller.setPageSize(4000);

    }

 

}

 

 

 

I am Facing problem to export 4000 records to CSV or Excel where i can export 2000 records sucessfully

 

The Error when i give size as 4000 is 

 

"system.security.NoAccessException: Object type not accessible. Please check permissions and make sure the object is not in development mode: invalid batch size: 4000 

 

 

 

 

"

 

Any Ideas ! 

I have a wrapper class within an apex controller:


    public list<sidebarWrapper> getSidebars() {
        list<sidebarWrapper> sidebars = new list<sidebarWrapper>();
        
        
            for (Sidebar_Element__c sidebar :
                [Select id, Name, Order_On_Page__c, Page_Layout__c, Content_Item__c, Content_Type__c,
                Twitter_Feed__c, No_of_Tweets__c, Keyword__c, No_of_Items__c, Synopsis_Length__c,
                Content_Item__r.Heading__c, Content_Type__r.Title__c, Content_Type__r.View_All__c, Content_Type__r.View_All_Dest__c,
                Content_Type__r.List_Length__c, Content_Type__r.Synopsis_Length__c
                From Sidebar_Element__c where Page_Layout__c = :pgId order by Order_On_Page__c asc]) {
                                
                sidebars.add(new sidebarWrapper(sidebar));
            }
        return sidebars;
   }

    // Wrapper Class for sidebar  
    public class sidebarWrapper {
        public Sidebar_Element__c sel {get; set;}
        public Content_Item__c sci;
        public list<Content_Item__c> scl;

        // constructor method
        
        public sidebarWrapper (Sidebar_Element__c thisSel) {
            sel = thisSel;
        }
        
        public Content_Item__c getItem()
        {
            if (null==sci)
            {
                try {
                    sci =
                        [select Id, URL_Link__c, Image__c, Synopsis__c, Release_Date__c, Name, Heading__c,
                        Attachment__c, (Select Id From Attachments limit 1),
                        Content_Type__r.Image_Position__c, Content_Type__r.Image_Border__c, Content_Type__r.Show_Date__c,
                        Content_Type__r.Read_More__c, Content_Type__r.Read_More_Dest__c,
                        (select Name, Content_Item__c, Description_Text__c from Contents__r order by name)
                        From Content_Item__c
                        where Id in (Select Content_Item__c From Sidebar_Element__c where id = :sel.id)
                        order by Release_Date__c desc];
                }
                catch(QueryException e) {
                    return null;
                }
            }
            return sci;
        }
    
        public List<Content_Item__c> getList()
        {
            if (null==scl && sel.no_of_items__c >= 1)
            {
                try {
                    string sKey;
                    if (sel.keyword__c != null) sKey = '%' + sel.keyword__c + '%';
                    else sKey ='%';
                    scl =
                        [Select URL_Link__c, Image__c, Synopsis__c, Release_Date__c, Name, Heading__c, Content_Type__c,
                        Internal_Link_Prefix__c, Keywords__c,
                        Attachment__c, (Select Id From Attachments limit 1),
                        (Select Id From Contents__r limit 1),
                        Content_Type__r.Id, Content_Type__r.Title__c, Content_Type__r.Show_Date__c,
                        Content_Type__r.Image_Position__c, Content_Type__r.Image_Border__c,
                        Content_Type__r.Read_More__c, Content_Type__r.Read_More_Dest__c,
                        Content_Type__r.List_Style__c, Content_Type__r.Searchable__c,
                        (Select Page_Layout__c From Sidebar_Elements__r) From Content_Item__c
                        where Content_Type__c in (select Content_Type__c From Sidebar_Element__c where id = :sel.id)
                        and Keywords__c like :sKey
                        order by Release_Date__c desc limit :sel.no_of_items__c.IntValue()];
                }
                catch(QueryException e) {
                    return null;
                }
            }
              return scl;
        }
        
    }
    // End Wrapper

}


and I'm trying to write a test:

 

<!--- SET SOME TEST DATA UP -->


        string pgl = 'testPage';
        string fl = 'testflash';
        
        ApexPages.currentPage().getParameters().put('pgl', pgl);
        ApexPages.currentPage().getParameters().put('mov', fl);

        // Instantiate a new controller  
        PageRenderer pr = new PageRenderer();
        list<sidebarWrapper> s = new list<sidebarWrapper>();


        string nl1 = pr.getNav_Level_1();
        string nl2 = pr.getNav_Level_2();
        boolean bb = pr.getBack_Button();
        Page_Layout__c ap = pr.getActivePage();
        list<Page_Element__c> el = pr.getElements();
        s = pr.getSidebars();
        list<Sidebar_Element__c> sel = s.sel();
        list<Content_Item__c> ci = pr.getContentItems();
        list<Content_Item__c> sci = s.getItem();
        list<Content_Item__c> cl = pr.getContentList();
        list<Content_Item__c> scl = s.getList();
        Content__c c = pr.getPageContent();
        string flash = pr.getFlash();

        ApexPages.StandardController sc = new ApexPages.standardController(pe[0]);

        PageElementExtension pee = new PageElementExtension(sc);
        ci = pee.getContentItems();
        cl = pee.getContentList();

        ApexPages.StandardController sc2 = new ApexPages.standardController(se[0]);

        SidebarElementExtension see = new SidebarElementExtension(sc2);
        ci = see.getsContentItems();
        cl = see.getsContentList();

 

But I just get:


Save error: Invalid type: sidebarWrapper    TestPageRender.cls    /fusionai.com/src/classes    line 59    Force.com save problem

 

So why can't it see the Wrapper Class??

 

I have a VF page with a 2-level nested apex:repeat structure with separate SOQL queries for each loop.  The outer loop returns (amongst other things) a list of strings which I want to use as filter terms in the inner loop's SOQL.  The list is saved as a list variable in the controller (keywords[]), along with an index integer (iKey) for the inner loop.

 

However, although I can see from the logs that the list of filter terms is all build correctly, the debug loop seems to show that the inner loop's SOQL is only run once and hence it only seems to use the first of the filter terms to get results.

 

Here's what the debug log looks like:-

 

 

18:58:54.115|CODE_UNIT_STARTED|[EXTERNAL]|01pA0000002NfKZ|PageRenderer get(sContentList)
18:58:54.115|CODE_UNIT_STARTED|[EXTERNAL]|01pA0000002NfKZ|PageRenderer invoke(getsContentList)
18:58:54.115|METHOD_ENTRY|[155]|LIST.size()
18:58:54.115|METHOD_EXIT|[155]|LIST.size()
18:58:54.115|METHOD_ENTRY|[156]|System.debug(ANY)
18:58:54.115|USER_DEBUG|[156]|DEBUG|%all%
18:58:54.115|METHOD_EXIT|[156]|System.debug(ANY)
18:58:54.115|METHOD_ENTRY|[155]|LIST.size()
18:58:54.115|METHOD_EXIT|[155]|LIST.size()
18:58:54.115|METHOD_ENTRY|[156]|System.debug(ANY)
18:58:54.115|USER_DEBUG|[156]|DEBUG|%
18:58:54.115|METHOD_EXIT|[156]|System.debug(ANY)
18:58:54.115|METHOD_ENTRY|[155]|LIST.size()
18:58:54.116|METHOD_EXIT|[155]|LIST.size()
18:58:54.116|METHOD_ENTRY|[156]|System.debug(ANY)
18:58:54.116|USER_DEBUG|[156]|DEBUG|%
18:58:54.116|METHOD_EXIT|[156]|System.debug(ANY)
18:58:54.116|METHOD_ENTRY|[155]|LIST.size()
18:58:54.116|METHOD_EXIT|[155]|LIST.size()
18:58:54.116|METHOD_ENTRY|[156]|System.debug(ANY)
18:58:54.116|USER_DEBUG|[156]|DEBUG|%fractal%
18:58:54.116|METHOD_EXIT|[156]|System.debug(ANY)
18:58:54.116|METHOD_ENTRY|[155]|LIST.size()
18:58:54.116|METHOD_EXIT|[155]|LIST.size()
18:58:54.116|SOQL_EXECUTE_BEGIN|[159]|Aggregations:3|Select URL_Link__c, Image__c, Synopsis__c, Release_Date__c, Name, Heading__c, Content_Type__c,
Internal_Link_Prefix__c, Keywords__c,
Attachment__c, (Select Id From Attachments limit 1),
(Select Id From Contents__r limit 1),
Content_Type__r.Id, Content_Type__r.Title__c, Content_Type__r.Show_Date__c,
Content_Type__r.Image_Position__c, Content_Type__r.Image_Border__c,
Content_Type__r.Read_More__c, Content_Type__r.Read_More_Dest__c,
Content_Type__r.List_Length__c, Content_Type__r.Synopsis_Length__c,
Content_Type__r.List_Style__c, Content_Type__r.Searchable__c,
(Select Page_Layout__c From Sidebar_Elements__r) From Content_Item__c
where Content_Type__c in (select Content_Type__c From Sidebar_Element__c where Page_Layout__c = :pgId)
and Keywords__c like :keywordList[iKey++]
order by Release_Date__c desc
18:58:54.143|SOQL_EXECUTE_END|[159]|Rows:3
18:58:54.143|METHOD_ENTRY|[172]|System.debug(ANY)
18:58:54.143|USER_DEBUG|[172]|DEBUG|1
18:58:54.143|METHOD_EXIT|[172]|System.debug(ANY)
18:58:54.143|METHOD_ENTRY|[173]|System.debug(ANY)
18:58:54.143|USER_DEBUG|[173]|DEBUG|%
18:58:54.143|METHOD_EXIT|[173]|System.debug(ANY)
18:58:54.143|CODE_UNIT_FINISHED|PageRenderer invoke(getsContentList)
18:58:54.143|CODE_UNIT_FINISHED|PageRenderer get(sContentList)

The filter terms %all%, %, %, %fractal% are correct, but the SOQL query should execute 4 times ... and must do as I get 4 results on the VF page.

 

So what's going on?

 

I have the following VF page using custom objects and a custom controller to generate the page content:-

 

<apex:page showHeader="false" controller="PageRenderer" title="FusionExperience" >
<apex:stylesheet value="{!URLFOR($Resource.fusionexperience, 'css/reset.css')}" />
<apex:stylesheet value="{!URLFOR($Resource.fusionexperience, 'css/style.css')}" />
<apex:stylesheet value="{!URLFOR($Resource.fusionexperience, 'css/type.css')}" />

<!-- CONTENT -->
<div id="content">

    <!-- PAGE ELEMENTS (PASSED THROUGH PGL PAGE PARAM) -->
    <apex:outputPanel rendered="{!NOT(elements.size=0)}">
        <apex:repeat var="el" value="{!elements}" >

            <!-- (LIST OF) CONTENT TYPE -->

            <apex:variable var="clRender" value="{!NOT(ISNULL(el.Content_Type__c))}" />
            <apex:outputPanel rendered="{!clRender}" layout="block" styleClass="box">
                <div class="viewdiv {!el.Box_Size__c}">
                    <!-- BOX TITLE -->
                    <!-- uses content type title -->
                    <div class="latestnews headline">
                        <h3>{!el.content_type__r.Title__c}</h3>
                    </div>
                    
                    <!-- //BOX TITLE -->
                    
                    <!-- OUTLINED BOX -->
                    <div class="latestnews content">
                        <ul class="latestnews">
                            <apex:variable var="noItems" value="{!el.content_type__r.List_Length__c}" />
                            <apex:repeat var="cl" value="{!ContentList}" >
 
                                <!-- Only list content of THIS content type -->
                                <apex:variable var="clRender" value="{!AND(noItems>0, cl.Content_Type__c=el.Content_Type__c)}" />
                                <apex:outputPanel rendered="{!clRender}" >
                        
                                    <!-- IMAGE/URL -->
                        
                                    <apex:variable var="isPDF" value="{!IF(cl.Attachment__c='pdf', cl.Use_Attachment__c, false)}"/>
                                    <apex:variable var="isFlash" value="{!IF(cl.Attachment__c='flash', cl.Use_Attachment__c, false)}"/>
                                    <apex:variable var="readMore" value="{!IF(cl.content_type__r.Read_More__c,true,false)}" />

                                    <!-- establish pdf string -->
                                    <apex:variable var="pdfLink" value="{!IF(isPDF, IF(cl.Attachments.size=0, '', cl.Attachments[0].id), '')}"/>
                                    <apex:variable var="pdfLink" value="/servlet/servlet.FileDownload?file={!pdfLink}" />
                                
                                    <!-- establish flash string -->
                                    <apex:variable var="flashLink" value="{!IF(isFlash, IF(cl.Attachments.size=0, '', cl.Attachments[0].id), '')}"/>
                                    <apex:variable var="flashLink" value="fe?id={!cl.Content_Type__r.Read_More_Dest__c}&mov={!flashLink}" />
                        
                                    <!-- establish URL string for new page view -->
                                    <apex:variable var="itmLink" value="{!IF(cl.Contents__r.size=0, '', cl.Contents__r[0].id)}" />
                                    <apex:variable var="itmLink" value="fe?id={!cl.Content_Type__r.Read_More_Dest__c}&itm={!itmLink}" />
                                    <apex:variable var="itmLink" value="{!IF(cl.Contents__r.size=0, '', itmLink)}" />

                                     <apex:variable var="link" value="{!IF(readMore, IF(isPDF, pdfLink, IF(isFlash, flashLink, itmLink)), cl.URL_Link__c)}" />


                                     <!-- TEXT BLOCK -->
                                    <li class="latestnews">
                                        <a href="{!link}" class="latestnews">{!cl.Heading__c}<br /></a>
                                        <apex:variable var="sRender" value="{!NOT(cl.Content_Type__r.Synopsis_Length__c=0)}" />
                                        <apex:outputText rendered="{!sRender}" escape="false" styleClass="latestintro" value="{!LEFT(cl.Synopsis__c,cl.Content_Type__r.Synopsis_Length__c)}..." />
                                    </li>
                                    <apex:variable var="noItems" value="{!noItems-1}" />
                                </apex:outputPanel>
                            </apex:repeat>
                        </ul>
                    </div>
                </div>
             </apex:outputPanel>
 
              <!-- //CONTENT TYPE -->
                     
        </apex:repeat>
    </apex:outputPanel>

<!-- //CONTENT -->

</div>
</apex:page>

 

However, it's not formatting correctly in the browser, and when looking at the html code produced:

 

(see here) http://www.yatecourtbarn.adsl24.co.uk/images/test.html

 

It seems to be producing code that is missing the closing </div> tags, and hence screwing-up the css layout.

 

AFAICS, it has opening nested <div> tags for 'box', 'box-left viewdiv', and 'content latestnews', but only closes two of them before the next opening sequence.

 

Has anyone come across this before and/or can anyone offer a solution?

 

Thanks.

 

I have a VF page including:

 

        <apex:form >
            <apex:pageBlock mode="edit" id="searchText">

                <apex:pageMessages />
                <apex:pageBlockSection >
                    <apex:pageBlockSectionItem >
                        <apex:panelGroup >
                            <apex:inputText id="searchTerm" value="{!searchTerm}"/>
                            <apex:commandButton value="Search" action="{!search}" rerender="results" status="status"/>

                        </apex:panelGroup>
                    </apex:pageBlockSectionItem>
                </apex:pageBlockSection>

            </apex:pageBlock>
         </apex:form>

        <apex:actionStatus id="status">
            <apex:facet name="start">
                <apex:outputText styleClass="searchword inputbox" value="searching... for '{!searchTerm}'"/>
            </apex:facet>
            <apex:facet name="stop">
            
            <apex:outputPanel id="results">


          ............displays the search results here................


        </apex:outputPanel>

        </apex:facet>
    </apex:actionStatus>
<br/>
debug -- {!searchTerm}<br/>

 

and a controller

 

public with sharing class SearchController {

    public SearchController() {
        searchResultLists = new List<Content_Item__c>();
        searchTerm = 'search...';
    }

    public List<Content_Item__c> searchResultLists { get; set; }

    public String searchTerm { get; set; }

    public void search() {
        for(List<Content_Item__c> results : search.query('find :searchTerm in all fields returning Content_Item__c'))
            searchResultLists = [select id, name, synopsis__c,
                URL_Link__c, Image__c, Release_Date__c, Heading__c, Content_Type__c,
                content_type__r.name,
                Content_Type__r.Id, Content_Type__r.Title__c, Content_Type__r.Show_Date__c,
                Content_Type__r.Image_Position__c, Content_Type__r.Image_Border__c,
                Content_Type__r.Read_More__c, Content_Type__r.Read_More_Dest__c,
                Content_Type__r.List_Length__c, Content_Type__r.Synopsis_Length__c,
                Content_Type__r.List_Style__c,
                Use_Attachment__c, Attachment__c, (Select Id From Attachments limit 1),
                (select id from Contents__r limit 1) from Content_Item__c where id in :results];
    }


}

 

I also have the following in a header component that renders through the template for the page:

 

       <apex:form >
        <div class="clearfix search">
             <div class="search-box">
                 <apex:inputText id="searchTerm" alt="search..." styleClass="searchword inputbox" value="{!searchTerm}" maxlength="20"/>
                 <apex:commandButton action="{!search}" styleClass="button" rerender="searchText" status="status"
                     image="{!URLFOR($Resource.fusionexperience, 'images/searchButton.gif')}" />
           </div>
       </div>
    </apex:form>

 

Both the page and the component reference the (same) custom controller in their header.


Now I'm getting two problems:


The first is that although entering the search text in the header component and clicking the command button triggers the controller action, the input text never seems to be passed to the controller and so the search fails.


The second is that although entering the search text in the main page and clicking its command button, does pass the search text and return the correct results, the debug line at the bottom of the page and the searching message in the facet don't return the expected  {!searchTerm} string - it's always the intialised value 'search...'


So what am I doing wrong?

I'm building a site using force sites and I need a simple search facility to search my custom objects.  Unfortunately the field I need to search on is a text area and SOQL won't search text areas AFAIU.  So I figure I need to use SOSL, but the problem is that I can't figure out the syntax of what I need to do.

 

I understand the search bit:

 

String searchquery='FIND\'%'+searchText+'%\'IN ALL FIELDS RETURNING Content_Item__c (id,name), Content__c';
list<list<Content_Item__c>> searchList = search.query(searchquery);

 

but I don't understand what to do next or how to render the results in a VF page using a standard controller.

 

Can anybody point me at an example?  This must be a really common requirement for a web site, but I can seem to find any examples to get me started.

I created a VF page and I associated it with a Salesforce page that i created. I create a inputfield whereby users can input the ID of the person within the database. My question is how do i create a button with the function of search. for example and the user would input the ID of the person they are looking for then they would hit this custom button and the name, address and etc associated with the ID will show up. 

 

I got as far as 

 

<apex:commandbutton action=" " value = "Search>

 

I don't know what to input in the for the action. 

 

Please help. 

 

Thank you. 

Hello Gurus,

 

I have a VisualForce page that is calling a Custom StandardSetController with Pagination. I go to page #2 and update a record. After I hit save, I am directed back to first page although {!CurrentPage} displays Page #2. How can I stay on the current record/Page after I hit save?

Here is the relevant code:

 

Controller code:

public with sharing class SMADummy {
    
public ApexPages.StandardSetController setCon {
    get {
        if (setCon== null){
            system.debug('Calling locator');
        setCon=new ApexPages.StandardSetController(Database.getQueryLocator(
                            [Select s.Name, Activity_Start_Date__c,Activity_End_Date__c From Dummy__c s order by name limit 30]));
                 
                
               
            }
            return setCon;
        }
        set;
    }
   public List<Smart_Marketing_Activity__c> getActivities() {
     
         return (List<Smart_Marketing_Activity__c>) setCon.getRecords();
 }

 

VF Code:

<apex:page controller="SMADummy">

<apex:form>

<apex:pageBlock>

    <apex:pageBlockButtons >
            
                <apex:CommandButton value="Save" action="{!save}" />
              
              </apex:pageBlockButtons>
          

  <apex:commandLink action="{!setCon.previous}" immediate="true" >Previous</apex:commandlink>
    <apex:commandLink action="{!setCon.next}" immediate="true">Next</apex:commandlink>
     <apex:pageBlockTable value="{!Activities}" var="SMA" >

 

 <apex:column >
               <apex:facet name="header">Activity Start Date</apex:facet>
               <apex:inputField value="{!SMA.Activity_Start_Date__c}" />
            </apex:column>

....

....

 </apex:pageBlockTable>
      
     </apex:pageBlock>
  </apex:form>

</apex:page>

This ought to be simple, but I can't figure out how to do it - I want to pass an integer number from a VF page to a custom controller to use in a SOQL query.

 

Something like this-

 

     public News_Item__c[] getHeadlines() {
         String recordsCount = ApexPages.currentPage().getParameters().get('recordsCount');
         Integer irecordsCount = integer.valueof(recordsCount);
         return [select Name,
             id,
            Release_Date__c,
            Title__c,
            Synopsis__c,
            Item__c from News_Item__c order by Release_Date__c desc limit :irecordsCount];
     }

 

However, the recordsCount String/Integer needs to be set statically in the VF page so that I can call different numbers of records using the same controller method in different situations.

 

I don't seem to be able to use apex:param, because I'm not clicking any buttons or inputing anything - I just want to set the variable in the page markup.

 

Thanks in advance.

Hi all,

For some reason I am having a date picker appear on my VF pages.  By date picker, I mean two picklists side by side, one listing the months and one listing years from 2009-2015.  Below that is text: SunMonTueWedThuFriSat.  Then below that is a blankspot where I assume a calendar should be followed by a blue "Today" link.

 

Below is the source form the generated page:

 

</html><div class="datePicker" id="datePicker"><div class="dateBar"><img src="/s.gif" alt="Previous Month"  class="calLeft" onblur="this.className = 'calLeft';" onclick="DatePicker.datePicker.prevMonth();" onfocus="this.className = 'calLeftOn';" onmouseout="this.className = 'calLeft';" onmouseover="this.className = 'calLeftOn';" title="Previous Month"/><select  id="calMonthPicker" name="calMonthPicker" title="Month"><option value="0">January</option>
<option value="1">February</option>
<option value="2">March</option>
<option value="3">April</option>
<option value="4">May</option>

<option value="5">June</option>
<option value="6">July</option>
<option value="7">August</option>
<option value="8">September</option>
<option value="9">October</option>
<option value="10">November</option>
<option value="11">December</option>
</select><img src="/s.gif" alt="Next Month"  class="calRight" onblur="this.className = 'calRight';" onclick="DatePicker.datePicker.nextMonth();" onfocus="this.className = 'calRightOn';" onmouseout="this.className = 'calRight';" onmouseover="this.className = 'calRightOn';" title="Next Month"/><select  id="calYearPicker" name="calYearPicker" title="Year"><option value="2009">2009</option>
<option value="2010">2010</option>

<option value="2011">2011</option>
<option value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
<option value="2015">2015</option>
</select></div><div class="calBody"><table  class="calDays" border="0" cellpadding="0" cellspacing="0" id="datePickerCalendar"><tr><TH class="dayOfWeek" scope="col">Sun</TH><TH class="dayOfWeek" scope="col">Mon</TH><TH class="dayOfWeek" scope="col">Tue</TH><TH class="dayOfWeek" scope="col">Wed</TH><TH class="dayOfWeek" scope="col">Thu</TH><TH class="dayOfWeek" scope="col">Fri</TH><TH class="dayOfWeek" scope="col">Sat</TH></tr>

<tr class="calRow" id="calRow1"><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td></tr>
<tr class="calRow" id="calRow2"><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td></tr>
<tr class="calRow" id="calRow3"><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td></tr>
<tr class="calRow" id="calRow4"><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td></tr>
<tr class="calRow" id="calRow5"><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td></tr>
<tr class="calRow" id="calRow6"><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td><td onblur="hiOff(this);" onclick="DatePicker.datePicker.selectDate(this);" onfocus="hiOn(this);" onmouseout="hiOff(this);" onmouseover="hiOn(this);">&nbsp;</td></tr>
</table><div class="buttonBar"><a href="javascript&colon;%20void%280%29%3B" class="calToday" onclick="DatePicker.datePicker.selectDate('today');return false;">Today</a></div></div></div>

 

 

However on my VF page, the final lines look like this:

 

</body></apex:form>
    </html>
</apex:page>

 

 

Any ideas where that picker might be coming from?  Unfortunately I am unable to post the full source, so I created a new VF page with only:

 

<apex:page sidebar="false" showHeader="false" standardController="Opportunity"   >
    <html>
      <apex:form > 
      </apex:form>
    </html>
</apex:page>

 

The date picker items still appear!  A solid head-scratcher.