• 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: newbie: basic question on getting a value from an entity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie: basic question on getting a value from an entity


  • Subject: Re: newbie: basic question on getting a value from an entity
  • From: Paul Marvine <email@hidden>
  • Date: Sat, 3 Mar 2007 16:42:44 -0600

I am using pagesDisplayGroup.selectedObject() successfully in other actions of the page. 

Also, on the page I have a WOtextField with  value = pagesDisplayGroup.selectedObject.pageTemplate

that shows the data which I am trying to use. So selectedObject() is not null and the attribute "pageTemplate" has some data in it. 

I can display the field on the page, but how do I call the same data in an action?

String desiredComponent = pagesDisplayGroup.selectedObject ().pageTemplate();  doesn't seem to work.

Thanks again.

Paul



On 03.03.2007, at 13:36, Paul Marvine wrote:


    But the trouble starts when I change the action to this...


    public String desiredComponent;


    public WOComponent doWebTemplate()
        {


    String desiredComponent = pagesDisplayGroup.selectedObject ().pageTemplate();
    WOComponent nextPage = pageWithName( desiredComponent );

    return nextPage;
        }


    What is the correct way to write the line to get the value of "pageTemplate"?
    I get a can't resolve symbol error, or with other variations on the line I'll get a Null pointer exception when it runs. 


I guess that selectedObject is null. How does the page know, what the selectedObject should be? How do you set this?

Next guess: you may display a page with a list of objects, where each of them has a "pageTemplate", somehow you select one of the objects and it should return the string value - but you have to assign "selectedObjects" of the displayGroup somehow.

Can you give some more info?


cug
 _______________________________________________
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: newbie: basic question on getting a value from an entity
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: newbie: basic question on getting a value from an entity
  • Next by Date: newbie: basic question on getting a value from an entity
  • Previous by thread: Re: newbie: basic question on getting a value from an entity
  • Next by thread: Re: newbie: basic question on getting a value from an entity
  • Index(es):
    • Date
    • Thread