Thanks Ramsey!

valueForBinding did the trick.

Kamal

On 06-Jan-09, at 9:04 PM, Ramsey Lee Gurley wrote:

The values for object and key should be getting passed to the component by your page. Making them public might get them to synchronize... If you just bind your string value to ^object.name in the wod file, I think it should work for you. If you really need to do it in the java file, you can try loading your object value with valueForBinding("object")

Ramsey


On Jan 2, 2009, at 4:46 AM, Kamal D Shah wrote:

Hi all,

I'm trying to build a property level custom component in my D2W application (not using Wonder). For testing, I put a simple table with a WOString in the component and in my Java file looks like this:

EOEnterpriseObject object;
String key;
        
public DBWidgets(WOContext context) {
        super(context);
}

public String value(){
        return (String)object.valueForKey("name");
}

The WOString's value is bound to value. When I access the component, I get a null pointer exception when it tries to render 'value' because object evaluates to null.

In my rules, I set two rules - one to say - use a D2WCustomComponent for the particular property and the second to specify the particular component (DBWidgets) that I am building.

My actual usage is more complicated but since I was getting this problem, I decided to try it in steps and this is the same problem I have in my component too.

Is there anything else I need to do to be able to use my property level component?

Thanks a ton...
Kamal
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/rgurley%40mac.com

This email sent to rgur...@mac.com


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

This email sent to arch...@mail-archive.com

Reply via email to