Find your content:

Search form

You are here

Visualforce: Using {!selected} to filter records (Chrome Incognito?)

 
Share

I'm a Salesforce newcomer. I'm trying to get some basic functionality working, based on the Introduction to VisualForce tutorial on Pluralsight.

The page is a list view:

<!--Tree Search -->
<apex:page standardController="Tree__c" recordSetVar="trees">
    <apex:form >
        <apex:pageBlock title="Tree List">
            <apex:inputField value="{!Tree__c.Status__c}"/>
            <apex:commandButton action="{!save}" value="Update"/>
            <apex:pageBlockTable value="{!selected}" var="tree">
                <apex:column >
                    <apex:facet name="header">Tree ID</apex:facet>
                    <apex:outputField value="{!tree.Name}"/>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">Status</apex:facet>
                    <apex:outputField value="{!tree.Status__c}"/>
                </apex:column>
            </apex:pageBlockTable>
                <apex:commandLink action="{!previous}">previous</apex:commandLink>&nbsp;
                <apex:commandLink action="{!next}">next</apex:commandLink>
        </apex:pageBlock>
    </apex:form>    
</apex:page>

A List Button has been added to the custom object:

Update status graphic

However, when I select objects from the Custom Object's tab (in this case "Trees") and click "Update Status". I get redirected to a blank page.

I'm expecting to see a list of all the records I just selected.

Any ideas?

Browser: Chrome Version 34.0.1847.131 m OS: Windows 7

ETA: This snippet works as expected in Firefox 28 and IE 11.

ETA: Also works when not in Chrome incognito mode.


Attribution to: powlo

Possible Suggestion/Solution #1

It would appear something in the Chrome Incognito mode is interfering with the code that passes the selected record ids to the Visualforce page.

I had a quick go at reproducing it, but didn't see any Javascript errors in the Console.

When the "Display Checkboxes (for Multi-Record Selection)" is active the Visualforce page ends up in an iframe. Around the iframe there is some Javascript and a form that both appear to be related to passing the selected record ids into the iframe.

enter image description here

<script>this.document._selectedRecordIds = {'00k': ['00k4000000fjXjl']};function getRecordIds(keyPrefix) { var ids = this.document._selectedRecordIds[keyPrefix]; return ids ? ids : []; }</script>
<iframe frameborder="0" height="600px" id="itarget" name="itarget" scrolling="auto" title="Content" width="100%"></iframe>
<form action="/apex/DFB__nestedVisualforcePage?oppId=0064000000WmuL0&amp;retURL=%2F0064000000WmuL0" id="workerForm" method="post" name="workerForm" target="itarget"><input type="hidden" name="ids" id="ids" value="00k4000000fjXjl"></form>
<script>document.forms['workerForm'].submit();</script>

Do you see any messages in the Console when it fails in Chrome Incognito mode?


Attribution to: Daniel Ballinger
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/34460

My Block Status

My Block Content