Manage Learn to apply best practices and optimize your operations.

Fastlink Views On Web

This code allows you to display a view on the web inside a neat table.
It also gives you a fast jump list at the bottom along with a neat javascript
code
that alows you to press a key to jump to that coresponding section.

i.e. Clicking W or pressing W would show the view starting from W.

There is also a Scroll Back and Scroll Forward button on the view to allow
users to SCROLL through the view.

To use this code, create a new form called $$ViewTemplate for ???
where ??? is the name of your view, add the code (read the code first though,
there are a few COMPUTED VALUE fields and 2 HOTSPOT areas.)

You also need to create another view for lookups.

E-Mail me if you have any problems with this code and I will help you.
Create a hidden field caled VIEWCOUNT, Computed number and set value to however
many items you want to display

then add the following code.


&LTScript LANGUAGE="Javascript">
var key = new Array();
<-------------------- insert computed value No1
function getKey(keyStroke)
{
isNetscape=(document.layers);
eventChooser = ( isNetscape) ? keyStroke.which : event.keyCode;
which = String.fromCharCode(eventChooser).toLowerCase();
for (var i in key) if (which == i) window.location = key[i];
}
document.onkeypress = getKey;
</script>

&LTTABLE border=0 cellspacing=0 width ="602">
&LTTR>
&LTTD bgcolor="#f0f0f0" colspan=3>
&LTTABLE border=0 width="100%">
&LTTR>
&LTtd width=20%>&LTDiv align=left>Scroll Back</DIV></TD>

Scroll back is a hotspot containing @DbCommand ("Domino";"ViewPreviousPage")

&LTTD width=60% align=center>&LTp class=tableheader> Title of view </p></TD>
&LTTD width=20%>&LTDIV align=right>Scroll Forward</DIV></TD>

Scroll Forward is a hotspot containing @DbCommand ("Domino";"ViewNextPage")

</TR>
</TABLE>
</TD>
</TR>
&LTTR valign =top>&LTtd bgcolor="#f0f0f0" width=1> </TD>&LTTD width=100%>


Add the field $$ViewBody as Text Editable

Then add the rest of the code.

[</TD>&LTtd bgcolor="#f0f0f0" width=1> </TD></TR>
&LTTR>&LTTD align=center colspan=3 bgcolor="#f0f0f0">
&LTTABLE border=0 width="100%">&LTTR>
&LTtd width=20%></TD>
&LTTD width=60% align=center>
<-------------------- insert computed value No2
</A></TD>
&LTTD width=20%></TD>
</TR>
</TABLE>
</Center>
</TD>
</TR>
</TABLE>




Computed Value Number 1

Viewname :="View";
ViewSource :=Viewname +
"?openview&count="+@Text(viewcount)+"&collapseView&StartKey=";
Viewlookup :="Lookupview";
Temp :=@LowerCase(@DbColumn("":"";"":"";ViewLookup;1));
Temp2 := "key[\'" + Temp + "\'] = \""+ViewSource + Temp+" \" ";
@Implode(emp2;";")


Computed Value Number 2

Viewname2 :="View";
viewSource2:=Viewname2
+"?openview&count="+@Text(viewcount)+"&collapseView&StartKey=";
ViewLookup2 :="Lookupview";
Temp3 :=@UpperCase(@DbColumn("":"";"":"";ViewLookup2;1));
Temp4 := "&LTA HREF=\""+Viewsource2 + Temp3+"
\"ONMOUSEOVER=\"window.status=\'Jump to "+Temp3+"\';return true\"
ONMOUSEOUT=\"window.status=\' \' ;return true\">" + Temp3+ " ";
@Implode(Temp4;"</A>")


You also need to create your lookup view with the following itmes
1 Column Sorted Ascending and catagorized ONLY
Your own selection formula depending on what you want to show
A column formula along the following lines
@Left(Surname;1)

Dig Deeper on Domino Resources - Part 6

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close