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
2
votes
1answer
146 views

Disabled button is still clickable

I have the following piece of code. Here the button is enabled only when all 3 conditions satisfy <apex:commandButton disabled="{!(AModel.InviteDisabled || AModel.VerifyDShareAttachmentType || ...
-1
votes
1answer
49 views

Call A JavaScipt Method From <apex:commandButton> Instead of call by a html Button [duplicate]

Is it possible to call javaScript from <apex:commandButton> ...?
0
votes
2answers
187 views

Command Button returning error

The idea here is to to populate a list of a users events for the day. Allow them to notate whichever ones they want, and then create completed tasks to document the details of the respective meeting. ...
0
votes
1answer
254 views

fields resetting after form submission

I have created a page that lists down 10-12 fields of the contact object on the vf page. This is for record insertion. Now my requirement is that if I click on the button to insert a record and there ...
1
vote
3answers
13k views

how to call another visualforce page from an apex command button

I have an Apex command button in my Visual Force page. Using that button I want to call another visual force page, which in turn should call action function written in the controller. Please advise.
6
votes
3answers
4k views

How to show/hide pageblock based on clicking a button in Visualforce using a standard controller?

Here i have one Visualforce page and my situation is when i am clicking on Save Button both PageBlock will appearing but i want is : when i am click on Save the existing Pageblock should be hide and ...
0
votes
2answers
1k views

How to avoid page reload on standardController standard action (Save)?

i am using stadardcontroller Opportunity on my visualforce page but my concern is i don't want to reload that Opportunity detail page when i click on Save Button... Code : <apex:commandButton ...
1
vote
1answer
210 views

Value from Visualforce UI not reflected in controller

I have an <apex:inputField> in my visualforce page that controls a custom wrapper object which the user can update and then saves using <apex:commandButton> to my controller. The problem ...
1
vote
1answer
1k views

returning Javascript onclick prevents button from using it's action

The action part of my button stops working as soon as I change my button to return my javascript confirmation. Javascript: function confirmDialog() { var confirmation = confirm('Once you submit ...
1
vote
1answer
153 views

“Deactivate” Order command on Visualforce page

On the Order object, how would one perform the Deactivate action in a Visualforce page? Is there a way to discover how Salesforce is performing the action when the button is pressed on the standard ...
2
votes
1answer
3k views

Used html button instead of apex command button,controller action not updating new values?why

Used html button instead of apex command button, but only old values are passing to contrller action method why? Its working fine for commandbutton!! <apex:actionFunction name="...
0
votes
1answer
255 views

Attach More Files: Rerender Clears Selection

When am trying to click on Attach Another file button ,selected file on first input file is getting null. Here is the code. public class SamplePageController{ public List<Attachment> ...
4
votes
2answers
414 views

apex:commandButton updated by apex:actionFunction

I am trying to disable my button from being pressed twice. When this happens, a self-registration user is only created once - but multiple 'account' records are created (person accounts) for each ...
0
votes
3answers
3k views

How to align apex command button in center using twitter bootstrap

I am new to twitter bootstrap, i am trying to align the apex command button to centre of the page ,, i tried several ways but it is not working for me. My code is below <apex:page ...
1
vote
2answers
303 views

Using apex:commandButton inside relatedList facet to show/hide pageBlocks on a VF page

I'm trying to replace the "header" facet inside a relatedList on my Visualforce page. Inside the header I want to put a commandButton that, when I click it, will hide (via rendered) the pageBlock that ...
0
votes
3answers
2k views

How to print particular data in visualforce page?

I have visualforce page that contains report card. This page have command button like Back to page and Print . I am using for Print command button apex:commandLink value="Print" onclick="window....
1
vote
0answers
102 views

PageRef or ActionMethod problem

I'm trying to add functionality to a JQuery mobile app someone else wrote and encountering problems with either the action method or the page reference class when trying to construct another page to ...
0
votes
2answers
105 views

Javascript Function Button display

I have the following javascript function which is called from a apex:commandbutton. hasuser is a variable of the controller function toggleButton(box, id1, id2) { var user='{!hasuser}'; ...
1
vote
1answer
1k views

Button Render depending on a boolean value

I have the following piece of code function toggleButton(box, id1, id2) { var elm1 = document.getElementById(id1); var elm2 = document.getElementById(id2); if(box.checked){ elm1.style.display = ""; ...
2
votes
2answers
227 views

Javascript button visibility depending on a variable

I have the following piece of code <td width="10%"/> <td width="80%"><input type="checkbox" name="checkbox-mini-1" id="checkbox-mini-1" data-mini="true" onclick="javascript: ...
1
vote
1answer
87 views

JavaScript for Commandbutton

The code below was created for us as a custom button in the UI on the Opportunity object. I would like to now include it in a Visualforce page for a custom object as a Commandbutton. I am not very ...
1
vote
1answer
43 views

EDIT Links break on custom VF page don't work when i use rerender attribute on the command button

I am a newbie to salesforce coming from java world. I was working on a piece of functionality where user select search criteria, i build a dynamic soql based on that and display records on the same ...
0
votes
0answers
296 views

Toggle between 2 VisualForce pages in same window - development mode opens multiple times

I have 2 Visualforce pages which represent 2 different views of the same data - one a list view and the other a detail view. I have toggle command buttons on both and would like them both to open in ...
0
votes
1answer
2k views

CommandButton Refresh Page

I have a VF page with a commandbutton. I am trying to get the page to refresh once the commandbutton is clicked. The code below does what it is supposed to do, but the page does not refresh. Does ...
5
votes
2answers
346 views

How to avoid hardcoding Visualforce Page names in PageReferences?

I have a button which takes the user to a new page and passes through an Id parameter. I eventually want to package these into an app, which will mean there will be a namespace. How do I do this ...
1
vote
1answer
1k views

Change commandButton image on hover

I am trying to build a simple VF page that has 2 buttons on it. One button creates a new record; the other links to the Reports tab. I have been able to get all the functionality working except that ...
4
votes
2answers
1k views

How can I add a Custom button to a Custom Visualforce page?

I have created a custom button that runs JavaScript to update a long text area field in my Opportunity object. This works fine when the custome button is added to the standard Opportunity Page Layout....
0
votes
1answer
2k views

Problem with redirect with PageReference in iframe

I open a visualforce page in an iframe witch contain two commandButton. The buttons call functions on the class. At the end of my functions, i made a redirection with PageReference but the ...
1
vote
3answers
3k views

how to disable a button?

I have two command buttons like "save" and "delete". If i click the save button then the "delete" button should disabled. vf <apex:page > <apex:form > <script type="text/javascript"&...
-1
votes
1answer
1k views

how to insert records after clicking command button?

I want to insert records after clicking the create button.In my code the record are inserted.but i want to insert record after clicking "create" button public class ItemController { public ...
1
vote
3answers
927 views

Rerendering on Delete button is not working

I have delete button on page which deletes selected record from page. The moment I click on button, Record gets deleted but page is not getting refreshed automatically. To see the changes I need to ...
0
votes
0answers
587 views

VisualForce drop down button creation with a Link(action) associated to it

I need to create a drop down button(command) on my Visual Force page. This drop down should have a "Link"(or a lable-Text), when we click on this link it should invoke an action. This design is ...
-3
votes
1answer
186 views

command button onclick

I have created a command button to create new contact from account object. The issue is, new contact page opens in separate tab. I want them to open in the same window.
1
vote
1answer
320 views

Passing param using command link but it working only on double click

<apex:commandlink Value="Add Batch" action="{!addBatch}" reRender="pb,errormsg" > <apex:param assignTo="{!qliRowNum}" value="{!rowNum}" name="qliRowNum" /> <apex:param assignto="{!...
2
votes
2answers
2k views

How to disable command button while the page is being processed by other action?

I have apex:commandButton and apex:selectList. When the user selects an item in apex:selectList, it takes some time to process the request. While the request is being processed, I'd like to disable ...
0
votes
1answer
754 views

Why am i not getting values from visualforce page on my controller?

when I try to get the selected values from picklist and the inputText value by clicking the command button, it's not really passing them to my controller. VF: <apex:page controller="...
2
votes
1answer
189 views

Creating a new QuoteLineItem results in error

I have a button on one of my visualforce pages thats meant to allow a user to click on the button and add a new QuoteLineItem to the list of QuoteLineItems. My first major error is that the ...
0
votes
1answer
723 views

disable an input field when command button clicked

I have below piece of code where click on Coach button needs to disable input field Outcome. I have placed that in below code which is not giving desired output. Can someone please let me know? Apex ...
0
votes
1answer
883 views

Render condition not working

I have below render condition on below snippet that makes output field show on apex page when a particular checkbox is true for a list record. It is not working when that checkbox is checked from a ...
1
vote
1answer
646 views

Update record based on checkbox

I have below page where I can show different records under different sections based on their record type. Now I have to update only those records where User checks checkbox Confirm_Attestation_abv__c ...
0
votes
1answer
228 views

Can reports be generated using visualforce/apex class

I want to be able to generate reports through a visualforce section in account layout. Is it possible to generate a report through an apex class using a command button?
3
votes
1answer
95 views

apex:commandButton renders incorrectly

According to the Salesforce API, an <apex:commandButton> should render as <input type="submit"> however in my visualforce page, it renders as <input type="button">. Anyone know why ...
0
votes
1answer
75 views

CommandButton to Increase/Decrease Probability ln Visualforce

I have a Visualforce page that has a list of opportunities with their probabilities. I want to use commandbuttons to allow the user to increase or decrease the probability by 10% right in the list ...
0
votes
2answers
84 views

commandButton only executes first row

I have multiple rows in the pageBlockTable and I want the commandButton to work for each row seperately. Right now it only executes the first row, does anyone have any ideas how I can do this? apex ...
3
votes
1answer
240 views

How do I generate 2 different documents from the same VisualForce page?

I've figured out how to open a VisualForce page that autogenerates a Word document using a button click: <apex:commandButton onClick="window.open('/apex/GrantDoc?id={!Grant__c.Id}');" id="...
1
vote
2answers
1k views

Auto-closing Modal Issue with Bootstrap3 and apex:commandLink

I'm trying to pass a parameter to my controller on open of a modal window using Bootstrap html attributes. When I use the standard html button tag, the modal window behaves appropriately, but I am ...
2
votes
3answers
1k views

Apex:CommandButton sending data to controller

I'm trying to create a visual force page with a table and a "request" button that will take the selected row and append it as a task. Here's a photo of the table: When a user hits request, I want to ...
1
vote
4answers
771 views

ReRender doesn't work

I want to show some text when I click on the button partially updating page. Why reRender option doesn't work? Here is my code controller: public class CustomAccountController { public ...
1
vote
1answer
68 views

Same apex method different output

I have "Items" object with different statuses. I need to get the following output with single soql query. Ordered Items: 10 Cancelled Items: 3 Reviewed Items: 2 VF Page and apex code below: ...
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 ...