Abhi Singh

Greenhorn
+ Follow
since Feb 02, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Abhi Singh

Bear Bibeault wrote:How do you have the validation hooked up? Can't help you with the scant info you have provided.


there is no submit button on my page.
I have used find button and it onclick is handled in js
$(.findbuttonclass).click(function(){
validateFind();
});

function validate(){
if(document.getElementById("account")==""){
return false;
}
}

Eric Pascarello wrote:You need to validate with onsubmit of the form, not onclick of a button.

Eric



there is no submit button on my page.
I have used find button and it onclick is handled in js
$(.findbuttonclass).click(function(){
validateFind();
});


I have one text field and one button('Find') on my JSP page. If I press 'Enter' key my form is getting submitted without validation.
I have no submit button on my page. Although I have handled that problem by checking Enter key code. But I wnat to know the
root cause and its probably its solution
<view-state id="downloadForm" view="externalRedirect:/download">
<on-entry >
<evaluate expression="clientService.getClientConsentForm(flowRequestContext.externalContext)" />
</on-entry>
<transition to="finish"/>
</view-state>

I am calling this function from a drop down but i am getting the form in alternate times.
I am using the given below function for the download

<rich:menuItem action="menuRedirect" value="#{messages.client_consent_form_label}">
<f:param name="redirectTo" value="client?goToState=downloadForm" />
</rich:menuItem>

In even times of call I am not getting goToState. Most probably because when I get the form the page is not rendered because the flow ends.
Can anyone help me to find out the exact issue behind this.
13 years ago
JSF
<view-state id="downloadForm" view="externalRedirect:/download">
<on-entry >
<evaluate expression="clientService.getClientConsentForm(flowRequestContext.externalContext)" />
</on-entry>
<transition to="finish"/>
</view-state>

I am calling this function from a drop down but i am getting the form in alternate times.
I am using the given below function for the download

<rich:menuItem action="menuRedirect" value="#{messages.client_consent_form_label}">
<f:param name="redirectTo" value="client?goToState=downloadForm" />
</rich:menuItem>

In even times of call I am not getting goToState. Most probably because when I get the form the page is not rendered.
Can anyone help me to find out the exact issue behind this.
13 years ago
JSF
<td align="center" id="tdBtnAddClient">
<sf:validateAllOnClick>
<a4j:commandButton id="btnSave" value="#{messages.btn_save}" styleClass="button_css" action="submit" onclick="#{rich:component('wait')}.show();" oncomplete="changeClientBtns(this);#{rich:component('wait')}.hide();Richfaces.showModalPanel('successDialogue');" reRender="clientDetailsPanel,cmbName,cmbBranch,lstClientDetails,dtClientHistoryList,dtScrClientHistoryList,dtAppointmentNavigate,AppointmentTable,billListPanel,tlbUpdateMedCat,dtPrescriptionNavigate,dtPrescriptionHistoryList,cltPresNotePanel,prescriptionInfoList,dtBillNavigate,sDtBillPayment,txtBillRemark,txtBalAmt,txtPaidAmt,txtTotalAmt,txtBillDate,txtBillNumber,serviceListTable,dtServiceNavigate,txtStatus,txtClientName,txtAptDate,txtBookTime,txtClinic,txtEmployee,successDialogue,showname,directSearchPanel"/>
</sf:validateAllOnClick>
<rich:spacer width="5px" />
</td>



I am using above code to add a new client in my spring module. Its working perfectly when I am using mozila forefox as browser but in IE8 the action is not getting called. A blank notification comes up without saving data. I have debugged using the IE debugger however I am not getting any type of scripting error. Is this a browser issue or something to be changed in code
13 years ago
JSF
Thanks Ilari Moilanen. Id was used, actually in place h:form I was using form so not getting the id.
Anyways thanks a lot
13 years ago
JSF

Nirvan Buddha wrote:The oncomplete attribute may be generating javascript code before the ajax request is made, which means the old value is passed(although it may be executing the function after the ajax request is complete). If your appStatusId is rendered somewhere in your page, you can use the getElementById to get its value in the chkPackList() function.

regards,
Nirvan.


Thanks Nirvan. I hope that javascript is getting called earlier before the ajax request. Anyways that issue has been resolved. Thanks a lot
13 years ago
JSF
<td align="left" scope="col" >
<rich:calendar datePattern="yyyy-MM-dd" id="calHolidayDate" value="#{holiday.holidayCalDate}" inputClass="calendarTextBox" mode="ajax" dataModel="#{currentCalForward}" boundaryDatesMode="scroll" />
</td>


I am using rich:calendar. When I change the month or year, the name of the month doesn't change. But on selecting any date after changing month it shows the correct data. In error console it gives the error

Error: this._form is null
Source File: http://localhost:8084/abs/spring/a4j/g/3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript
Line: 201

Although I am using the above code at many other places where it is working fine.
13 years ago
JSF
<h:selectBooleanCheckbox id="chkPanelPackage" value="#{packageDataMo.selected}" >
<a4j:support action="toggleServices" event="onclick" oncomplete="chkPackList(#{appointment.appStautsId})" Render="dtServicesDetails,scrServiceDetails,appointmentBookBtnsPanel,chkPanelPackage" ajaxSingle="true">
<f:param name="treatInd" value="-1"/>
<f:param name="packInd" value="#{packInd}"/>
</a4j:support>

</h:selectBooleanCheckbox>


In the above code I have called a javascript function on oncomplete tag named chkPackList and trying to pass a value that is returned from the action called. However I am not getting the exact value in the javascript. default value of appointment.appStautsId is 0 and in action it is set to -1. For the first time I am getting the zero value in place of -1 but on the second action completion I am getting -1 value. Can someone suggest me what is the exact problem.
13 years ago
JSF
I am new to Spring and my problem is that I am unable to fetch data from a jsp page in my MultiActionController.....I am getting null value there..


My jsp is as follow

<%--
Document : viewProfile
Created on : Feb 25, 2010, 8:24:36 PM
Author : Abhijeet
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="/spring" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Profile View Page</title>
</head>
<body>
<center>
<h2>My Profile</h2>
<form:form commandName="user" action="../Profile/UpdateDetail.htm" method="post">
<table border="1" bgcolor="gray">
<c:forEach items="${user}" var="user">
<tr>
<td>
<b>Login Id:</b>
</td>

<td>
<%--form:input path="loginName" /--%>
<input disabled="true" type="text" value="<c:out value="${user.loginName}"/>"/>
< value="<c:out value="${user.loginName}"/>" />
</td>
</tr>
<tr>
<td>
<b>Password:</b>
</td>
<td>
<input type="text" value="<c:out value="${user.password}"/>"/>
</td>
</tr>
<tr>
<td>
<b>First Name:</b>
</td>
<td>
<input type="text" value="<c:out value="${user.firstName}"/>"/>
</td>
</tr>
<tr>
<td>
<b>Last Name:</b>
</td>
<td>
<input type="text" value="<c:out value="${user.lastName}"/>"/>
</td>
</tr>
<tr>
<td>
<b>Phone:</b>
</td>
<td>
<input type="text" value="<c:out value="${user.phone}"/>"/>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Save" >
</td>

</tr>
</c:forEach>
</table>

</form:form>
</center>
</body>
</html>



I am trying to get the text box value from above jsp into my MultiActionController.......


My dispatcher-servlet.xml
..
...
..
<bean name="/Profile/*.htm" class="com.webaccess.springtrial.web.ProfileController">
<!--property name="commandName" value="profileForm"/>
<property name="commandClass" value="com.webaccess.springtrial.domain.User"-->
<property name="login" ref="login"/>



and ProfileController

public ModelAndView UpdateDetail(HttpServletRequest request,
HttpServletResponse response,Object command)throws Exception{

User user=(User)command;
// String userName=request.getParameter("loginName");
// String pass=request.getParameter("password");
// String fName=request.getParameter("firstName");
// String lName=request.getParameter("lastName");
// Long phn=Long.parseLong(request.getParameter("phone"));
String userName=user.getLoginName();
String pass=user.getPassword();
String fName=user.getFirstName();
String lName=user.getLastName();
Long phn=user.getPhone();
return new ModelAndView("home");

}

can anyone suggest me the fault in above coding or the alternate solution

</bean>
14 years ago
Thank you David for your suggestion. I have used profiler to get those results but I am not getting the actual point where the leakage occurs. Still i will try. Anyways thanks for your suggestion
14 years ago
Sometimes I am getting OutOfMemory error when running my projects for multiple users.I am using jdk 1.6,netbeans 6.0. Can anyone suggest how to find out the memory leaks or to overcome this error. As I am using jdk 1.6, it takes the size of the heap automatically according to the operating System.
14 years ago