0

How could you invoke a JSF2 composite (widget) within anothers composite's implementation tag?

When I do so, I get the following error: /resources/widgets/tileContainer.xhtml @25,45 <mywidgets:tileContainer> Tag Library supports namespace: http://java.sun.com/jsf/composite/widgets, but no tag was defined for name: tileContainer

The code snippet is:

<composite:interface name="tileContainer">
    <composite:attribute name="pubCategoryId" type="java.lang.Long" required="true" />
</composite:interface>

<composite:implementation>
    <div class="tileContainer">

        <ui:repeat value="#{pubController.getPubsByCategory(cc.attrs.pubCategoryId)}" var="pub">
            #{pub.title}
            <mywidgets:tileContainer title="Private">
                <mywidgets:tileSmallPictureTitle                        
                    title="Bulk Dispatch Lapse stressed with application protocols">
                </mywidgets:tileSmallPictureTitle>
            </mywidgets:tileContainer>
        </ui:repeat>

    </div>
</composite:implementation>

Any other design recommendations on how to handle this?

Thank you for sharing your thoughts.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
feder
  • 1,775
  • 5
  • 25
  • 36

2 Answers2

1

This is recognizable as Mojarra issue 2437 which was fixed in Mojarra 2.1.10 (released 25 july 2012). It look like you're using a rather outdated Mojarra version. It's currently already at 2.1.25 (2.2.x is even already out, but I wouldn't recommend switching to 2.2 right now, let them fix all childhood diseases first).

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
0

Okay, I moved the namespace declaration of my composite directory from the <html xmlns... tag down to the <composite:implementation> tag.

So the composite looks like this:

<composite:implementation xmlns:mywidgets="http://java.sun.com/jsf/composite/widgets">

Otherwise, the namespaces of the parent and child composite will resolve wrongly.

feder
  • 1,775
  • 5
  • 25
  • 36
  • Which JSF impl/version are you using? This bug was fixed long time ago somewhere around Mojarra 2.1.10 or maybe one or two versions before or later. – BalusC Aug 13 '13 at 12:41