It works! Thanks a lot! On Mon, Feb 21, 2011 at 3:18 PM, Taha Hafeez <tawus.tapes...@gmail.com>wrote:
> On Mon, Feb 21, 2011 at 9:50 AM, leon <mail....@gmail.com> wrote: > > > Hi All, > > > > Hi > > > > I know that we can pass a parameter through context attribute of tag in > > template, but how to achieve it in java code? like this: > > > > public class Edit { > > @Property > > @Autowired > > private Employee employee; > > > > @InjectPage > > private View view; > > > > @Log > > Object onSuccess() { > > employee.persist(); > > > > > view.setEmployeeId(employee.getId()); > > > > // Pass parameter employeeId to view Page > > > > return view; > > } > > } > > > > public class View { > > @Parameter > > private Long employeeId; > > > > > public void setEmployeeId(Long employeeId){ > this.employeeId = employeeId; > } > > Long onPassivate(){ > return employeeId; > } > > > > > > @Property > > private Employee employee; > > > > > > void onActivate(Long employeeId) { > > if (employeeId != null) > > employee = Employee.findEmployee(employeeId); > > } > > } > > > > Thanks! > > -- > > Best Regards > > Rock Lee > > > > regards > Taha > -- Best Regards Li Guoqiang