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.

Filter by
Sorted by
Tagged with
0
votes
0answers
39 views

URL param dissappear after onClick event

I tried researching on this particular topic and found a similar problem here https://developer.salesforce.com/forums/ForumsMain?id=906F000000096Q1IAI Unsure what causes the param to dissapear after ...
0
votes
1answer
622 views

Visualforce onClick Javascript Display

I have an issue with Javascript prompt display. I'm trying to check if user is Guest from the variable {!type} which i get from my Apex controller on my OnClick event. However, the Javascript message ...
1
vote
1answer
826 views

Tab index ignored in Visualforce page

This seems such a simple problem, but I cannot see why the solution is not working. I have an inputText and a command button in the same area of the screen, and want to tab from the inputText to the ...
1
vote
1answer
1k views

Use “accesskey” attribute of apex:commandbutton in VF page

I am trying to implement a functionality that would allow users to invoke controller method by pressing "enter" key also. I know "accesskey" attribute of apex:commandbutton can be used to perform such ...
2
votes
2answers
6k views

How to return to the previous page from a Visualforce page?

I have a page that shows records for an object and I need to be able to select some, and then once the "Add Packages" button is clicked I need the page to return to the previous page after completing ...
2
votes
1answer
39 views

Shifting an image down

I have a search bar along with a search and clear button. What I would like is for the clear button to be centered with the search button. I have tried using padding-top on the image as well as it's ...
1
vote
1answer
857 views

Popup confirm window on custom login page

I have a custom login page the makes use of the SiteLoginController. When the user inputs their username and password, I need a popup window to appear that they would need to acknowledge before it ...
0
votes
1answer
3k views

How to add a commandButton (or similar) for every row in pageBlockTable?

I am trying to add a button in the last column of every row in a pageBlockTable. Something like 'Create' that will use the row level data and create/update an sObject via a controller. When I use &...
7
votes
2answers
302 views

The case of the insubordinate command button

Good day Ladies and Gents. I lay before you the fruit of many days of frustration, labor and tears, begging for your help. There are a few moving parts here, so let me introduce them one by one, ...
0
votes
2answers
845 views

How to show/hide a commandButton or inputField or outputField in a custom visualforce page from a custom controller?

There is a custom visualforce page with a bunch of fields and a save button at the bottom. If the URL is bad/incorrect, I would like to hide the fields and the button on the page and display a ...
2
votes
2answers
3k views

<apex:commandButton> action doesn't work every time

I have implemented three dependent picklists like below: There is one visualforce page (standard controller for Opportunity with extension). This problem is connected with an action for Search button....
0
votes
0answers
48 views

Store record values before update

I have a requirement to allow User Rollback the Updates here by one click on a commandbutton. That feature I have tried to tackle by Revert Changes button here . Is there any other way to deal with it?...
1
vote
2answers
875 views

Command button display control

I have two command buttons (say A , B). I want when A is clicked then only B would be shown. When B clicked then it would be hidden again. Is this achievable ? Please find my page below. Page snippet:...
0
votes
3answers
2k views

Call two controller method from a single comandbutton click

what is the best practice to call two controller method from a single commandbutton click. I have a requirement that on single buttonclick, page will navigate to first page and also call add new ...
1
vote
1answer
216 views

commandbutton changes its postion when shown using inline-edit shownonedit from when shown using javascript function

I have 2 commondbutons inside a div, initially display hidden . <div style="width:1000px;height:50px;text-align:left;"> <apex:commandButton value="Save" oncomplete="triggerBlurEvents();"...
1
vote
2answers
600 views

Inline editing last updated field is not getting saved

I have a pageblock table where i can do some inline editing. But the last editd field is not getting saved. I need to explicitely click elsewhere after editing the field and then click on save and it ...
0
votes
1answer
121 views

Save Commanbutton errors out on hitting twice :System.ListException: Before Insert or Upsert list must not have two identically equal elements

I have a visualforce page, embedded in standard pagelayout of Account, that displays a list in peblocktable and can be inline edited. while hitting the Save button, it updates records and rerenders ...
0
votes
2answers
698 views

Saving a visualforce page embedded in Page Layout of Account object redirects abnormally

I have a VisualForce page inline1 embedded in Account page layout. While hitting the save button in the visualforce page it redirects to some other url : https://c.ap1.visual.force.com/apex/inline1?...
0
votes
2answers
369 views

Dynamic Visualforce Components with commandButtons tied to records

I'm creating a VisualForce page that is going to load records from a web service using JSON. I have a requirement to add a button next to each record I pull. I don't see a direct way to do this with ...
5
votes
1answer
1k views

CommandButton reRender causing action to fire twice

I havea custom save button on a visualforce page as below. I wanted to use actionstatus to show the user that the save process was taking place/in progress. However recently the redirect stopped for ...
3
votes
1answer
715 views

showOnEdit within commandButton not working when PageBlock section starts with rendered=false

On my visualforce page I have a pageblocksection that starts off hidden, this pageblock is shown when the user selects a value from a picklist. This feature works, but breaks the 'showOnEdit' ...
0
votes
1answer
2k views

Need Page refresh each time Save method called

I have to refresh the page each time the Save method is called. Please find my page and code snippet here. Can someone help me here? Page : <apex:commandLink value="Save" action="{!savei}" target=...
0
votes
1answer
1k views

Add standard button to visualforce element

I've been asked to create a custom visualforce element to replace the Campaign History related list on contact. Everything appears to be working as expected, except that the last requirement is to ...
1
vote
1answer
912 views

Void Method inside of Pagereference method does not fire

I have two different code samples. I am calling the PageReference method as an action on a CommandButton. Code Sample 1: public without sharing class MyClass{ public MyClass{ } public ...
4
votes
2answers
2k views

What is immediate=“true” translated into html

I am using the apex:inputField to capture the values and and required="true" to set some of the fields mandatory. However, for some buttons like cancel, I don't want it to check the required fields. ...
2
votes
2answers
4k views

Passing parameter through commandbutton is null value

I'm trying to pass a parameter of an Object to a controller with this code block: <apex:commandButton value="Accept" action="{!Accept}" > <apex:param name="deal" ...
1
vote
1answer
5k views

Using ActionStatus with a CommandButton and Apex:Param

This is my initial (and working) setup for a Select button against an OpportunityLineItem on a custom product selection Visualforce page. Note the OpportunityLineItems are displayed in a table, hence ...
1
vote
1answer
1k views

How to create a CommandButton with a dropdown

Is it possible, and what would be the approach, to create an apex:commandButton which displays a dropdown when clicked, in the same fashion as the Manage Members button on the Campaign object: I'm ...
1
vote
2answers
4k views

Passing parameters with commandButton

I'm trying to pass a parameter with a commandButton. I've seen a few ways to do it on the net, but they don't work. What I have now: <apex:commandButton value="Accept" action="{!acceptDeal}" ...
4
votes
3answers
3k views

Use jQuery to bind to apex:apex:commandButton onComplete event

Is it possible to bind to the onComplete event for an <apex:commandButton/>? Instead of using the following format: <script> function myOnComplete(){ // do onComplete stuff } </...
2
votes
2answers
1k views

How do I prevent the creation of multiple Records with an overwritten save button?

I have a custom save method, which saves my object and redirects me to his parent. This works fine for me and I used this kind of approach very often. Visualforce Page: <apex:commandButton value="...
0
votes
2answers
494 views

CommandButton action doesn't populate selectList field

I've got a simple VisualForce page with a form that has one custom picklist. My controller successfully populates the custom picklist and the page renders fine. But when I click on the CommandButton ...
1
vote
2answers
636 views

Null Value for method called by command button

Following is my VF page: <apex:page standardController="Case" extensions="ctrlClaim"> <!--read--> <style> .customPopup{ background-color: white; border-...
1
vote
1answer
765 views

Issue with Development footer

Command button with oncomplete attribute does not work when development footer is Enabled. <apex:page controller="google_redir"> <apex:form> <apex:commandButton action="{! hello1}" ...
0
votes
1answer
285 views

Need to click two times on <apex:commandButton> to call action

I have the code below. VF : <apex:form> <apex:tabPanel> ... </apex:tabPanel> <apex:commandButton value="mybutton" action="{!save}" style="...
0
votes
2answers
3k views

Reset search results and clear the search text using a button click

I want to clear the inputtext used to search, and clear all search results using a commandbutton. I tried the following on the 'Reset' button I added but it only clears the inputtext and the search ...
6
votes
1answer
3k views

How to associate Enter key to one of the many commandButtons on VF page

I have a Visualforce page with 3 buttons. One of button on clicking it will do a search and display the results on the same page. While other 2 buttons take the user to the next page. Also, I have a ...
1
vote
1answer
2k views

pressing enter on inputText does not trigger commandButton

<apex:form styleClass="container"> <apex:actionRegion > <div class="col-md-3 col-sm-5 col-xs-5 input-group"> <apex:inputText value="{!searchString}" styleClass="form-...
4
votes
1answer
3k views

commandbutton not running action function after reRender

So I have commandButtons being displayed through a apex:repeat and being given a variable value in the repeat. When the button it clicked, I have it going to the controller and assigning the values ...
1
vote
2answers
2k views

commandLink and commandButton with image not passing parameters

I'm trying to pass a parameter to a method in a visualforce page when the users clicks on a detail icon (a static resource image). I'm trying with a commandButton since I need the button to be an ...
2
votes
1answer
1k views

How to set defaults when creating a record from a visualforce page button/link?

I can create a link or button in a visualforce page that references an object's links or buttons with a line like this: <apex:commandButton action="{!URLFOR($Action.SiteProgram__c.New_Holidaybtn)}"...
0
votes
1answer
626 views

Action attribute works on page tag, not on commandbutton tag

I am very new to salesforce, apex, and visualforce. I created a developer account and began creating custom pages and apex classes. I am trying to create a method inside a custom controller class ...
-4
votes
2answers
969 views

I want to display POP UP Window in VF

For example, I have 3 command buttons in same page block table, clicked 2nd command button , its needs to display "POP Button " , will we copy first command data to here ? YES or NO . like that I ...
2
votes
2answers
2k views

Javascript action function not working after Summer 14 release

I have a VF page with a command button. It calls a javascript function, and then an actionFunction to call a method in the apex class. Everything was working fine until summer'14 release. Now, when ...
2
votes
2answers
1k views

Values don't update after I call action on a commandbutton?

I am trying to implement functionality in SalesForce where when a user clicks a button then the following count increases. Currently I have a simple test page that just shows the following count. ...
0
votes
1answer
646 views

Two action function from one commandbutton

I have implemented prev << next>> buttons also.. which will show me resultset part by part along with the sphere.. i've used SOQL Offset-limit logic..but the problem is when clicking ...
-2
votes
1answer
2k views

how to disable an apex commandbutton after first click [duplicate]

how to disable an apex commandbutton after first click . can someone help me out? page : <apex:pageBlockSection rendered="{!enableSpehere}"\> controller : boolean enableSpehere {get;set;} ...
0
votes
0answers
2k views

Closing a popup on clicking 'Cancel' and also implementing 'Save and Close'

I have a popup that that opens up when a custom button is clicked. The custom button is present on a standard salesforce page. The popup has a VF page in it. There are some mandatory inputText fields ...
0
votes
1answer
2k views

Make enter key execute controller method

I have an inputText being used as a search bar along with a commandButton that when pushed executes the search method in my controller. What I would like to add is that when the user pushes the enter ...
2
votes
3answers
924 views

search bar accessing apex controller variable in javascript

<apex:inputText id="searchBar" value="{!nameSearch}"/> <apex:commandButton value="Search" action="{!search}" rerender="Everything" status="statusId" onclick="if({!nameSearch}.length() < 3){...