2 Replies Latest reply on Mar 24, 2011 12:44 AM by toddpi314

    Pages.xml parms binding event

    toddpi314

      In pages.xml I have




       <page view-id="/index.xhtml">
        <param name="myPropertyName" value="#{myComponent.myProperty}"/>
       </page>





      On my component (Event scoped), I would like to initialize some items when the request parameter is bound to the property.


      This works fine on the setter, but does not work well when there are multiple parameters being passed.


      I cannot use the @Create method, because it is called before the binding.


      Is there a Seam Event that will let me hook into after the binding phase?

        • 1. Re: Pages.xml parms binding event
          lvdberg

          Hi,


          you have the:



          • org.jboss.seam.preSetVariable.yourVariable

          • org.jboss.seam.postSetVariable.yourVariable



          Evenst at your disposal.


          Leo

          • 2. Re: Pages.xml parms binding event
            toddpi314

            I still can't find a good resolution for this.


            If I have a component that has 3 request parameters mapped through the pages.xml, I cannot find out how to know when the all of the parameters have bound for that view.


            I am using:






                    @Observer("org.jboss.seam.beforePhase")
                    public void beforePhase(PhaseEvent event) {
                            if (event.getPhaseId() == PhaseId.RENDER_RESPONSE
                                            || event.getPhaseId() == PhaseId.APPLY_REQUEST_VALUES) {
                                    afterModelBinding();
                            
                            }
                    }







            But, this is not restricted to a particular component. This fires all over the place, but luckily only once... after the ApplyRequestValues



            What I need is a way to isolate this event down to APPLYREQUESTVALUES on the currently observing component.