Reputation: 834
I have problem in my project. I am using jsf1.2, towmhawk, a4j frameworks and greybox javascript. I want to get multiple username and password. so i use the below code
ManagedBean: psgBean
private String username;(managedbean code)
private String password; //setter and getters
public String addPsgLogin()
{
System.out.println("inside addUP");
if(username.length()!=0 && password.length()!=0)
{
psgLoginFlag=1;
psgUserNameErrorMsg="";
psgPasswordErrorMsg="";
NiPsgLoginInfo psgObj=new NiPsgLoginInfo(username,password);
userpassList.add(psgObj);
}
My Jsp page :newInstallations
UserName
<h:inputText styleClass="text_box_content" id="psgUserName" value="#{psgBean.username}" size="35" />
<h:outputLabel id="psgUserNameErrorMsg" styleClass="error_style" value="#{psgBean.psgUserNameErrorMsg}" />
Password
<h:inputText styleClass="text_box_content" id="psgPassword" value="#{psgBean.password}" size="35" />
<h:outputLabel id="psgPasswordErrorMsg" styleClass="error_style" value="#{psgBean.psgPasswordErrorMsg}" />
<h:commandButton styleClass="button_style" value="Add" actionListener="#{psgBean.addPsgLogin}" / >
<h:commandButton styleClass="button_style" value="Reset" onclick="psgClear()" type="button" />
<h:outputLink value="psgusername.faces" onclick="return GB_myShow('Solvedge smartphone Web Portal', this.href,600,850)" >
<h:commandButton styleClass="button_style" value="View"></h:commandButton>
</h:outputLink>
It has image as below
after adding multiple userlogins i want to see it after pressing view button. so that i have used arraylist to collect login objects and used t:datatable to list the values. and i used greybox javascript code to show a inner page
It looks like below image
You can see update button in the second page. that update button is used to update the edited values in the inputtext values. but no change occurs if i click update button. so i just called a normal backing bean method, that also not called. here is the code
other jsp page for view
<h:form>
<t:dataTable var="us" value="#{psgBean.userpassList}" rowIndexVar="rowid" styleClass="UserTable" id="psgLoginList" headerClass="UserTable_Header"
rowClasses="UserTable_Row1,UserTable_Row2" columnClasses="UserTable_ColumnLeft">
<h:column>
<f:facet name="header" >
<t:outputText styleClass="table_header_value" value="S.No" /></f:facet>
<h:inputText styleClass="text_box_content" value="#{rowid+1}" />
</h:column>
<h:column>
<f:facet name="header">
<t:outputText styleClass="table_header_value"
value="UserName" />
</f:facet>
<h:inputText styleClass="text_box_content"
value="#{us.username}" />
</h:column>
<h:column>
<f:facet name="header">
<t:outputText styleClass="table_header_value"
value="Password" />
</f:facet>
<h:inputText styleClass="text_box_content"
value="#{us.password}" />
</h:column>
<h:column>
<f:facet name="header">
<t:outputText styleClass="table_header_value"
value="Delete" />
</f:facet>
<h:commandButton value="Delete" action="#{psgBean.deletePsgLogin}">
<t:updateActionListener value="#{us}" property="#{psgBean.deletable1}"></t:updateActionListener>
<a4j:support ajaxSingle="true" reRender="psgLoginForm:psgLoginList"></a4j:support>
</h:commandButton>
</h:column>
</t:dataTable>
<h:commandButton value="Update" action="#{psgBean.saveClicking}">
</h:commandButton>
<h:commandButton value="cancel" onclick="winclose()"></h:commandButton>
</h:form>
here is the method in managed bean
public String saveClicking()
{
System.out.println("just checking");
return null;
}
this method is not called. above code is present with in form tag only. i think the problem is in with greybox code.
/
Upvotes: 0
Views: 137
Reputation: 834
I found the error. I put rowId(s.no) in inputbox, since it is auto incremented we cannot update the value.
Upvotes: 0