5 Replies Latest reply on Feb 22, 2010 10:07 AM by jbalunas

    Make outputPanel automatically rendered from particular components

    ilya_shaikovsky

      Forgot to mention earlier one interesting feature. It's widelly used in ADF faces component library. In order to define components for updates they using:

       

      <af:link partialSubmit="true" id="link"/>
      ...
      <af:panel partialUpdate="link">
           ...
      </af:panel>
      

       

      So it's fully opposite to our definitions. And in general using this as the only possible way to design updates(as ADF does) - this aproach seems not really convinient to me(at least not transparent for any other third party or standard components). But thinking about our outputPanel component and ajaxRendered feature I think we could discuss this way as possible functionlity expansion.

       

      As outputPanel is our special component for marking updateable zones - we could add one more attribute like AjaxRenderedFrom. And allow to define id's of components which should update it in this attribute. And moreover how about to allow some container definitions like shown below: (messages component based on outputPanel)

       

      <messages ajaxRenderedFrom="userForm"/>
      <rich:panel id="userForm">
           //some inputs, validators and ajax commands there
      </rich:panel>
      
      <messages ajaxRenderedFrom="userForm"/>
      <rich:panel id="siteSearchPanel">
           //some inputs, validators and ajax commands there     
      </rich:panel>
      

       

      In this case all the submiting behaviors/ajax command components from the first panel will update automatically first messages component, and second panel children - second messages.

       

      The second case I think about - if we show some modal panel and we have messages inside the panel and at the main page - both messages will be updated automatically. Or if you will mark them not updateable automatically - you will have to use reRender's to point them to be updated.

       

      Thoughts? Does it worth some more discussion?

        • 1. Re: Make outputPanel automatically rendered from particular components
          nbelaevski

          Hi Ilya,

           

          It's been asked about some time ago and it's really very easy to implement:

           

          <a4j:commandLink ...>
             <a4j:actionParam value="userForm" assignTo="#{eventsBean.ajaxEventName}" /> <!-- This can Facelets tag -->
          </a4j:commandLink>
          

           

          and

           

          <a4j:outputPanel ajaxRendered="#{eventsBean.ajaxEventName == 'userForm'}" ...> <!-- This can be Facelets tag too -->
          
          ...
          
          1 of 1 people found this helpful
          • 2. Re: Make outputPanel automatically rendered from particular components
            ilya_shaikovsky
            What about containers definitions proposal.. If this sounds implementable? It would be one definition and not param for every command. Or I've missed something.
            • 3. Re: Make outputPanel automatically rendered from particular components
              israel.bgf

              I did really like the Ilya idea. It seens clean enough, and pretty useful for my requirements. So using the ajaxRenderedFrom, makes the ajaxRendered attribute been ignored automatically right? Would be boring to put ajaxRendered="false" and ajaxRenderedFrom="" togheter.

               

              Nick, is it too hard to make that funcionality built-in?

               

               

               

              Keep up the good work, RF Team.

              • 4. Re: Make outputPanel automatically rendered from particular components
                cassionandi
                Ilya, that is sweet. This resolve completely our problems with modals in the current project we are working.
                • 5. Re: Make outputPanel automatically rendered from particular components
                  jbalunas

                  I do see how your example would accomplish the same behavior, but I'm also with Ilya because this would require the action param on every component that you want the behavior on.

                   

                  Right now we almost universally have a "push" model for component rendering.  Ajax components, or a4j:support must "push" what IDs should be rerended.  We do have the outputPanel that is a universal "pull" - i.e. it will rerender on any ajax request.  We do seem to be missing the declaritive "pull" that this feature would give.

                   

                  Another interesting idea that was discussed some time ago was the idea of conditional rendering.  i.e. automatically rerender a component if it changes, or if a component you declare changes.

                   

                  Time willing I would like to review the usability of the various ways we have to declare this type of info.  i.e. develop a universal approach for all components, and perhaps simplify where possible.