Greetings: Matthias and other developers
What shall i report following issue as a bug or a requested feature.
Issue:
Jsf + Tiles integration under myfaces works properly ONLY under the first level of tiles definition and layout. Myfaces seems to skip jsf phases after the first level.
A patch to make jsf implementation work properly at least in all fragments of its generated html page will enable Jsf+Tiles as a portal rendering engine. Technically, tiles can be nested in any level, so Jsf + Tiles should be able to achieve this level of integration if the rendering of jsf UI components are properly carried out. I hope this can be done quickly so a modern portal page under jsf + tiles can be out of the door. :-)
Prototype testings:
1) Using myfaces + tiles with JspTilesViewHandlerImpl of version 1.0.7, i created a portal page with 2 layouts: a portal page layout where tiles portlets are inserted in the 2 columns and a common display area, and a portlet layout that has common header menu and inserted tiles portlet contents. This is ok if portlet content has only jsp fragment. A mixture of jsf and jsp components will render the page in wrong order. This is a wellknown current issue between jsf and jsp. I solve the problem by using ONLY the portal page layout. Portlets are inserted directly as individual portlet tile fragment. Under this scenario, a portlet tile fragment can be presented as a normal jsf fragment.
2) Using normal jsf fragments under tiles portal page layout, i found jsf UI components behave normally in fragments of the page layout, but NOT in portlet fragments inserted by tiles. I try <h:commandButton>, <h:commandLink> and <h:outputLink>:
2.1) <h:commandButton> and <h:commandLink> are identically rendered (by looking at the page source - obviously with different component Ids) under the fragments of the page layout and fragments inserted by tiles. However, a click on <h:commandButton> and <h:commandLink> in the fragment inserted by tiles displays the same page. This means command actionListenner and action are skipped.
2.2) I put a simple onclick Javascript to check if password and confirmPassord identical. The onclick Javascript is executed, but when submitted the command action is ignored. This indicates that jsf phases are skipped.
2.3) <h:outputLink> dispatches to correct page under both types of fragments (layout fragment and tiles inserted fragment). This working case makes me think a temporary workaround may be to use <h:outputLink> only in the portlet inserted tile fragment and any page that required jsf actionListener, action will have a complete portal page layout cut and paste into it while waiting for a real solution of properly rendring Jsf components under tiles. This temporary solution goes against the reason why tiles is used in the first place.
3) Using the temporary solution as explained in 2.3, i experiment with dynamically generated portal tabs. The servlet dispatcher consistently throw ClassCastException for the last tab, while the same thing under 2.1 and 2.2 (i.e. jsf action and actionListener are NOT properly picked up) is stable and work properly. The root cause may then be the way how jsf is implemented. I hope this can be quickly patched and let us enjoy the fruit of Jsf + Tiles.
PS: If you are too busy, you can explain how jsf implementation is done and possible problems under tiles, and direct me to possible sources to resolve the issue.
Thanks
BaTien DBGROUPS
BaTien Duong wrote:
Hello:
Using myfaces-1.0.7, i was able create a complete dynamic portal page and tiles insertions of the display and portlet fragments. Each jsf page is a custom portal tab form.<h:commandButton> behaves normally within a portal page and can pick up correct action for a new page with new tiles fragments. However, within a fragment inserted by tiles, the <h:commandButton> does not pick up the command action.
Investigations:
(1) I tried both with and without the parent form and use / or NOT use parent form generation from myfaces. Results are the same.
(2) Looking at the generated html from myfaces, i saw the generated codes onclick for the <h:commandButton> that clears the old action form and supposely leads to the next navigation action. But this is not the case for the <h:commandButton> inside an inserted tiles fragment.
Possible solutions:
(1) Is there any readily solution and/or quick fix for the above issue? Even some direction to fix from source codes may help.
(2) One possible solution may be to write a custom onclick attribute for each <h:commandButton> within a tiles insertion, since myfaces will concatenate the custom onclick attribute with its generated javascript clear() function.
Sory to post this in both dev and user lists.
Thanks.
BaTien DBGROUPS
