• 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: D2W and Boolean values; anybody ever have anything work? SUMMARY
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: D2W and Boolean values; anybody ever have anything work? SUMMARY


  • Subject: Re: D2W and Boolean values; anybody ever have anything work? SUMMARY
  • From: gbrown <email@hidden>
  • Date: Wed, 08 Dec 2004 14:19:34 -0500

Thanks all for the info.

Java Booleans and D2W don't mix. However, if one uses an integer, and then fires up the D2W assistant, one may change the integer display to output a checkbox, non-zero is checked; also on queries an integer may be displayed as a D2WQUERYBOOLEAN which gives a "don't care [] Yes [] No []", a component able to build a query based on a integer-like-boolean. YES is rendered as > 0. With the assistant one may notice D2WCUSTOM{DISPLAY | QUERY | EDIT } , where:

This component lets you embed a regular WebObjects component inside a
DirectToWeb based component; you have to specify a component name to
embed. This component will be passed two bindings from its D2W parent:
'object', which will contain the EOEnterpriseObject being manipulated,
and 'key' which contains the key for which this embedded component was
used.


However, in the release notes:

Direct to Web

Radar #2201189

DirectToWeb does not handle queries with custom data types.

Description:

If one of your attributes has a custom data type (i.e. not one of the built-in types such as NSNumber, NSDecimalNumber, NSDate, NSCalendateDate) you can get an exception when DirectToWeb is trying to display it.

Workaround:

Using the Web Assistant, navigate to the faulty query page in expert mode and hide the property that has a custom type.


Summary:
Use java.lang.Integers, with Yes/True > 0 ; don't use java.lang.Booleans and a custom data type.


Maybe Apple will fix queries with custom data types.

Also, the javadoc documentation is quite thorough, much more so than the PDFs, all the classes are thoroughly documented there. The only problem is one must know enough about the classes to know where to look. Maybe the PDFs and html documentation will be fleshed out a little more.

gbrown wrote:

Searching the webobjects archive, I see there are several questions--all unanswered-- about getting d2w to work with booleans from a database.

Has anybody ever got something to work? How? Is it database dependent? a special class?

D2W currently won't allow a query using a boolean field, it says, " - cannot be used in a query - ". Nor will it allow editing a boolean field, it says. "
- not available -". However, in listing out records it appears to convert the string TRUE to the string true and display it. ( I went around webobjects and used database utilities to put the value TRUE in the database.)


On a related note, is there any documentation for the custom attribute mapping method, e.g. Factory Method:, Conversion Method:, Init Argument: as displayed by EO Modeler's Inspector? I did not find anything in the EO Modeler PDF.

Tanks.



_______________________________________________ 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: 
 >D2W and Boolean values; anybody ever have anything work? (From: gbrown <email@hidden>)

  • Prev by Date: Re: EOModeling Addresses.... better design
  • Next by Date: You've backtracked to far...
  • Previous by thread: Re: D2W and Boolean values; anybody ever have anything work?
  • Next by thread: EOModeling Addresses.... better design
  • Index(es):
    • Date
    • Thread