Please post this on the users list.

On Thu, Aug 19, 2010 at 11:00 AM, Kezzer <[email protected]> wrote:

> I've been following this guide and coming up with my own concoction in
> order to use MonoRail's FormHelper.Select that is generated from an
> enum. So here's the Brail syntax:
>
> ${FormHelper.Select("user.Role", ${LS.EnumToPairs(Roles)},
> {"value":"First", "text":"Second"})}
> "LS" is just my own helper, which I've defined as follows:
>
> public IEnumerable<Pair<int, string>> EnumToPairs(Type e)
> {
>    IList<Pair<int, string>> pairs = new List<Pair<int, string>>();
>
>    foreach (int val in Enum.GetValues(e))
>        pairs.Add(new Pair<int, string>(val, Enum.GetName(e, val)));
>
>    return pairs;
> }
> Yet from this, despite being the correct syntax, I get the following
> error:
>
> Node '$({ return
>
> Castle.MonoRail.Views.Brail.ExpandDuckTypedExpressions_WorkaroundForDuplicateVirtualMethods.Invoke(self.GetParameter('LS'),
> 'EnumToPairs', (self.GetParameter('Roles'),)) })' has not been
> correctly
>
> The source error doesn't help much unfortunately:
>
> Line 15: output FormHelper.TextField("user.Role", {"class":"text-input
> full-width"}) Line 16: output """ Line 17: """ Line 18: output
> FormHelper.Select("user.Role", ${LS.EnumToPairs(Roles)},
> {"value":"First", "text":"Second"}) Line 19: output """
>
> Any ideas what I'm doing wrong here?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Development List" group.
> To post to this group, send email to [email protected]
> .
> To unsubscribe from this group, send email to
> [email protected]<castle-project-devel%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/castle-project-devel?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en.

Reply via email to