I need a way to display the row number in a table view foundset. After doing a search, the result is displayed in table form, so Its like having the first column of the foundset to display the row number.
The only successful way of doing this seems to be creating a calculation that returns nothing and the looping the foundset after the search and assigning a counter to the calculation. However the problem of this method is that it slows down the process dramatically. I need to process hundreds of records. So looping the foundset is not an option.
Is there any way of doing this?
I tried using a calculation as follows
function calculation_sequence()
{
return currentRecordIndex;
}
but this is not consistent. Sometimes it works and sometimes it does not. I also have to sort the foundset after the search. So the row number should ideally populate after the sort.
Try to create another label as label for of the %%currentRecordIndex%% and set the text you want. If you don´t want text only put a space (" ").
In Servoy 5 it works.
victor.rojo:
Try to create another label as label for of the %%currentRecordIndex%% and set the text you want. If you don´t want text only put a space (" ").
In Servoy 5 it works.
How should this work?? A label from a label without anything in text property?
%%currentRecordIndex%% is only working as standard tag in the titleText or text property of a field/label. Perhaps you mean a calculation of “currentRecordIndex”. For that I can set an emty titleText property. But this is not (more) supported.
Sorry, maybe I was not clear.
I just tested it in Servoy 6 and it works:
[attachment=0]Captura de pantalla 2011-10-07 a la(s) 15.14.47.png[/attachment]
label_1 is the label with text set as “%%currentRecordIndex%%”.
labelfor_1 is the label with text set as " " and labelFor “label_1”.
Thank you Victor for your explaination and example!
Learning never ends. Placing labels on a table view list for titleText headers is new for me and a really cool solution.
I know that this is a “stale” thread, but I’m wondering if there’s a way to do this with the default headers, rather than using manually-inserted headers, so that users can sort, resize, etc. I have the problem mentioned with the label of the first column.
djlapin:
I know that this is a “stale” thread, but I’m wondering if there’s a way to do this with the default headers, rather than using manually-inserted headers, so that users can sort, resize, etc. I have the problem mentioned with the label of the first column.
Hi Don,
you also have to set a label ahead the first column with blank (" ") text or anything else (e.g. “No”). Think about to set the property ‘labelFor’ of the headerlabel to the field/label it belongs.
Look at Victor’s example a couple of posts above!