• 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: Bug in WOTextField?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in WOTextField?


  • Subject: Re: Bug in WOTextField?
  • From: Alexander Spohr <email@hidden>
  • Date: Fri, 22 Feb 2008 10:34:37 +0100

Sorry Timo,

your example seems fine at first glance. But what should the textfield do when the condition switches to false and it had text? If it switches to true with bound text?

And what should the user think if she puts in some value to that field as it is visible and then you just ignore it on submit?

The error ist yours. It is a bug to deliver something in appendToResponse and not having it anymore in takeValuesFromRequest, or vice versa.
Never change a condition in takeValuesFromRequest. It leads to odd behavior of most WOClasses, as they can not know what you intended.


	atze


Am 22.02.2008 um 10:14 schrieb Timo Hoepfner:

Hi,

I've stumbled across a behaviour of WOTextField (and possibly other WOInput subclasses) which looks like a bug to me:

When you have a textfield within a form, that appears as a result of the submission of that form (e.g. because it's in a conditional, whose condition becomes true as a result of the form submission), it will set it's binding to null during takeValuesFromRequest, as it's name doesn't appear in the WORequest's formValueKeys, which is (mis-)interpreded as "value is null". IMHO, the WOTextField should only set the binding, if it's name appears in the formValueKeys.
Is this a bug or intended behaviour?
I'm not sure, why this doesn't happen, when e.g. using a WOCollapsibleComponentContent with submitActionName bound. Probably I have to re-read "The secret life of components" chapter...


Below is some code to reproduce the problem and a workaround.

Timo



_______________________________________________
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: Bug in WOTextField?
      • From: Timo Hoepfner <email@hidden>
References: 
 >Bug in WOTextField? (From: Timo Hoepfner <email@hidden>)

  • Prev by Date: Bug in WOTextField?
  • Next by Date: Re: java heap trouble after 5.4.1 upgrade, opensnoop to the rescue
  • Previous by thread: Bug in WOTextField?
  • Next by thread: Re: Bug in WOTextField?
  • Index(es):
    • Date
    • Thread