You need to sign in to do that
Don't have an account?
Dorel4
VisualForce Custom Button Error Message
I am trying to create a custom button on the Opportunity Page to update the stage. After you click the button you select from the picklist and hit save. I have used similar code for a button on a list view but I am getting an error message: Error: Unknown property 'OpportunityStandardController.selected'
Please help I am new at Visual Force. Thank you Here is my code;
<apex:page standardController="Opportunity" showHeader="true">
<apex:form>
<apex:pageBlock title="Opportunity Stage-Update" mode="edit" id="mub1">
<apex:pageMessages />
<apex:pageBlockSection id="mus1">
<apex:inputField value="{!opportunity.stagename}"> id="stagename">
</apex:inputField>
</apex:pageBlockSection>
<apex:pageBlockButtons location="bottom" id="mubut">
<apex:commandButton value="Save" action="{!save}" id="butsav"/>
<apex:commandButton value="Cancel" action="{!cancel}" id="butcan"/>
</apex:pageBlockButtons>
</apex:pageBlock>
<apex:pageBlock title="Select Stage" id="muselectedlist">
<apex:pageBlockTable value="{!selected}" var="opp" id="mutab">
<apex:column value="{!opp.stagename}" id="oppstage"/>
</apex:pageBlockTable>
</apex:pageBlock> </apex:form>
</apex:page>
Please help I am new at Visual Force. Thank you Here is my code;
<apex:page standardController="Opportunity" showHeader="true">
<apex:form>
<apex:pageBlock title="Opportunity Stage-Update" mode="edit" id="mub1">
<apex:pageMessages />
<apex:pageBlockSection id="mus1">
<apex:inputField value="{!opportunity.stagename}"> id="stagename">
</apex:inputField>
</apex:pageBlockSection>
<apex:pageBlockButtons location="bottom" id="mubut">
<apex:commandButton value="Save" action="{!save}" id="butsav"/>
<apex:commandButton value="Cancel" action="{!cancel}" id="butcan"/>
</apex:pageBlockButtons>
</apex:pageBlock>
<apex:pageBlock title="Select Stage" id="muselectedlist">
<apex:pageBlockTable value="{!selected}" var="opp" id="mutab">
<apex:column value="{!opp.stagename}" id="oppstage"/>
</apex:pageBlockTable>
</apex:pageBlock> </apex:form>
</apex:page>
<apex:page standardController="Opportunity" showHeader="false" id="muopp" > <apex:form id="muform"> <apex:pageBlock title="Opportunity Stage-Update" mode="edit" id="mub1"> <apex:pageMessages /> <apex:pageBlockSection id="mus1"> <apex:inputField value="{!opportunity.stagename}" id="stagename"> <apex:actionSupport event="onchange" rerender="muselectedlist"/> </apex:inputField> </apex:pageBlockSection> <apex:pageBlockButtons location="bottom" id="mubut"> <apex:commandButton value="Save" action="{!save}" id="butsav"/> <apex:commandButton value="Cancel" action="{!cancel}" id="butcan"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
All Answers
<apex:page standardController="Opportunity" showHeader="false" id="muopp" > <apex:form id="muform"> <apex:pageBlock title="Opportunity Stage-Update" mode="edit" id="mub1"> <apex:pageMessages /> <apex:pageBlockSection id="mus1"> <apex:inputField value="{!opportunity.stagename}" id="stagename"> <apex:actionSupport event="onchange" rerender="muselectedlist"/> </apex:inputField> </apex:pageBlockSection> <apex:pageBlockButtons location="bottom" id="mubut"> <apex:commandButton value="Save" action="{!save}" id="butsav"/> <apex:commandButton value="Cancel" action="{!cancel}" id="butcan"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>