velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Kapp <andre.k...@up.ac.za>
Subject Velocity vm to vm question
Date Tue, 20 May 2008 06:04:07 GMT


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).addPathInfo("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 &#160;&#160;&#160;</grid-col>
        <grid-col>$transaction.PaymentStream &#160;&#160;&#160;</grid-col>
        #if($transaction.isAccepted())
        <grid-col>$transaction.Response &#160;&#160;&#160;</grid-col>
        <grid-col>$transaction.Auth_error &#160;&#160;&#160;</grid-col>
        #else
        <grid-col><error>$transaction.Response
&#160;&#160;&#160;</error></grid-col>

<grid-col><error>$setcomerr.get($transaction.Auth_error)&#160;&#160;&#160;</error></grid-col>
        #end
        <grid-col>$transaction.Timestamp &#160;&#160;&#160;</grid-col>
        <grid-col>$transaction.Order_id &#160;&#160;&#160;</grid-col>
        <grid-col>$transaction.Reference &#160;&#160;&#160;</grid-col>
        <grid-col>$transaction.getFormattedAmount()
&#160;&#160;&#160;</grid-col>
        <grid-col>$transaction.Processed &#160;&#160;&#160;</grid-col>
        <grid-col>$transaction.ClientType &#160;&#160;&#160;</grid-col>
        <grid-col>$transaction.ClientNumber &#160;&#160;&#160;</grid-col>
        <grid-col><error>$!transaction.Error
&#160;&#160;&#160;</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


Mime
View raw message