You need an object which is persistent for the whole session to do that.
(RunData and Context are build for each call ...)
For example you may use the User object that you can get from RunData
and then use user.setTemp("result",selectList) in your screen1
and user.getTemp("result") in the following screen.
(... and remove the Object from temp-Storage with
user.setTemp("result",null); )
Uwe
-----Ursprungliche Nachricht-----
Von: John Harris [mailto:[EMAIL PROTECTED]]
Gesendet am: Freitag, 3. Mai 2002 10:17
An: [EMAIL PROTECTED]
Betreff: Passing objects to context
Please forgive the simplicity of the question, but I'm trying to learn and
become accustomed to turbine. Any help is greatly appreciated.
How can I carry a vector holding the result of a doSelect query from one
screen to another? For example, if I have the following code for screen1.vm,
with its associated screen1.java - after the user selects the id, how can
testAction.java grab $resultSet from screen1.vm.
http://localhost/appname/servlet/appname/template/screen1.vm
<form action="$link.setAction("testAction")">
<select name="testSelect" id="testSelect">
#foreach $record in $resultSet
<option value=$record.id>$record.name</option>
#end
</select>
</form>
?-------------------------------------------------------
public class screen1 extends VelocityScreen {
public void doBuildTemplate(Rundata data, Context context) throws
Exception {
Criteria crit = new Criteria();
crit.add(TablePeer.TYPE, 1);
Vector ResultSet = TablePeer.doSelect(crit);
context.put("resultSet", ResultSet);
}
}
- John Harris
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>