> -----Original Message-----
> From: Amanda Edwards [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 03, 2002 11:27 AM
> To: [EMAIL PROTECTED]
> Subject: 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");
You should be using the RunData object to set the template in your action
Example:
public void doPerform(RunData data, Context context)
{
...
data.setScreenTemplate("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("GenericQue
> ueRecords"
> )">
>
> #if ($data.Parameters.nextTemplate)
> <input type="text" name="nextTemplate"
> value="$data.Parameters.nextTemplate">
> else
> <input type="text" name="nextTemplate"
> value="EnterNotices.vm">
> end
>
>
This isn't your entire form. Where is your submit button? I ask this
because it appears that the action you have defined below is written as an
action event. You need to have a submit button with
name="eventSubmit_doGetrecs" for the doGetrecs() method in
GenericQueueRecords to be fired. If you don't, doPerform() will be fired by
default and since I don't see doPerform() in your class, that probably means
it is defaulting to the super classes doPerform(), probably not what you
want.
> My java class currently look like:
>
> public class GenericQueueRecords extends SecureAction
You should be extending VelocitySecureAction if you are using Velocity as
your templating language. Or should I assume that SecureAction extends
VelocitySecureAction?
> {
> 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.
Where is the screen class that you mentioned above? It would be helpful if
you would include all the peices as it makes it easier for people on the
list diagnose your problem. Without all of the peices, we are left guessing
at what the real cause of the issue could be.
p.s.
I would highly recommend (if you have not already done so) reading these
Turbine how-to's:
http://jakarta.apache.org/turbine/turbine-2/howto/action-event-howto.html,
http://jakarta.apache.org/turbine/turbine-2/howto/velocity-site-howto.html,
http://jakarta.apache.org/turbine/turbine-2/howto/context-howto.html
> _______________________________
> Amanda Edwards
> Aircraft Management Technologies
> p: +353 1 845 7254
> f: +353 1 806 1025
> e: <mailto:[EMAIL PROTECTED]>
> [EMAIL PROTECTED]
> w:
> <outbind://8-000000009FA5961FE368094292D08BEB69BD89D70700E51C5
> 81E6A4B704
> 19EE95ECAF247F88700000000F3410000E51C581E6A4B70419EE95ECAF247F
> 8870000000
> 0F57F0000/www.airmantech.com> www.airmantech.com
>
>
Scott