|
1
|
- Jim Songer
- MainTree Systems
- jsonger@maintree.com
|
|
2
|
- Basic Concepts
- Control Tweaking
- Display Tweaking
- Other Possibilities
- Bonus Materials
- Reference Sources
|
|
3
|
|
|
4
|
- Only useable in BUI mode
- %preload and $assignobj will be your friend
- Watch out for CMHC patches
- Not limited to JavaScript, can use VBScript
|
|
5
|
- Easy to use and develop for
- Relatively easy to debug
- Plenty of online sources for help
- Can do cool tricks
|
|
6
|
- All form fields are prefixed with brAcdsp
- Use $assignobj for any form fields or buttons that you will be working
with
- Example:
- (void)$assignobj(“MyButton”)
- $button(“Click Me”)
- Becomes:
- brAcdsp.MyButton in Javascript
|
|
7
|
- Use early binding to assign JavaScript functions to form fields before
the page loads.
- Example:
- <SCRIPT language='javascript' for='ClientID' event='onchange'>
- <!--
- GetInfo();
- -->
- </SCRIPT>
- … Or …
- <td id=“Header” onclick=“DoCall();”>
|
|
8
|
- Use late binding to assign JavaScript functions to form fields after the
page loads.
- This also allows for reassignment on the fly.
- Example:
- brAcdsp.ClientID.onchange=GetInfo;
|
|
9
|
- Cool things with form controls
|
|
10
|
|
|
11
|
- $table("T1",," border='1' cellspacing='1'
id='table1'")
- $row()
- $col(,"middle",,,,)
- (void)$assignobj("DropDown2")
- $dropbox(DropDown2,"Option 1","1",,,,,)
- $dropbox(DropDown2,"Option 2","2",,,,,)
- $dropbox(DropDown2,"Option 3","3",,,,,)
- $dropbox(DropDown2,"Option 4","4",,,,,)
- $dropbox(DropDown2,"Option 5","5",,,,,)
- $dropbox(DropDown2,"Option 6","6",,,,,)
- $endtable("T1")
|
|
12
|
- <script language="javascript">
- <!--
- brAcdsp.DropDown2.size=5;
- //-->
- </script>
|
|
13
|
- Display drop down options with out a click
- Caveat: Drop box must be in a table
|
|
14
|
|
|
15
|
|
|
16
|
- xWork is x
- $form("TextAreaDemo")
- "mt-libHTMLArea":HTMLAreaInit()
- (void)$assignobj("TextTest")
- $textblock(xWork,20,80,,,,)
- "mt-libHTMLArea":HTMLArea("TextTest",,"100%")
- $sendform("TextAreaDemo")
|
|
17
|
- mt-libHTMLArea
- HTMLAreaInit()
- Inserts base JavaScript – Once per form
- HTMLArea(ObjectID, Height, Width, BodyStyle, ToolBar)
- Insert for each $textblock to convert
- Can use more than once per form
|
|
18
|
- Make your forms look nice
|
|
19
|
|
|
20
|
- 2 JavaScript Functions
- 3 Defined DHTML objects
- Executed initial state
|
|
21
|
- $table("T1",," border='0' cellspacing='1' id='table1'
width='50%‘”)
- $row()
- $col(,"middle",,,," bgcolor='#00CCFF'")
- $ctag("<font face='Webdings' id='UpArrow' onclick='RollUp()'
style='cursor: hand'>")
- $text("5")
- $ctag("</font>")
- $ctag("<font face='Webdings' id='DownArrow'
onclick='RollDown()' style='cursor: hand'>")
- $text("6")
- $ctag("</font>")
- $text("Header Cell")
- $row()
- $col(,"middle",,,," id='Content'")
- $text("This is a example of a content that can be rolled up and
down.")
- $ctag("<p>")
- $text("It can contain any information you want and it will be
hidden")
- $text("with a click of the
above arrow, and it returns just as fast.")
- $endtable("T1")
|
|
22
|
- <script language="javascript">
- <!--
- function RollUp() {
- UpArrow.style.display="none";
- DownArrow.style.display="inline";
- Content.style.display="none";
- }
- function RollDown() {
- UpArrow.style.display="inline";
- DownArrow.style.display="none";
- Content.style.display="inline";
- }
- RollDown();
- //-->
- </script>
|
|
23
|
|
|
24
|
- Wraps around the $sessiontabs function
- Uses the left-side-html & right-side-html parameters to place the
base JavaScript
- Uses the mt-STFloat.js to contain the guts of the JavaScript
- Also adds a button to hide the tabs
|
|
25
|
|
|
26
|
- Edit checks
- On-the-fly form updates
- Floating tables
- Pop up menus
- Your imagination is the only limit
|
|
27
|
- Where to look for answers
|
|
28
|
- Microsoft Platform SDK
- http://msdn.microsoft.com
- Download (342MB)
- Google
- O’Reilly Books
- JavaScript & DHTML Cookbook
- JavaScript Pocket Reference
- Safari Bookshelf
|
|
29
|
- Working code for the 4 examples
- MainTree uScript Shared Libraries
- mt-libBUI
- mt-libDialog
- mt-libGeneral
- mt-libHTMLArea
- mt-libPrint
|
|
30
|
|