Forum Discussion

thinkclay's avatar
5 years ago

Error when calling component out of context

I know that most components use env and page context vars as a default, but some of them allow you to pass in your own object via parameters. I'm having issues embedding the "message-view.widget.labels" component on a custom page. I have my messages loop, and would love to be able to call the OOTB component and pass in my own message object like:

 

 

<@component id="message-view.widget.labels" messageObject=message />

 

 

Does anyone know what the parameters this component can accept? Digging through Quilts, I've been able to deduce useChrome and useHeading which both accept boolean values. Is there a parameter to pass the message object or message.id or any other way I can make this component work on a custom page?

It's worth noting also, that unlike most components which silently fail, this one is loud about its error:

RenderQueueException:Render queue error in SetupRender[messages/contributions/MessageViewParametersContributionPage:labelsformessage]: Failure reading parameter 'message' of component messages/contributions/MessageViewParametersContributionPage:labelsformessage: No object of type lithium.coreapi.boards.IMessage is available from the Environment.
 
  • Try this:

    <@component id="message-view.widget.labels" message="lia-message:env" />