Hello! I think, column passed to QueryModel::fieldName(column) is considered 0-based index, not 1-based number.
Rows and columns are 0-based in Wt Model/View system. On Sat, Sep 22, 2012 at 3:11 AM, Craig Miller <craig.mil...@spatialminds.com> wrote: > I can work around this, so I don't need a fix but I think the > QueryModel::fieldName() method has an off by one index error. > > The following code returns the header name for column 1 when fetching > fieldName(0), header for column 2 when fetching (fieldName(1), etc. > > // Output headers > int colCount = pOpHistoryModel->columnCount(); > for (int col = 0; col < colCount; col++) > { > response.out() << pOpHistoryModel->fieldName(col); > > // Another element? Add a comma > if (col+1 < colCount) > { > response.out() << ","; > } > // Last item add a newline > else > { > response.out() << endl; > } > } > > Craig > > Craig Miller > http://spatialminds.com > > > > > ------------------------------------------------------------------------------ > Got visibility? > Most devs has no idea what their production app looks like. > Find out how fast your code is with AppDynamics Lite. > http://ad.doubleclick.net/clk;262219671;13503038;y? > http://info.appdynamics.com/FreeJavaPerformanceDownload.html > _______________________________________________ > witty-interest mailing list > witty-interest@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/witty-interest ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest