• 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
trying to get a Fetch Specification - Distinct Categories working on a WOPopupButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trying to get a Fetch Specification - Distinct Categories working on a WOPopupButton


  • Subject: trying to get a Fetch Specification - Distinct Categories working on a WOPopupButton
  • From: Thomas Peters <email@hidden>
  • Date: Sun, 03 Nov 2013 20:50:19 -0500


Hi All,
I created a Fetch Specification named 'DistinctCategories' in my Movie EO, and have select the Distinct rows option.  I also have it set to return Specific Attributes as raw rows and have only the category attribute selected.  I am linking that to my NewCategoryPop WOPopUpButton through the class property distinctCategories.  I need this drop down to represent the newcategory property in my form below.  It seems that the NSArray is configuring it with the option value set to the index of the array and the displayString set to the Movie object, not the value of the category.  The page displays the same value no pater if I have the item & displayString values set in my Dynamic Component.  What am I doing wrong?

Thomas


// Main.java

private Movie acategory; // Stores the value of the Category search field.
private NSArray<Movie> distinctCategories; // Stores the results of a search.
...
public NSArray<Movie> getDistinctCategories() {
return this.distinctCategories;
}


public void setDistinctCategories() {
EOEditingContext ec = session().defaultEditingContext();
NSArray<Movie> distinctCategories = EOUtilities.objectsWithFetchSpecificationAndBindings(ec, "Movie", "DistinctCategories", null);
this.distinctCategories = distinctCategories;
}
...

// Main.wo
NewCategoryPop : WOPopUpButton {
list = distinctCategories;
item = acategory.category;
displayString = acategory.category;
selectedValue = newcategory;
}

My Fetch Specification is set to return a distinct on the category property.  That seems to be returning the right number of rows, but I am getting an Object in the WOPopupButton option list.

<form method="post" enctype="multipart/form-data" action="">
<table class="simple">
<tr><td>Title:</td><td><input type="text" name="5.3.1" /></td></tr>
<tr><td>Category:</td><td><select name="5.3.3"><option value="0">{category = &quot;Comedy&quot;; }</option><option value="1">{category = &quot;Drama&quot;; }</option><option value="2">{category = &quot;SiFy&quot;; }</option><option value="3">{category = &quot;Test&quot;; }</option><option value="4">{category = &quot;War&quot;; }</option></select></td></tr>
<tr><td>Date Released:</td><td><input type="text" name="5.3.5" /></td></tr>
<tr><td colspan=2 ><input type="submit" value="Insert" name="5.3.7" /></td></tr>
</table>
<input type="hidden" name="wosid" value="8v9GksUm8D3deHrl4b0VAw" /></form>

 _______________________________________________
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

  • Follow-Ups:
    • Re: trying to get a Fetch Specification - Distinct Categories working on a WOPopupButton
      • From: Theodore Petrosky <email@hidden>
References: 
 >Re: I am trying to create a WOHyperlink inside a WORepetition > null target WOComponent (From: Theodore Petrosky <email@hidden>)
 >Re: I am trying to create a WOHyperlink inside a WORepetition > null target WOComponent (From: Thomas Peters <email@hidden>)
 >Re: I am trying to create a WOHyperlink inside a WORepetition > null target WOComponent (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Resolved: I am trying to create a WOHyperlink inside a WORepetition > null target WOComponent
  • Next by Date: Re: Deployment Question
  • Previous by thread: Resolved: I am trying to create a WOHyperlink inside a WORepetition > null target WOComponent
  • Next by thread: Re: trying to get a Fetch Specification - Distinct Categories working on a WOPopupButton
  • Index(es):
    • Date
    • Thread