• 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: Summarizing displayed data from an array of eo's
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Summarizing displayed data from an array of eo's


  • Subject: Re: Summarizing displayed data from an array of eo's
  • From: John Larson <email@hidden>
  • Date: Mon, 11 Sep 2006 14:21:22 -0500

Matt -

I take it that the list is in a worepetition. Proceeding from that assumption, make some code that looks like this:

Author currentAuthor;

public boolean showAuthor = true;

Book listItem;
public void setListItem(Book b) {
	listItem = b;
	if (listItem.author() != currentAuthor) {
		currentAuthor = listItem.author;
		showAuthor = true;
	}
	else {
		showAuthor = false;
	}
}
public Book listItem() {return listItem;}

Bind the repetition item to listItem. This way you can set a woconditional with the condition set to showAuthor. showAuthor will only be true if book's author is not the same as the currentAuthor. When the next book comes up with the same author, it will change showAuthor to false.

John

On Sep 11, 2006, at 2:05 PM, Matt Kime wrote:

I'm stumped on what the "WO way" is for a rather common information
display issue. I have an array of eo's that i want to display in a
list format. Some fields I want to display on every line, some fields
I want to display only if it differs from the previous item in the
array. Like so...


Title, Author Title Title Title, Author Title Title, Author Title, Author

Is it possible to do this with a simple WOConditional? I'm not sure
how to reference the previous object in an array. I've tried starting
from the parent objects and moving down the hierarchy which allows me
to display more detail info on only the first item in the array.
Unfortunately this seemed to create enough database interaction that I
had to adjust my WOAdapter to wait for the data.

--matt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com


This email sent to email@hidden

_______________________________________________ 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: 
 >Summarizing displayed data from an array of eo's (From: "Matt Kime" <email@hidden>)

  • Prev by Date: Summarizing displayed data from an array of eo's
  • Next by Date: Re: Navigation Working Example?
  • Previous by thread: Summarizing displayed data from an array of eo's
  • Next by thread: Utility to move files into database
  • Index(es):
    • Date
    • Thread