Commit d37a1b59 by nicku

Käyttäjänhallinta päivityksiä.

git-svn-id: https://dev.intra.insomnia.fi/svn/trunk@27 8cf89bec-f6a3-4178-919f-364fb3449fe5
1 parent f7160f8a
......@@ -12,19 +12,19 @@
<ui:define name="header">Edit user</ui:define>
<ui:define name="content">
<h:form>
<h:dataTable id="user" value="#{userView.user}" var="user">
<h:column>
<f:facet name="header">
<h:outputText value="Nick" />
</f:facet>
<h:inputText value="{#user.nick}" />
<h:inputText value="#{user.nick}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Real name" />
</f:facet>
<h:inputText value="{#user.realname}" />
<h:inputText value="#{user.name}" />
</h:column>
<h:column>
<f:facet name="header">
......@@ -36,9 +36,11 @@
<f:facet name="header">
<h:outputText value="Town" />
</f:facet>
<h:inputText value="{#user.town}" />
<h:inputText value="#{user.town}" />
</h:column>
</h:dataTable>
<h:commandButton action="#{userView.saveEdited()}" value="Save" />
</h:form>
</ui:define>
<ui:define name="footer">footer</ui:define>
......
......@@ -34,7 +34,7 @@ public class UserView {
private User currentUser;
private String nick = "default";
private String password = "default";
private String realname = "default";
private String name = "default";
private String email = "default";
private String address = "default";
private String town = "default";
......@@ -106,7 +106,7 @@ public class UserView {
return "fault";
}
// asetetaan muut kentt..
currentUser.setName(realname);
currentUser.setName(name);
currentUser.setAddress(address);
currentUser.setNick(nick);
currentUser.setZip(zip);
......@@ -120,6 +120,20 @@ public class UserView {
return "list";
}
public String saveEdited() {
this.item.setName(name);
this.item.setAddress(address);
this.item.setNick(nick);
this.item.setZip(zip);
this.item.setEmail(email);
this.item.setTown(town);
this.item.setPhone(phone);
this.item.setFemale(female);
this.item.setPassword(password);
userBean.mergeChanges(this.item);
return "list";
}
public void setNick(String nick) {
this.nick = nick;
......@@ -134,11 +148,11 @@ public class UserView {
}
public String getRealname() {
return realname;
return name;
}
public void setRealname(String realname) {
this.realname = realname;
this.name = realname;
}
public void setCurrentUser(User currentUser) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!