Hi!
I am experiencing a strange behavior in the PerFrom taglibrary.
If I use checkboxes with indices and a validate callback, I get the index in the value parameter of the checkbox if it is not checked. If it is checked, the value is filled with the value set in the value attribute of the checkbox tag, and the index is where it belongs.
Is this a known issue? Am I doing anything wrong?
Some peaces of code to show what I am doing:
The callback in my xsp page: --- cut here --- sub validate_qctest_ok { my ($ctx, $value, $index) = @_;
# # with this fix applied it behaves as expected (by me!) # if ($#_ < 2) { $index = $value; $value = 0; }
my ($testnr, $testposnr) = split (/_/, $index);
my $test = $ctx->{'test'}; if (!defined ($test->{$testnr})) { my %testitem;
$test->{$testnr} = \%testitem;
}
$test->{$testnr}->{$testposnr} = $value;
} --- cut here ---
The code that adds checkboxes, inside an xsp:logic block:
($testnr and $testposnr are iterated in foreach loops)
--- cut here ---
<f:checkbox name="qctest_ok" value="1">
<f:index><xsp:expr>sprintf "%d_%d", $testnr, $testposnr;</xsp:expr></f:index>
</f:checkbox>
--- cut here ---
this is found in the intermediate xml code after xsp has been performed: (passed thru xml_pp to make it readable!) --- cut here --- <checkbox> <index>0_21</index> <value>1</value> <name>qctest_ok</name> <label/> </checkbox> --- cut here ---
Thanks, Peter Mueller WOTLmade
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]