>From: Chrisi <[EMAIL PROTECTED]>
>
> Hi Gerald,
>
> you wrote:
>
> > It`s not best practice to have jsf corresponding tags and
> > plain html on the same page ...
>
> Sure, it would be nice to have jsf pages without plain html.
> But in reallity this wouldn't happen:
>
> In 90% of the projects I know, HTML is delivered from web-designer experts.
> Those people don't know about JSF and components. And I think they
> don't have to.
> In real projects this HTML is taken as the view component and the
> developer enhances the view with bean values and some navigation
> rules.
> But it isn't practical to force the developer to remap all the HTML
> into JSF components (and for complex HTML this doesn't really work).
>
 
If you are trying to get the most of the artifacts generated by your web designers, you might also take a look a struts shale (http://struts.apache.org/struts-shale/features-reusable-views.html).   
 
The JSF jsp tags are not designed to work with other view technologies.  Using clay, you can start with a JSP view entry point and expand to a Clay subview but there is not a way to include a jsp from a Clay template.  I believe that Facelets has the same restriction.
 

> When looking at JSF example-applications I always see mixing of plain
> html and JSF components. It works for f:view.
> The question is: Why doesn't it work for f:subview? Is there a
> workaround without wrapping anything in jsf-tags or using facelets?
>
 
The JSF 1.2 runtime addresses this problem.  Both Clay and Facelets breaks renderering into two steps.  First a component tree is created starting with a view root.  The entire content of the page is kept in JSF components.  Then the tree is rendered. 
 
Under JSF 1.1, the view is rendered as the tree is built.  The markup of the non-jsf JSP tags write to the same writer.  This causes problems with components like the dataTable that is trying to inter-weave content with a component and JSP tags output.
 
JSF 1.2 takes the same two step approach but the trick is keeping track of EL that exists in the JSP versus the JSF components.  This version has a unified EL engine between JSP and JSF.  Pointers to variables defined in the JSP PageContext have to be established for template blocks generated from JSP but added to the component tree as a verbatim JSF components.  So, JSP tags should only setup the component tree to be rendered.  Even the output markup of non-jsf jsp tags are taken for the buffered writer and stuffed in a verbatim component by the next JSF jsp tag before adding the target to the tree. 
 

> Greetings
> Chrisi
>
 
 
Gary

>
> On 5/20/06, Gerald Müllan <[EMAIL PROTECTED]>wrote:
> > Hi,
> >
> > I see the main problem in this that you mix up jsf presentation with
> > html markup. It`s not best practice to have jsf corresponding tags and
> > plain html on the same page. Try where ever possible to use only jsf
> > related stuff.
> >
> > Normally it should be possible to get along with your requirements
> > when doing it like this.
> > If not, you can also use tomahawks component. Furthermore
> > can help out.
> >
> > Apart from your problem, doing it like this makes you independent from
> > html renderkit.
> >
> > cheers,
> >
> > Gerald
> >
> > On 5/20/06, Chrisi <[EMAIL PROTECTED]>wrote:
> > > Hi Andrew,
> > >
> > > thanks for response.
> > > It's a pitty. We can't use facelets in our project currently.
> > >
> > > There must be a way to use subviews without messing the things up
> > > without using facelets, or?
> > >
> > > On 5/20/06, Andrew Robinson <[EMAIL PROTECTED]>wrote:
> > > > Facelets.
> > > >
> > > > Does includes very nicely (no subviews), is faster than JSP and you
> > > > don't need verbatim tags.
> > > >
> > > > On 5/20/06, Chrisi <[EMAIL PROTECTED]>wrote:
> > > > > Hello,
> > > > >
> > > > > I'm driving crazy with myfaces:
> > > > >
> > > > > I've got an JSF page with the following content:
> > > > >
> > > > >


> > > > > Some HTML tags and text
> > > > >


> > > > >
> > > > >
> > > > > Let it run and you see
> > > > > "
> > > > > Some HTML tags and text
> > > > > And here JSF text
> > > > > "
> > > > > on your browser. That's ok!
> > > > >
> > > > >
> > > > > Now I wanna make some refactoring and like to put the
> > > > > content into a subview. The content from above is inlcuded als follow:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > I let it run again and you see the output messed up (lines are not in
> order):
> > > > > "
> > > > > And here JSF text
> > > > > Some HTML tags and text
> > > > > "
> > > > >
> > > > > When putting or around the HTML in the
> > > > > subview it seems to work.
> > > > > But that's no adequate way. It messes up you view-code and makes it
> unreadable!
> > > > >
> > > > > Why is there a different behavior in subview vs. views?
> > > > >
> > > > > What is the way to go?????
> > > > >
> > > > >
> > > > >
> > > > > Thanks and Greetings
> > > > > Chrisi
> > > &g t; > ;
> > > >
> > >
> > >
> > > --
> > > Thanks and Greetings
> > > Chrisi
> > >
> >
> >
> > --
> > Gerald Müllan
> > Schelleingasse 2/11
> > 1040 Vienna, Austria
> > 0043 699 11772506
> > [EMAIL PROTECTED]
> >

Reply via email to