You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Hannum, Daniel" <Da...@PremierInc.com> on 2007/06/26 19:48:03 UTC

Trinidad not playing nice with Facelets ui:component?

Hi,

 

I am migrating from ADF to Trinidad. My old ADF code used the Facelets
taglib feature where I could specify a ui:component and have a snippet
of XHTML be substituted in for a custom tag.

 

For example, I had the following snippet in a JSPX file

 

<ui:component>

      <c:if test="#{render}">

            <af:form id="#{id}" usesUpload="#{usesUpload}"><ui:insert
/></af:form>

      </c:if>

      <c:if test="#{!render}">

            <ui:insert />

      </c:if>

</ui:component>

 

All it does is wrap the contents in an af:form if a parameter is set. I
called this custom tag "cs:form" and in ADF it worked fine. I put
cs:forms in my code and they were properly changed to af:forms, which
were then converted to HTML form tags by ADF.

 

However, in Trinidad, suddenly, my cs:forms are converted to af:forms,
but af:form is left in my HTML, clearly not working.

 

I think that because the cs->af translation happened, this isn't
Facelets fault. It's as if Trinidad is doing something differently. I
also verified that the page containing the cs:form does contain this
line at the top

 

xmlns:af="http://myfaces.apache.org/trinidad"

 

so it should know what af:form is. Any ideas? Troubleshooting tips are
also appreciated. I didn't see anything in the log, where I'd expect
some kind of "I don't understand what af:form is, so leaving it as is"
message.

 

Dan

 




-----------------------------------------
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.  

RE: Trinidad not playing nice with Facelets ui:component?

Posted by "Hannum, Daniel" <Da...@PremierInc.com>.
Solved! (by accident)

I noticed that there was another old application deployed to the same
JBoss instance so I removed it to shorten load times. All of the sudden,
my cs:form tags were working again. And then I remembered a bug that bit
me months ago:

Facelets custom taglibs are cached (by JBoss?). Regardless of who does
it, I believe they are cached by prefix, so the old version of the
taglib with the same prefix was still being used, and so it was trying
to access the ADF form tag, which of course couldn't be found, so it
spit it straight to HTML. Once I removed the old copy, the new one
(referencing the Trinidad form tag) was used and all was well.

I was bitten by this months ago when I made a change to the tag
implementation only to have it ignore it because the old version was
still hanging around. Why it doesn't use the newer version, I don't
know, but anyway, maybe this will help someone else.

Dan

-----Original Message-----
From: Hannum, Daniel [mailto:Daniel_Hannum@PremierInc.com] 
Sent: Tuesday, June 26, 2007 3:17 PM
To: MyFaces Discussion
Subject: RE: Trinidad not playing nice with Facelets ui:component?

I'm using Trinidad 1.0.0-incubating, sorry I forgot to mention that. I
admit, the page isn't simple :), but lots of other Trinidad tags on my
pages are rendered into HTML just fine. The only ones that don't are
ones inside Facelets taglibs.

If I use af:form in my page directly (instead of my cs:form custom tag),
the af:form is correctly converted into HTML form and the page is fine.
However, if I use cs:form, Facelets converts it to af:form correctly (so
I'm not sure I agree that Facelets isn't finding the taglib), but then
the af:form is just sent verbatim through to the HTML.

And as I said, this worked in ADF, so I wonder if there's some
difference in the order of processing between ADF and Trinidad. Maybe
Facelets isn't converting the cs:form->af:form until after Trinidad
already does it's processing. I don't know. I'm only guessing. I
understand JSF well enough but how things change when we add
Trinidad/Facelets/taglib, is still new to me.

Oh and BTW, when I say "af:form" I mean Trinidad form. I just chose not
to change my af: prefix to tr:... yet.

Thanks for any help. In the meantime, I'm going to look into your
'taglib not being found' suggestion.

Dan

-----Original Message-----
From: Adam Winer [mailto:awiner@gmail.com] 
Sent: Tuesday, June 26, 2007 2:26 PM
To: MyFaces Discussion
Subject: Re: Trinidad not playing nice with Facelets ui:component?

What version of Trinidad are you using?  Also,
have you tried starting with a very simple page and
just getting *some* tag in the trinidad namespace to show up?
If the tag is just getting passed throug to the HTML,
it means the taglib isn't found by Facelets.

-- Adam


On 6/26/07, Hannum, Daniel <Da...@premierinc.com> wrote:
>
>
>
>
> Hi,
>
>
>
> I am migrating from ADF to Trinidad. My old ADF code used the Facelets
> taglib feature where I could specify a ui:component and have a snippet
of
> XHTML be substituted in for a custom tag.
>
>
>
> For example, I had the following snippet in a JSPX file
>
>
>
> <ui:component>
>
>       <c:if test="#{render}">
>
>             <af:form id="#{id}" usesUpload="#{usesUpload}"><ui:insert
> /></af:form>
>
>       </c:if>
>
>       <c:if test="#{!render}">
>
>             <ui:insert />
>
>       </c:if>
>
> </ui:component>
>
>
>
> All it does is wrap the contents in an af:form if a parameter is set.
I
> called this custom tag "cs:form" and in ADF it worked fine. I put
cs:forms
> in my code and they were properly changed to af:forms, which were then
> converted to HTML form tags by ADF.
>
>
>
> However, in Trinidad, suddenly, my cs:forms are converted to af:forms,
but
> af:form is left in my HTML, clearly not working.
>
>
>
> I think that because the cs->af translation happened, this isn't
Facelets
> fault. It's as if Trinidad is doing something differently. I also
verified
> that the page containing the cs:form does contain this line at the top
>
>
>
> xmlns:af="http://myfaces.apache.org/trinidad"
>
>
>
> so it should know what af:form is. Any ideas? Troubleshooting tips are
also
> appreciated. I didn't see anything in the log, where I'd expect some
kind of
> "I don't understand what af:form is, so leaving it as is" message.
>
>
>
> Dan
>
>
>
>
> ________________________________
>
>
>
>
>  ***Note:The information contained in this message may be privileged
and
> confidential and protected from disclosure. If the reader of this
message is
> not the intended recipient, or an employee or agent responsible for
> delivering this message to the intended recipient, you are hereby
notified
> that any dissemination, distribution or copying of this communication
is
> strictly prohibited. If you have received this communication in error,
> please notify the Sender immediately by replying to the message and
deleting
> it from your computer. Thank you. Premier Inc.

-----------------------------------------
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.  

RE: Trinidad not playing nice with Facelets ui:component?

Posted by "Hannum, Daniel" <Da...@PremierInc.com>.
I'm using Trinidad 1.0.0-incubating, sorry I forgot to mention that. I
admit, the page isn't simple :), but lots of other Trinidad tags on my
pages are rendered into HTML just fine. The only ones that don't are
ones inside Facelets taglibs.

If I use af:form in my page directly (instead of my cs:form custom tag),
the af:form is correctly converted into HTML form and the page is fine.
However, if I use cs:form, Facelets converts it to af:form correctly (so
I'm not sure I agree that Facelets isn't finding the taglib), but then
the af:form is just sent verbatim through to the HTML.

And as I said, this worked in ADF, so I wonder if there's some
difference in the order of processing between ADF and Trinidad. Maybe
Facelets isn't converting the cs:form->af:form until after Trinidad
already does it's processing. I don't know. I'm only guessing. I
understand JSF well enough but how things change when we add
Trinidad/Facelets/taglib, is still new to me.

Oh and BTW, when I say "af:form" I mean Trinidad form. I just chose not
to change my af: prefix to tr:... yet.

Thanks for any help. In the meantime, I'm going to look into your
'taglib not being found' suggestion.

Dan

-----Original Message-----
From: Adam Winer [mailto:awiner@gmail.com] 
Sent: Tuesday, June 26, 2007 2:26 PM
To: MyFaces Discussion
Subject: Re: Trinidad not playing nice with Facelets ui:component?

What version of Trinidad are you using?  Also,
have you tried starting with a very simple page and
just getting *some* tag in the trinidad namespace to show up?
If the tag is just getting passed throug to the HTML,
it means the taglib isn't found by Facelets.

-- Adam


On 6/26/07, Hannum, Daniel <Da...@premierinc.com> wrote:
>
>
>
>
> Hi,
>
>
>
> I am migrating from ADF to Trinidad. My old ADF code used the Facelets
> taglib feature where I could specify a ui:component and have a snippet
of
> XHTML be substituted in for a custom tag.
>
>
>
> For example, I had the following snippet in a JSPX file
>
>
>
> <ui:component>
>
>       <c:if test="#{render}">
>
>             <af:form id="#{id}" usesUpload="#{usesUpload}"><ui:insert
> /></af:form>
>
>       </c:if>
>
>       <c:if test="#{!render}">
>
>             <ui:insert />
>
>       </c:if>
>
> </ui:component>
>
>
>
> All it does is wrap the contents in an af:form if a parameter is set.
I
> called this custom tag "cs:form" and in ADF it worked fine. I put
cs:forms
> in my code and they were properly changed to af:forms, which were then
> converted to HTML form tags by ADF.
>
>
>
> However, in Trinidad, suddenly, my cs:forms are converted to af:forms,
but
> af:form is left in my HTML, clearly not working.
>
>
>
> I think that because the cs->af translation happened, this isn't
Facelets
> fault. It's as if Trinidad is doing something differently. I also
verified
> that the page containing the cs:form does contain this line at the top
>
>
>
> xmlns:af="http://myfaces.apache.org/trinidad"
>
>
>
> so it should know what af:form is. Any ideas? Troubleshooting tips are
also
> appreciated. I didn't see anything in the log, where I'd expect some
kind of
> "I don't understand what af:form is, so leaving it as is" message.
>
>
>
> Dan
>
>
>
>
> ________________________________
>
>
>
>
>  ***Note:The information contained in this message may be privileged
and
> confidential and protected from disclosure. If the reader of this
message is
> not the intended recipient, or an employee or agent responsible for
> delivering this message to the intended recipient, you are hereby
notified
> that any dissemination, distribution or copying of this communication
is
> strictly prohibited. If you have received this communication in error,
> please notify the Sender immediately by replying to the message and
deleting
> it from your computer. Thank you. Premier Inc.

-----------------------------------------
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.  

Re: Trinidad not playing nice with Facelets ui:component?

Posted by Adam Winer <aw...@gmail.com>.
What version of Trinidad are you using?  Also,
have you tried starting with a very simple page and
just getting *some* tag in the trinidad namespace to show up?
If the tag is just getting passed throug to the HTML,
it means the taglib isn't found by Facelets.

-- Adam


On 6/26/07, Hannum, Daniel <Da...@premierinc.com> wrote:
>
>
>
>
> Hi,
>
>
>
> I am migrating from ADF to Trinidad. My old ADF code used the Facelets
> taglib feature where I could specify a ui:component and have a snippet of
> XHTML be substituted in for a custom tag.
>
>
>
> For example, I had the following snippet in a JSPX file
>
>
>
> <ui:component>
>
>       <c:if test="#{render}">
>
>             <af:form id="#{id}" usesUpload="#{usesUpload}"><ui:insert
> /></af:form>
>
>       </c:if>
>
>       <c:if test="#{!render}">
>
>             <ui:insert />
>
>       </c:if>
>
> </ui:component>
>
>
>
> All it does is wrap the contents in an af:form if a parameter is set. I
> called this custom tag "cs:form" and in ADF it worked fine. I put cs:forms
> in my code and they were properly changed to af:forms, which were then
> converted to HTML form tags by ADF.
>
>
>
> However, in Trinidad, suddenly, my cs:forms are converted to af:forms, but
> af:form is left in my HTML, clearly not working.
>
>
>
> I think that because the cs->af translation happened, this isn't Facelets
> fault. It's as if Trinidad is doing something differently. I also verified
> that the page containing the cs:form does contain this line at the top
>
>
>
> xmlns:af="http://myfaces.apache.org/trinidad"
>
>
>
> so it should know what af:form is. Any ideas? Troubleshooting tips are also
> appreciated. I didn't see anything in the log, where I'd expect some kind of
> "I don't understand what af:form is, so leaving it as is" message.
>
>
>
> Dan
>
>
>
>
> ________________________________
>
>
>
>
>  ***Note:The information contained in this message may be privileged and
> confidential and protected from disclosure. If the reader of this message is
> not the intended recipient, or an employee or agent responsible for
> delivering this message to the intended recipient, you are hereby notified
> that any dissemination, distribution or copying of this communication is
> strictly prohibited. If you have received this communication in error,
> please notify the Sender immediately by replying to the message and deleting
> it from your computer. Thank you. Premier Inc.