In each case, I just get the last of the values that was selected. The values are coming from checkboxes, generated by the given code:
foreach (@things) { <f:checkbox name="param_name"> <f:value> <xsp:expr>$_->get_name;</xsp:expr> </f:value> </f:checkbox>; <xsp:content> <xsp:expr>$_->get_name</xsp:expr> <br/> </xsp:content> }
What you should do is assign ids to each:
foreach ... {
$id++;
<f:checkbox name="param_name" value="1">
<f:index><xsp:expr>$id</xsp:expr></f:index>
</f:checkbox>
}Then have a validate sub:
sub validate_param_name {
my ($ctxt, $value, $id) = @_;
warn("validate param_name: $value, $id\n");
if ($value and $id) {
$ctxt->{Selected_Foo}{$id}++;
}
}Then in your submit function, just access $ctxt->{Selected_Foo}.
Off-topic question: I shouldn't need to have those semicolons, should I?
Axkit's generated perl code sometimes ends up with do {} blocks that
don't close with semicolons, preventing compilation.
No, you shouldn't need them. If you can boil it down to a simple test case we can find and fix the bug.
Matt.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
