• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quoting hell, anybody a solution?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quoting hell, anybody a solution?


  • Subject: Re: Quoting hell, anybody a solution?
  • From: Mike Schrag <email@hidden>
  • Date: Thu, 18 Feb 2010 11:40:53 -0500

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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Quoting hell, anybody a solution? (From: Johan Henselmans <email@hidden>)
 >Re: Quoting hell, anybody a solution? (From: Henrique Gomes <email@hidden>)
 >Re: Quoting hell, anybody a solution? (From: Johan Henselmans <email@hidden>)
 >Re: Quoting hell, anybody a solution? (From: Anjo Krank <email@hidden>)
 >Re: Quoting hell, anybody a solution? (From: Johan Henselmans <email@hidden>)
 >Re: Quoting hell, anybody a solution? (From: Mike Schrag <email@hidden>)
 >Re: Quoting hell, anybody a solution? (From: David LeBer <email@hidden>)

  • Prev by Date: Re: Quoting hell, anybody a solution?
  • Next by Date: Re: Problem re-executing adaptor operations
  • Previous by thread: Re: Quoting hell, anybody a solution?
  • Next by thread: Re: Quoting hell, anybody a solution?
  • Index(es):
    • Date
    • Thread