Program: 143643
Project: 143643
Buggy source:
public WebCellBasedView(final String id,final IApplication application,RuntimePortal scriptable,final Form form,final AbstractBase cellview,final IDataProviderLookup dataProviderLookup,final IScriptExecuter el,boolean addHeaders,final int startY,final int endY,final int sizeHint,int viewType){
  super(id);
  this.application=application;
  this.cellview=cellview;
  this.fc=el.getFormController();
  this.addHeaders=addHeaders;
  this.startY=startY;
  this.endY=endY;
  this.formDesignHeight=form.getSize().height;
  this.sizeHint=sizeHint;
  this.viewType=viewType;
  this.bodyWidthHint=form.getWidth();
  useAJAX=Utils.getAsBoolean(application.getRuntimeProperties().get("String_Node_Str"));
  useAnchors=Utils.getAsBoolean(application.getRuntimeProperties().get("String_Node_Str"));
  setOutputMarkupPlaceholderTag(true);
  dataRendererOnRenderWrapper=new DataRendererOnRenderWrapper(this);
  loadingInfo=new Label("String_Node_Str","String_Node_Str");
  loadingInfo.setVisible(false);
  add(loadingInfo);
  if (!useAJAX)   bodyHeightHint=sizeHint;
  String orientation=OrientationApplier.getHTMLContainerOrientation(application.getLocale(),application.getSolution().getTextOrientation());
  isLeftToRightOrientation=!OrientationApplier.RTL.equalsIgnoreCase(orientation);
  int tFormHeight=0;
  Iterator<Part> partIte=form.getParts();
  while (partIte.hasNext()) {
    Part p=partIte.next();
    if (p.getPartType() == Part.BODY) {
      tFormHeight=p.getHeight() - startY;
      break;
    }
  }
  formBodySize=new Dimension(form.getWidth(),tFormHeight);
  ChangesRecorder jsChangeRecorder=new ChangesRecorder(null,null){
    @Override public boolean isChanged(){
      boolean retval=false;
      if (super.isChanged()) {
        retval=true;
        return retval;
      }
      if (!retval) {
        Iterator<Component> iterator=elementToColumnIdentifierComponent.values().iterator();
        while (iterator.hasNext()) {
          Component object=iterator.next();
          if (object instanceof IProviderStylePropertyChanges) {
            if (((IProviderStylePropertyChanges)object).getStylePropertyChanges().isChanged()) {
              retval=true;
              break;
            }
          }
        }
      }
      if (retval) {
        MainPage page=(MainPage)getPage();
        page.getPageContributor().addTableToRender(WebCellBasedView.this);
        setRendered();
      }
      return false;
    }
    @Override public void setRendered(){
      super.setRendered();
      Iterator<Component> iterator=elementToColumnIdentifierComponent.values().iterator();
      while (iterator.hasNext()) {
        Component comp=iterator.next();
        if (comp instanceof IProviderStylePropertyChanges) {
          ((IProviderStylePropertyChanges)comp).getStylePropertyChanges().setRendered();
        }
      }
    }
  }
;
  this.scriptable=scriptable;
  ((ChangesRecorder)scriptable.getChangesRecorder()).setAdditionalChangesRecorder(jsChangeRecorder);
  add(TooltipAttributeModifier.INSTANCE);
  add(new StyleAppendingModifier(new Model<String>(){
    private static final long serialVersionUID=1L;
    @Override public String getObject(){
      if (isScrollMode())       return "String_Node_Str";
      if (findParent(IWebFormContainer.class) != null) {
        return "String_Node_Str";
      }
      return "String_Node_Str";
    }
  }
));
  if (cellview instanceof BaseComponent) {
    ComponentFactory.applyBasicComponentProperties(application,this,(BaseComponent)cellview,ComponentFactory.getStyleForBasicComponent(application,cellview,form));
  }
  boolean sortable=true;
  String initialSortString=null;
  int onRenderMethodID=0;
  AbstractBase onRenderPersist=null;
  if (cellview instanceof Portal) {
    Portal p=(Portal)cellview;
    setRowBGColorScript(p.getRowBGColorCalculation(),p.getInstanceMethodArguments("String_Node_Str"));
    sortable=p.getSortable();
    initialSortString=p.getInitialSort();
    onRenderMethodID=p.getOnRenderMethodID();
    onRenderPersist=p;
    int portalAnchors=p.getAnchors();
    isAnchored=(((portalAnchors & IAnchorConstants.NORTH) > 0) && ((portalAnchors & IAnchorConstants.SOUTH) > 0)) || (((portalAnchors & IAnchorConstants.EAST) > 0) && ((portalAnchors & IAnchorConstants.WEST) > 0));
  }
 else   if (cellview instanceof Form) {
    initialSortString=form.getInitialSort();
    onRenderMethodID=form.getOnRenderMethodID();
    onRenderPersist=form;
    isAnchored=true;
  }
  if (onRenderMethodID > 0) {
    dataRendererOnRenderWrapper.getRenderEventExecutor().setRenderCallback(Integer.toString(onRenderMethodID),Utils.parseJSExpressions(onRenderPersist.getInstanceMethodArguments("String_Node_Str")));
    dataRendererOnRenderWrapper.getRenderEventExecutor().setRenderScriptExecuter(fc != null ? fc.getScriptExecuter() : null);
  }
  initDragNDrop(fc,startY);
  if (sortable) {
    if (initialSortString != null) {
      StringTokenizer tokByComma=new StringTokenizer(initialSortString,"String_Node_Str");
      while (tokByComma.hasMoreTokens()) {
        String initialSortFirstToken=tokByComma.nextToken();
        StringTokenizer tokBySpace=new StringTokenizer(initialSortFirstToken);
        if (tokBySpace.hasMoreTokens()) {
          String initialSortColumnName=tokBySpace.nextToken();
          if (tokBySpace.hasMoreTokens()) {
            String sortDir=tokBySpace.nextToken();
            boolean initialSortAsc=true;
            if (sortDir.equalsIgnoreCase("String_Node_Str"))             initialSortAsc=false;
            initialSortColumnNames.put(initialSortColumnName,new Boolean(initialSortAsc));
          }
        }
      }
    }
    if (initialSortColumnNames.size() == 0) {
      try {
        String dataSource=null;
        if (cellview instanceof Portal) {
          Portal p=(Portal)cellview;
          String relation=p.getRelationName();
          int lastDot=relation.lastIndexOf("String_Node_Str");
          if (lastDot >= 0) {
            relation=relation.substring(lastDot + 1);
          }
          Relation rel=application.getFlattenedSolution().getRelation(relation);
          if (rel != null) {
            dataSource=rel.getForeignDataSource();
          }
        }
 else {
          dataSource=form.getDataSource();
        }
        if (dataSource != null) {
          Iterator<String> pkColumnNames=application.getFoundSetManager().getTable(dataSource).getRowIdentColumnNames();
          while (pkColumnNames.hasNext()) {
            initialSortColumnNames.put(pkColumnNames.next(),Boolean.TRUE);
          }
        }
      }
 catch (      RepositoryException e) {
        Debug.log("String_Node_Str",e);
      }
    }
  }
  maxHeight=0;
  try {
    Iterator<IPersist> components=cellview.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
    while (components.hasNext()) {
      IPersist element=components.next();
      if (element instanceof Field || element instanceof GraphicalComponent) {
        if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
          labelsFor.put(((GraphicalComponent)element).getLabelFor(),element);
          continue;
        }
        Point l=((IFormElement)element).getLocation();
        if (l == null) {
          continue;
        }
        if (l.y >= startY && l.y < endY) {
          int height=((IFormElement)element).getSize().height;
          if (height > maxHeight)           maxHeight=height;
        }
      }
    }
    if (maxHeight == 0)     maxHeight=20;
  }
 catch (  Exception ex1) {
    Debug.error("String_Node_Str",ex1);
  }
  tableContainerBody=new WebMarkupContainer("String_Node_Str");
  tableContainerBody.setOutputMarkupId(true);
  table=new WebCellBasedViewListView("String_Node_Str",data,1,cellview,dataProviderLookup,el,startY,endY,form);
  table.setReuseItems(true);
  tableContainerBody.add(table);
  add(tableContainerBody);
  final LinkedHashMap<String,IDataAdapter> dataadapters=new LinkedHashMap<String,IDataAdapter>();
  final SortedList<IPersist> columnTabSequence=new SortedList<IPersist>(TabSeqComparator.INSTANCE);
  createComponents(application,form,cellview,dataProviderLookup,el,startY,endY,new ItemAdd(){
    public void add(    IPersist element,    Component comp){
      if (element instanceof IFormElement && comp instanceof IComponent) {
        ((IComponent)comp).setLocation(((IFormElement)element).getLocation());
        ((IComponent)comp).setSize(((IFormElement)element).getSize());
      }
      elementToColumnIdentifierComponent.put(element,comp);
      if (cellview instanceof Form && element instanceof ISupportTabSeq && ((ISupportTabSeq)element).getTabSeq() >= 0) {
        columnTabSequence.add(element);
      }
      if (comp instanceof IDisplayData) {
        String dataprovider=((IDisplayData)comp).getDataProviderID();
        WebCellAdapter previous=(WebCellAdapter)dataadapters.get(dataprovider);
        if (previous == null) {
          WebCellAdapter wca=new WebCellAdapter(dataprovider,WebCellBasedView.this);
          dataadapters.put(dataprovider,wca);
        }
        if (dataprovider != null) {
          if (initialSortColumnNames.containsKey(dataprovider))           initialSortedColumns.put(comp.getId(),initialSortColumnNames.get(dataprovider));
        }
      }
    }
  }
);
  for (int i=columnTabSequence.size() - 1; i >= 0; i--) {
    elementTabIndexes.put(columnTabSequence.get(i),Integer.valueOf(i));
  }
  if (addHeaders) {
    headers=new SortableCellViewHeaders(form,this,"String_Node_Str",table,cellview,application,initialSortedColumns,new IHeaders(){
      public void registerHeader(      IPersist matchingElement,      Component headerComponent){
        SortableCellViewHeader sortableHeader=(SortableCellViewHeader)headerComponent;
        Component columnIdentifier=WebCellBasedView.this.elementToColumnIdentifierComponent.get(matchingElement);
        if (columnIdentifier instanceof IProviderStylePropertyChanges) {
          String width=(String)((IProviderStylePropertyChanges)columnIdentifier).getStylePropertyChanges().getChanges().get("String_Node_Str");
          if (width != null) {
            sortableHeader.setWidth(Integer.parseInt(width.substring(0,width.length() - 2)));
          }
 else           if (matchingElement instanceof BaseComponent)           sortableHeader.setWidth(((BaseComponent)matchingElement).getSize().width);
        }
        sortableHeader.setTabSequenceIndex(tabIndex);
        sortableHeader.setScriptExecuter(el);
        sortableHeader.setResizeClass(columnIdentifier.getId());
        WebCellBasedView.this.registerHeader(matchingElement,headerComponent);
      }
    }
);
    add(headers);
  }
  if (useAJAX) {
    add(pagingNavigator=new ServoyAjaxPagingNavigator("String_Node_Str",table));
    add(tableResizeBehavior=new ServoyTableResizeBehavior(startY,endY,cellview));
  }
 else {
    add(pagingNavigator=new ServoySubmitPagingNavigator("String_Node_Str",table));
  }
  final int scrollbars=(cellview instanceof ISupportScrollbars) ? ((ISupportScrollbars)cellview).getScrollbars() : 0;
  showPageNavigator=!((scrollbars & ISupportScrollbars.VERTICAL_SCROLLBAR_NEVER) == ISupportScrollbars.VERTICAL_SCROLLBAR_NEVER);
  try {
    if (cellview instanceof Portal) {
      relationName=((Portal)cellview).getRelationName();
      Relation[] rels=application.getFlattenedSolution().getRelationSequence(((Portal)cellview).getRelationName());
      if (rels != null) {
        Relation r=rels[rels.length - 1];
        if (r != null) {
          defaultSort=((FoundSetManager)application.getFoundSetManager()).getSortColumns(application.getFoundSetManager().getTable(r.getForeignDataSource()),((Portal)cellview).getInitialSort());
        }
      }
    }
 else {
      defaultSort=((FoundSetManager)application.getFoundSetManager()).getSortColumns(((Form)cellview).getDataSource(),((Form)cellview).getInitialSort());
    }
  }
 catch (  RepositoryException e) {
    Debug.error(e);
    defaultSort=new ArrayList<SortColumn>(1);
  }
  try {
    dal=new DataAdapterList(application,dataProviderLookup,elementToColumnIdentifierComponent,el.getFormController(),dataadapters,null);
  }
 catch (  RepositoryException ex) {
    Debug.error(ex);
  }
  Object defaultScrollable=application.getClientProperty(IApplication.TABLEVIEW_WC_DEFAULT_SCROLLABLE);
  setScrollMode(Boolean.TRUE.equals(defaultScrollable));
  table.setPageabeMode(!isScrollMode());
  if (isScrollMode()) {
    tableContainerBody.add(new StyleAppendingModifier(new Model<String>(){
      private static final long serialVersionUID=1L;
      @Override public String getObject(){
        String overflow="String_Node_Str";
        if ((scrollbars & ISupportScrollbars.HORIZONTAL_SCROLLBAR_NEVER) == ISupportScrollbars.HORIZONTAL_SCROLLBAR_NEVER) {
          overflow+="String_Node_Str";
        }
 else         if ((scrollbars & ISupportScrollbars.HORIZONTAL_SCROLLBAR_ALWAYS) == ISupportScrollbars.HORIZONTAL_SCROLLBAR_ALWAYS) {
          overflow+="String_Node_Str";
        }
 else {
          overflow+="String_Node_Str";
        }
        if ((scrollbars & ISupportScrollbars.VERTICAL_SCROLLBAR_NEVER) == ISupportScrollbars.VERTICAL_SCROLLBAR_NEVER) {
          overflow+="String_Node_Str";
        }
 else         if ((scrollbars & ISupportScrollbars.VERTICAL_SCROLLBAR_ALWAYS) == ISupportScrollbars.VERTICAL_SCROLLBAR_ALWAYS) {
          overflow+="String_Node_Str";
        }
 else {
          overflow+="String_Node_Str";
        }
        return overflow + "String_Node_Str";
      }
    }
));
    tableContainerBody.add(scrollBehavior=new ScrollBehavior("String_Node_Str"));
  }
  add(new StyleAppendingModifier(new Model<String>(){
    private static final long serialVersionUID=1L;
    @Override public String getObject(){
      WebForm container=findParent(WebForm.class);
      if (container != null && container.getBorder() instanceof TitledBorder) {
        int offset=((TitledBorder)container.getBorder()).getTitleFont().getSize() + 4;
        return "String_Node_Str" + offset + "String_Node_Str";
      }
      return "String_Node_Str";
    }
  }
){
    @Override public boolean isEnabled(    Component component){
      WebForm container=component.findParent(WebForm.class);
      if (container != null && container.getBorder() instanceof TitledBorder) {
        return super.isEnabled(component);
      }
      return false;
    }
  }
);
}

Fixed version (ground truth):
public WebCellBasedView(final String id,final IApplication application,RuntimePortal scriptable,final Form form,final AbstractBase cellview,final IDataProviderLookup dataProviderLookup,final IScriptExecuter el,boolean addHeaders,final int startY,final int endY,final int sizeHint,int viewType){
  super(id);
  this.application=application;
  this.cellview=cellview;
  this.fc=el.getFormController();
  this.addHeaders=addHeaders;
  this.startY=startY;
  this.endY=endY;
  this.formDesignHeight=form.getSize().height;
  this.sizeHint=sizeHint;
  this.viewType=viewType;
  this.bodyWidthHint=form.getWidth();
  useAJAX=Utils.getAsBoolean(application.getRuntimeProperties().get("String_Node_Str"));
  useAnchors=Utils.getAsBoolean(application.getRuntimeProperties().get("String_Node_Str"));
  setOutputMarkupPlaceholderTag(true);
  dataRendererOnRenderWrapper=new DataRendererOnRenderWrapper(this);
  loadingInfo=new Label("String_Node_Str","String_Node_Str");
  loadingInfo.setVisible(false);
  add(loadingInfo);
  if (!useAJAX)   bodyHeightHint=sizeHint;
  String orientation=OrientationApplier.getHTMLContainerOrientation(application.getLocale(),application.getSolution().getTextOrientation());
  isLeftToRightOrientation=!OrientationApplier.RTL.equalsIgnoreCase(orientation);
  int tFormHeight=0;
  Iterator<Part> partIte=form.getParts();
  while (partIte.hasNext()) {
    Part p=partIte.next();
    if (p.getPartType() == Part.BODY) {
      tFormHeight=p.getHeight() - startY;
      break;
    }
  }
  formBodySize=new Dimension(form.getWidth(),tFormHeight);
  ChangesRecorder jsChangeRecorder=new ChangesRecorder(null,null){
    @Override public boolean isChanged(){
      boolean retval=false;
      if (super.isChanged()) {
        retval=true;
        return retval;
      }
      if (!retval) {
        Iterator<Component> iterator=elementToColumnIdentifierComponent.values().iterator();
        while (iterator.hasNext()) {
          Component object=iterator.next();
          if (object instanceof IProviderStylePropertyChanges) {
            if (((IProviderStylePropertyChanges)object).getStylePropertyChanges().isChanged()) {
              retval=true;
              break;
            }
          }
        }
      }
      if (retval) {
        MainPage page=(MainPage)getPage();
        page.getPageContributor().addTableToRender(WebCellBasedView.this);
        setRendered();
      }
      return false;
    }
    @Override public void setRendered(){
      super.setRendered();
      Iterator<Component> iterator=elementToColumnIdentifierComponent.values().iterator();
      while (iterator.hasNext()) {
        Component comp=iterator.next();
        if (comp instanceof IProviderStylePropertyChanges) {
          ((IProviderStylePropertyChanges)comp).getStylePropertyChanges().setRendered();
        }
      }
    }
  }
;
  this.scriptable=scriptable;
  ((ChangesRecorder)scriptable.getChangesRecorder()).setAdditionalChangesRecorder(jsChangeRecorder);
  add(TooltipAttributeModifier.INSTANCE);
  final int scrollbars=(cellview instanceof ISupportScrollbars) ? ((ISupportScrollbars)cellview).getScrollbars() : 0;
  add(new StyleAppendingModifier(new Model<String>(){
    private static final long serialVersionUID=1L;
    @Override public String getObject(){
      if (isScrollMode())       return "String_Node_Str";
      if (cellview instanceof Portal) {
        return scrollBarDefinitioToOverflowAttribute(scrollbars);
      }
      if (findParent(IWebFormContainer.class) != null) {
        return "String_Node_Str";
      }
      return "String_Node_Str";
    }
  }
));
  if (cellview instanceof BaseComponent) {
    ComponentFactory.applyBasicComponentProperties(application,this,(BaseComponent)cellview,ComponentFactory.getStyleForBasicComponent(application,cellview,form));
  }
  boolean sortable=true;
  String initialSortString=null;
  int onRenderMethodID=0;
  AbstractBase onRenderPersist=null;
  if (cellview instanceof Portal) {
    Portal p=(Portal)cellview;
    setRowBGColorScript(p.getRowBGColorCalculation(),p.getInstanceMethodArguments("String_Node_Str"));
    sortable=p.getSortable();
    initialSortString=p.getInitialSort();
    onRenderMethodID=p.getOnRenderMethodID();
    onRenderPersist=p;
    int portalAnchors=p.getAnchors();
    isAnchored=(((portalAnchors & IAnchorConstants.NORTH) > 0) && ((portalAnchors & IAnchorConstants.SOUTH) > 0)) || (((portalAnchors & IAnchorConstants.EAST) > 0) && ((portalAnchors & IAnchorConstants.WEST) > 0));
  }
 else   if (cellview instanceof Form) {
    initialSortString=form.getInitialSort();
    onRenderMethodID=form.getOnRenderMethodID();
    onRenderPersist=form;
    isAnchored=true;
  }
  if (onRenderMethodID > 0) {
    dataRendererOnRenderWrapper.getRenderEventExecutor().setRenderCallback(Integer.toString(onRenderMethodID),Utils.parseJSExpressions(onRenderPersist.getInstanceMethodArguments("String_Node_Str")));
    dataRendererOnRenderWrapper.getRenderEventExecutor().setRenderScriptExecuter(fc != null ? fc.getScriptExecuter() : null);
  }
  initDragNDrop(fc,startY);
  if (sortable) {
    if (initialSortString != null) {
      StringTokenizer tokByComma=new StringTokenizer(initialSortString,"String_Node_Str");
      while (tokByComma.hasMoreTokens()) {
        String initialSortFirstToken=tokByComma.nextToken();
        StringTokenizer tokBySpace=new StringTokenizer(initialSortFirstToken);
        if (tokBySpace.hasMoreTokens()) {
          String initialSortColumnName=tokBySpace.nextToken();
          if (tokBySpace.hasMoreTokens()) {
            String sortDir=tokBySpace.nextToken();
            boolean initialSortAsc=true;
            if (sortDir.equalsIgnoreCase("String_Node_Str"))             initialSortAsc=false;
            initialSortColumnNames.put(initialSortColumnName,new Boolean(initialSortAsc));
          }
        }
      }
    }
    if (initialSortColumnNames.size() == 0) {
      try {
        String dataSource=null;
        if (cellview instanceof Portal) {
          Portal p=(Portal)cellview;
          String relation=p.getRelationName();
          int lastDot=relation.lastIndexOf("String_Node_Str");
          if (lastDot >= 0) {
            relation=relation.substring(lastDot + 1);
          }
          Relation rel=application.getFlattenedSolution().getRelation(relation);
          if (rel != null) {
            dataSource=rel.getForeignDataSource();
          }
        }
 else {
          dataSource=form.getDataSource();
        }
        if (dataSource != null) {
          Iterator<String> pkColumnNames=application.getFoundSetManager().getTable(dataSource).getRowIdentColumnNames();
          while (pkColumnNames.hasNext()) {
            initialSortColumnNames.put(pkColumnNames.next(),Boolean.TRUE);
          }
        }
      }
 catch (      RepositoryException e) {
        Debug.log("String_Node_Str",e);
      }
    }
  }
  maxHeight=0;
  try {
    Iterator<IPersist> components=cellview.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
    while (components.hasNext()) {
      IPersist element=components.next();
      if (element instanceof Field || element instanceof GraphicalComponent) {
        if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
          labelsFor.put(((GraphicalComponent)element).getLabelFor(),element);
          continue;
        }
        Point l=((IFormElement)element).getLocation();
        if (l == null) {
          continue;
        }
        if (l.y >= startY && l.y < endY) {
          int height=((IFormElement)element).getSize().height;
          if (height > maxHeight)           maxHeight=height;
        }
      }
    }
    if (maxHeight == 0)     maxHeight=20;
  }
 catch (  Exception ex1) {
    Debug.error("String_Node_Str",ex1);
  }
  tableContainerBody=new WebMarkupContainer("String_Node_Str");
  tableContainerBody.setOutputMarkupId(true);
  table=new WebCellBasedViewListView("String_Node_Str",data,1,cellview,dataProviderLookup,el,startY,endY,form);
  table.setReuseItems(true);
  tableContainerBody.add(table);
  add(tableContainerBody);
  final LinkedHashMap<String,IDataAdapter> dataadapters=new LinkedHashMap<String,IDataAdapter>();
  final SortedList<IPersist> columnTabSequence=new SortedList<IPersist>(TabSeqComparator.INSTANCE);
  createComponents(application,form,cellview,dataProviderLookup,el,startY,endY,new ItemAdd(){
    public void add(    IPersist element,    Component comp){
      if (element instanceof IFormElement && comp instanceof IComponent) {
        ((IComponent)comp).setLocation(((IFormElement)element).getLocation());
        ((IComponent)comp).setSize(((IFormElement)element).getSize());
      }
      elementToColumnIdentifierComponent.put(element,comp);
      if (cellview instanceof Form && element instanceof ISupportTabSeq && ((ISupportTabSeq)element).getTabSeq() >= 0) {
        columnTabSequence.add(element);
      }
      if (comp instanceof IDisplayData) {
        String dataprovider=((IDisplayData)comp).getDataProviderID();
        WebCellAdapter previous=(WebCellAdapter)dataadapters.get(dataprovider);
        if (previous == null) {
          WebCellAdapter wca=new WebCellAdapter(dataprovider,WebCellBasedView.this);
          dataadapters.put(dataprovider,wca);
        }
        if (dataprovider != null) {
          if (initialSortColumnNames.containsKey(dataprovider))           initialSortedColumns.put(comp.getId(),initialSortColumnNames.get(dataprovider));
        }
      }
    }
  }
);
  for (int i=columnTabSequence.size() - 1; i >= 0; i--) {
    elementTabIndexes.put(columnTabSequence.get(i),Integer.valueOf(i));
  }
  if (addHeaders) {
    headers=new SortableCellViewHeaders(form,this,"String_Node_Str",table,cellview,application,initialSortedColumns,new IHeaders(){
      public void registerHeader(      IPersist matchingElement,      Component headerComponent){
        SortableCellViewHeader sortableHeader=(SortableCellViewHeader)headerComponent;
        Component columnIdentifier=WebCellBasedView.this.elementToColumnIdentifierComponent.get(matchingElement);
        if (columnIdentifier instanceof IProviderStylePropertyChanges) {
          String width=(String)((IProviderStylePropertyChanges)columnIdentifier).getStylePropertyChanges().getChanges().get("String_Node_Str");
          if (width != null) {
            sortableHeader.setWidth(Integer.parseInt(width.substring(0,width.length() - 2)));
          }
 else           if (matchingElement instanceof BaseComponent)           sortableHeader.setWidth(((BaseComponent)matchingElement).getSize().width);
        }
        sortableHeader.setTabSequenceIndex(tabIndex);
        sortableHeader.setScriptExecuter(el);
        sortableHeader.setResizeClass(columnIdentifier.getId());
        WebCellBasedView.this.registerHeader(matchingElement,headerComponent);
      }
    }
);
    add(headers);
  }
  if (useAJAX) {
    add(pagingNavigator=new ServoyAjaxPagingNavigator("String_Node_Str",table));
    add(tableResizeBehavior=new ServoyTableResizeBehavior(startY,endY,cellview));
  }
 else {
    add(pagingNavigator=new ServoySubmitPagingNavigator("String_Node_Str",table));
  }
  showPageNavigator=!((scrollbars & ISupportScrollbars.VERTICAL_SCROLLBAR_NEVER) == ISupportScrollbars.VERTICAL_SCROLLBAR_NEVER);
  try {
    if (cellview instanceof Portal) {
      relationName=((Portal)cellview).getRelationName();
      Relation[] rels=application.getFlattenedSolution().getRelationSequence(((Portal)cellview).getRelationName());
      if (rels != null) {
        Relation r=rels[rels.length - 1];
        if (r != null) {
          defaultSort=((FoundSetManager)application.getFoundSetManager()).getSortColumns(application.getFoundSetManager().getTable(r.getForeignDataSource()),((Portal)cellview).getInitialSort());
        }
      }
    }
 else {
      defaultSort=((FoundSetManager)application.getFoundSetManager()).getSortColumns(((Form)cellview).getDataSource(),((Form)cellview).getInitialSort());
    }
  }
 catch (  RepositoryException e) {
    Debug.error(e);
    defaultSort=new ArrayList<SortColumn>(1);
  }
  try {
    dal=new DataAdapterList(application,dataProviderLookup,elementToColumnIdentifierComponent,el.getFormController(),dataadapters,null);
  }
 catch (  RepositoryException ex) {
    Debug.error(ex);
  }
  Object defaultScrollable=application.getClientProperty(IApplication.TABLEVIEW_WC_DEFAULT_SCROLLABLE);
  setScrollMode(Boolean.TRUE.equals(defaultScrollable));
  table.setPageabeMode(!isScrollMode());
  if (isScrollMode()) {
    tableContainerBody.add(new StyleAppendingModifier(new Model<String>(){
      private static final long serialVersionUID=1L;
      @Override public String getObject(){
        return scrollBarDefinitioToOverflowAttribute(scrollbars) + "String_Node_Str";
      }
    }
));
    tableContainerBody.add(scrollBehavior=new ScrollBehavior("String_Node_Str"));
  }
  add(new StyleAppendingModifier(new Model<String>(){
    private static final long serialVersionUID=1L;
    @Override public String getObject(){
      WebForm container=findParent(WebForm.class);
      if (container != null && container.getBorder() instanceof TitledBorder) {
        int offset=((TitledBorder)container.getBorder()).getTitleFont().getSize() + 4;
        return "String_Node_Str" + offset + "String_Node_Str";
      }
      return "String_Node_Str";
    }
  }
){
    @Override public boolean isEnabled(    Component component){
      WebForm container=component.findParent(WebForm.class);
      if (container != null && container.getBorder() instanceof TitledBorder) {
        return super.isEnabled(component);
      }
      return false;
    }
  }
);
}