Aleksei,
This is very interesting what you've done.  The source code would definitely be 
more enlightening.  How do you do these expanding/contracting panels? 
Thanks,
Simeon

-----Original Message-----
From: Aleksei Valikov [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 11, 2006 1:22 PM
To: MyFaces Discussion
Subject: Re: Run-time component generation

Hi.

>> We're doing a lot of dymanic component manipulation in or projects so 
>> this would be a nice documentation for my fellow developers as well.
> 
> Now that I have a better understanding of what you're doing, let me
> through out another possiblity.   What about dynamically generating
> the page code and passing that to the parser (you'd probably have to 
> use facelets rather than jsp in this case) rather than dynamically 
> generating the components?

I just don't see what's the problem of generating the components directly.
Why should we go through tags? What tags do is not much different from 
programmatic component creation. But when generating tags you have to respect 
syntax of tags. Missing a '}' somewhere would cost quite a lot of time.
It's just like creating Swing in runtime, not much different.

I have attached a screenshot of the programmatically-generated form.
This is just a small part of what I generate in the runtime. I create all these 
components programmaticaly, make them children of other components, set styles 
and so on - i.e. build the component structure. All simple inputs are AJAXified 
with ajax4jsf. Buttons like [+] or [-] which are used to add or remove complex 
sub-editors are AJAXified as well.

Yes, in the beginning it was hard. MyFaces (as well as JSF RI as well as 
everything else I saw in the JSF world) has plenty of nasty hacks and things 
that make you crazy sometimes. I had to read a lot of MyFaces code to 
understand what's wrong and how to develop a workaround for this, but that's 
all manageable.

Bye.
/lexi

==============================================================================
Please access the attached hyperlink for an important electronic communications 
disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================

Reply via email to