Skip to main content

#Ddd0 debatiendo

Hi! I'm working on this module and I keep getting this challenge error:

Challenge not yet complete in Quick Start: Lightning Web Components

We can't find the '{name}' attribute in the selector.html file.

 

BUT - I did add the name attribute to the selector.html file, as shown. Please help. 

 

<template>     <div class="wrapper">     <header class="header">Available Bikes for {name}</header>     <section class="content">         <div class="columns">         <main class="main" >             <c-list onproductselected={handleProductSelected}></c-list>         </main>         <aside class="sidebar-second">             <c-detail product-id={selectedProductId}></c-detail>         </aside>         </div>     </section>     </div> </template>

11 respuestas
  1. 12 ago 2021, 06:41

    Hi Monica,

     

    It is written as follows. Can you confirm that it was deployed?

     

    When you deploy the selector component files to your org (make sure that your deployment includes the selector files), you should see the following with your name instead of Mary Jones. You might need to refresh the page.

0/9000

I have created a Visualforce PDF and fully tested in Sandbox and looks fine.  When deployed to production the formatting is off in one section.  Does anyone know what is going on here?  I have tried to open PDF in both Edge and Chrome and the production PDF is not wrapping text and is missing a boarder. 

 

This is the page set up / start of code

<apex:page cache="false" extensions="AccEngageClass" renderAs="pdf" standardController="Account" applyBodyTag="false" applyHtmlTag="false" showHeader="false">    <head>        <style>        @page {        size: A4 landscape;        }        html,body {        margin: 0 0 0 0;        font-family: 'Arial', sans-serif;            font-size: 16px;            font-weight: normal;             color: black;        }        .center-table {        width: 95%;        border: 1px solid #000;        border-collapse: collapse;        margin-left: 20px;        margin-right: 20px;                }        .center-table th, .center-table td {                padding: 8px;                border: 1px solid #ddd;                text-align: left;         }         .cell-heading {            background-color: #5e5e5e;            color: white;         }        </style>    </head>    <div style="text-align: center;"><apex:image url="{!URLFOR($Resource.Logo)}" width="150px"/>        </div>    <h1 style="text-align: center; margin-bottom: 150px;">  </h1>      <h1 style="text-align: center; margin-bottom: 20px;">{!Account.Name}</h1>         <h1 style="text-align: center; margin-bottom: 20px;">Intermediary Engagement Summary </h1>

 

This is the section that is missing the right boarder and not wrapping text in Details column:

 <p style="page-break-after: always;" ></p>         <div style="text-align: center;">        </div>      <h2 style="text-align: center; margin-bottom: 20px;">All Related Activities </h2>                 <apex:outputPanel >                    <br/>                    <apex:pageBlock >                        <apex:dataTable style="-Fs-table-paginate: paginate;text-align: center"  value="{!act1}" var="o" border="1"  styleClass="print-friendly" width="100%">                            <apex:column styleClass="inBorder" >                                <apex:facet name="header">Assigned</apex:facet>                                <apex:outputText >{!o.Assigned_2__c}</apex:outputText>                            </apex:column>                              <apex:column styleClass="inBorder" >                                <apex:facet name="header">Contact</apex:facet>                                <apex:outputText >{!o.Who.name}</apex:outputText>                            </apex:column>                                 <apex:column styleClass="inBorder" >                                <apex:facet name="header">Activity Date</apex:facet>                               <apex:outputText value="{0,date,dd/MM/yyyy}">    <apex:param value="{!o.ActivityDate}"/></apex:outputText>                            </apex:column>                             <apex:column styleClass="inBorder" >                                <apex:facet name="header">Subject</apex:facet>                                <apex:outputText >{!o.Subject}</apex:outputText>                            </apex:column>              <apex:column styleClass="inBorder" >                                <apex:facet name="header">Description</apex:facet>                                <apex:outputText >{!o.Description}</apex:outputText>                            </apex:column>                          </apex:dataTable>                    </apex:pageBlock>                </apex:outputPanel>  

Visualforce PDF Formatting

 

Salesforce Live PDF.png

 

 

 

#Salesforce Developer

1 respuesta
  1. 17 may 2025, 17:58

    Hi @Richard Samme

     

    Could you please try the following approach:

    <apex:page renderAs="pdf" showHeader="false" standardController="Your_Object__c">

    <style type="text/css">

    table.center-table {

    width: 100%;

    border-collapse: collapse;

    -fs-table-paginate: paginate;

    }

    table.center-table th, table.center-table td {

    border: 1px solid #ddd;

    padding: 4px;

    text-align: center;

    vertical-align: top;

    }

    .desc-col {

    text-align: left !important;

    white-space: normal !important;

    }

    </style>

    <apex:outputPanel layout="block">

    <apex:dataTable value="{!records}" var="rec" styleClass="center-table">

    <apex:column headerValue="Name">

    <apex:outputText value="{!rec.Name}"/>

    </apex:column>

    <apex:column headerValue="Description" styleClass="desc-col">

    <apex:outputText value="{!rec.Description__c}"/>

    </apex:column>

    </apex:dataTable>

    </apex:outputPanel>

    </apex:page>

     

     

    For more details, please refer to: 

    https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_output_pdf_considerations.htm

     

    https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_output_pdf_renderas.htm

     

     

    Thanks!

0/9000
5 respuestas
  1. 10 nov 2023, 11:35

    hi @Sinziana Dobos you can solve this error by following steps first go to manage playground delete all the playground expect the one one you are using for this challenge in your case its (MY TRAILHEAD PLAYGROUND 1) then go to vs code then again author org then deploy in default org then come back to challenge page, click on  3 dots present side of the playground you will see the another playground expect the one your using select that and connect the org then verify the challenge .  

0/9000
7 respuestas
  1. 10 oct 2023, 13:31

    @Harsh Singh

    Please replace these code 

      Selector.html 

     

    <template>

        <div class="wrapper">

        <header class="header">Available Bikes for {name}</header>

        <section class="content">

            <div class="columns">

            <main class="main" >

                <c-list onproductselected={handleProductSelected}></c-list>

            </main>

            <aside class="sidebar-second">

                <c-detail product-id={selectedProductId}></c-detail>

            </aside>

            </div>

        </section>

        </div>

    </template>

     

    selector.css

     

    body {

      margin: 0;

    .wrapper{

      min-height: 100vh;

      background: #ccc;

      display: flex;

      flex-direction: column;

    }

    .header, .footer{

      height: 50px;

      background: rgb(255, 255, 255);

      color: rgb(46, 46, 46);

      font-size: x-large;

      padding: 10px;

    }

    .content {

      display: flex;

      flex: 1;

      background: #999;

      color: #000; 

    }

    .columns{

      display: flex;

      flex:1;

    }

    .main{

      flex: 1;

      order: 2;

      background: #eee;

    }

    .sidebar-first{

      width: 20%;

      background: #ccc;

      order: 1;

    }

    .sidebar-second{ 

      width: 30%;

      order: 3;

      background: #ddd;

    }

     

    selector.js-meta.xml

     

    <?xml version="1.0" encoding="UTF-8"?>

    <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">

        <apiVersion>48.0</apiVersion>

        <isExposed>true</isExposed>

        <targets>

            <target>lightning__AppPage</target>

            <target>lightning__RecordPage</target>

            <target>lightning__HomePage</target>

        </targets>

    </LightningComponentBundle>

0/9000
2 respuestas
  1. 10 oct 2023, 13:33

      Selector.html 

     

    <template>

        <div class="wrapper">

        <header class="header">Available Bikes for {name}</header>

        <section class="content">

            <div class="columns">

            <main class="main" >

                <c-list onproductselected={handleProductSelected}></c-list>

            </main>

            <aside class="sidebar-second">

                <c-detail product-id={selectedProductId}></c-detail>

            </aside>

            </div>

        </section>

        </div>

    </template>

     

    selector.css

     

    body {

      margin: 0;

    .wrapper{

      min-height: 100vh;

      background: #ccc;

      display: flex;

      flex-direction: column;

    }

    .header, .footer{

      height: 50px;

      background: rgb(255, 255, 255);

      color: rgb(46, 46, 46);

      font-size: x-large;

      padding: 10px;

    }

    .content {

      display: flex;

      flex: 1;

      background: #999;

      color: #000; 

    }

    .columns{

      display: flex;

      flex:1;

    }

    .main{

      flex: 1;

      order: 2;

      background: #eee;

    }

    .sidebar-first{

      width: 20%;

      background: #ccc;

      order: 1;

    }

    .sidebar-second{ 

      width: 30%;

      order: 3;

      background: #ddd;

    }

     

    selector.js-meta.xml

     

    <?xml version="1.0" encoding="UTF-8"?>

    <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">

        <apiVersion>48.0</apiVersion>

        <isExposed>true</isExposed>

        <targets>

            <target>lightning__AppPage</target>

            <target>lightning__RecordPage</target>

            <target>lightning__HomePage</target>

        </targets>

    </LightningComponentBundle>

0/9000