Skip to main content

ui:composition with template behaving strangely

4 replies [Last post]
jweight
Offline
Joined: 2007-11-12
Points: 0

I am seeing some strange behavior when trying to convert a JSF 1.2 app in GF2 to JSF 2 in GF3. It worked fine previously. Here is the problem.

I have a simple page as follows:

This is contents. Test1 starts.

Test1 ends.

Here is test1.xhtml

This is test1
#{testAttribute}

And here is test2.xhtml

This is test2
#{testAttribute}

The output you would expect would be as follows

This is contents. Test1 starts.
This is test1 attribute1
This is test2 attribute2
Test1 ends

The output we are actually getting is as follows:

This is contents. Test1 starts.
This is test1 attribute1
This is test1 attribute2
Test1 ends

Notice that the static content in test2.xhtml is using the content from test1.xhtml, but the new attribute value is used.

If we remove the template from the composition, and instead use the ui:decorate tag, then things display as expected.

Did the expected behavior of ui:composition change in JSF 2, or is it broken?

Thanks,
Joel

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
araymartin
Offline
Joined: 2008-04-30
Points: 0

did you ever get an answer to this?

Joel Weight

Unfortunately, I received no help on this. We have spent unanticipated
weeks converting all of our composition based components to the new
composite components. Are you seeing the same behavior?

Joel

On Thu, Jul 15, 2010 at 12:47 PM, wrote:

> did you ever get an answer to this?
> [Message sent by forum member 'araymartin']
>
> http://forums.java.net/jive/thread.jspa?messageID=477756
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>
[att1.html]

tommy_bo
Offline
Joined: 2010-09-16
Points: 0

I have the same problem converting to version 2.0.2. Most of our templates should perhaps be converted to components, but we have a few usecases where this is not an option. We have got several modal windows in our app, and some of these need to use the same template. But we can't do that when we use several windows in one view.
I think bug 1708 covers this issue: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1708

Joel Weight

Anyone have any thoughts on this? We are finding that we are having to rip
out basically all of our ui:compositions and try to convert them to
composite implementations. In many cases, this is a good thing anyway, but
is it expected that ui:composition just doesn't work (as described above)?
It's like el variables are bleeding all over the place and not being
updated or something. Could it be a problem with the EL?

Here's our jsf related dependencies if it helps. We are running in GF3.


com.sun.faces
jsf-api
2.0.2
provided


com.sun.faces
jsf-impl
2.0.2
provided


org.glassfish.web
el-impl
2.2


javax.el
el-api
2.2

Thanks,
Joel

On Wed, Apr 28, 2010 at 11:22 AM, wrote:

> I am seeing some strange behavior when trying to convert a JSF 1.2 app in
> GF2 to JSF 2 in GF3. It worked fine previously. Here is the problem.
>
> I have a simple page as follows:
>
>
>
>
> This is contents. Test1 starts.
> > testAttribute="attribute1"/>
> > testAttribute="attribute2"/>
> Test1 ends.
>

>
>

>

>
> Here is test1.xhtml
>
>
>
> This is test1
> #{testAttribute}
>

>

>
> And here is test2.xhtml
>
>
>
> This is test2
> #{testAttribute}
>

>

>
>
> The output you would expect would be as follows
>
> This is contents. Test1 starts.
> This is test1 attribute1
> This is test2 attribute2
> Test1 ends
>
>
> The output we are actually getting is as follows:
>
> This is contents. Test1 starts.
> This is test1 attribute1
> This is test1 attribute2
> Test1 ends
>
>
> Notice that the static content in test2.xhtml is using the content from
> test1.xhtml, but the new attribute value is used.
>
> If we remove the template from the composition, and instead use the
> ui:decorate tag, then things display as expected.
>
> Did the expected behavior of ui:composition change in JSF 2, or is it
> broken?
>
> Thanks,
> Joel
> [Message sent by forum member 'jweight']
>
> http://forums.java.net/jive/thread.jspa?messageID=399435
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>
[att1.html]