Using Checkboxes in a LANSA Browse list

If you want to use checkboxes in browse lists with their initial set checked, you will need to deploy the following technique. This technique is based on the preceding example.

<input type=”hidden” name=”__{field name}-<RDML MERGE=”&ROWNUM” FORMAT=4> D”

value=”<RDML MERGE=”{field name}” size=”{size}”>” />

<input type=”checkbox” name=”DUMMY” value=”<RDML MERGE=”{field name}”>”

onclick=”SetCBState(this, ‘__{field name}-<RDML MERGE=”&ROWNUM”

FORMAT=4> D’, ‘Y’, ‘N’)”

<RDML ONCONDITION=”{field name}”>

checked=”checked”

</RDML>

/>

{field name} is the name of the field you have defined in your DEF_LIST command. This {field name} is padded with trailing blanks to 10 characters.

Note that this technique uses the <RDML ONCONDITION> tag to determine the initial state of the checkbox.

This technique calls a different JavaScript function, SetCBState:

function SetCBState(obj, RFld, CY, CN)

{

var NumElements=document.LANSA.elements.length;

for (i=0; i<NumElements;i++)

{

if (document.LANSA.elements[i].name==RFld)

{

if (obj.checked) document.LANSA.elements[i].value=CY

else document.LANSA.elements[i].value=CN;

break;

}

}

}

Visual LANSA Editor Short Cuts

Position the current line on the top of the window Ctrl + T

Position the current line in the middle of the window Ctrl + M

Position the current line on the bottom of the window Ctrl + B

Toggle a tag on a line Ctrl + F2

Remove all tags Alt + F2

Jump to the previous tagged line Ctrl + Up Arrow

Jump to the next tagged line Ctrl + Down Arrow

Comment selected text Ctrl + W

Uncomment selected text Ctrl + Shift + W

Collapse blocks. This command blocks a level at a time.
If you keep collapsing the blocks, the entire code will
be collapsed, except for lines that are not in blocks. Ctrl + F9

Expand blocks. This command expands a level at the time Ctrl +F10

Collapse the block containing the line that has the focus Ctrl + Shift + F9

Expand the collapsed block that has the editor focus Ctrl + Shift + F10

Makes selection/next character upper case Alt + UpArrow

Makes selection/next character lower case Alt + DownArrow

Delete word right Ctrl + Delete

Delete word left Ctrl + BackSpace

Delete from current position to end of line Alt + Shift + L

Cut line and place it on clipboard Ctrl + L

Copy line and place it on clipboard Alt + Q

Copy selection or line Plus key in number pad

Copy selected text to the clipboard Ctrl + Insert

Paste text from the clipboard Shift + Insert

Copy selected text to the clipboard Ctrl + C

Cut selected text to the clipboard Ctrl + X

Paste text from the clipboard Ctrl + V

Extend/reduce selection to next part of statement Ctrl + Shift + RightArrow

Extend/reduce selection to start of previous part of statement Ctrl + Shift + LeftArrow

Block select to end of line Shift + End

Block select to start of line Shift + Home

Block select to start of file Ctrl + Shift + Home

Block select to end of file Ctrl + Shift + End

Block select to page down Shift + PageDown

Block select to page up Shift + PageUp

Block select part of statement Left Button double-click

Line selection Shift + UpArrow

Line selection Shift + DownArrow

Select all text Ctrl + A

Find text Ctrl + F

Replace text Ctrl + H

Find next F3

Find previous Shift + F3

Go to line Ctrl + G

The only reference to *NOBCIPT on the web, courtesy of Mark Mason

*Noxxxxx

 

The contents of this variable allows you to disable:

·         Borders around the browse list.

·         Column headings.

·         Selection image.

·         Borders around empty cells in the browse list.

To turn off any of the above features, you will need to define the variable as a Text variable. The content of the variable is then set to be:

*Noxxxxx

where xxxxx can be up to five characters, identifying the feature to disable.

If you want to disable the border around the browse list, specify a ‘B’ character.

If you want to disable the column heading in the browse list, specify a ‘C’ character.

If you want to disable the selection image, specify an ‘I’ character.

If you do not want a <table> HTML tag around your browse list, specify a ‘T’ character.

If you do not want borders displayed around empty cells in your browse list, specify a ‘P’ character.

Note that if you disable the selection image, none of the columns in the browse list will be hyperlinked, even though you have enabled LANSA for the Web to allow selection from any column in a browse list. For example, *NOB would switch borders off.

Good Javascript date compare

<html>
<head>
<title>Compare Dates</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<Script Language=Javascript>
function CompareDates()
{
var str1  = document.getElementById(“Fromdate”).value;
var str2  = document.getElementById(“Todate”).value;
var dt1   = parseInt(str1.substring(0,2),10);
var mon1  = parseInt(str1.substring(3,5),10);
var yr1   = parseInt(str1.substring(6,10),10);
var dt2   = parseInt(str2.substring(0,2),10);
var mon2  = parseInt(str2.substring(3,5),10);
var yr2   = parseInt(str2.substring(6,10),10);
var date1 = new Date(yr1, mon1, dt1);
var date2 = new Date(yr2, mon2, dt2);

if(date2 < date1)
{
alert(“To date cannot be greater than from date“);
return false;
}
else
{
alert(“Submitting …”);
document.form1.submit();
}
}

</Script>
</head>

<body bgcolor=”#FFFFFF” text=”#000000″>
<form name=”form1″ method=”post” action=””>
<input type=”text” name=”fromdate” id=”fromdate” value=”20/10/2005″>
<input type=”text” name=”todate” id=”todate” value=”19/10/2005″>
<input type=”button” value=”compare dates” onclick=”CompareDates()”>
</form>
</body>
</html>