You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Amanda Edwards <Am...@airmantech.com> on 2002/04/03 18:27:16 UTC

Screens & Redirect & XML & loads of hassle

Hi Folks,
 
Still trying to get to grips with Turbine!
 
Anyway the problem I'm having is that I call my action class, which then
parses an xml file, and depending on the element that comes back from
the xml file I need to display a certain screen.
 
Ok so in the action class I think I need to use setTemplate(RunDate
data, "SomeScreen.vm");
 
But the problem is that when the screen is displayed it contains no form
field values, i.e. the java class that sits behind the screen doesn't
seem to be called to populate the screen.
 
Maybe I should be doing this differently?
 
My html looks like the following
 
<form method="POST" name="form1"
action="$link.setPage("GenericQueue.vm").setAction("GenericQueueRecords"
)">
            
            #if ($data.Parameters.nextTemplate)
                        <input type="text" name="nextTemplate"
value="$data.Parameters.nextTemplate">
            else
                <input type="text" name="nextTemplate"
value="EnterNotices.vm">    
            end
 
 
My java class currently look like:
 
public class GenericQueueRecords extends SecureAction
{
public void doGetrecs( RunData data, Context context ) throws Exception
{
boolean template = getValueFromXML();
 
                        if (template)
                        {
                                    setTemplate(data, "AcCabinForm.vm");
                        }
                        else 
                        {
                                    setTemplate(data, "AcCabin.vm");
                        }
            }
}
 
Any help would be appreciated. 
_______________________________ 
Amanda Edwards
Aircraft Management Technologies 
p: +353 1 845 7254 
f:  +353 1 806 1025 
e:  <ma...@airmantech.com> amanda.edwards@airmantech.com 
w:
<outbind://8-000000009FA5961FE368094292D08BEB69BD89D70700E51C581E6A4B704
19EE95ECAF247F88700000000F3410000E51C581E6A4B70419EE95ECAF247F8870000000
0F57F0000/www.airmantech.com> www.airmantech.com 
 

Re: Screens & Redirect & XML & loads of hassle

Posted by John McNally <jm...@collab.net>.
use data.setTarget("foo.vm")

john mcnally

Amanda Edwards wrote:
> 
> Hi Folks,
> 
> Still trying to get to grips with Turbine!
> 
> Anyway the problem I'm having is that I call my action class, which then
> parses an xml file, and depending on the element that comes back from
> the xml file I need to display a certain screen.
> 
> Ok so in the action class I think I need to use setTemplate(RunDate
> data, "SomeScreen.vm");
> 
> But the problem is that when the screen is displayed it contains no form
> field values, i.e. the java class that sits behind the screen doesn't
> seem to be called to populate the screen.
> 
> Maybe I should be doing this differently?
> 
> My html looks like the following
> 
> <form method="POST" name="form1"
> action="$link.setPage("GenericQueue.vm").setAction("GenericQueueRecords"
> )">
> 
>             #if ($data.Parameters.nextTemplate)
>                         <input type="text" name="nextTemplate"
> value="$data.Parameters.nextTemplate">
>             else
>                 <input type="text" name="nextTemplate"
> value="EnterNotices.vm">
>             end
> 
> 
> My java class currently look like:
> 
> public class GenericQueueRecords extends SecureAction
> {
> public void doGetrecs( RunData data, Context context ) throws Exception
> {
> boolean template = getValueFromXML();
> 
>                         if (template)
>                         {
>                                     setTemplate(data, "AcCabinForm.vm");
>                         }
>                         else
>                         {
>                                     setTemplate(data, "AcCabin.vm");
>                         }
>             }
> }
> 
> Any help would be appreciated.
> _______________________________
> Amanda Edwards
> Aircraft Management Technologies
> p: +353 1 845 7254
> f:  +353 1 806 1025
> e:  <ma...@airmantech.com> amanda.edwards@airmantech.com
> w:
> <outbind://8-000000009FA5961FE368094292D08BEB69BD89D70700E51C581E6A4B704
> 19EE95ECAF247F88700000000F3410000E51C581E6A4B70419EE95ECAF247F8870000000
> 0F57F0000/www.airmantech.com> www.airmantech.com
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>