Yeah, problem is, that I do not have a non-abstract generic
repository, I could use with subitem.gettype(). Seems like I need to
create something like that.
On Thu, Sep 11, 2008 at 9:01 AM, Markus Zywitza
<[EMAIL PROTECTED]> wrote:
>
> Does MR know how to make a Kit from an ID? I use ARDataBind for it
> when I use AR, you'll need a specialized binder when using NH
> directly.
>
> -Markus
>
> 2008/9/11 Jan Limpens <[EMAIL PROTECTED]>
>>
>> now I am doing this:
>> // themeFromForm has no Kit, etc.. because they are abstract
>> Articles, databind cannot create
>> // so i need to get these manually
>> themeFromDb.Kit = ArticleDao.GetById(getId("theme.Kit.Id"));
>> themeFromDb.AdditionalGuestKit =
>> ArticleDao.GetById(getId("theme.AdditionalGuestKit.Id"));
>> themeFromDb.AdditionalDecoration =
>> ArticleDao.GetById(getId("theme.AdditionalDecoration.Id"));
>> themeFromDb.PartyFavor =
>> ArticleDao.GetById(getId("theme.PartyFavor.Id"));
>>
>> not too elegant. I guess it is here where active record really kicks
>> the llamas ass :)
>>
>> any good ideas?
>>
>>
>> On Wed, Sep 10, 2008 at 7:22 PM, Jan Limpens <[EMAIL PROTECTED]> wrote:
>> > cought it! theme.Kit is of an abstract baseclass.
>> > now i wonder how i come around this, because from a domain point of
>> > view, this is absolutely correct.
>> >
>> > On Wed, Sep 10, 2008 at 6:27 PM, Jan Limpens <[EMAIL PROTECTED]> wrote:
>> >> Hi folks,
>> >>
>> >> I generate a control like that
>> >> ${FormHelper.Select("theme.Kit.Id", sets, [EMAIL PROTECTED]:"Id",
>> >> @text:"Name",
>> >> @firstoption:"Sem Kit", @firstoptionvalue:''})}
>> >>
>> >> It gets populated and the right item is selected
>> >>
>> >> I post it to this action
>> >> public void Save([DataBind("theme")] Theme themeFromForm)
>> >>
>> >> In my Params["theme.Kit.Id"] shows the correct value.
>> >> but
>> >> themeFromForm.Kit is null
>> >>
>> >> this happened recently and without changing code that should be able
>> >> to affect this (which probably means, that's exactly what happened, I
>> >> just don't know yet). Did something spooky happen the Databind?
>> >>
>> >> --
>> >> Jan
>> >> ___________________
>> >> [EMAIL PROTECTED]
>> >> www.limpens.com
>> >> +55 (11) 3082-1087
>> >> +55 (11) 3097-8339
>> >>
>> >
>> >
>> >
>> > --
>> > Jan
>> > ___________________
>> > [EMAIL PROTECTED]
>> > www.limpens.com
>> > +55 (11) 3082-1087
>> > +55 (11) 3097-8339
>> >
>>
>>
>>
>> --
>> Jan
>> ___________________
>> [EMAIL PROTECTED]
>> www.limpens.com
>> +55 (11) 3082-1087
>> +55 (11) 3097-8339
>>
>> >
>
> >
>
--
Jan
___________________
[EMAIL PROTECTED]
www.limpens.com
+55 (11) 3082-1087
+55 (11) 3097-8339
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---