On 10/15/2012 02:11 AM, Marius Dumitru Florea wrote:
On Sat, Oct 13, 2012 at 4:04 PM, poppakap
<poppakap(a)yahoo.com> wrote:
Ok, it appears that there isn't an
"automagical" way to do it.
I was hoping that I might be missing something simple, but I guess that I
need to do it in code.
AppWithinMinutes creates a single xclass per application (e.g.
ShoppingCartClass). In your case you need one more xclass (at least)
for the shopping cart item (following Jerome's suggestion). You need
to create this class yourself and modify ShoppingCartSheet to add
support for managing the shopping cart items (as you said below). As a
result your application entries will have one object of type
ShoppingCartClass and one or more objects of type
ShoppingCartItemClass.
And to be explicit, that's outside the scope of the AppWithinMinutes
wizard, which is optimized for simple applications. More complex
applications, such as yours, need writing some code.
In the ShoppingCartSheet, I added a little bit of velocity script to add in
the ShoppingCartItem object with a button click post. So in the sheet I will
have to take care of listing out the page's items, adding and deleting them.
Is that what you meant? It would be pretty cool if a "Field Type" had a
dynamic count to it though, so that if you added a field to a class property
list, it would take care of itself. That would rock.
The xclass is a descriptor for a set of xobjects. It holds the list of
properties, their names, types, etc. but it doesn't hold any values!
So you can't use the xclass to store data, you have to use xobjects,
which are instances of an xclass. Objects assign values to the
properties defined by the class.
Note that when you edit your AWM application, you can set default
values to the xclass properties but those values are not saved in the
class but in the template, ShoppingCartTemplate, which is a page that
contains an object of type ShoppingCartClass.
Hope this helps,
Marius
>
> Thanks again, all of you guys are extremely fast to respond, and I really
> appreciate your kindness.
>
--
Sergiu Dumitriu
http://purl.org/net/sergiu/