[albatross-users] can't figure out why it's flipping me the bird
Matt Goodall
matt at pollenation.net
Thu Sep 11 10:08:29 EST 2003
On Thu, 2003-09-11 at 00:36, Eric S. Johansson wrote:
> started on another CGI script. Obviously my knowledge is better and it went
> much faster than the traditional naked python CGI but I'm still hitting a bit of
> a roadblock. In the spamtrap viewer I have a fragment of nicely working
> albatross that looks like:
>
>
> <al-if expr="line.value().checked=='on'">
> <al-exec expr="albatross_token = line.value().token">
> <al-else>
> <al-exec expr="albatross_token = 'off'">
> </al-if>
>
> <al-input type="checkbox" name="albatross_token"
> valueexpr="line.value().token" list onclick="CCA(this,'mystery');DownHalt();" >
> <td>
>
>
> so now, in the configuration editing tool I have a similar problem (multiple
> data elements of similar structure) so I figured I would use a similar structure:
>
> <al-exec expr="albatross_token=line.value().field_name">
> <td><al-input type="text" name="albatross_token" size="50" maxlength="100"
> valueexpr="line.value().variable">
>
> but all it does is give me...
>
> ApplicationError: al-input "albatross_token" not defined as "list"
>
> I'm confused. Is there an option I'm forgetting to set?
The error means that you have multiple al-input fields with the same
name, "albatross_token". There are two ways to fix that, depending on
what you are trying to do:
1. Add a 'list' attribute to the al-input element to allow more than one
al-input with the same name. The name will always be the string
"albatross_token".
2. Use a 'nameexpr' attribute rather than 'name' so that each al-input
has a different name. The name of the al-input will be the current value
of the albatross_token variable.
>
> The only reason I'm trying to set the name is so I can identify each field and
> determine whether or not has changed from the previous value so I will know
> whether to write it out or not.
OK, I think you want 2 - use a 'nameexpr' attribute.
Cheers, Matt
--
Matt Goodall <matt at pollenation.net>
More information about the Albatross-users
mailing list