>> you can just have a method that returns "javascript:ShowContent('Image" + id >> + ")')" and use WOGenericContainer/Element for the div and WOHyperlink for >> the link > > Yes, this is what I try and do: Keep as much html/wod/css as such and just > pick out the specific things I need to be code generated. I do the same thing > for id's and classes. i use helpers for things like ids and classes, where it's a common algorithm that i always apply:
public class ERXGenericRecordHelper { public String id(ERXGenericRecord eo) { return eo.entityName() + "_" + eo.primaryKey(); } public String save(ERXGenericRecord eo) { return id(eo) + "Save()"; } public String edit(ERXGenericRecord eo) { return id(eo) + "Edit()"; } public String cancel(ERXGenericRecord eo) { return id(eo) + "Cancel()"; } public String idPlus(ERXGenericRecord eo, String toAppend) { return id(eo) + "_" + toAppend; } public String url(ERXGenericRecord eo, String action) { WOContext context = ERXWOContext.currentContext(); return EntityLink.url(new EntityRouter.Action(action), eo, EntityRouter.HTML, null, context, UrlUtils.isRequestSecure(context.request()), context.hasSession() && context.session().storesIDsInURLs()); } public String url(ERXGenericRecord eo, String action, String requestType) { WOContext context = ERXWOContext.currentContext(); return EntityLink.url(new EntityRouter.Action(action), eo, new EntityRouter.RequestType(requestType), null, context, UrlUtils.isRequestSecure(context.request()), context.hasSession() && context.session().storesIDsInURLs()); } } (EntityRouter was from our internal framework that has partially turned into the rest routing stuff) ms
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com