• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Xpages–viewicons
 

Xpages–viewicons

on

  • 2,753 views

 

Statistics

Views

Total Views
2,753
Views on SlideShare
2,753
Embed Views
0

Actions

Likes
0
Downloads
59
Comments
2

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

12 of 2 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • just one note - after testing this, the before page loads code, i had to move it into the column formula for the pager to work . thanks again for posting this
    Are you sure you want to
    Your message goes here
    Processing…
  • Thanks for sharing this. I finally got it to work. Using DDE 8.5.2, on the data panel for the column, set it to 'computed value and make the value ' ' . This is what worked for me. Much Appreciated!!!!
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Xpages–viewicons Xpages–viewicons Presentation Transcript

    • Xpages – Creating View Icons Lotus Notes R8.5 Helpful tip
    • Issue: Xpages and View Icons
      • In a Lotus Notes view, displaying view icons is a handy way for displaying statuses or other information easily (and takes up less space).
    • Issue: Xpages and View Icons
      • When creating a view xpage, view icons are not available automatically like in a view.
    • Issue: Xpages and View Icons
    • Solution: Computed View Icons
      • There is a solution on Lotus Notes Application Wiki - http://www-10.lotus.com/ldd/ddwiki.nsf/dx/02042009032445PMWEBRXJ.htm .
        • There were two minor issue not noted in the Wikki
          • You need to tell what server the icons are on, which is not documented.
          • You have to have access to the server files structure to get to the icons. (Some of us live in 3 tier environment system Dev,QA, Prod. Yes, some developers don’t have direct access to prod servers. I am one of them.)
      • Described in the next few slides are better details on making view icons work.
        • 1) Get the view column numbers of the columns you want to display the view icons.
          • Get column value with icon property. Col 0 = first column, Col 1 = second column, etc.
        • 2) Use Icons in the Open Image Resource
            • You may want to make copies and renumber, or using existing name.
    • Solution: Computed View Icons
        • 3) Create Custom Control/Xpage and in the Data section – Add the Domino View and select current or other database to import the Notes View to use on this custom control or xpage
    • Solution: Computed View Icons
        • 4) Highlight all the fields and drag into the Custom Control/Xpage (you can remove,rearrage columns as needed).
      Note: If you have Dev/QA environment, you may want change the data source from Static to computed (to remove the hardcoded server name) Example 1:var thisDB:NotesDatabase = session.getCurrentDatabase(); return thisDB; Example 2: var thisDB:NotesDatabase = session.getCurrentDatabase(); var thisView:NotesView = thisDB.getView("CStatus"); return thisView;
    • Solution: Computed View Icons
        • 5) Open the columns that need the view icons – Turn on the Display column Values, Content type = “HTML”.
        • 6) Select Icon option and Column Image - Computed
    • Solution: Computed View Icons
        • 8) The computed text, which can vary depending on Column number and recourse icon names:
              • var url:XSPUrl = new XSPUrl(database.getHttpURL());
              • var idx = viewEntry.getColumnValues().get(6);
              • var pics = "";
              • if (idx<10)
              • pics += &quot;00&quot; + idx
              • else if (idx < 100)
              • pics +=&quot;0&quot; +idx
              • else
              • pics = idx;
              • var path = &quot;&quot;+h+&quot;.nsf/&quot; + &quot;vwicn&quot;+ pics + &quot;.gif&quot;+ &quot;?OpenImageResource&quot;;
              • url.setPath(path);
              • url.removeAllParameters()
              • return url.getPath()
    • Solution: Computed View Icons
        • 9) Once you fill in the column information, open the source, to add universal variables
              • <xp:this.beforePageLoad><![CDATA[#{javascript:/*
              • Created By: Sheila Blanchette
              • Created On: 12/21/2009
              • Setting up Varables for ViewICONs in Xpage Views
              • */
              • var PJDB:NotesDatabase = session.getCurrentDatabase();
              • var pjname:string = PJDB.getFilePath();
              • var varserver:String = PJDB.getServer();
              • var i=@Left(PJDB,&quot;.nsf&quot;);
              • var h = &quot;http://mks-appdev2.mksinternal.com//&quot;+ i
              • }]]></xp:this.beforePageLoad>
    • Solution: Computed View Icons
        • 10) Now, can save the custom Control and to Xpage or save the Xpage. (you may have to update the code to fit your environment.
    • Lessons Learned:
      • Recommend: View Icons should be used on a flat (not categorized view).
    • Lessons Learned:
      • If you are getting an error, on the xpage when display on the web (trying displaying it to the Client – displays error messages)