On Sat, Oct 13, 2012 at 4:04 PM, poppakap <[email protected]> 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.
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.
-- View this message in context: http://xwiki.475771.n2.nabble.com/Dynamic-number-of-fields-in-Class-tp758177... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users