function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sylvie SerpletSylvie Serplet 

Lightning Component issue

Hi,
I have a Lightning Component with a button and I need:
  • to display the text in 2 lines
My current code is :
.THIS .button { 
 width: 150px; 
 color: #00396B;   
 border: 2px solid #005FB2;  
   }
  • the button open a VF page and I would like that it opens it in a new window
My current code is :
({
	openResidentialform: function(component, event, helper) {
	var urlEvent = $A.get("e.force:navigateToURL");   
    urlEvent.setParams({
      "url": "/apex/ResidentialForm"
    })
My Component looks like this:
<aura:component implements="flexipage:availableForAllPageTypes" access="global">    
   <aura:attribute name="FFform" type="String" default="Fact Finder Form" access="global" />	
       
<div class="FFbuttons"> 
    <div aria-labelledby="FFformB">            
         <fieldset class="slds-box slds-theme--default slds-container--fluid">       
          <legend id="FFform" class="slds-text-heading--small">Fact Finder Forms</legend>
    
             <form class="slds-form--inline">    
    
         <div class="slds-form-element">
          <ui:button label="Residential Landlord"                     
                     class="button"
                     press="{!c.openResidentialform}" />
          </div>    
</form>         
  </fieldset>        
  </div>
 </div>
</aura:component>
I could not find any solutions in all the forums I read.
Any help will be greatly appreciated.
Sylvie
sharathchandra thukkanisharathchandra thukkani
In the controller.js you need to use urlEvent.fire() to navigate on press of button
Sylvie SerpletSylvie Serplet
({
	openResidentialform: function(component, event, helper) {
	var urlEvent = $A.get("e.force:navigateToURL");   
    urlEvent.setParams({
      "url": "/apex/ResidentialForm"
    });
    urlEvent.fire();	
	},
Sorry I missed the line when I copy my code.
 
sharathchandra thukkanisharathchandra thukkani
How are you executing the component?
Sylvie SerpletSylvie Serplet
I have added the component in the Opportunity detail page as shown below:
User-added image
Balasubramaniam 07Balasubramaniam 07
Hi Sylvie,

Try this
 
openResidentialform: function(component, event, helper) {

var id = [RecordId];
window.open('/apex/PageName?Id='+Id,'_blank');
	
	},

use javascript in the VF page to get Id from URL and display according to it.

Thanks,
Bala