"Diethelm Guallar, Gonzalo" wrote:
> 
> Hello,
> 
> I have just realized that I understand how a Java
> file (say, Foo.java) and a WM file (Foo.wm) work
> hand in hand only for passing parameters from Java
> to WM. That is, I know you can do
> 
>   context.put("today", new Date().toString());
> 
> in your Java file, and access that value as
> 
>   $today
> 
> in your WM file. Fine. What about a class such as
> DateSelector? Can I use it directly from a WM file?
> Do I HAVE to use it from an associated Java file?

You can use instances of any Java classes which you've added to your
template's associated WebContext.

> Now, say my WM file looks like
> 
>   <table>
>   ... [lots of HTML content]
>   <!-- here I would like to have a DateSelector -->
>   ... [more HTML content>
>   </table>
> 
> How do I go about putting that DateSelector where I
> want it in the WM file?

You must add an instance of DateSelector to your WebContext.

  // Java code
  context.put("dateSelector", new DateSelector());


  ## WebMacro template
  $dateSelector.frobHard();
-- 

Daniel Rall <[EMAIL PROTECTED]>
http://collab.net/ | open source | do the right thing


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to