I can't reproduce this bug. I am using Wt 3.2.1

For me, fieldName(0) returns name for column 0 (first column),
fieldName(1) -- for column 1 (second column) etc.

>The following code returns the header name for column 1 when fetching 
>fieldName(0), header for column 2 when fetching (fieldName(1), etc.
What argument is passed to get header name for column 0?

Could you write full compilable example to reproduce this bug, please?

On Sun, Sep 23, 2012 at 9:47 PM, Spatial Minds
<craig.mil...@spatialminds.com> wrote:
> Yes and code to replicate the bug uses 0 based indexes.
>
>
>
> On Sep 23, 2012, at 8:14 AM, Nagaev Boris <bnag...@gmail.com> wrote:
>
>> 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
>
> ------------------------------------------------------------------------------
> 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

------------------------------------------------------------------------------
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

Reply via email to