• 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: Struggling with D2W Custom Components, how to get a Custom Component Page?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Struggling with D2W Custom Components, how to get a Custom Component Page?


  • Subject: Re: Struggling with D2W Custom Components, how to get a Custom Component Page?
  • From: David LeBer <email@hidden>
  • Date: Thu, 16 Dec 2010 16:20:44 -0500

Johan,

You are seeing the component repeated 20 times because those instructions are for creating a 'property level component'.

Hense the propertyKey being important. Without it, the component is used for every property on your entity.

It looks like you want to create a page level component. In that case look at some of the existing page level components in wonder.

On 2010-12-16, at 3:04 PM, Johan Henselmans wrote:

>
> Here's the idea:
>
> I have a custom component page from somewhere else with javascript that does a whole bunch of calculations based on values of an EO.
>
> No problem, I thought, according to the D2W Rules References I follow rule 7:
>
> (http://wiki.objectstyle.org/confluence/display/WO/D2W+Rules+Reference+-+Cookbook+-+FAQ)
>
> 7. How do I easily use my own custom component in a Direct to Web page?
>
> Step 1:
>
> Add the following rules to your rule file:
>
> 100: pageConfiguration = "ListTheEntity" and propertyKey = "theProperty" => componentName = "D2WCustomComponent"
> 100: pageConfiguration = "ListTheEntity" and propertyKey = "theProperty" => customComponentName = "MyThePropertyComponent"
>
>
> Step 2:
>
> Create a component in your project named 'MyThePropertyComponent' and give it an 'object' and 'key' binding. The object will receive the current object, and the key will receive the current propertyKey (as a string) from DirectToWeb. Do with them what you will.
>
>  public
> EOEnterpriseObject object() {
>
> return (EOEnterpriseObject) valueForBinding("object"
> );
>  }
>
>
> public String
> key() {
>
> return (String) valueForBinding("key"
> );
>  }
>
>
> So I add these methods, but removed this propertyKey thingy because I want my the entity  to be used as the object.
>
> Im my situatiion:
>
> 100: pageConfiguration = "InspectTheEntity"  => componentName = "D2WCustomComponent"
> 100: pageConfiguration = "InspectTheEntity"  => customComponentName = "MyNiceJavascriptAndAllPage"
>
> first I had to add some extra methods to this page, because WebObjects complained it could not set object and key values, so I added:
>
> 	public void setObject(EOEnterpriseObject anObject) {
> 		currentObject = anObject;
> 	  }
>
> 	public void setKey(String aKey) {
> 		currentkey = aKey;
> 	  }
>
> But then it displayed the page.
>
> 20 times.
>
> I get a display of my custom page for all the components in the page. So component 1 displays a complete empty page, component 2  etc. None of my EOEnterprise values are displayed from the EOObject that I selected.
>
> I must be missing something. I understood that the object would pass through the current select enterprise object, and I could use that to fill in the values in my custom page. Apparently, that is not the case. I tried to find some customcomponent in the d2wmodels of BugTracker or ERMoviesDemo, but did not find anything over there.
>
> Can someone enlighten me?
>
> Johan Henselmans
> email@hidden
>
>
>
> _______________________________________________
> 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

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: 	http://codeferous.com
blog: 	http://davidleber.net
profile:	http://www.linkedin.com/in/davidleber
twitter:	http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




 _______________________________________________
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: Struggling with D2W Custom Components, how to get a Custom Component Page?
      • From: Johan Henselmans <email@hidden>
References: 
 >Struggling with D2W Custom Components, how to get a Custom Component Page? (From: Johan Henselmans <email@hidden>)

  • Prev by Date: Re: MySQL 5.5 goes GA Release
  • Next by Date: Re: Struggling with D2W Custom Components, how to get a Custom Component Page?
  • Previous by thread: Re: Struggling with D2W Custom Components, how to get a Custom Component Page?
  • Next by thread: Re: Struggling with D2W Custom Components, how to get a Custom Component Page?
  • Index(es):
    • Date
    • Thread