[Cartoweb-dev] Table invisible?

Carolin Latze carolin.latze at unifr.ch
Wed Oct 31 04:25:50 EDT 2007


Hi all,

I really want to understand it, so does anybody know the meaning of
totalRows and numRows? For me, it sounds similar, but I experienced,
that you do not need to set numRows, but there is no need for totalRows.

Thanks
Carolin

Oliver Christen wrote:
> well, you did a $table->totalRows = 1;
> and I dont see any $table->numRows = .. in your code, so I presume it
> is normal.
> as far as I know, these properties are not generated automaticaly so
> it really depend what value you give them
>
> I never used the Table object though so I dont know much about its usage
>
> regards
> Oliver
>
>> Hi Oliver,
>>
>> the problem was much easier: I used $table->totalRows instead of
>> $table->numRows. Using $table->numRows the table will be shown... can
>> you explain that?
>>
>> Regards
>> Carolin
>>
>> Oliver Christen wrote:
>>> depends if you are working with Ajax mode on or off.
>>>
>>> if off, simply be sure you have the correct variables set in your
>>> plugin renderForm function
>>>
>>> if on, same as above but you also need to have the corresponding code
>>> in your plugin .ajax.js file to tell the script where to write the new
>>> content.
>>>
>>> regards
>>> Oliver
>>>
>>>
>>>> Hi all,
>>>>
>>>> I try to write  a plugin which shoulds its result as table very
>>>> similar
>>>> to the query coreplugin. I had a deeper look at the query
>>>> handlePreDrawing method. I now tried to reproduce its functionality:
>>>>
>>>> public function handlePreDrawing($tabularInformationRequest){
>>>>
>>>>        $this->log->debug("tabularInformationRequest->layr
>>>> (handlePreDrawing): ".$tabularInformationRequest->layr);
>>>>        $tabularInformationResult = new TabularInformationResult();
>>>>        $tables = array();
>>>>
>>>>        $table = new Table;
>>>>        $table->tableId = $tabularInformationRequest->layr;
>>>>        $table->tableTitle = $tabularInformationRequest->layr;
>>>>        $this->log->debug("table->tableId (handlePreDrawing):
>>>> ".$table->tableId);
>>>>
>>>>        $table->columnTitles = array("C1","C2","C3");
>>>>
>>>>        $tableRow = new TableRow();
>>>>        $tableRow->cells = array("a","b","c");
>>>>        $table->rows[] = $tableRow;
>>>>
>>>>        $table->totalRows = 1;
>>>>
>>>>        $tables[0]=$table;
>>>>
>>>>        $tabularInformationResult->tableGroup = new TableGroup();
>>>>        $tabularInformationResult->tableGroup->groupId = 'tabinfo';
>>>>        $tabularInformationResult->tableGroup->groupTitle =
>>>> I18nNoop::gt('TabularInformation');
>>>>        $tabularInformationResult->tableGroup->tables = $tables;
>>>>
>>>>        // Applies the registred table rules
>>>>        $tablesPlugin =
>>>> $this->getServerContext()->getPluginManager()->tables;
>>>>        $groups =
>>>> $tablesPlugin->applyRules($tabularInformationResult->tableGroup);
>>>>        $tabularInformationResult->tableGroup = $groups[0];
>>>>
>>>>        return $tabularInformationResult;
>>>>
>>>>    }
>>>>
>>>> On the client side, I just add this tableGroup to the tables
>>>> plugin. If
>>>> I execute the plugin, I see the name of the tableGroup in cartoweb,
>>>> but
>>>> there is not table below. It seems, that the table is invisible,
>>>> because
>>>> I can read out the table data on the client side (I tried to write
>>>> them
>>>> into the log file and that works). How do I show that table?
>>>>
>>>> Any hints appreciated
>>>>
>>>> Regards
>>>> Carolin
>>>>
>>>> -- 
>>>> Carolin Latze
>>>> Research Assistant
>>>>
>>>> Department of Computer Science
>>>> Boulevard de Pérolles 90
>>>> CH-1700 Fribourg
>>>>
>>>> phone: +41 26 300 83 30
>>>>
>>>>
>>>> _______________________________________________
>>>> Cartoweb-dev mailing list
>>>> Cartoweb-dev at lists.maptools.org
>>>> http://lists.maptools.org/mailman/listinfo/cartoweb-dev
>>>>
>>>
>>
>> -- 
>> Carolin Latze
>> Research Assistant
>>
>> Department of Computer Science
>> Boulevard de Pérolles 90
>> CH-1700 Fribourg
>>
>> phone: +41 26 300 83 30
>>
>>
>>
>

-- 
Carolin Latze
Research Assistant

Department of Computer Science
Boulevard de Pérolles 90
CH-1700 Fribourg

phone: +41 26 300 83 30




More information about the Cartoweb-dev mailing list