• Carl-Jesper
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies

I'm want to pass a dynamically set variable "f" which serves as an element id into a javascript to be able to recolor the item. 

 

However, I get the following error at compile time: 

Save error: Unknown property 'OpportunityStandardController.f' 

 

Is this a limitation or have I misunderstood anything?

 

<apex:repeat var="f" value="{!families}">
<li>
<span>
<apex:commandLink value=""
action="{!runSearch}"
rerender="results,debug"
oncomplete="doIt({!f});">
<apex:param name="name" value="" />
<apex:param name="onlySellable" value="" />
<apex:param name="family" value="{!f}" />
<span id="{!f}" name="nameAllItems">{!f}</span>
</apex:commandLink>
</span>
</li>
</apex:repeat>

 

<script>

function doIt(string anId){
var items = document.getElementsByName("nameAllItems");
for(var i = 0; i < items.length; i++)
{
items[i].setAttribute("class", "");
}
document.getElementById(anId).setAttribute("class", "current");
}
</script>

I try to access the Product-entity in a custom-made apex class method and get the following compile time error:

"Entity 'Product' not accessible in version 25.0"

 

Any thoughts? I'm currently developing a product selection screen & functionality and was hoping to be able to reuse the Product Entity itself.