Creating unique identification tags in ui: include resource

I am creating a page with multiple tag instances, such as:

<ui:include id="foo" src="images/something.svg" />

The Faces servlet passes through the svg file to the browser without any processing other than the EL expressions found, which is good. The problem is that the id tags in the include file are static, so multiple inclusions of this file generate non-identical identification tags.

I want to do something like what h: form does , where the identifier of the ui: include tag is added to the identifiers of the elements in the including file. Then I could definitely figure it out.

Is there a “best practice” way to do this?

UPDATE: maybe I should reinforce this question with subsequent observation, what should I do first? My goal is to unambiguously address tags in each of the included copies of the svg document, of which there can be any number. I have jQuery since it eventually gets pulled into Primefaces.

So, if I have a JSF file, for example:

<ui:include id="foo" src="images/something.svg" />
<ui:include id="bar" src="images/something.svg" />

And inside the something.svg file I have a tag

<rect id="blink" ... />

In javascript on the page, I want to get a pointer to foo: blink or : blink . I suppose I could use XPath expressions, but I realized that they are slow. I can’t imagine that the guys who invented the ui: include tag didn’t think about how to deal with this, so I guess I missed something obvious.

+5
2

<ui:param>.

<ui:include src="images/something.svg">
    <ui:param name="id" value="foo" />
</ui:include>
<ui:include src="images/something.svg">
    <ui:param name="id" value="bar" />
</ui:include>

#{id} EL . .

<rect id="#{id}_blink" ... />
+3

:

<f:subview id="uniqueXXX">

. :

0

All Articles