usr-local-ΕΨΗΕΛΩΝ
usr-local-ΕΨΗΕΛΩΝ

Reputation: 26874

Passing inner markup into Facelet tags

I'm a very-beginner JSP/Facelets developer needing to create a new custom tag that extends the common ICEFaces's commandButton. I would like to be able to know how to pass the markup included between the custom tag's begin and end into the commandButton. This comes necessary when needing to deal with f:param.

Example:

<myNS:myTag ...>
    <f:param name="name" value="value" />
    <f:param name="name2" value="value2" />
</myNS:myTag>

Should be rendered as

<myMarkup>
    <ice:commandButton ...>
        <f:param name="name" value="value" />
        <f:param name="name2" value="value2" />
    </ice:commandButton>
<myMarkup>

Personal note: I'm very confused about these technologies. I still think in .NET 4 :(

Upvotes: 0

Views: 268

Answers (2)

BalusC
BalusC

Reputation: 1108732

As per the updated question and the comments you seem to be really using Facelets (.xhtml files) instead of JSP (.jsp files). In that case, you can use <ui:insert /> to declare the insert location of the children of a custom tag.

Upvotes: 0

fdreger
fdreger

Reputation: 12495

Try and change the requirements. What you want to do is COMPLEX and really not a good way to start working with JSF (or JSP). JSP + JSF is not a single, simple technology like ASP.NET, but rather two different technologies layered in a complicated way (this is one of the reasons why the combination is deprecated). Even if you manage to do what you want, you will be bitten by different lifecycles of JSF objects and JSP tags, so probably it will not work the way you want anyway.

Upvotes: 2

Related Questions