-
1. Re: [ scrollableDataTable ] Performance issues
alexmreis Oct 22, 2007 4:45 PM (in response to alexmreis)Seems the image didnt work...
Here's the profiler output
http://alexeshadow.googlepages.com/profiling -
3. Re: [ scrollableDataTable ] Performance issues
alexmreis Oct 22, 2007 4:48 PM (in response to alexmreis)Oh man... another post with errors... Moderator, pretty please enable post editing lol
This one's right:
http://alexeshadow.googlepages.com/profiling.jpg -
4. Re: [ scrollableDataTable ] Performance issues
maksimkaszynski Oct 23, 2007 6:13 AM (in response to alexmreis)what's value of your dataTable's 'rows' attribute
-
5. Re: [ scrollableDataTable ] Performance issues
amitev Oct 23, 2007 7:36 AM (in response to alexmreis)Btw what profiling are you using?
-
6. Re: [ scrollableDataTable ] Performance issues
amitev Oct 23, 2007 7:37 AM (in response to alexmreis)ah firebug profiler sorry
-
7. Re: [ scrollableDataTable ] Performance issues
alexmreis Oct 23, 2007 8:13 AM (in response to alexmreis)I have it set to table.setRows(50);
Here's my code snippet that builds the table dynamically:public HtmlScrollableDataTable buildConsulta() throws ImportacaoException { HtmlScrollableDataTable table = (HtmlScrollableDataTable) app .createComponent(HtmlScrollableDataTable.COMPONENT_TYPE); table.setVar(TABLE_VAR); table.setId("tabelaConsultar"); table.setRendered(true); table.setValueBinding("value", app .createValueBinding("#{consultar.listaPedidos}")); table.setStyleClass("table"); table.setHeaderClass("tableHeader"); table.setRowClasses("oddRow, evenRow"); table.setRows(50); table.setWidth("98%"); table.setHeight("500px"); addColumnsConsulta(table); return table; } @SuppressWarnings("unchecked") private void addColumnsConsulta(HtmlScrollableDataTable table) throws ImportacaoException { Application app = FacesContext.getCurrentInstance().getApplication(); ArrayList<Coluna> colunas = Coluna.getColunas(); Collections.sort(colunas); for (Coluna c : colunas) { HtmlColumn column = (HtmlColumn) app .createComponent(HtmlColumn.COMPONENT_TYPE); column.setId(c.getId()); column.setWidth((c.getTamanho() * 10) + "px"); HtmlOutputText header = (HtmlOutputText) app .createComponent(HtmlOutputText.COMPONENT_TYPE); header.setEscape(false); header.setValue(assembleHeader(c)); header.setId("header" + c.getNome() + header.hashCode()); column.getFacets().put("header", header); UIInput input = null; input = assembleInputField(c); input.setId("input" + c.getNome() + input.hashCode()); column.getChildren().add(input); HtmlMessage msg = (HtmlMessage) app.createComponent(HtmlMessage.COMPONENT_TYPE); msg.setFor(input.getId()); msg.setId("message" + c.getNome() + msg.hashCode()); msg.setRendered(true); column.getChildren().add(msg); column.setRendered(c.canView()); table.getChildren().add(column); } } private HtmlInputText assembleInputField(Coluna c) { HtmlInputText campo = (HtmlInputText) app .createComponent(HtmlInputText.COMPONENT_TYPE); setTipo(campo, c); campo.setDisabled(!c.canEdit()); campo.setMaxlength(c.getTamanho()); campo.setSize(c.getTamanho()); campo.setValueBinding("value", app.createValueBinding("#{" + TABLE_VAR + "." + c.getElExpression() + "}")); return campo; }
-
8. Re: [ scrollableDataTable ] Performance issues
alexmreis Oct 24, 2007 9:05 AM (in response to alexmreis)Ok, I set the rows property to the same amount of rows that are visible on-screen (18) and it worked fine, with a minor impact on usability since now any scrolling triggers AJAX updating.
I'd suggest the RF team to look into some form of what I would call "Lazy rendering". that is, rendering only what's visible, and on scroll render the next parts, even though the data for it would be (in part) already in the client. I can try to put some work on it and submit a patch if it's ok with the team.
Cheers,
Alex