2

I am trying reproduce the following example, but in the dynamicFieldList.xhtml the #{cc.table} is not detected and I have the following error:

/WEB-INF/tags/dynamicFieldList.xhtml @17,93 binding="#{cc.table}": Target Unreachable, identifier 'cc' resolved to null

Below is the line of code

<ui:composition
...
    xmlns:cc="http://java.sun.com/jsf/composite">
...

<cc:implementation>

    <h:dataTable id="table" binding="#{cc.table}" value="#{cc.attrs.value}" var="field">

        <h:column><h:outputLabel value="#{field.label}" /></h:column>

        // ...
</cc:implementation>

...

probably linked to the same issue but label and value Strings in the outputLabel from the "Field" Class are not detected as well. What could be the reason for that?

Community
  • 1
  • 1
LEK
  • 83
  • 2
  • 11
  • A composite component is not a tagfile. Hover the [composite-component] tag below the question until a popover shows up and then click therein *info* link. – BalusC Nov 14 '15 at 16:10
  • @BalusC: Thank you for your guidance – LEK Nov 15 '15 at 10:12

2 Answers2

1

The path in your error message doesn't look right.

/WEB-INF/tags/dynamicFieldList.xhtml

Composite components doesn't belong there. You seem to have treated the composite component as a tagfile. This is not right. It's very different from a tagfile. Composite components are supposed to be placed in JSF /resources folder in a subfolder representing the library name. The below example uses components as library name.

WebContent
 |-- META-INF
 |-- WEB-INF
 |-- resources
 |    `-- components
 |         `-- dynamicFieldList.xhtml   <--- Here.
 `-- some.xhtml

Also you don't need to declare them in a *.taglib.xml file as you would do for tagfiles. You can just declare them via implicit http://java.sun.com/composite/[libraryName] XML namespace.

<html ... xmlns:my="http://java.sun.com/composite/components">
...
<my:dynamicFieldList ... />

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Thanks for your time. As my clientID issue for ajax change remain unsolved I will post another question for that. I manually created the nested table and subtable with but I still can't update the column next by... – LEK Nov 16 '15 at 11:11
0

My expectation of a Content Assist at this location inside a composite-component implementation is not possible.

By creating the following folder: WebContent > resources > mycomponents where I placed my composite-component solved my issue.

LEK
  • 83
  • 2
  • 11