myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Lessard" <simon.lessar...@gmail.com>
Subject Re: [Trinidad] PPR and Dialog
Date Wed, 02 May 2007 13:51:18 GMT
Hello,

There's little detail you need to be aware of when working with PPR. This is
not directly linked to the issue, but rather to the suggestion. Trinidad
uses tr:body as PPR root. Therefore, anything placed outside body won't be
PPR-able, even if it's a homemade component supporting PPR.

As for the main issue itself, you could also use the partialTriggers
attribute on the component you want to refresh on dialog return. The result
will be the same as Srinath's suggestion, but you won't have to write any
Java code.


Regards,

~ Simon

On 5/2/07, Srinath K <srinathreddy.komatireddy@gmail.com> wrote:
>
> Sorry for a Wrong tip. viewRoot doesn't render anything and hence it
> cannot be added as a partial target. One simple solution could be wrap all
> your contents with a  panelGrouplayout component and add it to the partial
> target.
> You can use the binding attribute to get the instance of the
> panelGroupLayout or any other component in your managed bean
>
> <tr:panelGroupLayout binding="#{DialogMB.panel}">
> ..
> </tr:panelGroupLayout>
>
> in your managed bean
>
> CorePanelGroupLayout panel; and a getter and setter for the same.
>
> -Thanks,
> Srinath K
>
>
>
> On 5/2/07, Luka Surija <luka.surija@iytim.hr> wrote:
> >
> > Hi,
> > tnx for the tip, but it doesn't work.
> >
> > here is my code:
> >
> >     --- Managed bean  "DialogMB"----
> >     public void returnContactDetail(ReturnEvent event){
> >
> > RequestContext.getCurrentInstance ().addPartialTarget(
> > FacesContext.getCurrentInstance().getViewRoot());
> >     }
> >
> >
> >     --- Close button on Dialog ----
> >     public void closeContactDetail(ActionEvent event){
> >         RequestContext.getCurrentInstance().returnFromDialog(null,null);
> >     }
> >
> > --- JSF code ---
> > <tr:commandLink text="details" action="#{DialogMB.contactDetail}"
> > useWindow="true" returnListener="#{DialogMB.returnContactDetail }" />
> >
> >
> > after closing the Dialog the page is not refreshed and in server log I
> > get this exception:
> >
> > ava.lang.NullPointerException
> >         at
> >
> > org.apache.myfaces.trinidadinternal.context.RequestContextImpl._getNearestPPRTarget(
> > RequestContextImpl.java:697)
> >         at
> >
> > org.apache.myfaces.trinidadinternal.context.RequestContextImpl.addPartialTarget
> > (RequestContextImpl.java:448)
> >         at
> > com.iytim.yachtpool.web.DialogMB.returnContactDetail (DialogMB.java:45)
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at
> > sun.reflect.NativeMethodAccessorImpl.invoke(
> > NativeMethodAccessorImpl.java:39)
> >         at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke (
> > DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:585)
> >         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
> >         at
> > com.sun.el.MethodExpressionImpl.invoke (MethodExpressionImpl.java:283)
> >         at
> > com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java
> > :68)
> >         at
> > com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java
> > :69)
> >         at
> >
> > org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding
> > (UIXComponentBase.java:1183)
> >         at
> > org.apache.myfaces.trinidad.component.UIXCommand.broadcast(
> > UIXCommand.java:162)
> >         at
> > org.apache.myfaces.trinidad.component.UIXCollection.broadcast(
> > UIXCollection.java:110)
> >         at
> > org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java
> > :190)
> >         at
> > javax.faces.component.UIViewRoot.broadcastEvents (UIViewRoot.java:448)
> >         at
> > javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
> >         at
> > com.sun.faces.lifecycle.InvokeApplicationPhase.execute(
> > InvokeApplicationPhase.java:97)
> >         at
> > com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
> >         at
> > com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
> >         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
> >         at
> > org.apache.catalina.core.ApplicationFilterChain.servletService(
> > ApplicationFilterChain.java:398)
> >         at
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> > ApplicationFilterChain.java :304)
> >         at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > ApplicationFilterChain.java:185)
> >         at
> >
> > org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter
> > (TrinidadFilterImpl.java :326)
> >         at
> >
> > org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl
> > (TrinidadFilterImpl.java:290)
> >         at
> > org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(
> > TrinidadFilterImpl.java :213)
> >         at
> > org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(
> > TrinidadFilter.java:90)
> >         at
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> > ApplicationFilterChain.java:217)
> >         at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > ApplicationFilterChain.java:185)
> >         at
> > org.apache.catalina.core.StandardWrapperValve.invoke(
> > StandardWrapperValve.java:275)
> >         at
> > org.apache.catalina.core.StandardContextValve.invokeInternal(
> > StandardContextValve.java:255)
> >         at
> > org.apache.catalina.core.StandardContextValve.invoke(
> > StandardContextValve.java:188)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke (
> > StandardPipeline.java:611)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
> > :564)
> >         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java
> > :81)
> >         at
> > org.apache.catalina.core.StandardHostValve.invoke (
> > StandardHostValve.java:207)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
> > :611)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
> > :564)
> >         at
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
> > :558)
> >         at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1067)
> >         at
> > org.apache.catalina.core.StandardEngineValve.invoke (
> > StandardEngineValve.java:137)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
> > :611)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java
> > :564)
> >         at
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
> > :558)
> >         at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1067)
> >         at
> > org.apache.coyote.tomcat5.CoyoteAdapter.service (CoyoteAdapter.java:249)
> >         at
> >
> > com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter
> > (DefaultProcessorTask.java:618)
> >         at
> > com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(
> > DefaultProcessorTask.java:549)
> >         at
> > com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(
> > DefaultProcessorTask.java:790)
> >         at
> >
> > com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(
> > DefaultReadTask.java:326)
> >         at
> > com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(
> > DefaultReadTask.java:248)
> >         at
> > com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(
> > DefaultReadTask.java :199)
> >         at
> > com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
> >         at
> > com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(
> > SSLWorkerThread.java:93)
> > ---
> >
> >
> > It looks like FacesContext.getCurrentInstance.getViewRoot() returns
> > null?!!
> >
> > The same thing happend if I want to partial update anything using
> > actionListener. For example:
> >
> > public void changePremiums(ValueChangeEvent event){
> >
> > RequestContext.getCurrentInstance().addPartialTarget(event.getComponent
> > ().findComponent("someComponent"));
> >     }                    <-- this code works on changeListener
> >
> > public void changePremiums(ActionEvent event){
> >
> > RequestContext.getCurrentInstance().addPartialTarget(event.getComponent
> > ().findComponent("someComponent"));
> >     }                   <== but here I get the same exception if I want
> > to refresh something pressing commanButton
> >
> > Is this a bug or some feature that I don't understand?!
> >
> > Best regards
> > Luka
> >
> >
> >
> > Srinath Reddy Komatireddy wrote:
> > > Try adding the viewroot to the partialTargets in your returnListener
> > by
> > >
> > > RequestContext.getCurrentInstance().addPartialTarget(viewRoot);
> > >
> > > -Thanks,
> > > Srinath K.
> > >
> > > On 5/2/07, *Luka Surija* <luka.surija@iytim.hr
> > > <mailto:luka.surija@iytim.hr>> wrote:
> > >
> > >     How to partialy refresh a page after returning from a Dialog
> > (called
> > >     from tr:commandLink )?
> > >
> > >     Regards
> > >
> > >     --
> > >     Luka Surija
> > >     luka.surija@iytim.hr <mailto:luka.surija@iytim.hr >
> > >     +385 98 434 061
> > >
> > >     I.Y. tim d.o.o.
> > >     www.iytim.hr <http://www.iytim.hr>
> > >     info@iytim.hr <mailto:info@iytim.hr>
> > >
> > >
> >
> >
>

Mime
View raw message