xPage : Custom Login : Dojo xhrPost does not execute the load function

Dear All,

first of all I am very sorry, that I don’t know exactly under which category Product Area or Technical area should I post my question, so I am very sorry.

I have just started to explore the new feature of Lotus Domino 8.5.1

I have created a custom control for user login and now I embedded this into a xpage say login.xsp.

in the application’s ACL :: Anonymous has reader access.

Now when I entered a user name & password and click on log in button for authentication, the code does not give any result.

below is the code which I have written in my custom control.


<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp=“http://www.ibm.com/xsp/core

xmlns:xc="http://www.ibm.com/xsp/custom">



<xp:this.resources>

	<xp:styleSheet href="/login.css"></xp:styleSheet>

	<xp:script src="/commonJS.js" clientSide="true"></xp:script>

</xp:this.resources>

<xp:panel styleClass="loginContainer" id="mainPanel">

	<xp:br></xp:br>

	<xp:panel id="errPanel" styleClass="errMsg"></xp:panel>

	<xp:panel id="titleBarPanel" styleClass="titleBar">

		<xp:text escape="true" id="computedField1"

			styleClass="titleBar">

			<xp:this.value><![CDATA[#{javascript:compositeData.get("titleBarText");}]]></xp:this.value>

		</xp:text>

	</xp:panel>

	<xp:br></xp:br>

	<xp:panel id="loginPanel" style="padding-left:2px;">

		<xp:table border="0" cellspacing="0" disableTheme="true"

			styleClass="tblLogin">

			<xp:tr>

				<xp:td style="width:15%">

					<xp:label value="User Name" id="lblUser"></xp:label>

				</xp:td>

				<xp:td style="width:85%">

					<xp:inputText id="inpUser" styleClass="inpText"

						tabindex="1">

					</xp:inputText>

				</xp:td>

			</xp:tr>

			<xp:tr>

				<xp:td>

					<xp:label value="Password" id="lblPassword"></xp:label>

				</xp:td>

				<xp:td>

					<xp:inputText id="inpPassword"

						styleClass="inpText" password="true" tabindex="2">

					</xp:inputText>

				</xp:td>

			</xp:tr>

			<xp:tr>

				<xp:td></xp:td>

				<xp:td></xp:td>

			</xp:tr>

			<xp:tr>

				<xp:td></xp:td>

				<xp:td>

					<xp:button type="button" id="btnLogin"

						value="Login" tabindex="3" styleClass="btnLogin">

						<xp:eventHandler event="onclick"

							submit="true">

							<xp:this.handlers>

								<xp:handler

									type="text/javascript">

									<xp:this.script>

										<![CDATA[

										var msg = "";											

										var userName = trim(document.getElementById("#{id:inpUser}").value);

										var password = trim(document.getElementById("#{id:inpPassword}").value);											

										if (userName.length==0 || password.length ==0)

										{

											msg = "User Name or Password can not be blank. Please login using your user name and password."

											document.getElementById("#{id:errPanel}").innerHTML = msg;

											return false;

										}

										else

										{

											document.getElementById("#{id:errPanel}").innerHTML = "";																					dojo.xhrPost(							{						 url : '#{javascript:compositeData.get("loginURL");}',

						 handleAs : "text",

						 preventCache : true,			content:{											"UsrName":dojo.byId('#{javascript:getClientId("inpUser")}').value,							"Password":dojo.byId('#{javascript:getClientId("inpPassword")}').value			},						load : function(response,ioArgs){		 		if(response.indexOf('reasonType')==-1)						 		{								 			dojo.byId('#{javascript:getClientId("errPanel")}').innerHTML = "Successfuly Loggedin."

					}

else

{

	 			dojo.byId('#{javascript:getClientId("errPanel")}').innerHTML = "Invalid User Name or Password. Try Again!"					}					 	}

					})

											}																																										

										]]>

									</xp:this.script>

								</xp:handler>

							</xp:this.handlers>

						</xp:eventHandler>

					</xp:button>

				</xp:td>

			</xp:tr>

		</xp:table>

	</xp:panel>

</xp:panel>	

</xp:view>


The value of “titleBarText” is “Login using your User Name and Password”.

and “loginURL” is “http://lotusR85Server/names.nsf?login

When I debug this code through firebug, what I found that it skip from the function written for load in xhrPost. because I don’t have much knowledge of dojo, so can any body help me to resolve this problem.

Thank you,

Regards

Ashish