tag:blogger.com,1999:blog-6133363959081933104.post8502629907781655235..comments2023-04-26T16:26:30.439+02:00Comments on Big Al's Blog: Example of using custom facelet tagsAllan Lykke Christensenhttp://www.blogger.com/profile/00646797647221121520noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-6133363959081933104.post-60756415898845405682009-06-03T22:24:07.461+02:002009-06-03T22:24:07.461+02:00Hi there,
home="true" should display th...Hi there,<br /><br />home="true" should display the Home link with red background and white text, and the other links should be ordinary links. Ensure that you don't have any break lines in the lines of h:outputText. On the blog entry the lines may appear to be chopped into separate lines when each h:outputText is suppose to have only a single line.<br /><br />P.S. The blog is being moved to <a href="http://blogs.i2m.dk/allan" rel="nofollow">http://blogs.i2m.dk/allan</a>.Allan Lykke Christensenhttps://www.blogger.com/profile/00646797647221121520noreply@blogger.comtag:blogger.com,1999:blog-6133363959081933104.post-37685446144168569932009-06-02T14:40:59.960+02:002009-06-02T14:40:59.960+02:00Hi,
When i am giving home="true" only then other m...Hi,<br />When i am giving home="true" only then other menus are displaying but without css. Is it possible that they should not be visible if the are not true?<br /><br />Thanks for Reply.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6133363959081933104.post-20166578951495531852008-07-26T16:41:00.000+02:002008-07-26T16:41:00.000+02:00For custom tags you will need to provide Facelets ...For custom tags you will need to provide Facelets with a taglib.xml like the one you created for this example.<BR/><BR/>An example of such a taglib.xml can be found on the <A HREF="http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk" REL="nofollow">MyFaces wiki</A> where they are explaining how to get the Tomahawk JSF library to work with Facelets.<BR/><BR/>I can highlighly recommend The <A HREF="http://www.apress.com/book/view/1430210494" REL="nofollow">Facelets Essentials</A> book from Apress written by my good friend Zubin Wadia.Allan Lykke Christensenhttps://www.blogger.com/profile/00646797647221121520noreply@blogger.comtag:blogger.com,1999:blog-6133363959081933104.post-68037164434207382822008-07-26T16:03:00.000+02:002008-07-26T16:03:00.000+02:00Hi Allan,It worked , I copy pasted into some runni...Hi Allan,<BR/><BR/>It worked , I copy pasted into some running code and it worked fine.<BR/><BR/>I have on more problem though not related with your issue . <BR/><BR/>I have an existing project which uses Myfaces and JSP . I have a custom Pagination tag in the project which works fine.<BR/>The tag is extending the org.apache.myfaces.taglib.core.ViewTag and has doStart and doEnd methods. For this tag there is a tld and which I have included in the jsp :<BR/><BR/>%@ taglib uri="/WEB-INF/PaginationTag.tld" prefix="p" %<BR/><BR/>This is my tag class :<BR/><BR/>public class PaginationTag extends ViewTag {<BR/> public int doStartTag(){<BR/> ......<BR/> }<BR/> }<BR/><BR/>I havent made any other entry in faces-config or made any renderer/component for this tag.<BR/><BR/>I am trying to create the same tag in SUN JSF RI 1.2 and Facelets . But the tag doesn't seem to work . there is not error thrown but the xhtml file doesnot seem to understand the tag and it displays the tag as it is.<BR/><BR/>I have extended the com.sun.faces.taglib.jsf_core.ViewTag to create this tag since I am using SUN JSF RI 1.2 .<BR/><BR/>Do I need to create a Component class and/or a Renderer too . Why it was not required in myfaces case ? <BR/><BR/>How can I have the same functionality as I had in the JSP case like implement doStartTag() and other methods ? <BR/><BR/>Please help me some links or example codes you have ? <BR/><BR/>Also which books one should refer for Facelets and JSF ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6133363959081933104.post-48092068346572686722008-07-26T15:59:00.000+02:002008-07-26T15:59:00.000+02:00You can place the taglib.xml files in any director...You can place the taglib.xml files in any directory of the web application. If you have more than one Facelets taglib you should separate them using semicolons (;) and not commas (,).<BR/><BR/>Also check that the namespace is identical in both the taglib.xml and the XML namespace declaration on the XHTML page.Allan Lykke Christensenhttps://www.blogger.com/profile/00646797647221121520noreply@blogger.comtag:blogger.com,1999:blog-6133363959081933104.post-50017320844382630152008-07-26T15:54:00.000+02:002008-07-26T15:54:00.000+02:00Hi Allan,Thanks for the prompt reply . But I have ...Hi Allan,<BR/><BR/>Thanks for the prompt reply . But I have done that too. I have the entry in web.xml<BR/><BR/>Any other specific thing like should all the xxx.taglib.xml files be inside facelets folder only ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6133363959081933104.post-39261020666170554922008-07-26T13:38:00.000+02:002008-07-26T13:38:00.000+02:00Sounds like you missed the step of loading your ta...Sounds like you missed the step of loading your tags into Facelets using the context parameter facelets.LIBRARIES.Allan Lykke Christensenhttps://www.blogger.com/profile/00646797647221121520noreply@blogger.comtag:blogger.com,1999:blog-6133363959081933104.post-69188337751931434562008-07-26T13:26:00.000+02:002008-07-26T13:26:00.000+02:00Hi,I tried ur example but my page displayed blank ...Hi,<BR/><BR/>I tried ur example but my page displayed blank . The source code of the xhtml showed the tag as it was written , it was not replaced.<BR/>It means the tag was not recognised. Any inputs ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6133363959081933104.post-67588275566290779142008-06-25T20:24:00.000+02:002008-06-25T20:24:00.000+02:00You are right that there is no way of scanning a f...You are right that there is no way of scanning a faclets file to determine the tag attributes, as any variable in the file could be a tag.<BR/><BR/>Instead you could document the tag by creating a TLD (Tag Library Descriptor) for the facelet file and then run it through a utility like <A HREF="https://taglibrarydoc.dev.java.net/" REL="nofollow">taglibdoc</A> which creates JavaDoc-like documentation for tag libraries.Allan Lykke Christensenhttps://www.blogger.com/profile/00646797647221121520noreply@blogger.comtag:blogger.com,1999:blog-6133363959081933104.post-55605305644976532922008-06-23T18:31:00.000+02:002008-06-23T18:31:00.000+02:00Hi,Great example! I was wondering if there is any ...Hi,<BR/><BR/>Great example! <BR/><BR/>I was wondering if there is any way to document the tag's attributes?<BR/>So far I've read that there is no possibility to scan the facelet, so I'm expecting some other solution.goodusernamehttps://www.blogger.com/profile/04493971951189463724noreply@blogger.comtag:blogger.com,1999:blog-6133363959081933104.post-60195757968534097092008-04-07T09:57:00.000+02:002008-04-07T09:57:00.000+02:00Hi,Nice blog.Thanks,Gudduhttp://freesourceutilityh...Hi,<BR/><BR/>Nice blog.<BR/><BR/>Thanks,<BR/>Guddu<BR/><A HREF="http://freesourceutilityhelp.googlepages.com" REL="nofollow">http://freesourceutilityhelp.googlepages.com</A>Anonymousnoreply@blogger.com