• 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: Strangeness afoot
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strangeness afoot


  • Subject: Re: Strangeness afoot
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 25 Oct 2007 19:49:50 -0700


On Oct 25, 2007, at 6:36 PM, Lachlan Deck wrote:

On 26/10/2007, at 11:16 AM, Kevin Windham wrote:

On Oct 25, 2007, at 7:30 PM, Lachlan Deck wrote:

On 26/10/2007, at 9:35 AM, Kevin Windham wrote:

After finally figuring out my goofy mistake earlier I made some progress. I have a functioning solution now, but I am puzzled by some strange behavior I am seeing although I am sure there is a perfectly reasonable explanation for it. I just can't see it.

I have the following method that creates a name for a checkbox.

tableIndex is bound to the repetition of the table row that contains the checkboxes.
lastTableIndex is a variable I use to help keep track of when the column index needs to be reset
colIndex is the column index that I am using for naming purposes.
<...>

<td width="175" align="left" class="black10" style="padding:3px 0px 3px 2px;">Dog 2</td>
<td align="center"></td>
<td align="center"><input type="checkbox" name="r1c1" value="0.37.10.18.1.5.0"></td>
<td align="center"><input type="checkbox" name="r1c3" value="0.37.10.18.1.7.0">&nbsp;</td>
<td align="center"><input type="checkbox" name="r1c5" value="0.37.10.18.1.9.0"></td>
<td align="center"></td>
</tr>


Notice how the columns count by two? Anyone have any idea why that might be?

Yes, you are incrementing a variable that is already being incremented by WORepetition. So it's doubly incremented per item.

How would colIndex be incremented by the WORepetition. It's not bound to anything. I actually tested the method after removing the colIndex++ line and nothing is incremented. I get results like r1c1, r1c1, r1c1, r2c1, r2c1, r2c1. It's almost like the method is reentrant or something.

It is definitely getting called more than once. Is that method used in some other binding (a test one you have forgotten about?) in the WOD? You can also try adding this to the method:


NSLog.out.appendln(new RuntimeException("backtrace"));

To get a back trace from when it gets called.


Chuck

--

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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Strangeness afoot (From: Kevin Windham <email@hidden>)
 >Re: Strangeness afoot (From: Lachlan Deck <email@hidden>)
 >Re: Strangeness afoot (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Re: many-to-many query question
  • Next by Date: Re: Strangeness afoot
  • Previous by thread: Re: Strangeness afoot
  • Next by thread: Re: Strangeness afoot
  • Index(es):
    • Date
    • Thread