0

I created a simple JSF 2 composite component.

<cc:implementation>
    <nav>
        <ul class="pagination">
            <li>Prev</li>
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>Next</li>
        </ul>
    </nav>
</cc:implementation>

When I use it, I see that some built-in attributes are already created for it like class. So I can write:

<my:pagination class="someclass"/>

But when I navigate to the page and view the source of the page, I can't see no mention of someclass.

So how can I use that class attribute in JSF composite component?

EDIT
Here all the built-in attributes that I have got:
enter image description here

nrofis
  • 8,975
  • 14
  • 58
  • 113
  • I don't think you can, afaik it refers to a java class – Jaqen H'ghar May 01 '16 at 12:28
  • So why it generate it automatically? – nrofis May 01 '16 at 12:40
  • Balusc described it once, but I can't find it. But I believe the component has an equivalent backend component - which as all java classes extends from Object, and therefore has a getClass() method. That's the reason there is a class attribute, but it is not meant to be used. But I may be mixing things together - lets hope someone else chimes in – Jaqen H'ghar May 01 '16 at 13:14
  • The description of the `class` attribute is `The component CSS class name` so I don't thinks it the `getClass()` of Object – nrofis May 01 '16 at 14:25
  • 1
    *"I see that some built-in attributes are already created for it"* Whoever did that is wrong. Report it, define your own `styleClass` and advance. By the way, please read http://stackoverflow.com/q/6822000 to get terminology right. You initially called this all "custom component", but this is really a composite component. – BalusC May 01 '16 at 15:06
  • Where should I report it? – nrofis May 01 '16 at 15:14
  • BTW, I uploaded a picture of the autocomplete window in NetBeans that suggest me all the built-in attributes. – nrofis May 01 '16 at 15:19
  • Report it to Netbeans guys. It seems that their "intellisense" is blindly inspecting every single getter available on the `UIComponent` class. The `getClass()`, however is inherited from `Object` class and means something entirely different. – BalusC May 01 '16 at 15:36

0 Answers0