Stack Exchange Network

Stack Exchange network consists of 174 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
21 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
23 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
27 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
56 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
330 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
1k 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
696 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 ...
0
votes
0answers
286 views

Get value of a selected element in a lightning component

I have a lightning component with several buttons in it that are meant to be selected by the end user. I wish to be able to get the value of the selected buttons so I can send those values to my Apex ...
6
votes
2answers
511 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
98 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
177 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
82 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
340 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
1k 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
226 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
901 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
98 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
84 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
76 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
329 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
290 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
901 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
334 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
319 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
321 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
243 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
5k 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'...
7
votes
2answers
1k 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
670 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
225 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
242 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
356 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
299 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
185 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
337 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
248 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
325 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', '...
1
vote
1answer
1k views

what is the use DOM in sales force where we can use that?

I have understanded the abbrevation of DOM,but iam not understanding what is use of that in sales force.Is there any link between xml and DOM.