• Chuck H.
  • NEWBIE
  • 29 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
I'll preface by saying this is working in other locations, where it is not nested. I have a component (cmp A) nested in a lightning:accordionSection, the component contains a  <aura:attribute name="oppContacts" type="Object[]"/> that is displayed in an aura:iteration. My Controller.js has the following code that allows users to 'clone' the js objects (on save, all objects are inserted in SFDC as Custom_Objects via apex):
    cloneThis : function(component, event, helper){
         console.log(event);
        var cloneObj = {}; 
        cloneObj = Object.assign({}, event.getSource().get("v.name"));
        //cloneObj = event.getSource().get("v.name");

        console.log(cloneObj.role); //test
        var optionsArr = component.get("v.oppContacts");
        console.log(optionsArr);
        optionsArr.push(cloneObj);
        
        //set new clone ref priority to none...doesn't help
        //optionsArr[optionsArr.length-1].priority = 'NONE';
        component.set("v.oppContacts", optionsArr);
        console.log(document.getElementById("cW").innerHTML);
        document.getElementById("cW").innerHTML = document.getElementById("cW").innerHTML;
        console.log('set html!!!');
        
        
        //var bottomMarker = document.getElementById("bottomMarker");
        //bottomMarker.scrollIntoView();
    }

The issue I'm having is that the iteration on the page does not update. I believe this is because of how it's nested, but not sure. Hoping to learn the best way to handle this...maybe rerender.js but again, not sure.

I do log the array after the clone, and it does grow. I can also debug in the cmp as {!v.oppContacts.length} and the length does increase by one with each button push. Button is setup as follows:
<lightning:button name="{!contact}" aura:id="{!contact.name}" value="{!contact.name}" variant="brand" label="Clone" onclick="{!c.cloneThis}" />



An odd behavior I noticed was that if I put two of the same "cmp A"'s on the page, clicking my 'doClone' button in one cmp would rerender the other as expected.

I don't want to add to confusion with a wall of code. I think I have the relevant bits. I pretty sure I'm close because this works on other pages, outside of being nested.

I'll lastly add that I'm a newer developer. Open to any input: general approach, specific, js, etc. Circling back for formatting asap.
I'm trying to sort a list of sObjects based upon several varying 'soft' relationships. I butchered O^n already by traversing creating nested for loops and soon discovered that just wasn't going to work. I am a newer developer so hoping I got all my terms correct and that this isn't something painfully simple that is documented elsewhere.

In starting over here, I'm not too sure where to begin. Here's what I'm trying to achieve...
I have a list of sObjects that I'm trying trying to sort by varying relationships. The ultimate goal is to have these in a linear list sorted by heirachy and also 'family sets'. The data will ultimatey be displaying on a custom Lightning page in various components. I also have varying amounts of some of the RecordTypes, where a parent can have one or many children, sometimes no immediate children (eg - RT's 1, 5, 6* only). The end order should look like this, I've colored/simplified the relationships in an effort to digest this more easily myself...it's not helping much, lol:

OCR friendly table of data and relationships. Message with any questions!

I've done some basic comparable interfaces for sorting in the past, but doesn't seem like a fit for this case. Are there suggestions on efficient ways to sort the records above when given in a random order? Reach out with any questions and I'll be happy to elaborate. To be clear, I can be given multiple families at once and they can contain any number of each RecordType. It is assumed that all colored relationships will be in place and unique to each parent.

For reference, here's the approach I originally tried. This 'works' for smaller sets with only one familay but doesn't get me much past that...I am using a wrapper class, hence the .variableNames without __c's. I know enough to know this is horribly inefficient!
for(TreeRow product : prodSvRows){
            sortedList.add(product);
            for(TreeRow exp : expRows){
                if(exp.parentRowId == product.serviceRowSpec){
                    sortedList.add(exp);    
                }
                for(TreeRow pattern : ptnRows){
                    if(pattern.parentRowId == product.rowId){
                        sortedList.add(pattern);
                    }
                    for(TreeRow stage : stageRows){
                        if(stage.parentRowId == pattern.rowId){
                            sortedList.add(stage);
                        }
                    }
                }
                for(TreeRow cadSpec : cadSpRows){
                    if(cadSpec.parentRowId == exp.rowId){
                        sortedList.add(cadSpec);
                    }
                    for(TreeRow cadSvc : cadSvRows){
                        if(cadSvc.rowMdmKey == cadSpec.rowLabel){
                            sortedList.add(cadSvc);
                        }
                    }
                }
           } 
     }

Yaay, first question posted!
I'll preface by saying this is working in other locations, where it is not nested. I have a component (cmp A) nested in a lightning:accordionSection, the component contains a  <aura:attribute name="oppContacts" type="Object[]"/> that is displayed in an aura:iteration. My Controller.js has the following code that allows users to 'clone' the js objects (on save, all objects are inserted in SFDC as Custom_Objects via apex):
    cloneThis : function(component, event, helper){
         console.log(event);
        var cloneObj = {}; 
        cloneObj = Object.assign({}, event.getSource().get("v.name"));
        //cloneObj = event.getSource().get("v.name");

        console.log(cloneObj.role); //test
        var optionsArr = component.get("v.oppContacts");
        console.log(optionsArr);
        optionsArr.push(cloneObj);
        
        //set new clone ref priority to none...doesn't help
        //optionsArr[optionsArr.length-1].priority = 'NONE';
        component.set("v.oppContacts", optionsArr);
        console.log(document.getElementById("cW").innerHTML);
        document.getElementById("cW").innerHTML = document.getElementById("cW").innerHTML;
        console.log('set html!!!');
        
        
        //var bottomMarker = document.getElementById("bottomMarker");
        //bottomMarker.scrollIntoView();
    }

The issue I'm having is that the iteration on the page does not update. I believe this is because of how it's nested, but not sure. Hoping to learn the best way to handle this...maybe rerender.js but again, not sure.

I do log the array after the clone, and it does grow. I can also debug in the cmp as {!v.oppContacts.length} and the length does increase by one with each button push. Button is setup as follows:
<lightning:button name="{!contact}" aura:id="{!contact.name}" value="{!contact.name}" variant="brand" label="Clone" onclick="{!c.cloneThis}" />



An odd behavior I noticed was that if I put two of the same "cmp A"'s on the page, clicking my 'doClone' button in one cmp would rerender the other as expected.

I don't want to add to confusion with a wall of code. I think I have the relevant bits. I pretty sure I'm close because this works on other pages, outside of being nested.

I'll lastly add that I'm a newer developer. Open to any input: general approach, specific, js, etc. Circling back for formatting asap.
Hello,

As of yesterday, our users began seeing rich text fields on an embedded visualforce page appear with a incorrectly rendered toolbar:

Screenshot of incorrectly rendered rich text editor toolbar.

We have confirmed this is affecting all of our users who are using the Chrome browser. After testing in Safari, the editor renders correctly. Is this a known issue with any recent updates?

Thanks in advance,
George

Hi,

Lets say we have an object and on the lightning component we are displaying its details. when ever i click on the button i need to pass record id to the controller.

This how my code look like:-
<aura:iteration items="{! v.vegs}" var="veg">
            <div class='tile' aura:id="test1" press="{! c.tester}" >              
                <img src='{! veg.Image__c}'  onClick="{! c.tester}" aura:id="imgId" value="{! veg.Name }"> </img>
                Name: {! veg.Name } <br></br>             
                price: {! veg.Price__c }   <br></br>
                <ui:button label="Add to cart" press="{! c.addToCart}"  aura:id="btn1" >      </ui:button>               
           </div>
</aura:iteration>

I want something similer to :-
 
<aura:iteration items="{!v.newCases}" var="case">
<button type="button" onclick="{!c.showCaseDeleteModal(case.Id)}">Delete</button>
</aura:iteration>


How can I pass the id to a component controller when the  button gets clicked?


Thank you!
Hi,

Assume I have attachments for different types of salesforce object types (i.e. accounts, contacts ...). How can I get the downloadable link for those attachment? 
I can see different type of URLs for different type of attachment file types. i,e for a text file downloadable link in the UI is,
https://c.na15.content.force.com/sfc/servlet.shepherd/version/download/068i0000001hvwC?asPdf=false&operationContext=CHATTER
but for pdf it is,
https://c.na15.content.force.com/servlet/servlet.FileDownload?file=00Pi0000004wHwY

I have a component with ApacheTika and later I can parse this downloadable link to that component. So that component can download attachment. 

Thanks!