• 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
Generate HTML from a WOComponent programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Generate HTML from a WOComponent programmatically


  • Subject: Generate HTML from a WOComponent programmatically
  • From: Jacky Gagnon <email@hidden>
  • Date: Fri, 30 Mar 2007 16:38:04 -0400

Hi,

I want to be able to generate HTML code from a WOComponent programmatically and insert the response into a String (to be display into a parent component).

I tried something like this :

public class ParentComponent extends WOComponent {
//A WOString will display the result
public String getText()
{
while ( iNeedMoreSubcomponent )
{
String htmlFromSubComponent = generateHTMLOfSubcomponent();

... code where I insert the result of the sub component into my text ...
}
return text;
}

//This sub component will contain component action and the result will be inserted into the "text"...
public String generateHTMLOfSubcomponent()
{
WOComponent subComponent = pageWithName("SubComponent");
String chaineHTML = resultAjax.generateResponse().contentString();

return chaineHTML;
}

}

But the problem with this example is the value of context().page() (was ParentComponent), who is replaced by the SubComponent (in my case this will be a problem). If I create a new Context for the sub component, I will lost my session.

Is there a way to do this or I'm better to change strategy?

Thanks in advance.

Jacky
 _______________________________________________
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: Generate HTML from a WOComponent programmatically
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: DBUnit configuration WOLips
  • Next by Date: Re: Generate HTML from a WOComponent programmatically
  • Previous by thread: Re: DBUnit configuration WOLips
  • Next by thread: Re: Generate HTML from a WOComponent programmatically
  • Index(es):
    • Date
    • Thread