Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The attribute list is not defined in o:converter (Netbeans 7.3)

I'm trying to use the new org.omnifaces.converter.ListConverter in a primefaces picklist. I added the new dependency in my project with maven and rebuilt the project in order to download the jar file:

<dependency>
    <groupId>org.omnifaces</groupId>
    <artifactId>omnifaces</artifactId>
    <version>1.5</version>
</dependency>

I'm importing the namespace in my facelets as follows:

xmlns:o="http://omnifaces.org/ui"

Still, when I try to use <o:converter> in my picklist as follows:

<o:converter converterId="omnifaces.ListConverter" list="#{projectBean.clientSource}" />

I get a message from netbeans 7.3 saying :

The attribute list is not defined in the component converter

It doesn't seem to cause any build failure though... Am I missing something? Do I not use omnifaces as it is meant to be?

like image 718
Eric C. Avatar asked Oct 04 '22 13:10

Eric C.


1 Answers

This is, unfortunately, "by design".

Netbeans apparently validates the attributes rather strictly based on their registration in the *.taglib.xml file.

The <o:converter> is supposed to support all attribtues of any arbitrary converter, such as pattern and locale of <f:convertDateTime>, the minFractionDigits and integerOnly of <f:convertNumber>, etcetera. It's however impossible to register all of those attributes in the *.taglib.xml file in order to satisfy all possible use cases of <o:converter>. It namely also supports custom converters instead of standard ones.

It's however valid to specify a "custom" tag attribute and this is where the <o:converter> relies on. The list attribute is actually an attribute of the omnifaces.ListConverter converter. I don't have Netbeans at hands and I'm not sure whether it interpretes it as an error or as an warning and or if it's configurable somewhere in its validation settings, but I can assure you that this is absolutely harmless and should at most generate a warning (and thus not as an error).

In case you didn't understood the use of <o:converter>, it's a special tag handler which evaluates the attributes of the specified converter during view render time instead of view build time. This way it's possible to supply "dynamic" attributes tied to bean properties instead of hardcoded string attributes.

like image 186
BalusC Avatar answered Oct 07 '22 18:10

BalusC