Re: WOPopUpButton

Lawrence Kendall <[email protected]>
Newsgroups gmane.comp.web.webobjects.newbies
Message-ID <[email protected]>

On 10/02/2005, at 4:29 PM, Lawrence Kendall wrote:



  I've searched the archive but can't seem to find the answer to my 
query.

    I have created 2 NSArrays, priceLevels and priceLevelsExt

    priceLevels contains the price levels as I want them searched in my
  database
    such as:
    RES
    EDU

    PriceLevelsExt contains the price levels as I want the user to see
  them such
    as:
    Retail
    Education

    I would like to be able to do a search using
    productDetailDisplayGroup.queryMatch.priceLevel


    Example - User puts the following into the form:
        Product Description - iPod (text field using queryMatch.descr)

        Price Level - Education (pop up button using 
queryMatch.priceLevel
    matched to EDU)

        Result: All products with "iPod" in the productDetail.descr and
  "EDU" in
    the productDetail.priceLevel


  ~~~~~~~~~~~~~~~~~~~~~~~~

  The way I would do this is to set up an entity in my model called
  "PriceType" or something.

  PriceType would contain an ID plus two fields, "longName" and
  "shortName".

  In your component have a priceTypeDisplayGroup and an itemForPriceType.

  Your WOPopUpButton should have the following keys filled in:

  displayString = itemForPriceType.shortName
  item = itemForPriceType
  list = pricTypeDisplayGroup.displayedObjects
  noSelectionString = "-Please Select-"
  selection = productDetailDisplayGroup.queryMatch.priceType

  That's it.

  Cheers then,

  Larry.

~~~~~~~~~~~~~~~~~~~~~~~~

I forgot to mention....

add a relationship to your product entity, so your Product entity will 
have a "priceTpyeID" field and you connect that to the ID in the 
PriceType entity.

Therefore, your selection key on the WOPopUpButton should be:

selection = productDisplayGroup.queryMatch.pricetype

Cheers then,

Larry.


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/webobjects-newbies/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.