• 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: Problem passing strings to my wrapper component
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem passing strings to my wrapper component


  • Subject: Re: Problem passing strings to my wrapper component
  • From: "Daniele Corti" <email@hidden>
  • Date: Fri, 23 Feb 2007 09:29:23 +0100



2007/2/23, Kevin Windham <email@hidden>:
I have a page wrapper and I've set up an API for it so I can pass
some variables to it from the pages containing content. I have
managed to pass Boolean values without any problem. In my .java file
I put

public Boolean boolValue;

And in the API for the wrapper I have the name boolValue and value
set is Boolean.

This works fine, I can inspect the wrapper in my content page and set
the boolValue to true and my wrapper page responds appropriately.

However, if I do the same thing with a string, I get a null pointer
exception. The only difference I can see is there is no option for
String in the value set menu, so I just leave that unset. I imagine I
am missing something, but I can't seem to find any leads on what it is.

That's strange, maybe try to create two methods for set and get the string:
String myString;

public String myString()
{
    return myString;
}

public void setMyString(String newString)
{
   myString = newString;
}

now you bind your wrapper to myString, and it will call the two methods!

Maybe the difference is that I am trying to access the string in
my .java file. I simply put in some code in the constructor, but
maybe the string hasn't been set yet by the content page.

well that's because the constructor is called just one time: after the first initialization the component is kept in cache by the app, or the session, I don't remember... then the component is just awaked.

You must override
public void awake()
{
//put here the code you want to be executed at the beginning of request-response loop
}

or at the end of the loop:

public void sleep()
{
}
 
or append to the response

public void appendToResponse(WOResponse r, WOContext c)
{
//your code before append the component
super.appendToResponse(r,c);
//your code after appended the component
}

Is there
any documentation on the chain of events for this scenario?

Thanks,
Kevin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden This email sent to email@hidden



--
Daniele Corti
AIM: S0CR4TE5
Messenger: 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

  • Follow-Ups:
    • Re: Problem passing strings to my wrapper component
      • From: Kevin Windham <email@hidden>
References: 
 >Problem passing strings to my wrapper component (From: Kevin Windham <email@hidden>)

  • Prev by Date: Refresh
  • Next by Date: Re: Re(2): WebObjects 5.3.3 released
  • Previous by thread: Problem passing strings to my wrapper component
  • Next by thread: Re: Problem passing strings to my wrapper component
  • Index(es):
    • Date
    • Thread