Why not just do this:

boolean booleanFirstItem()
{
        if(Items.count() > 0)
                return Items.objectAtIndex(0) == anItem;
        return false;
}

You should never toogle Conditional state in a setMethod of a repetition. The side-effects are strange. WO might or might not go through the Repetition if it takesValuesFromRepsonse.

Or even better: Don’t use a Conditiona at all. As i understand it you have a Batch-Repetition, so just put a link before the Item- Repetition...

BatchRep
        HEADERLINK for Batch
        ItemRep
                Item
        /ItemRep
/BatchRep


        atze


Am 24.05.2007 um 02:12 schrieb David Holt:

Thanks Chuck,

Here is the code:

        protected Integer previousBatchNumber = new Integer(-1);
        protected Integer currentBatchNumber;


    public void setAnItem(Item newAnItem)
    {
                if(!(newAnItem == null)) {
                        currentBatchNumber = (Integer) newAnItem.batch_number();
                        if ( currentBatchNumber.equals(previousBatchNumber)) {
                                booleanFirstItem = false;
                        } else {
                                booleanFirstItem = true;
                                
                        }
                        previousBatchNumber = currentBatchNumber;
                }                       
                anItem = newAnItem;
    }


On 23 May 2007, at 5:05 PM, Chuck Hill wrote:

How is "isFirstItemInABatch" determined? That sounds like your problem. It seems like this returns true only once, when the page is first drawn.

Chuck


On May 23, 2007, at 4:55 PM, David Holt wrote:

Hello everyone,

I am having problems with a boolean changing the structure of my page - a la Jerry's pet bug :-) The usual answer is to set the boolean in the appendToResponse. In my case, the conditional applies to multiple items and the boolean is determined from a value in the item in the setAnItem() method. Here is the structure of the calling page:

--
repetition-->Batches-->aBatch
repetition-->Items-->anItem

?+isFirstItemInABatch
Batch Headings
?+

anItem details

repetition // items
repetition // batches
--

I want to put a hyperlink in the Batch Headings section that calls an edit page. The link currently reloads the page. If I put a link in the Item Details section the edit batch page is called, but then I have a hyperlink beside every item in the batch.

How can I debug this unresponsive link in the Batch Headings section?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net

This email sent to [EMAIL PROTECTED]


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/atze% 40freeport.de

This email sent to [EMAIL PROTECTED]

Freeport & Soliversum
Alexander Spohr
[EMAIL PROTECTED]
www.freeport.de


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to