Hi Jaco,
I would expect rich faces components to work just fine as long as the
facelets taglib for them is present. For creating / debugging your
template-based components, you might want to use the regular
jsftemplating.jar file and create a test application (you can use
JSFTemplating's "demo" application). This will give you the debug
environment, the ability to goto
http://localhost:8080/demo/info.jsf to
see the known component types, etc.
If you can send me your example code, I can look at it later tonight.
Ken
Jaco Prinsloo wrote:
> Hi Ken,
>
> Feels like I'm spamming you - sorry about that.
> I managed to do everything I wanted except for two things:
>
> 1) Dynamically create child components according to the passed count
> (as per previous mail).
> 2) Use RichFaces inside my template (currently the tag is being passed
> on as is)
>
> Here's my template file at the moment, if you could help me with those
> two I'd be eternally grateful:
>
> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <ui:composition xmlns="http://www.w3.org/1999/xhtml"
> xmlns:h="http://java.sun.com/jsf/html"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:ui="http://java.sun.com/jsf/facelets"
> xmlns:rich="http://richfaces.org/rich">
>
> <ui:event type="beforeEncode">
> setAttribute(key="message" value="DEFAULT");
> if ($property{message}) {
> setAttribute(key="message" value="$property{message}");
> }
> </ui:event>
>
> <rich:panel bodyClass="selectPanel">
> <h:outputText value="#{message}" />
> </rich:panel>
>
> </ui:composition>
>
> Thanks a lot, sorry about all this.
> Jaco
>
> On Thu, Jun 19, 2008 at 10:41 AM, Jaco Prinsloo <jmprinsloo_at_gmail.com
> <mailto:jmprinsloo_at_gmail.com>> wrote:
>
> Hi Ken, sorry to bother you again.
>
> I'm trying to do the following, but I'm not sure how to do it or
> if it is even possible in JSFT:
> I'd like to create a custom tag which looks like this
> <my:customComponent text="Hello World!" count="2" />.
> That tag should be parsed to return two <h:outputText /> elements,
> both containing the text "Hello World!".
> In other words, the text attribute determines what to display and
> the count attribute how many times to display it.
>
> I understand the article examples which create HTML markup
> dynamically, but how can I do the same for other JSF components
> (in this case h:outputText)?
>
> Thank you,
> Jaco
>
>
> On Wed, Jun 18, 2008 at 5:16 PM, Jaco Prinsloo
> <jmprinsloo_at_gmail.com <mailto:jmprinsloo_at_gmail.com>> wrote:
>
> I used exactly the same app that I sent you - I only added the
> slash and then modified the Template.xhtml to contain valid
> JSF markup in order to get it to work. Thanks for all your
> help - I'll definitely be giving the debug mode a try.
>
> Once again, thanks a lot!
> Jaco
>
>
> On Wed, Jun 18, 2008 at 4:54 PM, Ken Paulsen
> <Ken.Paulsen_at_sun.com <mailto:Ken.Paulsen_at_sun.com>> wrote:
>
>
> What was the jsf mapping in your web.xml file? I noticed
> it was *.xhtml in the example you sent me. So using that
> mapping and having the file named Template.xhtml, it
> worked. If you tried *.jsf and named the file *.xhtml, it
> would not have found it (b/c the default suffix for that
> format is *.jsf, so it wouldn't have looked for *.xhtml).
>
> Otherwise, you just needed to restart your server to make
> it work. If you enabled debug mode, you can now switch
> back and forth between the 2 formats w/o restarting the
> server and you will see any changes you make.
>
>
> Ken
>
> Jaco Prinsloo wrote:
>> Hi Ken,
>>
>> Nevermind, I got it to work.
>> I replaced the template content with the following:
>>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
>> Transitional//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>> <html xmlns="http://www.w3.org/1999/xhtml"
>> xmlns:h="http://java.sun.com/jsf/html"
>> xmlns:f="http://java.sun.com/jsf/core"
>> xmlns:ui="http://java.sun.com/jsf/facelets">
>>
>> <h:outputText value="IT WORKS!"/>
>>
>> </html>
>>
>> Any idea why just "IT WORKS! didn't work?
>>
>> Thank you,
>> Jaco
>>
>> On Wed, Jun 18, 2008 at 12:19 PM, Jaco Prinsloo
>> <jmprinsloo_at_gmail.com <mailto:jmprinsloo_at_gmail.com>> wrote:
>>
>> Thanks for the response, Ken.
>> Unfortunately that didn't solve my problem:
>>
>> A LayoutDefinition was not provided for
>> '/Templates/Template.xhtml'! This is required.
>>
>> Anything else that I might be missing?
>> Does the WAR work correctly on your server?
>>
>> Thank you,
>> Jaco
>>
>>
>> On Wed, Jun 18, 2008 at 10:04 AM, Ken Paulsen
>> <Ken.Paulsen_at_sun.com <mailto:Ken.Paulsen_at_sun.com>> wrote:
>>
>>
>> Hi Jaco,
>>
>> You are right, it was a *very* small mistake. :)
>> I should have caught this right away when you
>> asked yesterday, but sometimes the small mistakes
>> are the hardest to find.
>>
>> In "src/com/test/TestComponent.java" add a
>> leading '/' character in front of the path so
>> that it looks like this:
>>
>>
>> setLayoutDefinitionKey("/Templates/Template.xhtml");
>>
>> That's it!
>>
>> You don't need the factory class
>> (src/com/test/TestFactory.java) at all if you're
>> using a facelets taglib file. Also, if you want
>> use the factory you need to compile with "apt"
>> instead of "javac". I can then show you how to
>> use the factory w/o a facelets taglib file.
>>
>> Good luck!
>>
>> Ken
>>
>>
>>
>> Jaco Prinsloo wrote:
>>
>> Hi Ken,
>>
>> Thanks for taking the time to have a look at
>> my demo app.
>> I just can't shake the feeling that my
>> problem is caused by a small, stupid mistake
>> - but I can't find it.
>> Have a look at the build file, there's one
>> property that you'll need to change.
>>
>> Thanks a lot,
>> Jaco Prinsloo
>>
>>
>>
>
>
>