0

I have the multiple Lightning components each has a button on it. I wan to display these lightning components in the lightning pages side by side instead of one below the other. Is it possible to do with styling to not take up the entire line ? Currently it shows like below enter image description here

The component of one is like below

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global"  controller="manageCase"  >
    <aura:attribute name="isOpen" type="boolean" default="false"/>

        <lightning:button variant="brand"
                          label="Transfer Case"
                          title="Transfer Case"
                          onclick="{! c.openModel }" />

I dont want to combine these two buttons in one component. Is it possible to do what I am trying

3

No, the Lightning Page itself forces the components to appear this way. You could write a third component to include the other two, rather than just combining them, though.

4
  • can you please give me an example of how I can do this with third component
    – user81642
    Apr 16 '20 at 18:08
  • 1
    @user81642 <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global"><c:component1 recordId="{!v.recordId}" /><c:component2 recordId="{!v.recordId}" /></aura:component> If you want spacing or other stuff, you could also leverage lightning:layout to make a grid.
    – sfdcfox
    Apr 16 '20 at 18:17
  • Thank you. Can you please help me with this salesforce.stackexchange.com/questions/302782/…
    – user81642
    Apr 16 '20 at 18:25
  • @user81642 You already have an answer there, and that's basically it. You can't directly call two Apex classes from a single component, so you need either multiple components, LWC, or just deal with having all the methods in the same class. Also, reading the comments, 10 methods in a class isn't that bad, especially if they're all related functionality. You could even add in helper methods so that you're not doing the same thing in each method (query, update fields, save records). Actually, I'd make a single method that accepts parameters to make the updates.
    – sfdcfox
    Apr 16 '20 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.