Questions tagged [dom]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
39 views

Clarification on what this.template.querySelectorAll lets you see in LWCs: want to modify field labels

I have a form rendered using just a lightning-record-form - very cool to get so much done by this single LWC (Lightning Web Component). But I'm trying to replace the labels with the inline help text ...
2
votes
1answer
234 views

div innerHTML with standard lightning web components

I'm trying to display a custom format for my lightning web component via rendered and innerHTML of a div. <template> <div class="container" lwc:dom="manual"></div> </template&...
0
votes
0answers
35 views

System.SerializationException: Not Serializable: dom.Document for displaying hierarchial Documents

Code is very big hence mentioning only relevant stuff , When I click on 'DocumentCallAll' tab, from the class I am getting the value in string jsonStr1 and then it need to pass on page and display the ...
1
vote
0answers
176 views

LWC: Using lwc:dom=“manual” to reach and interact with a certain DOM element

I am trying to find a way to interact with the built-in chat widget. I need to simulate a click on it. I understand that the Locker Service is there to prevent any interaction outside of the DOM of ...
0
votes
1answer
77 views

Dom Document generation by APEX code

I am writing APEX to generate DOM document. I want to generate <TOTALVOLUME units="m3">1.0</TOTALVOLUME>. Parent node for TOTALVOLUME is consignmentBody and I am trying Below code to ...
1
vote
0answers
101 views

I'm not able to access DOM element even in “afterRender”

I'm trying to create a canvas in my custom lightning component. This is a child component of another component. The canvas draws few charts, and the methods are called only after both the script(...
2
votes
1answer
409 views

How can I test the click of a button that calls an Apex method, and makes the component show a toast?

The component itself, when loaded, queries some data from the database. Then, depending on what it finds, loads the specific template. One of those has a button, which will call the server again, and ...
0
votes
1answer
105 views

Lightning data locker restricting Javascript for CSS/HTML

I am trying to retrieve JavaScript Static resource in Community lightning component to override the numbering from Unescaped html. But the data locker service is blocking the script. Am trying to ...
4
votes
0answers
365 views

Lightning Web Components: Set scroll position on lightning-datatable based on 'key' field value

We are looking to auto-scroll the user to a specific point in a lightning-datatablewhen a button is clicked. Assuming we referenced the key-field attribute data-row-key-value in the dom then in HTML ...
1
vote
1answer
167 views

Document.fullScreen API implementation in Lightning Web Components(LWC)

I was trying to achieve full screen on an element in Lightning Web Components but was unable to use Document.fullscreen API. I tried var elem = this.template.querySelector('svg'); if (elem....
2
votes
1answer
3k views

Using this.template.querySelectorAll() to modify the DOM in Lightning Web Component

Currently, I am stuck in a situation to modify the DOM in LWC using the querySelectorAll function. Here the {team.item.Description__c} field having the DOM details and saved in string form into the ...
1
vote
1answer
128 views

How to build an integration with rest API in apex using XML

Situation I need to build a connection from Salesforce to "post" to a rest api. The recipient has given me XDS schema files of the data to be sent over. My Current Plan Build a sObject to be the ...
1
vote
0answers
38 views

Entire page appearing twice in the DOM in LEX?

So the two snippets in this screenshot are the same page loaded in Lightning. This is the "main div" as I can see it that holds the main contents of the page. I promise it is the same page, a standard ...
0
votes
2answers
831 views

Document.getElementById().value returning Null in Lightning

I am getting null value from Lightning component from document.getElementById().value below is the case. I am showing already existed record as default(pricebookId) in the dropDown from total list. &...
0
votes
1answer
812 views

Read document cookies in Lightning Component [duplicate]

I want to read the cookies out of the DOM document object. I tried the following: Controller: init : function(component, event, helper) { console.log(document.cookie); // returns nothing } ...
0
votes
1answer
133 views

ltng:require afterScriptsLoaded will run after dom was fully loaded. Why?

ltng:require afterScriptsLoaded will run after dom was fully loaded. Why? I mean where is it documented? I saw it, for example, here As per @TrevorBliss comments , adding afterScriptsLoaded to ...
1
vote
1answer
382 views

getBoundingClientRect() does not work in lightning component?

Every example I am seeing about positioning a tooltip manually involves getting client boundaries, which you would get through getBoundingClientRect() on the element. I have a lightning component ...
1
vote
0answers
175 views

How to programmatically identify that no modal is visible on screen?

I want to identify that screen does not have any modal visible, and based on this, I want to show or hide the window's default scrollbar. To show/hide the scrollbar I got excellent solution from this ...
1
vote
1answer
973 views

Salesforce generating a div with padding when using Lightning Component

I am using lightning component to override my standard 'new' action on custom object. Problem is: Salesforce is generating a DOM element where it puts my lightning component's code. This div has ...
2
votes
1answer
3k views

DOM manipulation on lightning:datatable

I want to add attributes or classes for rows/cells in lightning:datatable based on cell values (I want to customise styles based on values). Is it possible? How can this be achieved? P.S. I tried to ...
1
vote
2answers
2k views

Retrieve elements created with Aura:Iteration

I'm trying to retrieve elements using document.getElementsByClassName("") within the afterRender function. This works as expected with normal elements. However, I can't seem to retrieve elements being ...
6
votes
2answers
803 views

AfterRender on button in Lightning Component (DOM update)

I am trying to do something that sounds easy in JavaScript but that I have difficulty to do with Lightning component. The functionality is to highlight the currently pressed button as explained in ...
2
votes
1answer
161 views

What is the benefit in using the $Component selector?

Reading through a topic - Best Practices for Accessing Component IDs, I learned that: Use the $Component global variable to simplify referencing the DOM ID that is generated for a Visualforce ...
2
votes
0answers
431 views

What is all that <!--render facet: 5:0--> thing in Lightning Pages about?

I know it's a "who cares" question, but somehow I care and I wanted to have this documented somewhere in the WWW :) In Lightning Pages the whole DOM is full of <!--render facet: 5:0--> ...
0
votes
1answer
101 views

Is it possible to add apex:inputFile dynamically to the DOM during runtime with Javascript?

I can add html elements to the DOM but how do I add a VF element such as apex:inputFile? From this post I understand that I can use a wrapper class and apex:repeat but I was wondering if there is ...
2
votes
0answers
536 views

Lightning Components: what is the easiest way to get the components DOM root element without a wrapper in the markup?

I'm having a couple of very different components and often I need to do some work on the components root DOM-node. Some of the compos have Version<=39.0 other have 40.0+ and therefore I'm not ...
1
vote
1answer
2k views

Onclick handler doesn't fire in dynamically-added dom element

The interface for my Lightning component is a very dynamic table that must be built according to data that is retrieved from a remote source. To create this table, inside of my helper class, I'm using ...
6
votes
1answer
292 views

event propagation breaks with API v40 - FundExplorer Demo app

Szenario We want to refactor a dynamic created list by using only one click event listener on the surrounding <ul>-tag rather having one on each <li>-tag as recommended by Christophe ...
22
votes
3answers
1k views

force:navigateToComponent not loading component in Summer '17 | DOM repetition issue in Summer '17

I'm using force:navigateToComponent to navigate to a different component on click. On the first click, it navigates to the component and everything is successfully loaded. When pressing back button ...
2
votes
1answer
127 views

How do i empty the value in lightning without violating DOM Modification

Component <input onchange="{! c.readCSV}" accept=".csv" type="file" id="file-upload" aura:id="file-upload"/> Controller readCSV : function(component, event, helper){ var file = component....
3
votes
1answer
2k views

Export a CSV using lightning Component without DOM modification

Lightning Controller getData : function(component, file, fileContents) { var action = component.get("c.data"); action.setCallback(this, function(response) { var state = ...
0
votes
1answer
99 views

Injecting HTML into a specific location in email

I'm looking for a way to inject HTML into a specific location in an email. I'm thinking something like a javascript DOM. Essentially We have coupons that use a specific set of variables, lets use ...
2
votes
1answer
117 views

How to prevent DOM XSS Vulnerability for this script -

{!tableData} is Server variable. <script> $('.content').html("{!tableData}"); ... </script> "{!tableData}" is having HTML data.
2
votes
2answers
640 views

How to get all buttons in my page from a controller javascript function(component, event, helper)?

I know how to enable the clicked button. Lets say I want to enable all buttons on the click of a button. The button is in a Lightning component as: <aura:component implements="flexipage:...
2
votes
1answer
357 views

Visualforce 'onChange' DOM event not firing when dependent picklist changes to default value

I have a VF page where several field's required attribute is dynamically tied to the value selected on a picklist: <apex:outputPanel id="idAccountField"> <apex:inputfield value="{!...
0
votes
1answer
36 views

JavaScript reading visualforce binded variables

I need some help understand how JavaScript and Visualforce interact. I have a eventListener that works perfectly when the DOM is loaded: window.addEventListener('DOMContentLoaded', function() { if (...
0
votes
1answer
2k views

Root Element with two or more namespace in a XML Document

How can I add two or more namespace on root element in a XML Document? In Java, I create the XMLNode with two namespace and then I set it as root element in a XML Document. In Salesforce, I have ...
2
votes
1answer
491 views

getBodyDocument returns null

I'm trying to write tests using httpCalloutMock in a fashion similar to global class MyHttpMock implements HttpCalloutMock { global HTTPResponse respond(HTTPRequest httpRequest){ ...
1
vote
0answers
401 views

Can't find variable: $

I'm got this error in lightning while testing in an iPad (issue only occurs in iPad / iOS. All other os , desktop,tablet works fine). My solution is locker service enabled. All the resources like ...
0
votes
1answer
45 views

Getting Attempt to de-reference a null object in DOMParser in salesforce

I wrote a class which given below. public class DomDocument { Public void parseXmlFile(String xml){ Dom.Document doc=new Dom.Document(); doc.load(xml); Dom.XmlNode node=...
1
vote
1answer
443 views

How to pass the XML as a url in DOMParser

I found the following details from the Reading and Writing XML Using the DOM in online salesforce. As in the page shows, following one is XML file. <address> <name>Kirk Stevens</...
1
vote
1answer
309 views

How do I maintain state for Dom.Document type variables between Start and execute method of a batch [closed]

I want to create a XML Head in start method of a batch class. I was getting "System.SerializationException: Not Serializable: dom.Document" error for DOM. To handle this I declared all the variables ...
4
votes
1answer
7k views

How to modify innerHTML/DOM of an HTML element in a lightning component?

I am trying to dynamically create a picklist in a lightning component which aligns with the lightning design system look and feel. The lightning design system says that we should create it as given in ...
1
vote
1answer
39 views

HTML elements issue in visualforce

I have the following html structure in my VF page (docType="html-5.0"): <a class="outer"> <span>Some text</span> <span><a class="innerLink"></a></span&...
7
votes
2answers
1k views

DOM manipulation using External libraries in lightning component

As per the LC documentation and answers to the below questions: 1.Jquery selector is not working properly in subsequent loads in lightning component. 2.DOM modification feasibility in lightning. It'...
8
votes
2answers
2k views

How to add a <meta>-Tag for an Lightning app

Is possible to add a <meta> tag for my Lightning application? Within the Salesforce1 mobile application my iPhone turns a custom-formatted date visualization into a hyperlink to create a native ...
3
votes
2answers
886 views

Map one xml to List of SObject?

I am quite new in Xml parsing. i am having a XMl <company> <account> <id>8c98a6be</id> <label>4356</label> <reference>4356</reference> </...
1
vote
1answer
304 views

getBodyDocument - XmlException: unexpected markup &lt;

For example I want to connect to http://www.google.com and get DOM. In Anonymous Window I have code: String url = 'http://www.google.com/'; HttpRequest req = new HttpRequest(); ...
4
votes
0answers
332 views

How to Address DOM-based XSS from Security Review

I have a remoting function on my page that takes a list of contacts, and displays them in on Lightning Design styled page. It works fine, but the final innerHTML statement gets flagged in security ...
2
votes
1answer
460 views

VF Page on-click events for HTML elements

I have a checkbox on my VF page, with the label in a <TD> element of the table, and the checkbox in a <TD> element next to it like this: <tr> <td class="LeftColumnTop W50" ...