Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Visualforce Development
- :
- On Clicking Save button, Cancel button also need t...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
On Clicking Save button, Cancel button also need to go into Saving mode
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-12-2012 01:29 AM
Hi, I designed a VF page with save and cancel buttons . On Clicking Save button, Cancel button also need to go into Saving mode, similar to Salesforce standard page.
My Requirement is :
On Clicking Save Button we should disble both Save & Cancel buttons and need to show saving text for both buttons
Thanks,
Ramana
Solved! Go to Solution.
Re: On Clicking Save button, Cancel button also need to go into Saving mode
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-12-2012 02:12 AM - edited 11-12-2012 02:17 AM
Dear Reddy,
if i got it correct u want disable cancel button once Save button is clicked...
for this you can rerender the buton's section or panel where your buttons reside when the save button is clicked...
Some tips would be:
1)Use onclick event for save button
2)reRender the buttons section with attribute disabled is true for cancel button
Sravan Alaparthi
Salesforce Developer/Adminstrator
Re: On Clicking Save button, Cancel button also need to go into Saving mode
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-12-2012 02:34 AM - edited 11-12-2012 02:48 AM
Thanks Sravan,
The below code is working for save.but i want to disable cancel and show saving text for both the buttons(Save and Cancel) when i clicked on Save button.
<apex:pageBlockButtons location="bottom">
<apex:actionStatus id="leadActivityTypeStatus">
<apex:facet name="stop">
<apex:commandButton value="{!$Label.save}" action="{!saveLeadActivityType}" onclick="this.disabled=true;"
disabled="false" rerender="Form" status="leadActivityTypeStatus"/>
</apex:facet>
<apex:facet name="start">
<apex:commandButton status="leadActivityTypeStatus" value="{!$Label.saving}" disabled="true" />
</apex:facet>
</apex:actionStatus>
<apex:CommandButton value="{!$Label.cancel}" action="{!closePanel}"/>
</apex:pageBlockButtons>
Thanks
Ramana
Re: On Clicking Save button, Cancel button also need to go into Saving mode
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-12-2012 03:29 AM
Try this, it will disable both the buttons and it will show the text as 'saving...' on both of them.
<apex:pageBlock >
<apex:commandButton value="Save" id="save" action="{!save}" onclick="saving('start', this, '{!$Component.cancel}');" oncomplete="saving('stop', this, '{!$Component.cancel}');"/>
<apex:commandButton value="Cancel" id="cancel" action="{!cancel}" />
<script>
function saving(activity, obj, id)
{
if(activity == 'start'){
obj.value = 'saving...';
obj.disabled=true;
document.getElementById(id).value = 'saving...';
document.getElementById(id).disabled = true;
}
else{
obj.value = 'save';
obj.disabled=false;
document.getElementById(id).value = 'cancel';
document.getElementById(id).disabled = false;
}
}
</script>
</apex:pageBlock>
Kudos a post if it helps, mark it as solution if it solves.
http://exploretheforce.blogspot.in
Re: On Clicking Save button, Cancel button also need to go into Saving mode
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-13-2012 09:02 PM
Thank you Vishal...You did a gr8 job..Its working for me.

