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 [dom]

The tag has no usage guidance.

0
votes
1answer
41 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
55 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
42 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....
0
votes
1answer
269 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
22 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
23 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
176 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
289 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
63 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
135 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
105 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
539 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
2k 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
1k 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
651 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
127 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
282 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
90 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
414 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
248 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 ...
18
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
111 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
1k 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
89 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
103 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
452 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
323 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
413 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
355 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
44 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
367 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
269 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 ...
3
votes
1answer
6k 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&...
6
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
753 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
266 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(); ...
5
votes
0answers
300 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
410 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" ...
0
votes
1answer
346 views

Null pointer exception when parsing XML

DOM.Document xmlDOC = new DOM.Document(); xmlDOC.load(xmlstring); DOM.XMLNode rootElement = xmlDOC.getRootElement(); for(DOM.XMLNode xmlnodeobj:xmlDOC.getRootElement().getChildElements()){ For(...
3
votes
2answers
215 views

How to copy one XML Dom onto another?

I have a need to merge one XML document into another. I'm hoping for a more direct way than the one I've come up with. Given two documents where I want to put B inside A, I can convert B to a string,...
2
votes
1answer
1k views

How to form SOAP XML request to update Salesforce dara

Is anyone has some idea how can i use DOM or XmlStreamWriter to generate SOAP XML request for Salesforce? Can we use these classes to generate SOAP XML request or not? I tried following code but ...
3
votes
2answers
346 views

How to remove prefix of apex:form from elements?

I amworking on a Visualforce Project where I need to access elements from a form via jQuery. The problem is that the elements always get a prefix like j_id0:j_id4: in the ID. Therefore I can't access ...
2
votes
1answer
262 views

Parse XML fails with null object dereference

I have below code that fails to execute in developer console, I receive the following error: Attempt to de-reference a null object. Can someone please help here? Apex class: public class ...
1
vote
0answers
363 views

Apex DOM get children at nth level

I have got the XML of the following format: <parNode> <parNode2> <parNode3> <parNode4 name="name1"> <flags attrVal="1" /> ...
2
votes
1answer
2k views

Error converting HttpResponse to Dom.Document

I am calling the Tooling API from Apex in order to find out if a Custom Field has been created. Here is my code: HttpRequest req = new HttpRequest(); req.setHeader('Authorization', '...