You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Werner Punz (JIRA)" <de...@myfaces.apache.org> on 2010/03/03 14:44:28 UTC

[jira] Commented: (MYFACES-2584) h:outputScript missing target error

    [ https://issues.apache.org/jira/browse/MYFACES-2584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840659#action_12840659 ] 

Werner Punz commented on MYFACES-2584:
--------------------------------------

Ok as it seems the solution might be simply to 
set a second listener for PreRender on component level
and then do a check for the target... which in case of our outpoutScript can only be head or body.


> h:outputScript missing target error
> -----------------------------------
>
>                 Key: MYFACES-2584
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2584
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Werner Punz
>            Priority: Minor
>
> There is a bug in our workflow regarding the h:outputScript which prevents an error message to be shown if the target is not present although being set.
> Following behavior, make a html page with normal <head and <body tags, not <h:head, or h:body
> now set the outputScript target to head, and see that nothing happens no error message nothing.
> A black box test against mojarra revealed that mojarra places a FacesMessage error in the message displaying
> that the target could not be found.
> The problem lies within our own lifecycle here, following happens, we have a component event listener on our outputScript 
> which registers itself als componentResource under the target.
> Now if head or body renders it gets the resources registered  for the target head or body and renders them.
> But the problem now is, if there is no dedicated h:head or h:body the resources will never get called and hence nohting happens.
> I personally see two solutions to the problem, one being a head or body check on the outputScript side, but this is inperformant.
> The better idea probably would be simply to also use event mechanisms on the head and body to save a marker somewhere (request maybe) which then later can be checked on the outputScript component side, and if the corresponding marker to target is not present we simply add an error...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.