function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tf_ianrtf_ianr 

Pass a parameter to a custom component inside a repeater

 

I can't figure out why this isn't working:
<apex:repeat value="{!MyContacts}" var="c" >
    <c:ContactRowComponent contactLastName="{!c.LastName}"/>  
</apex:repeat>
(where on the main controller MyContacts returns an array of Contact objects, and on the component contactLastName is defined as a String attribute)
This gives me error:
Literal value is required for attribute contactLastName in <c:ContactRowComponent> at line 25 column 27
It seems to be saying that a literal value is required and not a formula? Is what I am trying to do impossible, or am I doing it wrong?

 

I can't figure out why this isn't working:

 

<apex:repeat value="{!MyContacts}" var="c" >
    <c:ContactRowComponent contactLastName="{!c.LastName}"/>  
</apex:repeat>

 

 

(where on the main controller MyContacts returns an array of Contact objects, and on the component contactLastName is defined as a String attribute)

 

This gives me error:

 

Literal value is required for attribute contactLastName in <c:ContactRowComponent> at line 25 column 27


It seems to be saying that a literal value is required and not a formula? Is what I am trying to do impossible, or am I doing it wrong?

 

This question also at StackOverflow if you want to get some StackOverflow points : )

imuino2imuino2

What you are doin is possible.

I did found in other posts that changing the parameter contactLastName attribute required from false to true will solve this.

How is your component defined?

 

Ignacio

diodio

I have the same issue, I tried  

Error: Literal value is required for attribute

 

Anyone?