Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [commandbutton]

A button that is rendered as an HTML input element with the type attribute set to submit, reset, or image, depending on the <apex:commandButton> tag's specified values. The button executes an action defined by a controller, and then either refreshes the current page, or navigates to a different page based on the PageReference variable that is returned by the action.

0
votes
0answers
14 views

How to edit an element on a PageblockTable via Button

I have a list of products with their prices and I would like to be able to apply discounts to each product, but I'm not able to get the discount and the row number when clicking the button. I get an ...
0
votes
1answer
21 views

How do I cancel a 'window.open' from a commandbutton?

I have the following CommandButton: <apex:commandButton value="View Statement" action="{!openInvestmentStatement}" title="View Statement" oncomplete="window....
1
vote
1answer
36 views

Command Button not saving!

The command button on my Visualforce page is not saving edits to the record. Any help is appreciated! Visualforce Pg: <apex:page action="{!redirectToPartnerships}" extensions="EditExtensions" ...
1
vote
1answer
25 views

Apex command button does not work with Apex Repeat on Transient Varriable?

I am running into a strange issue, I've created the following function in my visualforce controller for testing: public void willFail() { Account acc = null; acc.Name = 'test'; update acc;...
1
vote
3answers
92 views

How can I get this button to pass data to controller?

UPDATE I have the following function: <apex:actionFunction action="{!selectRec}" name="recordSelectFunction"> <apex:param name="selectedID" assignto="{!selectedRec}" ...
1
vote
2answers
100 views

Command button value with special characters

I have command button. I want display the button value as below : View the "Requested Items" Chart So i have tried. <apex:commandButton style="background:#d0a416; font-weight: bold;float: right; ...
0
votes
0answers
64 views

How to download the excel from visual force page?

I have uploaded CSV file in visualforce page,When i click on the Download button then download the excel file,this is actual scenario,But here button also downloading along with excel file,How to ...
0
votes
1answer
53 views

How do I code a 'confirm send' button on my VisualForce page?

I have the following commandButton which runs the javascript function 'sendEmails'. This runs an ApexFunction which runs apex code to create and send an email from the controller. I need to add in a '...
0
votes
1answer
80 views

Unintended Page refresh command button inside form

I have an apex command button inside apex form with it's action calling an apex pagereference method. This makes the page reload every time I click the button. Can someone please help regarding this? ...
1
vote
0answers
132 views

How to redirect to a different page from popup window in visualforce

I am displaying a popup window on visualforce page. My use case is to redirect user to a entirely different visualforce page after user clicks Yes button on popup. Currently, It just stays on the ...
2
votes
1answer
167 views

Visualforce Page Redirect from Cancel

I have a simple VF page embedded in the detail page of the Contract object. The VF page is designed to replace the standard buttons on the detail page since one of the buttons needs to only appear if ...
1
vote
2answers
117 views

Visualforce CommandButton Open in Existing Window

I am trying to overwrite the standard buttons on a standard object with an embedded VF page. The reason for this is that I want a custom button to be conditionally rendered based upon a field in the ...
1
vote
2answers
37 views

How Do You Prevent Action Repeat (i.e. Send Email Again) When VF Page is Refreshed?

If I send an email from my VF page - via inputTextArea, commandButton and MassEmailMessage - and then refresh the page, the email gets sent again. How do I prevent this? Please review my code below. ...
0
votes
1answer
94 views

How to call a javascript method from an apex method to display a button

I have a use case where I have a button "Add another". I want this button to be hidden until an apex method "Save" is called. The save method calls a javascript method which in turn displays the ...
0
votes
2answers
72 views

How to detect which command button is clicked?

I have 2 command buttons on my vf page: <apex:commandButton onclick="saveAndnewmethod()" value="Save and New"/> <apex:commandButton onclick="savemethod()" value="Save"/> and they call ...
0
votes
1answer
132 views

apex:commandButton align center

How to move Button 'Create Referral' to center. I don't want that button on new Line. I want to show both Ok and Create Referral on same line, Ok on left side and 'Create Referral' to center <...
0
votes
1answer
52 views

How to align an image-button with another button?

I am able to create a commandbutton with image in visualforce page. But how to align it with another button? This is the current result: Here is the code <apex:outputPanel id="top" layout="block"...
2
votes
1answer
464 views

Embedded VF page's refresh issue

This is an Embedded VF page on the standard Contact detail page. I am having a Command button on my VF page with following JS function: <apex:commandButton value="Click ME" onclick="jsFunction(); ...
0
votes
1answer
381 views

Page redirection in same tab doesn't work with commandButton

I'm trying to get a button to open a standard record page in Salesforce classic view. I can get it to open in a new tab, but not in the same tab. I want to override the existing tab. Example of what ...
1
vote
1answer
736 views

Style and Show command Link as Command Button in Classic & Lightning

I would like a command link to look like a command button. I was once told that I could to that with using the style.
2
votes
2answers
1k views

How to disable a apex command button

In my VF page I want to disable the command button via Javascript(not through controller). <apex:page id="thepage" standardController="Opportunity" extensions="OpportunityExt"> <apex:...
0
votes
1answer
1k views

Apex Class for Extension AND Standard Controller Save Button

I have a visual force page using an extension and the standard controller. I added a pagereference save() action to the page but it is only updating the child and grandchild records. How can I get ...
0
votes
1answer
87 views

Apex:ActionRegion blocking Controller function Action

I'm trying to call a simple function in my Apex Controller and want to use an actionRegion to stop most sections of the page re-rendering. I note though when I add the actionRegion the controller ...
0
votes
0answers
230 views

pass variables into command button

I have a command button which has an action status and param values .please see code below <apex:commandButton id="songdbabc" action="{!synchsongmethod}" immediate="true" status="...
0
votes
1answer
60 views

TabInFocus Show CommandButton

I have a VF page with a requirement to show a commandbutton only for a specific tab. Can I do this with a {!TabInFocus} method? I want to show the 'Add Contact' button only when the Contacts tab is ...
-1
votes
1answer
203 views

How to pass a String from Visualforce to Apex, then re-rendering the page

I have a VF page that displays a table of records. I'd like the table to be filtered by one of it's String fields, "currency", so if I chose 'USD', it will only show records with 'USD', same for 'CAD',...
1
vote
1answer
705 views

Command Button not calling action function

I am trying to call action function from command button but for some reason the method in the action function is not getting invoked at all. Can any one please point out what is the issue here. <...
2
votes
1answer
1k views

CommandButton oncomplete JS function not firing [duplicate]

I have run into an issue with an apex:command button, where the oncomplete part of the process is not being called, and prevents the button from completing its action. The VF page is a component on a ...
0
votes
1answer
228 views

CommandButton onClick

I have a commandbutton at my page which open a new window. The url should be different for each item in the list, but if I put the url with the condition into the onclick the url doesnt work. With ...
0
votes
1answer
108 views

Command button in Salesforce is not working on first click

I have written one logic in that when we select an object and its related fields on VF page and click on a Add Mapping Button,it will redirect to an other page where selected object and its fields ...
2
votes
2answers
4k views

Passing Parameters Commandbutton

I don't know what is wrong with the code, I read a lot about the commandbutton and param, but it doesn't work. The Debug shows me that the value of the MS_Item is Null. 07:44:00.0 (8771917)|...
0
votes
2answers
73 views

How-to provide a status message prior to invoking a custom controller method

I have a custom controller to obtain a record set, which I invoke from a commandbutton. pbtable is a pageblocktable populated by the method searchproperties shown below. <apex:commandButton ...
1
vote
2answers
137 views

Only allow one submission with apex CommandButton

I've been trying the solutions outlined on this page: Disable commandButton after first click to prevent double submission However, I am still creating multiple submissions. I am unsure if this is ...
0
votes
1answer
69 views

page redirection not working in vf page

After deleting the record, the page should be redirected.This is my code: <button class="slds-button slds-button--neutral" id="btnAssetDelete"> <apex:outputLink value="{!URLFOR($...
0
votes
2answers
576 views

Render in Command Button

I have a question on how to use render on command button? <apex:pageBlockButtons > <apex:commandButton onclick="appendSelected(); return false;" value="Select" /> <apex:...
0
votes
1answer
312 views

Visualforce button to open EmailTemplate preview in new page causes error

I have a Visualforce page where I allow a user to edit text to add to a VF template and then send it. (I can't use an HTML template as there is an attachment which is built up using data from the ...
0
votes
0answers
78 views

Command button not routing to action function

I am trying to insert a campaign through a Visualforce Page to Salesforce db. After insert, user must be directed to the inserted Campaign's detail page. However, the command button is not directing ...
0
votes
1answer
291 views

System.QueryException: unexpected token: = Error is in expression '{!dosearch}' in component

public class search { public search(){ soql = ''; service = new list<Service__c>(); } public string soql; public string city{get;set;} public list<Service__c> service{get;set;} public void ...
0
votes
1answer
118 views

Difference between HTMl button element to apex:commandButton

Can someone explain the differences between the two Vf snippets below? VF Snippet A: <button type="button" onclick="{!CaseSubmitForm}">Submit a Ticket</button> VF Snippet B: <apex:...
0
votes
0answers
329 views

How to stop the <apex:form> onSubmit event from triggering when html5 validation kicks in?

I have this simple form <apex:form onSubmit="alert('submit!');"> <apex:inputText id="a" value="{!a}" required="true"/> <apex:commandButton action="{!signup}" value="b"/> </...
1
vote
1answer
704 views

Apex Controller Variable value Not Passing to Javascript function

My requirement is: On the click of a command button, I need to call a controller method and set a value to a controller variable. After that assignment is done, oncomplete attribute of actionfunction ...
2
votes
1answer
100 views

Shift Command button position to float center

I have a requirement to shift an apex command button to middle or center position. I can get the feeling that if I can achieve float: center then it would be my desired location for the command button,...
0
votes
2answers
811 views

Hide custom button on visualforce page [duplicate]

I have a requirement to hide custom button when condition is satisfied.On case I have person_role field.If the field is null then I need to hide custom button on vf page. <apex:commandButton value=...
1
vote
1answer
289 views

Controller method is not called second time

I am calling controller function on command button click. This is button: <apex:commandButton value="Add" onClick="addItemToCard('{!$Component.bVAL}', '{!item.Id}'); return false;"/> This is ...
1
vote
1answer
513 views

Rendering and Rerendering a command button after submitting a record

I have a two command buttons that are able to save a record. One button fully submits the record and sends it to the edit view. The other save button will update the record if there is anything the ...
0
votes
1answer
218 views

How to save my pick list value to custom object FeedbackFrom__c? [duplicate]

I am having 10 pick list fields for my custom object FeedbackFrom__c Each fields having different VF Page(Totally 10 VF Page) at page 11 am having one submit button. if i click it should save all the ...
0
votes
2answers
82 views

Is there a way to hide the “Save And Submit” button after the record is saved?

Page <apex:pageBlockSection id="buttonSection"> <apex:pageBlockSectionItem > <apex:outputPanel id="buttonPanel"> <div align="right"> ...
3
votes
0answers
130 views

ActionStatus only affects a single PageBlockButton, not both

While testing a page I was working on, I noticed something strange- the apex:actionStatus I had set up to prevent users from clicking save more than once was only working with the button that the user ...
0
votes
2answers
1k views

Can Apex method be called from <apex:commandButton> oncomplete attribute?

Visualforce Page: I'm calling an apex method 'removeServiceTechnician' in ...
0
votes
1answer
82 views

How to handle passing field values when immediate attribute is used in commandButton

I have a situation in my code where I need to validate input fields when a user clicks the "Save" button. I have other commandButtons on the page, one specifically that copies the values of an ...