Is it possible to include merge fields for custom HTML attributes of Visualforce tags? The following code doesn't seem to work.

<apex:repeat value="{!lst_items}" var="item">
   <apex:inputText value="{!item.Value}" html-data-object="{!item.objectName}" />

The above code throws the following compilation error:

Unknown property : Classname.item

The item property is declared public with getters and setters. In fact, the following works fine.

<apex:repeat value="{!lst_items}" var="item">

1 Answer 1


No it is not possible. As per Salesforce documentation.

Pass-through attributes aren’t supported in dynamic Visualforce.

I also tried and it is only working for static values.

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

  • Well that's awfully lame... Any idea if HTML-passthroughs are supported by Dynamic VF Components? If so, you could probably accomplish the same Commented Jun 16, 2015 at 20:19
  • I am not using dynamic visualforce component but using merge fields in static markup. Isn't dynamic visualforce is something you create using apex? developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/…
    – user5050
    Commented Jun 17, 2015 at 6:03
  • @user5050 What I meant to say was if you write html-data-object="xyz" it will work but if you write html-data-object="{!item.objectName}" it won't as the value is dynamic.
    – Saroj Bera
    Commented Jun 17, 2015 at 8:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .