Skip to main content
19 votes
Accepted

Checkbox in LWC

You can add attribute checked to lightning-input from javascript controller. You can access checkbox element by some attribute. In this example all checkboxes are accessed by setting data-id ...
amitghadage's user avatar
  • 1,350
12 votes

Checkbox in LWC

You can check it directly like this. <lightning-input label="test" class="slds-p-left_xx-large" type="checkbox" checked="checked"> </lightning-input>...
Rahul Gawale's user avatar
  • 12.2k
7 votes

Controller object not updating fast enough

This is primarily due to network latency. When using apex:actionSupport, an ajax call is initiated to the server. These calls are non-blocking, meaning you can initiate several, completely ...
S Morgan Robertson's user avatar
7 votes
Accepted

Controller object not updating fast enough

A good way to do that is to skip the method and use the basic visualforce setters. <apex:inputCheckbox value="{!myCheckboxValues[0]}"> <apex:actionSupport event="onchange" reRender="...
Fernando Gavinho's user avatar
7 votes

How to display a checkbox field using ligntning:datatable?

Checkbox columns are now supported out-of-the-box in lightning:datatable and doesn't require custom Javascripting. boolean: Displays the icon utility:check if the value is true, and a blank ...
Mahmood's user avatar
  • 5,954
7 votes
Accepted

lightning checkbox is not working

You might want to use onchange event handler on your component to track changes in your lighting:input components vs using onclick, why? Because onclick will invoke your method regardles if the ...
glls's user avatar
  • 20.2k
6 votes

Handling nulls on checkbox fields in Apex

Answer from support for Case #14025277 R&D has confirmed that this is a documentation issue. The documentation will be updated to clarify this behavior (please see below). "The expression ...
Daniel Ballinger's user avatar
6 votes
Accepted

ui:inputCheckbox how to allign with the checkbox itself

I found the answer! I wrote a class in css called .myCheckbox: .THIS .myCheckbox{ display: inline-block; float: left; } and added the class to the inputCheckbox: <ui:inputCheckbox class="...
Dana Griff's user avatar
  • 1,576
6 votes

How to display a checkbox field using ligntning:datatable?

You can use the iconName cell attribute to display icons in your datatable (see the "Appending an Icon to Column Data" section in the documentation). This can either be a static value, e.g. utility:...
Pawel Fronczak's user avatar
5 votes

Implement three state checkbox using LWC

Indeterminate is not a content attribute, as per the documentation, it cannot be used in the component's markup In addition to the checked and unchecked states, there is a third state a checkbox ...
glls's user avatar
  • 20.2k
5 votes

How to add a radio button in lwc datatable?

Using: <lightning-dattable max-row-selection="1"> According to the lwc datatable documentation: Radio buttons are used when maxRowSelection is 1.
Gian Vallejos's user avatar
4 votes
Accepted

How to style a checkbox in a Visualforce page using Lightning Design System?

Sometimes you have to change the SLDS example to work correctly with Visualforce. Visualforce depends on the input field having a specific "id" attribute, so the id of the checkbox is actually ...
Mike's user avatar
  • 754
4 votes
Accepted

Visualforce: Checkbox is not firing function onclick

The problem is reported in the console: Uncaught TypeError: checked is not a function It seems to be a name conflict but I can't see where. Changing the function name to e.g. isChecked works ...
Keith C's user avatar
  • 136k
4 votes

Visualforce: Checkbox is not firing function onclick

The first thing you should always do when you face a Javascript error is open up the console. Here's how to do it on: Chrome Firefox Opera Safari IE If you had done so, you would have seen the ...
Adrian Larson's user avatar
  • 150k
4 votes
Accepted

How do I read the value from an input checkbox?

I believe you may just have the name of the event wrong. On the checkboxes, the event being sent is called change like this: component.cmp <ui:inputCheckbox aura:id="checkbox" label="Select?" ...
Etienne Rocheleau's user avatar
4 votes
Accepted

How to rename 'Checkbox' column in lightning 'datatable' component?

You can't modify the behavior of the select row column. Recommended Action Specify an action button in the upper-right area (where "Close" is in your images) with a button to link/unlink, and use ...
sfdcfox's user avatar
  • 495k
4 votes
Accepted

Summer '18 Lightning checkbox values

In Spring '18, checking the box results in a single event: aura:valueChange { "expression": "v.booleanTest", "value": true, "oldValue": false } In Summer '18, checking the box results in ...
sfdcfox's user avatar
  • 495k
4 votes
Accepted

Why is <lightning-input-field> not setting value of checkboxes in LWC?

Probably due to JavaScript's type conversion rules; a string is converted to a Boolean in the following way: a string that is undefined, null or empty (i.e. "") becomes false a string that ...
Phil W's user avatar
  • 36.9k
3 votes

lightning checkboxgroup get last value

If I understand correctly, you want to get last selected value of array of all selected checkboxes var selectedValues = cmp.find("mygroup").get("v.value"); if(selectedValues.length != 0){ var ...
Oleksandr Berehovskyi's user avatar
3 votes

Using AMPscript to see if Checkbox is checked

I'd suggest displaying the values manually or with the output() to debug: %%[ SET @variable = RequestParameter("checkbox") output(concat("<br>variable: ", @variable)) IF @variable == null ...
Adam Spriggs's user avatar
  • 30.8k
3 votes

Get the values of checkboxes (in a lightning component)

I gather that at some point you are pushing an articles array to the view. Before you do that, you could add a boolean checked attribute to each object in the array. Here I am using Array.prototype....
Charles T's user avatar
  • 11k
3 votes
Accepted

Dynamic checkbox only eveluates to true

For the "ui:inputCheckbox" I would recommend you fetch the value using event.getSource(). Although the documentation seems to indicate you can use component.get('v.value'), however, the documented ...
glls's user avatar
  • 20.2k
3 votes
Accepted

How to display a checkbox field using ligntning:datatable?

Old: Out of the box <lighting:datatable> component doesn't support booleans as checkboxes in the standard data types, the supported data types currently are: action button currency date email ...
Art of Cloud's user avatar
3 votes

Identify User that Last Modified Specific Field by using apex

Just query for it. List<CustomField> fields = [ SELECT DeveloperName, LastModifiedBy.Name, LastModifiedDate FROM CustomField WHERE ... ];
Adrian Larson's user avatar
  • 150k
3 votes
Accepted

Javascript button to set checkbox true if conditions are met

Wrap your apex merge variables in quotes. They're directly printed into the javascript, which can be useful, but needs to be handled a certain way. if("{!Delegate__c.VC_Profile_ID__c}" == "") { ... }...
battery.cord's user avatar
  • 8,835
3 votes
Accepted

Multiple Checkboxes in Formula Field

If you don't mind a trailing comma, then you can simply use string concatenation. Note that you do not need to compare a checkbox to TRUE. IF(Foo__c, "Foo, ", "") & IF(Bar__c, "Bar, ", "") & ...
Adrian Larson's user avatar
  • 150k
3 votes

Make child rows selected on selecting parent row - lwc tree grid

After a couple of hours - I implemented solution: HTML: <lightning-tree-grid key-field="name" data={treeItems} columns={columns} onrowselection={setSelectedRows} ...
Valentine Potapov's user avatar
3 votes
Accepted

LWC - Checkbox read-only, reset

I won't comment too much on your code, however, there are some things you need to consider when migrating to LWC. for starters, document.getElementById("numberForm") is not supported. ...
glls's user avatar
  • 20.2k
3 votes
Accepted

lightning-input checkbox margin-right

Your last screenshot gives it away: margin-right: var(--lwc-spacingXSmall,0.5rem) True, 0.5rem is the default. So set your own --lwc-spacingXSmall: :host { --lwc-spacingXSmall: 0; } It's all ...
Felix van Hove's user avatar
3 votes
Accepted

lightning-input checkbox - getting checked rows when submitted

Something like this: let selected = [ ...this.template.querySelectorAll('lightning-input') ].filter((input) => input.checked) .map((input) => input.closest('[data-contact-id]').dataset....
sfdcfox's user avatar
  • 495k

Only top scored, non community-wiki answers of a minimum length are eligible