Item3890 introduced an attempt to fix the variable expansion in
EditTablePlugin in the format string of EDITTABLE.
Variable $percnt gets rendered as % and $percntY%percnt becomes
But before the Item3890 the $percnt was expanded when you saved the table. This is no longer the case. Now it is expanded when viewing.
But this only works with simple TWiki Variables.
Variables like %CALC% are not rendered because the
SpreadSheetPlugin runs before
EditTablePlugin.
When I specify a $percnt in the format of EDITTABLE is should be saved as a %-sign like it was
Then we have the old problem that % variables are expanded when you enter edit mode in
EditTablePlugin which is the real problem here and that was what should have been resolved. We have 4 or 5 bug items now related to this error. We need to get this right and revert the behavour introduced in Item3890.
I did not realize that this was the behavour when Item3890 got closed - otherwise I would have protested.
Here is an example of a real application
And it has been made using the $percnt excaping.
- Set MYNAMES = Ed, Kenneth,Benny
- Set EXTRACT = R0:C0..R0:C-1
In the above example I have an existing table where the first 3 have a correct 23 Jan 2008 - Ed . The last two row have been added using edit-table. And the result is the $percnt escaped EXTRACT. And yes it gets rendered as a %-sign but too late. The CALC is never rendered. Same happens if you put the CALC directly in the format.
I cannot find any workaround to get this working anymore. We use CALC everywhere in tables. And in most places also in the format of EDITTABLE. Making tables work like small spreadsheets is what the Spreadsheet Plugin was made for in the first place.
The above example is just one of many twikiapps that are broken and what makes it serious is that I cannot even find a work around for it.
This needs to get fixed in 4.2.1 and we should upload a fixed
EditTablePlugin within days on t.o.
--
TWiki:Main.KennethLavrsen - 23 Jan 2008
Reproduce: edit table, and click Add row.
--
TWiki:Main.ArthurClemens - 04 Feb 2008
I am testing this now on TWiki 4.1. But I cannot find out how to create the desired behaviour. I cannot add =label,1, 23 Jan 2008 - Ed = to the format attribute, because it will render the first 'cell' of the format attribute.
Do you have an example that works well on TWiki 4.1?
--
TWiki:Main.ArthurClemens - 15 Mar 2008
First - thanks for looking at this bug.
The original bug report example works in 4.1. I just tried again in 4.1
You have to use the $percnt in the format attribute.
The EXTRACT detail was probably done to make the table look simpler when editing. You can also just use the CALC directly which may be a better example.
The above table was created in 4.1 and new rows were added in 4.1. When you add more rows in 4.2 the new %CALC is added as $percnt CALC. The percnt has to be expanded to a % when you add the row.
--
TWiki:Main.KennethLavrsen - 17 Mar 2008
I have a solution - with a configurable option: variable EXPAND_FORMAT_VARIABLES
. This is the draft info for the plugin topic:
- Variables that should be expanded on row creation. Variables can be prevented from expansion by writing
$percntVARIABLE$percnt
in the format
attribute. But SpreadSheetPlugin's %CALC{}%
is evaluated before any other variable expansions, so $percntCALC{}$percnt
won't work. For these cases, list the variable names that should get expanded when a row gets created (space or comma separated, like CALC MYNAMES
):
- Set EXPAND_FORMAT_VARIABLES = CALC
Would that be clear enough?
And I have got it working too.
Hold on. I may have found a way after all to escape variables inside edit tables. Thanks to a thorough refactoring of the code.
--
TWiki:Main.ArthurClemens - 17 Mar 2008
Yes, variables are now preserved automatically. Perhaps at the cost of speed, I have not measured that.
Release note: Code refactoring; disabled table sort when editing; removed usage of
$percnt
to prevent variable expansion (is now done automatically); made Javascript interface aware of headers and footers, and of
changerows="off"
; improved feedback on row move.
--
TWiki:Main.ArthurClemens - 19 Mar 2008
There was a problem with
%BR%
tags.
--
TWiki:Main.ArthurClemens - 20 Mar 2008
Fixed a failing test as well (different
TablePlugin attributes setting).
--
TWiki:Main.ArthurClemens - 24 Mar 2008