This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jun 5, 2012, 8:01 AM
15 Posts

Search by Employee ID

  • Category: Other
  • Platform: Windows
  • Release: 8.5
  • Role: Developer
  • Tags:
  • Replies: 3
 Hi,
In present, my main issue is to search an employee by using his/her employee ID and filter it from the view. I have tried several times with several types of codes through Demos, but it provides an error. My code is as follows.
 
 
 
  <?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:table>
<xp:tr>
<xp:td colspan="2">
Search</xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:label id="label1" value="Employee Name:"></xp:label></xp:td>
<xp:td>
<xp:inputText id="searchName" value="#{sessionScope.searchName}"></xp:inputText></xp:td>
</xp:tr>
<xp:tr>
<xp:td>Employee ID:</xp:td>
<xp:td>
<xp:inputText id="searchId" value="#{sessionScope.searchId}"></xp:inputText></xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:button id="button1" value="Search"><xp:eventHandler event="onclick" submit="true" refreshMode="complete" immediate="false" save="true"></xp:eventHandler></xp:button></xp:td>
<xp:td></xp:td>
</xp:tr>
</xp:table>

<xp:viewPanel rows="30" id="viewPanel1">
<xp:this.facets>
<xp:pager partialRefresh="true" layout="Previous Group Next"
xp:key="headerPager" id="pager1">
</xp:pager>
</xp:this.facets>

<xp:this.data>
<xp:dominoView var="view1" viewName="vAddUser">
<xp:this.search><![CDATA[#{javascript:var tmpArray = new Array ("");
var cTerms = 0;

if (sessionScope.searchName !=null & sessionScope.searchName !=""){
tmpArray[cTerms++] = "[FIELD Emp_Name = \"" + sessionScope.searchName + "\"]"
}

if (sessionScope.searchId !=null & sessionScope.searchId !=""){
tmpArray[cTerms++] = "[FIELD Emp_Id = \"" + sessionScope.searchId + "\"]"
}
}]]></xp:this.search>
</xp:dominoView>
</xp:this.data>
<xp:viewColumn columnName="Emp_Name" id="viewColumn1">
<xp:viewColumnHeader value="Emp_Name"
id="viewColumnHeader1">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Emp_Id" id="viewColumn2">
<xp:viewColumnHeader value="Emp_Id"
id="viewColumnHeader2">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Dept" id="viewColumn3">
<xp:viewColumnHeader value="Dept" id="viewColumnHeader3"></xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Designation" id="viewColumn4">
<xp:viewColumnHeader value="Designation"
id="viewColumnHeader4">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Date_Of_Join" id="viewColumn5">
<xp:viewColumnHeader value="Date_Of_Join"
id="viewColumnHeader5">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Address" id="viewColumn6">
<xp:viewColumnHeader value="Address"
id="viewColumnHeader6">
</xp:viewColumnHeader>
</xp:viewColumn>
<xp:viewColumn columnName="Email" id="viewColumn7">
<xp:viewColumnHeader value="Email" id="viewColumnHeader7"></xp:viewColumnHeader>
</xp:viewColumn>
</xp:viewPanel></xp:view>
 
 
If you have any code regarding to this functionality, please send it to me as soon as you can. 
Jun 5, 2012, 12:21 PM
135 Posts
Re: Search by Employee ID
Hi,
 
are you really in Domino version 8.5.0? Any chance you can get the server upgraded?
 
I tried this quickly on 8.5.3FP1 and am not getting any errors. Please post the error you are getting. 
 
- Panu 
Jun 6, 2012, 12:37 PM
586 Posts
Re: Search by Employee ID
 I can't really look at your code, but I did a video on NotesIn9 that MIGHT have examples of what you're looking for.  Not 100% sure.  I think it was show 18 - Data Relationships.  Pretty sure I did a bunch of lookups in there.
 
good luck 
Jun 12, 2012, 6:04 AM
25 Posts
Re: Search by Employee ID

Hi Prashan,

To search any employee by using employee ID, You need  not to write such a long code. Its simple. Do the following steps,

 1.     1.  Read the employee id through text box and set it in session scope variable.

2.      2. Design the view and view panel having first column as employee Id.

3.      3. In view panel property, go to data – filter by column value.

4.      4. Place the computed formula by placing session scope variable value

 Above code will return you the exact result. Try it.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal