Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core">
- <h:head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
- <title>Users</title>
- <h:outputStylesheet library="css" name="style.css" />
- </h:head>
- <h:body>
- <h1>Users</h1>
- <h:form>
- <h:dataTable value="#{loginBean.list}" var="l" border="1" >
- <h:column>
- <f:facet name="header">Name</f:facet>
- <h:inputText value="#{l.UName}" size="10" rendered="#{loginBean.editable}" />
- <h:outputText value="#{l.UName}" rendered="#{not loginBean.editable}" />
- </h:column>
- <h:column>
- <f:facet name="header">Email</f:facet>
- <h:inputText value="#{l.emailAdd}" size="10" rendered="#{loginBean.editable}" />
- <h:outputText value="#{l.emailAdd}" rendered="#{not loginBean.editable}" />
- </h:column>
- <h:column>
- <f:facet name="header">Password</f:facet>
- <h:inputText value="#{l.pword}" size="10" rendered="#{loginBean.editable}" />
- <h:outputText value="#{l.pword}" rendered="#{not loginBean.editable}" />
- </h:column>
- <h:column>
- <f:facet name="header">Edit</f:facet>
- <!-- <h:commandLink value="Edit" action="#{loginBean.editAction(list)}"/> -->
- <h:commandLink value="Edit" action="#{loginBean.editAction(l)}" rendered="#{loginBean.editable}"/>
- </h:column>
- <h:column>
- <f:facet name="header">Save</f:facet>
- <h:commandLink value="Save" action="#{loginBean.updateAction()}" />
- </h:column>
- <h:column>
- <f:facet name="header">Delete</f:facet>
- <h:commandLink value="Delete" action="#{loginBean.deleteAction(l)}" />
- </h:column>
- </h:dataTable>
- </h:form>
- </h:body>
- </html>
- @ManagedBean(name = "loginBean" , eager=true)
- @ViewScoped
- public class LoginBean implements Serializable {
- private static final long serialVersionUID = 1L;
- private String emailid;
- private String password;
- boolean disabled = true;
- @EJB
- LoginManagerRemote loginmanager;
- EntityManager em;
- List<Login> list=null;
- @PostConstruct
- public void init()
- {System.out.println(">>>> In List method <<<<");
- list = new ArrayList<Login>();
- list = loginmanager.findAll();
- }
- public List<Login> getList()
- {
- return list;
- }
- public void setList(List<Login> list) {
- this.list = list;
- }
- public String updateAction() {
- for ( Login log: list){
- System.out.println(">>>> Started in the list for loop <<<<");
- System.out.println(">>>> Update nethod, ersisted data <<<<");
- log.setEditable(false);
- setEditable(false);
- }
- return "";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement