Re: Implementing an ordered tree
Re: Implementing an ordered tree
- Subject: Re: Implementing an ordered tree
- From: "YL" <email@hidden>
- Date: Mon, 23 Jan 2006 10:18:54 -0700
validateForSave() is where i would put the logic for re-ordering.
the idea:
implement methods
(1) checkChildrenOrder() that returns false if children array has order
problem
(2) resetChildrenOrder() that loop over its children array and set each
one's order attribute to its index in the array.
in validateForSave(), you say
validateForSave() {
super().validateForSave();
if(!checkChildrenOrder()) {
resetChildrenOrder();
}
}
----- Original Message -----
From: "Karoly Szantai" <email@hidden>
To: <email@hidden>; <email@hidden>
Sent: Monday, January 23, 2006 4:32 AM
Subject: Implementing an ordered tree
> Hello,
>
> I have a Category entity. Each Category has zero or more subcategories,
> which are ordered. There is a root Category (called main category)
> which has no parent.
> I have created this EO model:
>
> oid
> oidParentCategory
> name
> ordinalNumber
>
> parentCategory (oidParentCategory --> oid)
> subcategories (oid -->> oidParentCategory)
>
>
> I need some hints on how to implement the following operations
> (methods) with "ordered way":
>
> -add a category
> -delete a category
> -cut & paste a category (and its subcategories) from one level to
> another level
> -reorder categories (move a category in its level)
> etc.
>
> My big headache is manipulating the ordinalNumber attribute in "EO way".
>
>
> Regards,
> Karoly
>
>
>
>
>
>
> _______________________________________________
> WebObjects-dev mailing list
> email@hidden
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.375 / Virus Database: 267.14.21/236 - Release Date: 1/20/2006
>
>
_______________________________________________
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