src\com\groundside\jsf\backing\Edit.java
07-Apr-2005 08:10:38
1 package com.groundside.jsf.backing;
2
3 import com.groundside.jsf.Neighbors;
4 import javax.faces.application.Application;
5 import com.groundside.jsf.Contact;
6 import javax.faces.context.FacesContext;
7 import javax.faces.el.ValueBinding;
8 public class Edit
9 {
10
11 public String saveAction()
12 {
13 FacesContext ctx = FacesContext.getCurrentInstance();
14 Application app = ctx.getApplication();
15 ValueBinding editedContactBind = app.createValueBinding("#{editContact}");
16 ValueBinding contactListBind = app.createValueBinding("#{neighbors}");
17 Contact contact = (Contact)editedContactBind.getValue(ctx);
18 Neighbors neighbors = (Neighbors)contactListBind.getValue(ctx);
19 neighbors.updateContact(contact);
20 return "return";
21 }
22
23
24
25 }
26