File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes need help in jquery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "need help in jquery" Watch "need help in jquery" New topic
Author

need help in jquery

Shakuntala Bhajantri
Greenhorn

Joined: Dec 23, 2010
Posts: 4
I am using JSF and xhtml i am displaying grid on select of grid it should trigger to next page i have add loading image till next page load i tried with Jquery i am getting following error

01:03:56,186 [http-8083-Processor24] ERROR [Faces Servlet] - Servlet.service() for servlet Faces Servlet threw exception
java.lang.IllegalArgumentException: null source
at java.util.EventObject.<init>(Unknown Source)
at javax.faces.event.SystemEvent.<init>(SystemEvent.java:67)
at javax.faces.event.ComponentSystemEvent.<init>(ComponentSystemEvent.java:69)
at javax.faces.event.PostRestoreStateEvent.<init>(PostRestoreStateEvent.java:69)
at com.sun.faces.lifecycle.RestoreViewPhase.deliverPostRestoreStateEvent(RestoreViewPhase.java:256)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:245)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.databorough.utils.SessionTimeoutFilter.doFilter(SessionTimeoutFilter.java:80)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)


My code XHTML code


<!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"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<title>Select Customer</title>
<hutputScript name="jsf.js" library="javax.faces" target="head" />
<script language="JavaScript" src="scripts/jquery/bootjquery.js" type="text/javascript"></script>
<!-- Stylesheet -->
<link href="theme/XWDFT.CSS" rel="stylesheet" type="text/css" />
<link href="theme/AZOFQCSRRS1.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen" href="block.css" />

<script type="text/javascript" src="jquery.blockUI.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#submitloading').click(function() {
alert('HI');
$.blockUI({
message: $('#loading'),
css: { top: '20%' }
});

setTimeout($.unblockUI, 2000);
});
});

</script>
<script type="text/javascript">

function checkimage() {
var max="updtGrid:grid:0:submitloading";
document.getElementById(max).style.display = 'none';

}
//Pavan 12.08.2011 Created to toggle for show/hide old quotes
function old_quotes(quotes_status,status){
if(quotes_status=='Y'){

hide_old_quotes_process(status);
if(status=='Y'){
document.getElementById('updtGrid:show_hide_old_quotes_toggle').value = 'Y';
document.getElementById('updtGrid:grid:0:applyFilter').click();
}

}
if(quotes_status=='N'){

show_old_quotes_process(status);
if(status=='Y'){
document.getElementById('updtGrid:show_hide_old_quotes_toggle').value = 'N';
document.getElementById('updtGrid:grid:0:applyFilter').click();
}
}

if(quotes_status==''){
document.getElementById("show_quote").style.visibility = 'visible';
document.getElementById("show_quote").style.display = 'block';
document.getElementById("show_quote_label").style.visibility = 'hidden';
document.getElementById("show_quote_label").style.display = 'none';
document.getElementById("hide_quote").style.visibility = 'hidden';
document.getElementById("hide_quote").style.display = 'none';
document.getElementById("hide_quote_label").style.visibility = 'visible';
document.getElementById("hide_quote_label").style.display = 'block';
}

}

function hide_old_quotes_process(status1){

document.getElementById('show_quote').style.visibility = 'hidden';
document.getElementById('show_quote').style.display = 'none';
document.getElementById('show_quote_label').style.visibility = 'visible';
document.getElementById('show_quote_label').style.display = 'block';
document.getElementById('hide_quote').style.visibility = 'visible';
document.getElementById('hide_quote').style.display = 'block';
document.getElementById('hide_quote_label').style.visibility = 'hidden';
document.getElementById('hide_quote_label').style.display = 'none';
//if(status1=='Y'){
//document.getElementById('updtGrid:displayorhideoldquotes').click();
//}
}
function show_old_quotes_process(status1){

document.getElementById('show_quote').style.visibility = 'visible';
document.getElementById('show_quote').style.display = 'block';
document.getElementById('show_quote_label').style.visibility = 'hidden';
document.getElementById('show_quote_label').style.display = 'none';
document.getElementById('hide_quote').style.visibility = 'hidden';
document.getElementById('hide_quote').style.display = 'none';
document.getElementById('hide_quote_label').style.visibility = 'visible';
document.getElementById('hide_quote_label').style.display = 'block';
//if(status1=='Y'){
//document.getElementById('updtGrid:displayorhideoldquotes').click();
//}
}
function credit(status){
alert(status);
document.getElementById('updtGrid:creditFlag').value=status;
alert(document.getElementById('updtGrid:creditFlag').value);
document.getElementById('updtGrid:grid:0:applyFilter').click();
alert(document.getElementById('updtGrid:creditFlag').value);
}
</script>
<script type="text/javascript">

//--><![CDATA[//><!--
function validnumber(){
var c=document.getElementById('updtGrid:grid:0:Common_Customer_ID').value;
var q=document.getElementById('updtGrid:grid:0:Quote_number').value;
var l=document.getElementById('updtGrid:grid:0:License_Year').value;

if(c==""&& q==""&&l==""){
//alert('Enter Value to filter');
return true;
}
else if(c!=""){
//if(isNaN(c)){
// alert('Invalid value.Please enter Customer ID numeric value');
//document.getElementById('updtGrid:grid:0:Common_Customer_ID').focus();
//document.getElementById('updtGrid:grid:0:Common_Customer_ID').select();
//return false;
//}else{
return true;

//}
}else if(q!=""){
if(isNaN(q)){
if(document.getElementById('updtGrid:grid:1:Quote_number').value=='C'){
return true;
}else{
alert('Invalid value.Please enter numeric value');
document.getElementById('updtGrid:grid:0:Quote_number').focus();
document.getElementById('updtGrid:grid:0:Quote_number').select();
return false;
}
}else{
return true;

}
}else if(l!=""){
if(isNaN(l)){
alert('Invalid value.Please enter numeric value');
document.getElementById('updtGrid:grid:0:License_Year').focus();
document.getElementById('updtGrid:grid:0:License_Year').select();
return false;
}else if(l.length<4){


alert('Please enter valid licensce year');
return false;
}else{

return true;
}
}


}
//--><!]]>
</script>
<style type="text/css">
.hyperlink{
color: blue;
text-decoration: underline;
cursor: pointer;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 8pt;
}
.non_hyperlink{
color: black;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 8pt;
}
</style>
</h:head>

<body onload="checkimage();" onLoad="autoFitDepIFrame('depGridFrame');" onbeforeunload="beforeLogout();" onUnload="logout('/x_ref16febealinvoice/faces/azopbysrrs1l.xhtml?logout=t');">
<div id="AZOPBYSRRS1L" class="clientArea">
${azopbysrrs1l.onPreRender}
<f:view>
<h:form id="updtGrid" styleClass="XWDFTrecordStatus">
<!-- Modified by pavan 01.08.2011, removed rendered="#{azdsgbsrrs1.titleBarRendered} from panelGroup
<h:panelGroup rendered="#{azopbysrrs1l.titleBarRendered}">
-->
<h:panelGroup ><H1 class="groupHeader">
<Label class="groupHeaderText">Select Customer
</Label>
</H1>
</h:panelGroup>
<table border="0" >
<tr><td></td></tr>
<tr>
<td id="messagePanel"><div class="clientMessages"></div><h:messages layout="table" styleClass="XWDFTrecordStatus"/></td>
</tr>
</table>

<!-- Pavan 12.08.2011 Created to toggle for show/hide old quotes -->
<h:inputHidden id="show_hide_old_quotes_toggle_classValue" value="#{azopbysrrs1l.show_Hide_Old_Quotes}"/>
<h:inputHidden id="show_hide_old_quotes_toggle"/>
<h:inputHidden id="hidden_C_ID" value="#{azopbysrrs1l.hidden_C_ID}"/>
<h:inputHidden id="hidden_Quote_Number" value="#{azopbysrrs1l.hidden_Quote_Number}"/>
<h:inputHidden id="hidden_L_Year" value="#{azopbysrrs1l.hidden_L_Year}"/>
<script type="text/javascript">
document.getElementById('updtGrid:show_hide_old_quotes_toggle').value = document.getElementById('updtGrid:show_hide_old_quotes_toggle_classValue').value;
</script>

<table border="0" >
<tr>
<td >
<div id="show_quote">
<label class="hyperlink">Show old</label><label class="non_hyperlink">/</label>
</div>
<div id="show_quote_label">
<label class="non_hyperlink" >Show old</label><label class="non_hyperlink">/</label>
</div>
</td>

<td >
<div id="hide_quote">
<label class="hyperlink" >Hide old</label>
</div>
<div id="hide_quote_label">
<label class="non_hyperlink">Hide old</label>
</div>
</td>

<td><DIV class="actionLink"></DIV></td>
<td >
<div class="pageLinks">
<h:commandLink id="fstLink" action="#{azopbysrrs1l.fetchFirst}" rendered="#{azopbysrrs1l.page.hasFirstPage}">
<h:graphicImage url="theme/first.gif" value="#{azopbysrrs1l.firstLinkText}" alt="First page" style="border:0px"/>
</h:commandLink>
<h:commandLink id="prevLink" action="#{azopbysrrs1l.fetchPrevious}" rendered="#{azopbysrrs1l.page.hasPreviousPage}">
<h:graphicImage url="theme/left.gif" value="#{azopbysrrs1l.prevLinkText}" alt="Previous Page" style="border:0px"/>
</h:commandLink>
<h:commandLink id="nextLink" action="#{azopbysrrs1l.fetchNext}" rendered="#{azopbysrrs1l.page.hasNextPage}">
<h:graphicImage url="theme/right.gif" value="#{azopbysrrs1l.nextLinkText}" alt="Next Page" style="border:0px"/>
</h:commandLink>
<h:commandLink id="lastLink" action="#{azopbysrrs1l.fetchLast}" rendered="#{azopbysrrs1l.page.hasLastPage}">
<h:graphicImage url="theme/last.gif" value="#{azopbysrrs1l.lastLinkText}" alt="Last Page" style="border:0px"/>
</h:commandLink>
</div>
</td></tr>
<!-- Modified by pavan 01.08.2011, removed <TR>
<TD id="messagePanel" style="display:block"><div class="clientMessages"></div><h:messages layout="table" styleClass="XWDFTrecordStatus"/>
</TD></TR>
-->
</table>
<div id="gridContainer" class="XWDFTgridContainer">
<table border="0" >
<tr>
<td>
<h:dataTable id="grid" value="#{azopbysrrs1l.dataModel}" var="opbysrrG" styleClass="XWDFTgrid" headerClass="gridTableHeader gridTableHeader-Text" columnClasses="XWDFTrightBottomBorder" rowClasses="XWDFTgridData,XWDFTgridAltData" border="0" cellspacing="0" cellpadding="0">
<h:column>
<f:facet name="header">
<h:selectBooleanCheckbox style="width: 15px;height: 15px;display:none;" onclick="checkAll(this, 'checked')"/>
</f:facet>
<hutputLink id="submitloading" class="submit" style="display:block;" value="zzopaae1rs1.xhtml">
<h:graphicImage alt="image not found." value="/images/Select1.png" width="15" height="15" title="Select" />

<f:param name="SCREEN_MODE" value="UPDATE" />
<f:param name="parm0" value="#{opbysrrG.price_quote_inv_HDR_main.common_Customer_ID}" />
<f:param name="parm1" value="#{opbysrrG.price_quote_inv_HDR_main.quote_number}" />
<f:param name="parm2" value="#{opbysrrG.price_quote_inv_HDR_main.sales_model}" />
<f:param name="parm3" value="#{opbysrrG.price_quote_inv_HDR_main.license_Year}" />
<f:param name="parm4" value="N" />
<f:param name="parm5" value="S" />
</hutputLink>


<h:commandButton id="applyFilter" value="" title="Apply Filter" style="border:0px" styleClass="filterButton" image="theme/filter.gif" rendered="#{opbysrrG.positionTo}" action="#{azopbysrrs1l.applyFilter}" onclick="if(!validnumber())return false;"/>

</h:column>



<h:column>
<f:facet name="header">
<hutputText value="Customer ID" title=""/>
</f:facet>

<h:inputText id="Common_Customer_ID" maxlength="10" value="#{opbysrrG.price_quote_inv_HDR_main.common_Customer_ID}" style="width: 90px; #{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />

</h:column>
<h:column>
<f:facet name="header">
<hutputText value="Quote" title=""/>
</f:facet>
<h:inputText id="Quote_number" maxlength="1" value="#{opbysrrG.price_quote_inv_HDR_main.quote_number}" style="width: 9px; #{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
</h:column>
<h:column>
<f:facet name="header">
<hutputText value="Year" title=""/>
</f:facet>
<h:inputText id="License_Year" maxlength="4" value="#{opbysrrG.price_quote_inv_HDR_main.license_Year}" style="width: 36px; #{opbysrrG.style}; text-align: right" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" >
<f:converter converterId="NumberConverter"/>
<f:param name="dbFormat" value="0000"/>
<f:param name="siteFormat" value="###0;-###0"/>
</h:inputText>
</h:column>

<h:column>
<f:facet name="header">
<hutputText value="Customer" title=""/>
</f:facet>
<h:inputText id="Bill_to_customer_name" value="#{opbysrrG.price_quote_inv_HDR_main.bill_to_customer_name}" style="width: 270px; #{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
</h:column>
<h:column>
<f:facet name="header">
<hutputText value="Customer Name 2" title=""/>
</f:facet>
<h:inputText id="Bill_to_customer_name_2" value="#{opbysrrG.price_quote_inv_HDR_main.bill_to_customer_name_2}" style="width: 200px; #{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
</h:column>

<h:column>
<f:facet name="header">
<hutputText value="Address" title=""/>
</f:facet>

<table border="0">
<tr >
<td >
<h:inputText id="Bill_to_address_line_1" size="35" value="#{opbysrrG.price_quote_inv_HDR_main.bill_to_address_line_1}" style="#{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
 
<h:inputText id="Bill_to_address_line_2" size="60" value="#{opbysrrG.price_quote_inv_HDR_main.bill_to_address_line_2}" style="#{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
</td>
</tr>
<tr>
<td >
<h:inputText id="Bill_to_city_name" size="35" value="#{opbysrrG.price_quote_inv_HDR_main.bill_to_city_name}" style="#{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
 
<h:inputText id="State_Province_desc" size="20" value="#{opbysrrG.state_Province_desc}" style=" #{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
 
<h:inputText id="Country_name" size="30" value="#{opbysrrG.country_name}" style="#{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
</td>
</tr>
</table>
</h:column>


<!--<h:column>
<f:facet name="header">
<hutputText value="Address_line_2" title=""/>
</f:facet>
<h:inputText id="Bill_to_address_line_2" value="#{opbysrrG.price_quote_inv_HDR_main.bill_to_address_line_2}" style="width: 270px; #{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
</h:column>
<h:column>
<f:facet name="header">
<hutputText value="City Name" title=""/>
</f:facet>
<h:inputText id="Bill_to_city_name" value="#{opbysrrG.price_quote_inv_HDR_main.bill_to_city_name}" style="width: 216px; #{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
</h:column>
<h:column>
<f:facet name="header">
<hutputText value="State Province Desc" title=""/>
</f:facet>
<h:inputText id="State_Province_desc" value="#{opbysrrG.state_Province_desc}" style="width: 117px; #{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
</h:column>
<h:column>
<f:facet name="header">
<hutputText value="Country Name" title=""/>
</f:facet>
<h:inputText id="Country_name" value="#{opbysrrG.country_name}" style="width: 270px; #{opbysrrG.style}; text-align: left" styleClass="XWDFTgridField XWDFTgridFieldReadOnly" readonly="#{opbysrrG.readonly}" />
</h:column>
--></h:dataTable>
</td></tr>
</table>
<!-- Pavan 21.07.2011 -->
<script type="text/javascript">
document.getElementById("updtGrid:grid:0:Bill_to_customer_name").style.visibility="hidden";
document.getElementById("updtGrid:grid:0:Bill_to_customer_name_2").style.visibility="hidden";
document.getElementById("updtGrid:grid:0:Bill_to_address_line_1").style.visibility="hidden";
document.getElementById("updtGrid:grid:0:Bill_to_address_line_2").style.visibility="hidden";
document.getElementById("updtGrid:grid:0:Bill_to_city_name").style.visibility="hidden";
document.getElementById("updtGrid:grid:0:State_Province_desc").style.visibility="hidden";
document.getElementById("updtGrid:grid:0:Country_name").style.visibility="hidden";
</script>
</div>
<input type="hidden" name="form" value="f"/>
<h:inputHidden id="jsessionid" value="#{azopbysrrs1l.sessionId}"/>
<h:inputHidden id="jobDetails" value="#{azopbysrrs1l.jobDetails}"/>
<h:inputHidden id="creditFlag" value="#{azopbysrrs1l.credit}"/>
<table border="0" >
<tr>
<td class="XWDFTrecordStatus" >
<input type="button" name="" value="Cancel" class="buttons" onclick="parent.$.fn.colorbox.close();" style="display:none;"/>
<h:commandButton id="SELECT_S" value="Select" title="SELECT" styleClass="buttons" onclick="return chkGridRecord(this);setGridTarget('ZZPPRPPVRS1'); javascript:self.close()" action="#{azopbysrrs1l.select}" style="display:none;"/>
<h:commandButton id="displayorhideoldquotes" value="Display/Hide Old Quotes" title="displayorhideoldquotes" styleClass="buttons" disabled="#{azopbysrrs1l.gridEmpty}" action="#{azopbysrrs1l.displayOrHideOldQuotes}" actionListener="#{azopbysrrs1l.evenListener}" style="display:none;"/>
<script type="text/javascript">
document.getElementById('updtGrid:grid:0:Common_Customer_ID').value = document.getElementById('updtGrid:hidden_C_ID').value;
document.getElementById('updtGrid:grid:0:Quote_number').value = document.getElementById('updtGrid:hidden_Quote_Number').value;
document.getElementById('updtGrid:grid:0:License_Year').value = document.getElementById('updtGrid:hidden_L_Year').value;
if(document.getElementById('updtGrid:show_hide_old_quotes_toggle').value=='N'){
old_quotes('N','N');
}
if(document.getElementById('updtGrid:show_hide_old_quotes_toggle').value=='Y'){
old_quotes('Y','N');
}
else{
old_quotes('','N');
}
</script>
</td>
</tr>
</table>
</h:form>
</f:view>
<SCRIPT LANGUAGE = 'javascript'>
function setNavMenu(Page)
{
if(Page=='AZOPBYSRRS1L')
{
if(document.getElementById('updtGrid:creditFlag').value == 'Y'){
window.parent.document.getElementById('NavMenuNotAct8').style.display="block";
window.parent.document.getElementById('NavMenuAct8').style.display="none";
}
if(document.getElementById('updtGrid:creditFlag').value == 'N'){
window.parent.document.getElementById('NavMenuNotAct1').style.display="block";
window.parent.document.getElementById('NavMenuAct1').style.display="none";
}
}
}
showTitle();
showJobDetails(document.getElementById("updtGrid"));
setScreenName("AZOPBYSRRS1L");
setNavMenu("AZOPBYSRRS1L");
</SCRIPT>

</div>

<div id=loading style="display:none">

<h1>Processing....</h1>
</div>

</div>
</body></html>





Please help me i am trying from past 2 days plzzzzzzzzzz
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Use code tags!

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help in jquery
 
Similar Threads
Foreign key field population from datatable to textbox?
unable to get next form
How to pass values from struts select tag to another struts tag?
rich:dropSupport not working
spaces while populating using s:iterator