NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Bruce

Pages: 1 ... 7 8 [9]
121
News And Views / NetTalk Version 4.29 pre-release posted for testing
« on: August 30, 2007, 05:28:32 AM »
Hi All,

A pre-release build of NetTalk 4.29 has been uploaded here
http://www.capesoft.com/ftp/public/prerelease/index.htm

(Note this is NOT the regular NetTalk downloads page which still contains version 4.28 - Use the link above to get to the 4.29 files.)

The goal of this release is for regression testing before the official 4.29 release. Unfortunately I can't say that every reported bug has been fixed, but there are already folk needing fixes in this release so I need to draw the line somewhere.

If you see any regressions, or show-stoppers, please let me know.

Cheers
Bruce

122
Web Server - Share Knowledge / Pre-Compressing Static Files
« on: August 27, 2007, 12:35:31 AM »
One of the NetTalk web server's features is the (optional) ability to serve pre-compressed static files. In other words if the browser asks for a.htm, and a.htm.gz exists, then a.htm.gz will be sent to the browser (if the browser supports compressed files.)

.gz files are not parsed by the server (ie they are not searched for <!-- Net: tags) so this technique is limited to Static files.

CSS and JS files are clear beneficiaries of this approach, graphic files (PNG & JPG) are not as they are already compressed.
Static HTM files (ie ones without NetTalk tags) are also good candidates for this approach.

To create a .gz file you will need the gzip command line tool from http://www.gzip.org/.

Run the gzip utility using the -9 -n -f -c switches. For example
gzip -9 -n -f -c web\scripts\prototype.js   > "web\scripts\prototype.js.gz"

The .gz file should be in the same folder as the actual file (wherever that is.)

Cheers
Bruce

123
Web Server - Share Knowledge / Calling a Browse with Parameters
« on: August 20, 2007, 05:50:55 AM »
Setting the URL for a browse is pretty trivial. Simply specify the name of the browse function, or the Page Name of the browse function.

By default the browse starts with the sort order you specified (Default Sort Order button) and it starts at the "top" of the table.

However you'll also notice that if you change the sort order, maybe page down a couple times, that it "remembers". For example if you then go off and do somethign else, returning to this browse a little later on, it'll be in the same sort order (and same position) that you left it.

This is all well and good, but what if you want to open a browse, using a specific sort order, and jump to a specific position, using just the URL. Well, you can.

The browse pays attention to the following parameters (amongst some others):
ProcedureName_Sort
Locator1ProcedureName
Refresh=sort
or
Refresh=locate

So using these 3 together, let's say our browse is called BrowseCustomers, the field we want to sort on is CUS:Name and we want to start with the customer starting with "Time".

The the URL becomes (in 2 steps)
http://127.0.0.1:88/BrowseCustomers?BrowseCustomers_Sort=+UPPER(Cus:Name)&refresh=sort
then
http://127.0.0.1:88/BrowseCustomers?Locator1BrowseCustomers=Time&refresh=locate

Cheers
Bruce

124
In Version 4.29 I've simplified the method for displaying popup messages on a Form.

For an example, see example number 3. You will see this has resulted in a simplification of all the examples that do logins.

How it works

set a local variable (loc:alert) when you set loc:invalid.
The contents of loc:alert will be displayed as a popup message when the form is re-loaded.

It will also be displayed as a message on the form, just below the sub-header of the form. The CSS Class of this message is set on the CSS Classes tab (Alert:).

If you wish to suppress the popup, and display only the message, the tick off the option on the Advanced tab ("Popup Alert Message")

Advanced:
This feature works on the existance of a Value called ALERT. So if you would like to call a form, and include a popup message when the form opens, then you can append the parameter to the URL. For example:
'MySurveyForm?Alert=You must be over 18 to take this survey'

Considerations for those upgrading from 4.28 or earlier

If you have used a technique based on the login examples (In other words a combination of the XHTML tab, and the DisplayLoginMessage, and PopupLoginMessage procedures) then you might want to revise it to use this new (easier) approach.

Cheers
Bruce



125
The browse, form and page procedures all let you embed your own HTML. The NetWebSource procedure is also a good place to put your own custom HTML, but there are some rules worth pointing out.

When "bits" of pages are sent asynchronously the HTML you create is validated according to XML rules. In effect, this means you shouldn't write HTML, you should write XHTML.

The main difference between the two is that XHTML is more rigid, and less forgiving. And the most common manifestation of this is the issue of closing tags.

In HTML you can code an image like this
<img src="bob.gif">
And you'd be fine. But in XML this leaves an unclosed tag (<img>). So in XHTML you need to close the tag, like this
<img src="bob.gif" />
or like this
<img src="bob.gif"></img>

Other common HTML tags used in isolation are <br> and <p>.

There are cases where HTML will suffice, but it never hurts to use valid XHTML.

The main indicator that you've done something wrong is that the page will display correctly when first loaded, but will refuse to "refresh" when it is dynamically updated.

126
Web Server - Share Knowledge / Customising your own Styles
« on: August 06, 2007, 01:29:30 AM »
There are a lot of questions in the forums that can be answered by changing the CSS for a specific item. However editing the supplied CSS files are dangerous, since changes you make will be lost with the next NetTalk update.

This post describes the steps needed for you to use your own CSS file. Inside this file you can put your own styles (based on the shipping ones if you like.)

Step 1:
--------
Create a new CSS file in your \web\styles folder. This is a text file, you can use something like notepad to create it. Name it whatever you like - custom.css is popular. (But be careful Notepad doesn't call it custom.css.txt)


Step 2:
---------
Add this CSS file to the list in the Web Server procedure, Styles tab.


Step 3:
---------
Into this new CSS file you can place your own styles. Usually the easiest way to start is by copying an existing style from the all.css file and then renaming it, and modifying it to your needs.

NOTE: CSS IS CASE SENSITIVE


Step 4:
---------
In your net web app, set the "thing" (it might be a browse, or a form field, or whatever) to use the new style. There are CSS tabs just about everywhere that give you a lot of control over the CSS class that is being used.

EXAMPLE:
-----------
To change the style of a browse

a) Do Step 1 and Step 2 as laid out above.

b) For a browse, go to the NetWebBrowse Settings, to the CSS Classes tab. Notice that the browse is (by default) set to use the 'BrowseTable' class

c) open \web\styles\all.css in Notepad. Find the BrowseTable style and copy it to your custom.css file. Notice that it has 3 parts to it...

.BrowseTable {
  font-family: Tahoma, Verdana,  Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: #333;
  margin: 5px 0px 5px;
  border-collapse: collapse;
  border: 1px solid #888;
  padding: 0px;
}

.BrowseTable th {
  font-weight: bold;
  padding: 2px;
  border: 1px solid #AAA;
}

.BrowseTable td {
  padding: 2px;
  border: 0px solid #AAA;
  height: 20px;
}

They need a unique name so rename these 3 bits, to say MyBrowseTable in the custom.css file.

d) make any changes to the browse "look" that you want. For example to give each "cell" in the browse a border, set the border in the "td" section to 1

.myBrowseTable {
  font-family: Tahoma, Verdana,  Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: #333;
  margin: 5px 0px 5px;
  border-collapse: collapse;
  border: 1px solid #888;
  padding: 0px;
}

.myBrowseTable th {
  font-weight: bold;
  padding: 2px;
  border: 1px solid #AAA;
}

.myBrowseTable td {
  padding: 2px;
  border: 1px solid #AAA;
  height: 20px;
}

e) Back in the App, change the browse to use 'myBrowseTable' instead of 'BrowseTable'

REMEMBER CSS IS CASE SENSITIVE so make sure you get the Case right.

f) Lastly - Compile and run your program, and run the browser. You will need to press Ctrl-F5 in your browser after making changes to the CSS file in order to see the changes take effect.

You do not need to re-compile, or re-run the program while you fiddle with CSS changes. Just pressing Ctrl-F5 will reload the new file.

You will need to re-compile and re-run if you change any setting in the APP (for example a setting on the CSS Classes tab.)

127
Web Server - Share Knowledge / Temporary Files start with $$$
« on: June 26, 2007, 01:27:58 AM »
Hi all,

TIP: If you are generating a temp file, that is created, sent to the browser, and then needs to be deleted (in other words it will only be served _once_) then start the name with $$$. eg
temp\$$$N1234.png

The web server will automatically delete files that start with $$$ as soon as they are served.

This technique is used by the graphing template and the report tempate, so you'll notice that the PDF files generated and the PNG files generated by these templates both start with $$$.

Cheers
Bruce

128
News And Views / NetTalk 4.26 released
« on: June 21, 2007, 10:48:32 PM »
Hi All,

NetTalk 4.26 has been released.
Download your update from
http://www.capesoft.com/accessories/downloads.htm#nettalk

New documentation index can be found here
http://www.capesoft.com/docs/NetTalk/NetTalkWebFAQ.htm

Release notes:
# NOTE: the latest Web folder is installed to \clarion6\3rdparty\libsrc\netweb
Copy this to your application folder after installing the NetTalk update.

# Add: Support for Legacy report procedures, and (I think) CPCS report procedures. See example.

# Add: Forms now have a variable, loc:act which is set to either InsertRecord, ChangeRecord or DeleteRecord. Expressions can use this to determine current form action.

# Add: Ability to override CSS class for Prompt and Comment for individual form fields.

# Change: Made blank tab headings more visible in list of tabs.

# Change: .SetSessionPics, and .SetPics methods have been retired. Replaced with SetPics routine in form.

# Add: Translation for the "Locate" prompt can be set in WebServer procedure, Advanced tab.

# Add: Embed point into menu routine.

# Add: New Short-hand method names, GSV and SSV for GetSessionValue and SetSessionValue respectively. Use either short, or long form.

# Add: GetSessionValueLength method to return length of Session Value.

# Add: GetValueLength method to return length of parameter in Value queue.

# Add: New examples, 38 (Legacy) and 39 (LegacyReports) added.

# Update: Chrome menu script updated to version 2.01

# Reorganised docs a bit.

# Fix: Could generate code for "SmallOtherButton"

# Fix: "highlighted record" problem when Last or Previous pushed.

# Fix: Values getting dropped when a lookup is done.

# Fix: DATE and TIME data types were being treated as Alpha, not Numeric.

# Fix: For time fields that were > 12:00, but didn't include am or pm.

# Fix: Handled empty packets (with just a header) sent from a NetWebPage. Typically when sending a PDF or other static file from a NetWebPage.

** Those Who attended the World Tour, and added code to work around this issue can now remove the work around code **

Cheers
Bruce

Pages: 1 ... 7 8 [9]