Sunday, April 1, 2012

XPages type ahead step by step


Below are the steps for create type ahead in xpages

  1. Create a new notes form(not xpage) and name it "EmpForm"
  2. Create below fields in "EmpForm".
    1. EmpId(text, Editable) 
    2. EmpName(text, Editable)
  3. Save "EmpForm" and preview it Notes Client.
  4. Create these documents using "EmpForm"
    1. EmpId=1 & EmpName=Alice
    2. EmpId=2 & EmpName=Alisha
    3. EmpId=3 & EmpName=Barney
    4. EmpId=4 & EmpName=Alfred
    5. EmpId=5 & EmpName=Baker
  5. Create a new view "EmpView"
  6. Selection formula = SELECT form="EmpForm"
    1. First column = EmpName
  7. Preview the view in Notes Client, you should be able to see all created document here.
  8. Create a xpage "EmpXPage".
    1. Drop an Edit Box on it, name it "EmpNameTxt".
    2. Go to the type ahead section of "EmpNameTxt".
  9. Change below settings
    1. Check Enable Type Ahead.
    2. Mode = Partial
    3. Write below formula in suggestions box using computed value under blue diamond next to the box.
      1. @DbColumn(@DbName(), "EmpView", 1)
    4. Uncheck Case-sesitive 
  10. Preview "EmpXPage" in internet explorar.
  11. Type a in the text box, you will see suggestions.
Thanks for reading !!!

No comments:

Post a Comment