8 Replies Latest reply on Oct 9, 2007 7:19 AM by dmitry.demyankov

    effect in a table/subtable

    hdmonty

      Hello together,

      I read the examples to rich:effect.
      These are all narrowly on rich:panel.
      Is it possible < rich:effect >, to apply to a dataTable?

      I have such a dataTable, a rowclick event is applied to these. Then, a subtable appears. With again-y clicks this vanishes again.
      Unfortunately, the subtable only simply jumps up, although I one < rich:effect > installed.

      <rich:dataTable id="myTable".... >
      
      [my cols...]
       <rich:subTable id="mysubtable"
       rendered="my condition..">
       </rich:subTable>
       <a4j:support event="onRowClick" reRender="myTable" ajaxSingle="true" actionListener="#{controller.processClick}" />
       <rich:effect event="onRowClick" for="subtable" type="BlindDown"
       params="duration:0.8" />
      </rich:dataTable>


      Can anybody help me here?
      Thx

        • 1. Re: effect in a table/subtable

          There are two points here:
          1. rich:effect is based on scriptacuous effects. So, you read about scriptacuous effects to understand how they work and what them can apply to.

          2. scriptacuous effects are applied to the DOM elements. However, the effect does not expect that you will replace DOM element (remove old and add new one) during the manipulation with the target DOM element.

          Look at your code. You direct to apply the BlindDown effect on the subtable, but at the same time, send an Ajax request and expect the subtable to be fully re-rendered. I.e. this is the situation I describe in the #2 above. So, my expectation that this will not work at all, or will work with unexpected glitches.

          • 2. Re: effect in a table/subtable
            hdmonty

            Thank you Sergey for your answer.
            This therefore mean that it doesn't have anything to do with a table or panel but, whether the complete DOM-tree already exists. If my table doesn't look simultaneously on the data of the server, the rich:effect will work. I think that I cannot give it up. Therefore I probably must live with it that the subtable simply appears after the click, without an effect.

            • 3. Re: effect in a table/subtable
              dmitry.demyankov

              Can you make subtable hidden and then apply rich:effect to it on row click? If the element is hidden then it's in DOM tree, right?

              • 4. Re: effect in a table/subtable
                hdmonty

                What kind of 'hidden' do you mean?

                I use the rendered-attribute

                <rich:subTable id="mysubtable" rendered="my condition..." value="myList..." >


                Furthermore, I have to look, wether my bean has changed data - by each click.
                I would prefer a solution with an event that I can handle after the DOM tree has refreshed.


                • 5. Re: effect in a table/subtable
                  dmitry.demyankov

                  I mean

                  style="display: none;"


                  • 6. Re: effect in a table/subtable
                    dmitry.demyankov
                    • 7. Re: effect in a table/subtable
                      damianharvey

                      What I'm hearing here is that you can't use rich:effect in combination with 'rendered'. Is that correct?

                      Thanks,

                      Damian.

                      • 8. Re: effect in a table/subtable
                        dmitry.demyankov

                         

                        "damianharvey" wrote:
                        What I'm hearing here is that you can't use rich:effect in combination with 'rendered'. Is that correct?


                        If you set rendered="false" then simply there's no such element on the page - so there's no element that rich:effect can be applied to..