-
1. Re: Can't get UIComponent id when overriding ViewHandlerWrapper
nbelaevski Jul 23, 2010 5:20 AM (in response to leofigs)Hi Leonardo,
RichFaces 3.x provides its own version of view root that has ID hard-coded instead of auto-generated one. Other components will return correct IDs assigned by application developer.
-
2. Re: Can't get UIComponent id when overriding ViewHandlerWrapper
leofigs Jul 23, 2010 10:39 AM (in response to nbelaevski)Ok. But the visitor is supposed to visit the whole tree, and it is returning 40+ (_viewRoot) components.
It does appear that the component visited is changing as expected acording with the following debug output:
11:28:21,458 DEBUG SecuredViewHandler:40 - Im visiting an component with id : _viewRoot and toString: org.ajax4jsf.component.AjaxViewRoot@56e88e24 11:28:21,932 DEBUG SecuredViewHandler:40 - Im visiting an component with id : _viewRoot and toString: org.ajax4jsf.component.AjaxViewRoot@2a24ed78 11:28:21,958 DEBUG SecuredViewHandler:40 - Im visiting an component with id : _viewRoot and toString: org.ajax4jsf.component.AjaxViewRoot@a0ccc96 11:28:21,981 DEBUG SecuredViewHandler:40 - Im visiting an component with id : _viewRoot and toString: org.ajax4jsf.component.AjaxViewRoot@4f0ab3f2 11:28:22,009 DEBUG SecuredViewHandler:40 - Im visiting an component with id : _viewRoot and toString: org.ajax4jsf.component.AjaxViewRoot@72c21d01 11:28:22,028 DEBUG SecuredViewHandler:40 - Im visiting an component with id : _viewRoot and toString: org.ajax4jsf.component.AjaxViewRoot@6c618821 (.....)
This is a code snippet of the jsp. There is no rich:* component in this page, and it is a very small login page:
<table style="margin:15em auto 0; width:300px"> <tr> <td><h:outputLabel value="Login: " for="loginField"/></td> <td><h:inputText value="#{loginBean.login}" required="true" requiredMessage="Informe o login." id="loginField"> </h:inputText></td> <td><h:message for="loginField"></h:message></td> </tr> <tr> <td><h:outputLabel value="Senha: " for="passwordField"/></td> <td><h:inputSecret value="#{loginBean.password}" required="true" requiredMessage="Informe a senha." id="passwordField"> </h:inputSecret></td> <td><h:message for="passwordField"></h:message></td> </tr>
The page is rendering as expected.
I thought i might be doing the wrong thing getting the target id but the components does not have any child as getChildCount() return 0 for all of them. The viewroot should have child components, right? And i suppose there shouldn't be as many _viewRoot as my visitor returns in the component tree...
-
3. Re: Can't get UIComponent id when overriding ViewHandlerWrapper
nbelaevski Jul 26, 2010 5:08 AM (in response to leofigs)Leonardo,
JSP views are empty at this stage. They are built and rendered in the same invocation of renderView() method - this is the difference with Facelets. I suggest you to use listener for PreRenderViewEvent instead. Also I couldn't reproduce 40+ view roots printed - is there a repeated invocation of renderView() method happening?