2 Replies Latest reply on Dec 3, 2008 10:43 AM by buttau

    ScrollableDataTable. Columns JS-Resize-Event

    buttau

      Does anybody know if there is a possibility to hook resize-event of columns of ScrollableDataTable.

      The background of this question is as follows:
      I need to save Column-Widths on the server side to restore it on next user session.

      Currently I make it with js-Function:

      function getGridColumns() {
       var comp;
       var i=0;
       var sum='';
       do{
       comp = document.getElementById('form:viewgrid:hc_' + i);
       if (comp) {
       sum = sum + parseInt(comp.getStyle('width')) + ';';
       }
       i++;
       }while(comp);
      
       return sum;
      }
      


      and it is posted by a command link command:
      <a4j:commandLink reRender="view" title="Save">
       <a4j:actionparam name="columns" value="getGridColumns()" noEscape="true" assignTo="#{backingBean.gridColumnState}"></a4j:actionparam>
       ...
      </a4j:commandLink>
      


      But I need that column widths are posted by each ajax-request.
      So I can do it with a inputHidden, but I must set its value on after column resized. That is why I need to hook JS-Resize-Event of columns.

      Or is there another way to get column widths on server side? Component-State or something like that?

      Thanks in advance!