:twisted: :twisted: :twisted: :twisted:
Puta velho,
<%@ taglib uri=“http://myfaces.apache.org/trinidad” prefix=“tr”%>
<%@ taglib uri=“http://richfaces.org/rich” prefix=“rich”%>
to tentando usar esse componente:
rich:datascroller
só que meu sitema usa o trinidad e o tipo do form é tr:form
dai olha só que fita:
parece que o richfaces tem que achar o formulario da pagina, e ai ele usa esse metodo:
UIForm form= RendererUtils.getInstance().getNestingForm(context, component);
que chama esse outro:
UIComponent parent = component.getParent();
while (parent != null && !(parent instanceof UIForm)) {
parent = parent.getParent();
}
bom acontece que como vcs viram meu form é do tipo: tr:form e nao h:form
logo !(parent instanceof UIForm) allways will evaluate false;
e vai ser true, vai entrar no while e vai procurar outro parent, sou seja nunca vou conseguir fazer o fdp entender que meu form nao é h:form…
cai nesse toopico pq eu vi essa linha:
text.setRendererType(“javax.faces.Text”);
bom,
sei la…vou tentar aqui setar um outro form hardcoded no meu componente e ver oque acontece…mas acho que isso nao vai funcionar…
se alguem ai tiver uma luz no fim do tunel, e souber bastante de trinidad…myfaces, richfaces e puder dar uma luz eu vou ser eternamente grato…
valeu.
public static void throwEnclFormReqExceptionIfNeed(FacesContext context, UIComponent component) throws EnclosingFormRequiredException {
UIForm form= RendererUtils.getInstance().getNestingForm(context, component);
//TODO nick -> nick - switchType checking can be harmful here
String switchType = (String) component.getAttributes().get("switchType");
boolean isSwitchTypeClient = switchType == null ? false : switchType.equalsIgnoreCase("client") ;
if (form == null && !isSwitchTypeClient){
throw new EnclosingFormRequiredException(component.getClass().toString()+" (id=\"" + component.getId() + "\") did not find parent form.");
}
}
public UIForm getNestingForm(FacesContext context, UIComponent component) {
UIComponent parent = component.getParent();
while (parent != null && !(parent instanceof UIForm)) {
parent = parent.getParent();
}
UIForm nestingForm = null;
if (parent != null) {
// link is nested inside a form
nestingForm = (UIForm) parent;
}
return nestingForm;
}
full stacktrace:
org.richfaces.component.EnclosingFormRequiredException: class org.richfaces.component.html.HtmlDatascroller (id="j_id_jsp_699352210_3i5") did not find parent form.
at org.richfaces.component.util.FormUtil.throwEnclFormReqExceptionIfNeed(FormUtil.java:45)
at org.richfaces.renderkit.html.DatascrollerTemplate.doEncodeEnd(DatascrollerTemplate.java:193)
at org.richfaces.renderkit.html.DatascrollerTemplate.doEncodeEnd(DatascrollerTemplate.java:673)
at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:135)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:829)
at org.apache.myfaces.trinidad.render.RenderUtils.encodeRecursive(RenderUtils.java:69)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:282)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:304)
at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:72)
at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:152)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:208)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:733)
at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1271)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:753)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)
at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:247)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:171)
at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:178)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:174)
at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
at org.ajax4jsf.Filter.doFilter(Filter.java:175)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:208)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:165)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:138)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.powerlogic.jcompany.controle.filter.PlcMasterFilter.doFilter(PlcMasterFilter.java:206)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:421)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:421)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)