• Aruna Vasahan
  • NEWBIE
  • 50 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 20
    Replies
I am having my component 
  

           
<aura:attribute name="persAccountList" type="Map" default="" />
     <table class="slds-table slds-table_bordered slds-table_cell-buffer">
              <thead>
                  <tr class="slds-text-title_caps">
                      <th>{!$Label.c.ACC_Select}</th>
               <th>{!$Label.c.Rforce_PersAcc_Lastname}</th>
                      <th>{!$Label.c.ACC_First_name}</th>
                      <th>{!$Label.c.ACC_Postal_Code}</th>
                      <th>{!$Label.c.ACC_City}</th>
                        <th>{!$Label.c.ACC_Email}</th>
                  <th>{!$Label.c.ACC_Last_Mobile}</th>
                  </tr>
                  </thead>
                  <tbody>
                  <aura:iteration items="{!v.persAccountList}" var="accountResult">
                      
                      <tr>
                          <td>  
      
              <input type="radio" name="select" value="" data-value="{!accountResult}" onclick="{!c.radioclick}"/></td>
                          <td>{!accountResult.lastName} </td>
                          <td>{!accountResult.firstName} </td>
                       <td>{!accountResult.zip} </td>
                           <td>{!accountResult.city} </td>
                           <td>{!accountResult.email} </td>
                           <td>{!accountResult.phoneNumber} </td>
                      </tr>
                      </aura:iteration>
                  </tbody>
              </table>



Here on the radio button with the onclick event I am trying to pass the record as a whole to my controller side. But I am not able to do so. Can anyone help me in this?
I have designed a lightning component to fetch record details. I am having this lightning component in the record detail page. I am also having picklist field inside the component. When I simply place picklist field inside component and try to fetch and display picklist values inside the component its working.
 
<aura:attribute name="recordId" type="String" default="{!v.recordId}"/> 
     <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
      <aura:attribute name="myObject" type="String" default=""/>
   <aura:attribute name="objInfo" type="case" default="{sobjectType : 'Case'}" />
 <div id="gee" class="slds slds-scrollable--x">

   <ui:inputSelect aura:id="cirjustification" class="slds-select" label="" value="{!v.myObject.CIRJustification__c}"/> 
<lightning:button variant="brand" label="Submit" onclick="{!c.myAction}" />
 </div>

But if I add lightning tabset to the code, I am getting apex error.
<lightning:tabset >
  <lightning:tab label="Main">    
  <div id="gee" class="slds slds-scrollable--x">
   <ui:inputSelect aura:id="cirjustification" class="slds-select" label="" value="{!v.myObject.CIRJustification__c}"/> 
<lightning:button variant="brand" label="Submit" onclick="{!c.myAction}" />
 </div>
   </lightning:tab>
</lightning:tabset>

Error : 
User-added image
I can find that the error is because the value cannot be set properly, but don't know how to do this. Can anyone help?
My controller code
({

 doInit: function(component, event, helper) {
    helper.fetchPickListVal(component, 'CIRJustification__c', 'cirjustification');
}
})

Helper code​
({
fetchPickListVal: function(component, fieldName, elementId) {
    var action = component.get("c.getselectOptions");
    action.setParams({
        "objObject": component.get("v.objInfo"),
        "fld": fieldName
    });
    var opts = [];
    action.setCallback(this, function(response) {
        if (response.getState() == "SUCCESS") {
            var allValues = response.getReturnValue();

            if (allValues != undefined && allValues.length > 0) {
                opts.push({
                    class: "optionClass",
                    label: "--- None ---",
                    value: ""
                });
            }
            for (var i = 0; i < allValues.length; i++) {
                opts.push({
                    class: "optionClass",
                    label: allValues[i],
                    value: allValues[i]
                });
            }
            component.find(elementId).set("v.options", opts);
        }
    });
    $A.enqueueAction(action);
},


Apex class
@AuraEnabled
  public static List < String > getselectOptions(sObject objObject, string fld) {
system.debug('objObject --->' + objObject);
 system.debug('fld --->' + fld);
 List < String > allOpts = new list < String > ();
 // Get the object type of the SObject.
Schema.sObjectType objType = objObject.getSObjectType();

// Describe the SObject using its object type.
Schema.DescribeSObjectResult objDescribe = objType.getDescribe();

// Get a map of fields for the SObject
map < String, Schema.SObjectField > fieldMap = objDescribe.fields.getMap();

// Get the list of picklist values for this field.
list < Schema.PicklistEntry > values =
 fieldMap.get(fld).getDescribe().getPickListValues();

// Add these values to the selectoption list.
for (Schema.PicklistEntry a: values) {
 allOpts.add(a.getValue());
}
system.debug('allOpts ---->' + allOpts);
allOpts.sort();
return allOpts;
}

 
I want to print dynamic header in all the pages of a visualforce paage rendered document. By using CSS styles I am able to get header in visualforce page when rendered as pdf but header is not coming when printed using window.print().
Here is my code:
<apex:page controller="Template" showHeader="false" standardStylesheets="false"  sidebar="false" action="{!renderTemplate}" 
           renderAs="{!chooserender}" applyHtmlTag="false" applyBodyTag="false" >
    <html>
        <head>
            <style type="text/css" media="print">
                @page {
                    padding-top: 40px;
                    @top-center {
                        content: element(header);
                    }
                }
                div.header {
                    padding :10px;
                    position: running(header);
                }
            </style>
        </head>
        <body>
            <apex:form id="renderContentForm">
                <div class="header">

                    <apex:outputText id="htmlHeaddddd" value="{!htmlHead}" >   </apex:outputText> 
                </div>
                <div id='content'>

                    <apex:outputText id="htmlText" value="{!htmlCode}" ></apex:outputText>  
                </div>
            </apex:form>
        </body>
    </html>
</apex:page>
In render as="Pdf" I am getting "header"n all pages but when tried to "print" I am not getting the "header". Do anyone know how to do this?
 
I have inside my "Account"object a rich text field to store images. When I tried to set size to the image I'm not able to do that. But if I add text content within it the styling is working perfectly with my text content. Only my image is not responding to the style given for it. I have given my code below.Can anyone figure out what's wrong with the code?

     <html> 
     <head> 
     <style type="text/css"> 
     myDiv 
     { 
      border:0px; 
      height:50px; 
      width:10px; 
     } 
     </style> 
     </head> 
     <body> 
     <div id="myDiv">Picture {!Picture__c}</div> 
     </body>
     </html>

Thanks
Aruna Vasahan
 
Hi guys,
           I have a visualforce page which I am embedding inside a lightning component using iframe. The code is 
<aura:component implements="force:lightningQuickAction,force:hasRecordId" access="global">
    <iframe src="{! '/apex/vf_page?Id=' + v.recordId }" width="100%" height="1000px;" frameBorder="0"/>
</aura:component>
I need the iframe to fit all the contents of the visualforce page without setting width and height to iframe. Do anyone have solution for this?  
Hi guys,
          My Aim is to append the table with div tag and to display the output using jquery. For that
          I have in my component
<div id="dTable"></div> // I need to append my table with this div 
In my controller
var Obj = JSON.parse(response.getReturnValue());
                   
          $('#dTable').append('<table id="data">' );
                 $('#data').append("<tr><th>"Type"</th><th>"Industry"</th><th>"Rating"</th></tr>");
                $('#data').append("<tr><td>"+Obj.Type+"</td><td>"+Obj.Industry+"</td><td>"+Obj.Rating+"</td></tr>");
              table</td></tr></table>"
                     $('#dTable').append( '</table>' );

Can anyone identify what is wrong with my code.

Thanks
Aruna

 
Hi guys,
           In my lightning controller I have a jquery code like this.
var Obj = JSON.parse(response.getReturnValue());
    $("#type").html("Type :");
    $("#demo").html(Obj.Type);
For this I'm receiving in 2lines.But I need my output to be displayed in a single line, like
 Type : Something
For this in Jquery there are methods like append, after, prepend. But when I tried to use them I'm not able to get the desired output. Does anyone know about this?

Thanks
Aruna


 
Hi guys,
         I have a question. Is it possible to use table structure in lightning components as in Visualforce page?
Thanks
Aruna
Hi guys,
         I have received json data from my server side and I parsed it into normal data in my client side.
var Obj = JSON.parse(response.getReturnValue());
Then I displayed it using the alert message.
alert("Type ="+ Obj.Type + "\n Industry = "+ Obj.Industry + "\n Rating ="+ Obj.Rating)
Since displayng the results using alert message is not a formal procedure I need an alternative option to display the output.
Please suggest any way to display the output using jquery or javascript.
Thanks
Aruna

 
Hi guys,
          I am now working with napili template. I want to know how to pass parameters from <ui:outputText> in the component area to the controller. Please help me in this. I have gone through all the possible ways but still I'm not able to pass the parameter values.
Thanks
Aruna
Hi guys,
          I'm now working with a community based on Napili template. Here my task is to fetch the record id from the record page and to display the details of the record in a separate page. I've wrote some coding for it but Since I'm new to lightning concept I'm not able to achieve this. I have given my code below.
<aura:component controller="ParamController" implements="force:lightningQuickAction,force:hasRecordId">
 <aura:attribute name="recordId" type="String" default="___"/>
    Record Id is {!v.recordId}
<ui:button label="Call server" press="{!c.echo}"/>
 </aura:component>
({
    echo : function(cmp,event,helper){
        
      
        var recordId = cmp.getParam("v.recordId");
     //   console.log("Current Record Id: " + attributeValue);

      //  var target = event.getSource();
        //cmp.set("v.recordId", target.get("v.recordId"));
     

        var action = cmp.get("c.serverEcho");
      
        action.setParams({ recordId : cmp.get("v.recordId") });

        action.setCallback(this, function(response) {
            var state = response.getState();
            
            if (state === "SUCCESS") {
              
                alert("From server: " + response.getReturnValue());

           
            }
            //else if (cmp.isValid() && state === "INCOMPLETE") {
            else if (state === "INCOMPLETE") {
                // do something
            }
            //else if (cmp.isValid() && state === "ERROR") {
            else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                 errors[0].message);
                    }
                } else {
                    console.log("Unknown error");
                }
            }
        });

        $A.enqueueAction(action);
    }
})
public class ParamController {
     @AuraEnabled
 public static Account serverEcho(Id recordId) {

      
  Account acct=[SELECT Type,Industry,Rating FROM Account WHERE Account.Id=:RecordId];
  return acct;
  
    }

}

I want to pass the fetched record Id to the apex class and to display the record dtails using SOQL query.Please help me in accompolishing my task.
Thanks and Regards
Aruna

 
Hi all,
      Is there any way to pass parameters to the lightning component in the background[like passing parameters through URL] from a standard page. I've called the lightning component using the lightning component action from my object page.
Thanks 
Aruna
Hi guys,
         I'm now working with a community that is built using the napili template. There I want to place a navigation button on the standard object page. The navigation button when pressed should redirect to a lighning component. Already I've created a button in the account object layout but I don't know how to perform navigation to the lighning component. So, is there any way[either coding/ configuration] to achieve this? If yes, plz comment below.
Thanks
Aruna  
I am having my component 
  

           
<aura:attribute name="persAccountList" type="Map" default="" />
     <table class="slds-table slds-table_bordered slds-table_cell-buffer">
              <thead>
                  <tr class="slds-text-title_caps">
                      <th>{!$Label.c.ACC_Select}</th>
               <th>{!$Label.c.Rforce_PersAcc_Lastname}</th>
                      <th>{!$Label.c.ACC_First_name}</th>
                      <th>{!$Label.c.ACC_Postal_Code}</th>
                      <th>{!$Label.c.ACC_City}</th>
                        <th>{!$Label.c.ACC_Email}</th>
                  <th>{!$Label.c.ACC_Last_Mobile}</th>
                  </tr>
                  </thead>
                  <tbody>
                  <aura:iteration items="{!v.persAccountList}" var="accountResult">
                      
                      <tr>
                          <td>  
      
              <input type="radio" name="select" value="" data-value="{!accountResult}" onclick="{!c.radioclick}"/></td>
                          <td>{!accountResult.lastName} </td>
                          <td>{!accountResult.firstName} </td>
                       <td>{!accountResult.zip} </td>
                           <td>{!accountResult.city} </td>
                           <td>{!accountResult.email} </td>
                           <td>{!accountResult.phoneNumber} </td>
                      </tr>
                      </aura:iteration>
                  </tbody>
              </table>



Here on the radio button with the onclick event I am trying to pass the record as a whole to my controller side. But I am not able to do so. Can anyone help me in this?
I have designed a lightning component to fetch record details. I am having this lightning component in the record detail page. I am also having picklist field inside the component. When I simply place picklist field inside component and try to fetch and display picklist values inside the component its working.
 
<aura:attribute name="recordId" type="String" default="{!v.recordId}"/> 
     <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
      <aura:attribute name="myObject" type="String" default=""/>
   <aura:attribute name="objInfo" type="case" default="{sobjectType : 'Case'}" />
 <div id="gee" class="slds slds-scrollable--x">

   <ui:inputSelect aura:id="cirjustification" class="slds-select" label="" value="{!v.myObject.CIRJustification__c}"/> 
<lightning:button variant="brand" label="Submit" onclick="{!c.myAction}" />
 </div>

But if I add lightning tabset to the code, I am getting apex error.
<lightning:tabset >
  <lightning:tab label="Main">    
  <div id="gee" class="slds slds-scrollable--x">
   <ui:inputSelect aura:id="cirjustification" class="slds-select" label="" value="{!v.myObject.CIRJustification__c}"/> 
<lightning:button variant="brand" label="Submit" onclick="{!c.myAction}" />
 </div>
   </lightning:tab>
</lightning:tabset>

Error : 
User-added image
I can find that the error is because the value cannot be set properly, but don't know how to do this. Can anyone help?
My controller code
({

 doInit: function(component, event, helper) {
    helper.fetchPickListVal(component, 'CIRJustification__c', 'cirjustification');
}
})

Helper code​
({
fetchPickListVal: function(component, fieldName, elementId) {
    var action = component.get("c.getselectOptions");
    action.setParams({
        "objObject": component.get("v.objInfo"),
        "fld": fieldName
    });
    var opts = [];
    action.setCallback(this, function(response) {
        if (response.getState() == "SUCCESS") {
            var allValues = response.getReturnValue();

            if (allValues != undefined && allValues.length > 0) {
                opts.push({
                    class: "optionClass",
                    label: "--- None ---",
                    value: ""
                });
            }
            for (var i = 0; i < allValues.length; i++) {
                opts.push({
                    class: "optionClass",
                    label: allValues[i],
                    value: allValues[i]
                });
            }
            component.find(elementId).set("v.options", opts);
        }
    });
    $A.enqueueAction(action);
},


Apex class
@AuraEnabled
  public static List < String > getselectOptions(sObject objObject, string fld) {
system.debug('objObject --->' + objObject);
 system.debug('fld --->' + fld);
 List < String > allOpts = new list < String > ();
 // Get the object type of the SObject.
Schema.sObjectType objType = objObject.getSObjectType();

// Describe the SObject using its object type.
Schema.DescribeSObjectResult objDescribe = objType.getDescribe();

// Get a map of fields for the SObject
map < String, Schema.SObjectField > fieldMap = objDescribe.fields.getMap();

// Get the list of picklist values for this field.
list < Schema.PicklistEntry > values =
 fieldMap.get(fld).getDescribe().getPickListValues();

// Add these values to the selectoption list.
for (Schema.PicklistEntry a: values) {
 allOpts.add(a.getValue());
}
system.debug('allOpts ---->' + allOpts);
allOpts.sort();
return allOpts;
}

 
I want to print dynamic header in all the pages of a visualforce paage rendered document. By using CSS styles I am able to get header in visualforce page when rendered as pdf but header is not coming when printed using window.print().
Here is my code:
<apex:page controller="Template" showHeader="false" standardStylesheets="false"  sidebar="false" action="{!renderTemplate}" 
           renderAs="{!chooserender}" applyHtmlTag="false" applyBodyTag="false" >
    <html>
        <head>
            <style type="text/css" media="print">
                @page {
                    padding-top: 40px;
                    @top-center {
                        content: element(header);
                    }
                }
                div.header {
                    padding :10px;
                    position: running(header);
                }
            </style>
        </head>
        <body>
            <apex:form id="renderContentForm">
                <div class="header">

                    <apex:outputText id="htmlHeaddddd" value="{!htmlHead}" >   </apex:outputText> 
                </div>
                <div id='content'>

                    <apex:outputText id="htmlText" value="{!htmlCode}" ></apex:outputText>  
                </div>
            </apex:form>
        </body>
    </html>
</apex:page>
In render as="Pdf" I am getting "header"n all pages but when tried to "print" I am not getting the "header". Do anyone know how to do this?
 
Hi guys,
           I have a visualforce page which I am embedding inside a lightning component using iframe. The code is 
<aura:component implements="force:lightningQuickAction,force:hasRecordId" access="global">
    <iframe src="{! '/apex/vf_page?Id=' + v.recordId }" width="100%" height="1000px;" frameBorder="0"/>
</aura:component>
I need the iframe to fit all the contents of the visualforce page without setting width and height to iframe. Do anyone have solution for this?  
Hi guys,
          My Aim is to append the table with div tag and to display the output using jquery. For that
          I have in my component
<div id="dTable"></div> // I need to append my table with this div 
In my controller
var Obj = JSON.parse(response.getReturnValue());
                   
          $('#dTable').append('<table id="data">' );
                 $('#data').append("<tr><th>"Type"</th><th>"Industry"</th><th>"Rating"</th></tr>");
                $('#data').append("<tr><td>"+Obj.Type+"</td><td>"+Obj.Industry+"</td><td>"+Obj.Rating+"</td></tr>");
              table</td></tr></table>"
                     $('#dTable').append( '</table>' );

Can anyone identify what is wrong with my code.

Thanks
Aruna

 
Hi guys,
           In my lightning controller I have a jquery code like this.
var Obj = JSON.parse(response.getReturnValue());
    $("#type").html("Type :");
    $("#demo").html(Obj.Type);
For this I'm receiving in 2lines.But I need my output to be displayed in a single line, like
 Type : Something
For this in Jquery there are methods like append, after, prepend. But when I tried to use them I'm not able to get the desired output. Does anyone know about this?

Thanks
Aruna


 
Hi guys,
         I have a question. Is it possible to use table structure in lightning components as in Visualforce page?
Thanks
Aruna
Hi guys,
          I am now working with napili template. I want to know how to pass parameters from <ui:outputText> in the component area to the controller. Please help me in this. I have gone through all the possible ways but still I'm not able to pass the parameter values.
Thanks
Aruna
Hi guys,
         I'm now working with a community that is built using the napili template. There I want to place a navigation button on the standard object page. The navigation button when pressed should redirect to a lighning component. Already I've created a button in the account object layout but I don't know how to perform navigation to the lighning component. So, is there any way[either coding/ configuration] to achieve this? If yes, plz comment below.
Thanks
Aruna  

Hi,

 

I have a VF page; which I am rendering as a PDF. In the page; I have a table which displays "QuoteLineItems".

I want that the table header should be repeated if the contents of "Table" goes over a page.

 

After doing research I found out that there is a css property which can be used to achieve this. But when I try to implement the solution it is not working. I have used following code(just a part of HTML)

 

Css that I have used -

<style>

thead { display: table-header-group;}

</style>

 

VF Page Code - 

<table border="0" width="100%" id="table4">
        <thead>
            <tr>
               <th bgcolor="#C0C0C0"><font face="Arial">{!$Label.quotePosition}</font></th>
               <th bgcolor="#C0C0C0"><font face="Arial">{!$Label.quoteDescription}</font></th>
               <!--<td bgcolor="#C0C0C0"><font face="Arial">Image</font></td>-->
               <th bgcolor="#C0C0C0"><font face="Arial">{!$Label.quoteQuantity}</font></th>
               <th bgcolor="#C0C0C0"><font face="Arial">{!$Label.quoteTotalPerPosition}</font></th>
            </tr>
        </thead>
        <tr>
            <apex:repeat value="{!lstQuoteLineItems}" var="quoteLineItemObj"> 
                <tr>
                     <td style="vertical-align:top">{!quoteLineItemObj.Position__c}</td>
                     <td style="vertical-align:top">{!quoteLineItemObj.Description}<br/>
                         <apex:outputField value="{!quoteLineItemObj.Product_Detail__c}"/> 
                     </td>            
                     <td style="vertical-align:top"><apex:outputText value="               {!quoteLineItemObj.Quantity}" /></td>
                     <td style="vertical-align:top"><apex:OutputField value=" {!quoteLineItemObj.Total_Per_Position__c}"/></td>
                 </tr>
                 <tr><td><br/></td></tr>
           </apex:repeat>
       </tr></table>

 

Does anybody implemented this sought of functionality; if yes, could you please share your thought or tell me what I am doing wrong here!!

 

Thanks in advance!!

 

Pretty simple question. How do you set the height of a Rich Text field in a visualforce page. It seems like no matter what I do it is stuck at 35px which is obviously not very useful.

 

None of these seem to work:

 

 

<apex:page controller="Image">
    <style>
        .customImage{
            height: 240px;
            width: 180px;
} </style> <apex:outputField id="image" value="{!obj.Image__c}" styleClass="customImage" /> <apex:outputField id="image" value="{!obj.Image__c}" style="height:240px;width:180px" /> </apex:page>

 

What's the secret?

 

Thanks,

Jason