Todd
unread,Sep 23, 2011, 4:17:57 AM9/23/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to kanso
I just started using Kanso and I think I need help using the embedForm
widget. Here's what I'm trying to do:
The user clicks an "Add an activity" link. The server would return an
Activity form using a show function. Within the Activity form, I'd
like the user to be able to fill in an Activity Details form. I'd like
the Activity form to produce an Activity document and the Activity
Details form to produce an Activity Details document.
I thought I should use an embed field with an embedForm widget. When I
try this with the following type definition, I get an "obj is
undefined" error and the Activity form doesn't render. Since I can't
find an example of what options I should put for the embedForm widget,
I'm wondering if I'm missing some required data in the options object.
Here are the type definitions I'm working with:
exports.activitydetail = new Type('activitydetail', {
fields: {
created: fields.createdTime(),
createdBy: fields.creator(),
description: fields.string({
widget: widgets.textarea({cols: 40, rows: 10})
}),
tags: fields.string(),
priority: fields.string()
}
});
exports.activity = new Type('activity', {
fields: {
created: fields.createdTime(),
createdBy: fields.creator(),
title: fields.string(),
body: fields.embed({
type: exports.activitydetail,
required: false,
widget: widgets.embedForm({
type: exports.activitydetail
})
})
}
});