[prev in list] [next in list] [prev in thread] [next in thread]
List: velocity-user
Subject: RE: Velocity vm to vm question
From: "White, Tim" <Tim.White () qwest ! com>
Date: 2008-05-20 14:16:31
Message-ID: CB058A0CB7F1174181636B6F30EC85C304E187C9 () ITDENE2KM05 ! AD ! QINTRA ! COM
[Download RAW message or body]
Well, it occurs to me that you'll need either:
You might try the Velocity Debug Console, and see if you can see what
actually is making it inito your called .vm.
http://wiki.apache.org/jakarta-velocity/VelocityDebuggingTemplate
-----Original Message-----
From: Andre Kapp [mailto:andre.kapp@up.ac.za]
Sent: Tuesday, May 20, 2008 12:04 AM
To: user@velocity.apache.org
Subject: Velocity vm to vm question
Good day.
I'm just starting of with Velocity and got stuck with this.
I have a select box in one .vm that I need to read the value of in
another .vm.
I'm battling against a timeline and need some help please. Good
documentation pointers will help as well!
This is a maintenance project that I'm responsible for.
Calling vm code....
<screen>
<form label-width="200" action="$link.setPage("query-results.vm")">
#set($now = $date.getDate(0))
#set($thirtydays = $date.getDate(-30))
<date name="start" label="Start Date" showday="true"
day="$date.getDay($thirtydays)" month="$date.getMonth($thirtydays)"
year="$date.getYear($thirtydays)">
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
<option value="2012">2012</option>
<option value="2013">2013</option>
</date>
<date name="end" label="End Date" showday="true"
day="$date.getDay($now)" month="$date.getMonth($now)"
year="$date.getYear($now)">
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
<option value="2012">2012</option>
<option value="2013">2013</option>
</date>
<select name="paymentStream">
<option value="StudentFinance">Student Finance</option>
<option value="GeneralFinance">General Finance</option>
</select>
<input type="submit" value=" OK "/>
</form>
</screen>
Called vm code
<screen>
#set($end_day=$int.end_day+1)
#set($transactions=$datatool.doSelectForDate($int.start_year,$int.start_
month,$int.start_day,$int.end_year,$int.end_month,$end_day,
$payment_stream))
##set($transactions=$datatool.AllTransactions)
<text>
<link
url="$link.setScreen("TransactionCSV").addPathInfo($data.Parameters).add
PathInfo("file","transactions.txt")">DownloadCSV</link><br/>
</text>
I'm looking for the paymentStream value here ...................
Testing paymentstream values
value0 is $!{int.start_year}
value1 is $!{paymentStream}
value2 is $!{payment_stream}
value3 is $!paymentStream
value4 is $!payment_stream
Done testing
<grid class="body" border="1">
<grid-row>
## <grid-col><b>Server IP</b></grid-col>
<grid-col><b>Payment Stream</b></grid-col>
<grid-col><b>Response</b></grid-col>
<grid-col><b>Auth/Error</b></grid-col>
<grid-col><b>Timestamp</b></grid-col>
<grid-col><b>Sequence</b></grid-col>
<grid-col><b>Reference</b></grid-col>
<grid-col><b>Amount</b></grid-col>
<grid-col><b>Processed</b></grid-col>
<grid-col><b>Client Type</b></grid-col>
<grid-col><b>Client Number</b></grid-col>
<grid-col><b>Error</b></grid-col>
</grid-row>
#foreach($transaction in $transactions)
<grid-row>
## <grid-col>$transaction.Ip    </grid-col>
<grid-col>$transaction.PaymentStream
   </grid-col>
#if($transaction.isAccepted())
<grid-col>$transaction.Response    </grid-col>
<grid-col>$transaction.Auth_error    </grid-col>
#else
<grid-col><error>$transaction.Response
   </error></grid-col>
<grid-col><error>$setcomerr.get($transaction.Auth_error)  
0;</error></grid-col>
#end
<grid-col>$transaction.Timestamp    </grid-col>
<grid-col>$transaction.Order_id    </grid-col>
<grid-col>$transaction.Reference    </grid-col>
<grid-col>$transaction.getFormattedAmount()
   </grid-col>
<grid-col>$transaction.Processed    </grid-col>
<grid-col>$transaction.ClientType    </grid-col>
<grid-col>$transaction.ClientNumber
   </grid-col>
<grid-col><error>$!transaction.Error
   </error></grid-col>
</grid-row>
#end
</grid>
</screen>
This message and attachments are subject to a disclaimer. Please refer
to www.it.up.ac.za/documentation/governance/disclaimer/ for full
details. / Hierdie boodskap en aanhangsels is aan 'n vrywaringsklousule
onderhewig. Volledige besonderhede is by
www.it.up.ac.za/documentation/governance/disclaimer/ beskikbaar.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic