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 - John Hickey

Pages: [1] 2
1
News And Views / New anti-spam mod added to forum
« on: May 31, 2009, 06:03:47 PM »
I just added a new anti-spam mod to the board, it shouldn't affect anyone but let me know if there are any unusual happening!

--John

3
Web Server - Ask For Help / Cell phone browsers
« on: June 25, 2007, 02:33:43 PM »
Has anyone tried accessing a web server app using a cell phone web browser?  I can't get past the login screen, the login button does not function.  Is there a work-around for this problem?

4
Web Server - Ask For Help / Conditional SSL
« on: June 21, 2007, 02:24:25 PM »
I would like to give my customers a choice of running our web app either with SSL or without.  Is that possible?  In the template it looks like it's either on or not, I don't see a way to make it so the end-user can choose.

5
Web Server - Share Knowledge / Advanced Searching with NetWeb Server
« on: June 18, 2007, 07:04:40 PM »
One of the first things I noticed when using a Web Browse with NetTalk, is that locators don't work very well.  At least, they didn't work the way I wanted them to.  What I decided I really wanted, was for my end-user to come to the page with the browse, enter in some search criteria, then have the browse filtered on that criteria.  So for example, if I had a customer list, rather than display the customer list as a browse first, I would present them with a screen of searchable fields that they could fill in, click "Find", then display the browse using their entries as a filter.

For an example of this, go to http://connect.gopositive.com:4155 login is demo password is demo .  Click on the Customer List tab.  First you will see a list of searchable field.  Type "jane" into the first name field, or "john" into the last name field and click "Find".  The next screen you see will be the filtered list.  Here is the trick... this is all done with the same procedure!

So, here is how it is done.

First, create a NetWebForm procedure.  I called the form CustomerFramingForm. This will serve as the container for the searchable fields and the browse.  Set the Form Style however you want (I used "Tab") and the Form Source as "Memory".

On the Fields tab, click Insert and set your Tab Heading as desired.  I used 'Customer'.

Next you will create several local variables that will hold your searchable fields.  Here is a screen shot of the fields you saw on my customer list:



The fields from l:Account to l:EMail are the search fields.  They are used to build the filter that is used.  I created another local variable called l:Filter2 to hold the filter based on what is filled in.  I then use l:Filter2 as a condition to show or hide fields on this screen.  If l:Filter2 is blank, then you will see the search fields.  If it is filled in, then you won't see these fields.  You could not have this condition, and always display the search fields if you want.




The Query and l:Reset fields are Submit buttons.  The l:Reset button is hidden if the l:Filter2 is blank, and displayed if it is filled in. 

Here is how the Query button prompts are filled in:



Notice that the URL will call the SAME PROCEDURE that I created.  Here is how that is possible.

At the top of the procedure in the embed "Procedure Setup", the following code is added:

l:Filter2 = p_web.GetSessionValue('CustomerFilter')
  IF p_web.GetValue('cusaccount') <> ''
     p_web.SetValue('l:Account',p_web.GetValue('cusaccount'))
     l:Filter2 = ''
  END
  IF l:Filter2 = ''
      IF p_web.GetValue('l:CompanyName')
         l:Filter2 = CLIP(l:Filter2) & ' AND CUS_NAME LIKE <39>%' & p_web.GetValue('l:CompanyName') & '%<39> '
      END
      IF p_web.GetValue('l:Account')
         l:Filter2 = CLIP(l:Filter2) & ' AND CUS_CustID LIKE <39>%' & p_web.GetValue('l:Account') & '%<39> '
      END
      IF p_web.GetValue('l:FirstName')
         l:Filter2 = CLIP(l:Filter2) & ' AND CUS_Fnam LIKE <39>%' & p_web.GetValue('l:FirstName') & '%<39> '
      END
      IF p_web.GetValue('l:LastName')
         l:Filter2 = CLIP(l:Filter2) & ' AND CUS_LNam LIKE <39>%' & p_web.GetValue('l:LastName') & '%<39> '
      END
      IF p_web.GetValue('l:Address')
         l:Filter2 = CLIP(l:Filter2) & ' AND CUS_bad1 LIKE <39>%' & p_web.GetValue('l:Address') & '%<39> '
      END
      IF p_web.GetValue('l:Phone')
         l:Filter2 = CLIP(l:Filter2) & ' AND CUS_phn1 LIKE <39>%' & p_web.GetValue('l:Phone') & '%<39> '
      END
      IF p_web.GetValue('l:Email')
         l:Filter2 = CLIP(l:Filter2) & ' AND CUS_EMail LIKE <39>%' & p_web.GetValue('l:Email') & '%<39> '
      END
      p_web.SetSessionValue('CustomerFilter',l:Filter2)
   END

So what is happening here?

l:Filter2 = p_web.GetSessionValue('CustomerFilter')

First, we check to see if a SessionValue containing the filter is already set.  Why?  This allows us to move to different pages but still maintiain our filter.

IF p_web.GetValue('cusaccount') <> ''
     p_web.SetValue('l:Account',p_web.GetValue('cusaccount'))
     l:Filter2 = ''
END

This looks to see if the value "cusaccount" is being passed in.  We have some invoice history screens that show the customer name on it.  You can click on the name, and it will bring you to this page.  This allows us to lookup the customer and display them (the account number is unique).

IF l:Filter2 = ''
      IF p_web.GetValue('l:CompanyName')
         l:Filter2 = CLIP(l:Filter2) & ' AND CUS_NAME LIKE <39>%' & p_web.GetValue('l:CompanyName') & '%<39> '
      END
 etc...

This is where the filter is built.  l:Filter2 will be used later on where PROP:Filter is set.

p_web.SetSessionValue('CustomerFilter',l:Filter2)

Finally, this sets the SessionValue so we can go away and come back later, and still have the same customer filter.  It is also passed on the the CustomerTable procedure (the actual customer browse we are going to filter).

That is all the code necessary for the CustomerFramingForm. 

You may have noticed that there is a Browse called CustomerTable also in this procedure.  It is hidden if l:Filter2 is blank, and visible when it is not.

In the CustomerTable procedure, all that is required is to retrieve the filter we have just built, and apply it.  This code is added to the "Procedure Setup" embed:

  l:Filter2 = p_web.GetSessionValue('CustomerFilter')
  IF l:Filter2 = ''
     packet = '<H2>Enter your customer search criteria and click "Find".</H2>'    !'<!-- Net:NoQuery --><13,10>'
     do SendPacket
     Return
  END

And finally, at the Start of "Browse Filter" embed:

  l:Filter = CLIP(l:Filter) & ' ' & l:Filter2
  ThisView{prop:Filter} = CLIP(l:Filter) & ')'

(I created another local variable here called l:Filter, because there is some additional filtering that we do with that variable.  You should just construct the filter as your needs require).

Phew, almost done!  How do we clear the filter? 

With the "Reset" button from our CustomerFramingForm.  This is set up as a Submit button, and calls another Form procedure (in this example, "CustomerResetForm".



This is poorly named on my part, as it is actually a NetWebPage.  I added the following code right before "do Footer" using the Embeditor:

    p_web.SetSessionValue('CustomerFilter','')
    packet = clip(packet) & '<!-- Net:CustomerFramingForm -->'
    DO SendPacket

All this does, is clear the session and call the CustomerFramingForm again.  Since the session is cleared, the filters are blank, and the searchable fields appear again.  Remember, you don't have to hide the searchable fields.  In fact, if you look at the Inventory List in my sample web app, you can see that the fields are there all the time.

OK, so that is ONE WAY that this can be done.  I have an idea for another way that will allow you to create one procedure that can handle all of your Queries for different browses.  I'm still playing with that though, so I will share those ideas with you another time!

Let me know if you have any questions, or if you have ideas for improving this technique!




6
Web Server - Ask For Help / Refresh Problem
« on: June 17, 2007, 09:11:43 PM »
I have a web form set up with tabs.  On the first tab is an inventory browse, and I have it set to refresh a browse on the second tab.  The browse is accessed from a menu item.

When I click on the menu item and the form displays, the browse box on the second tab does not show data related to the first item on the inventory browse.  If I click on an item on the inventory browse(say, the second item), then the browse on the second tab does show correct data.  If I then click on the first item on the inventory browse, then the browse on the second tab displays correctly. 

Is there a way to make sure that when the menu is clicked, the inventory browse will correctly set the second browse?  You can see what I mean on our demo site, http://connect.gopositive.com:4155 login is demo, password demo.  Click on the Inventory menu item.

Thanks for any help!

7
Web Server - Share Knowledge / Problem Generating PDFs on Web Server
« on: June 17, 2007, 03:15:24 PM »
On the Newsgroup, Rudi Havenga asked:

My Web Server system works fine on my own workstation to generate reports to
PDF. The problem is that when it is installed on the web server, the PDF
reports are generated in landscape and the bottom half of the reports are
cut off. Is there something that needs to be deployed to my web host?


And John Griffiths answered:

This one caught me once with ClarioNet.

The thing to watch out for here is :-

If you are running the Webserver App as a Service and it is started under the System
account (as opposed to a logged in user), then it will have no access to any printers.
This causes the reports to be formatted to the Console/Screen size  and the aspect
ratio of the screen. Hence the Landscape appearance.


8
Web Server - Share Knowledge / Handling Error Messages
« on: June 17, 2007, 03:11:53 PM »
On the Newsgroup, Rudi Havenga asked:

Is there a way to set the web server to not pop up with error messages on
the server itself. When a duplicate key is generated or a restricted
relationship is deleted, the server pops up with a message and the user's
system just hangs. What can I do about it?


Bruce Johnson answered:

the message box has to be suppressed using either
CapeSoft MessageBox (that's the easy way) or
by making your own message window (using system{prop:messagehook} )


Rudi then replied:

I made use of  system{prop:messagehook}

I have created a global queue that I populate with all the error messages.
My web server window I put my web server information on one tab and my error
messages on another.

Perfect.

And Roberto Artigas then chimed in:

Greetings Rudi - Nice queue idea.

I have hooked the messages (message, halt, stop) to make sure the web server
does not get hung with a console message coming from ABC or some other
place, this way I could log them or do something with them, I just had not
gotten around to a good way of dealing with them. I like your queue window
idea.

Thank you for sharing.


Finally, Sean Cameron (CapeSoft) said:

I'd probably use an IMDD table, as it's thread safe. I use xFiles to save queues and IMDD tables to disk as XML, which is also really fast.

9
Web Server - Share Knowledge / Validations and popups
« on: June 17, 2007, 03:08:30 PM »
On the Newsgroup, Rudi Havenga asked:

1. How do I execute code when a field is completed to either do a validation
or to assign a value to another field on the same form based on the value of
the entered field?

2. How do I validate a record when the save button is clicked, pop up a
message on the client workstation and return to the update form te let the
user correct his error?


And Bruce Johnson answered:

1. a) set the field to "send new value to server"
b) add the code you want to execute into the "Server code goes here" button.
c) remember in this code to set the SessionValue of anything that you want
to set (including itself).
d) on the client-side tab, set any "fields you want to update" in the "reset
fields" list.
(tip: you can add a field to it's own reset field list if you want to
correct, and resend).

2. see the loginform procedure in example 7 for how to do this.
In ValidateRecord routine
  set loc:invalid = 'fieldthatiswrong'

10
Web Server - Share Knowledge / Centering browses on the web page
« on: June 17, 2007, 03:05:53 PM »
On the Newsgroups, Bryan asked:

I am trying to alter the layout of the browse pages so that they are central on the webpage.

I have managed to do this successfully with the forms by altering ..FormTable in netweb.css by using:
  text-align: Left;
  margin-left: auto;
  margin-right: auto;
  width: 820px;

Forms are then always in the centre of the browse window no matter what size it is. But I have had no luck finding the equivalent with Browses.
Any ideas?


Wolfgang Orth answered:

the browses (and most of the other parts of a page) have its own "id"

<div id="yourBrowse_tbl" ...>

Instead of poushing into Netweb.CSS you better create your own, its easier to maintain.

In your own css-file you add:

#yourBrowse_tbl {
background-color: red ;
and so on...
}

In CSS the # is for id's, the dot . is for classes



11
Web Server - Share Knowledge / Creating a simple filter
« on: June 17, 2007, 03:03:22 PM »
On the newsgroup, Steve Ellis asked:

How do I code a simple browse filter like

TRI:TABLETYPE='P'

Sean Cameron (CapeSoft) answered:

The entire filter expression is a string, so you need to double up your quotation marks, or use ASCII 39:

'TRI:TABLETYPE=<39>P<39>'

or

'TRI:TABLETYPE=''P'''

Using the ASCII code is a nice way of doing it as it can be a lot clearer, especially when you have a long expression with a number of string literals.

12
Web Server - Share Knowledge / Dynamic DNS vs. Opera Browser
« on: June 17, 2007, 03:01:56 PM »
On the Newsgroups, Wolfgang Orth said:

I am using a dynamic DNS for redirecting to a server on my LAN. This is good enough for testing and personal use.

I encountered something that I wanted to share:

Nettalk Webserver uses a lot of JavaScripts and it works like a charm - mostly.

On a form I use the calendar-control and this cute little JS works well with IE and FireFox, no matter if I call the site with the redirecting DynDNS or directly with the IP-Adress.

In Opera nothing happens wen I click on the calendar-control when I access the site via DynDNS. It works well when I call the IP-Adress.

Just in case this happens to you also.

Beside that Opera is a great webbrowser, which inlcudes a NG-reader and even a chat-client so one can access easily the Clarion chat #cw-talk at irc.cw-talk.com

13
Web Server - Share Knowledge / Sessions and errors
« on: June 17, 2007, 02:57:04 PM »
On the Newsgroups, Bruce Johnson posted:

yes, the session will expire if you don't access it for a while. The exact
time is up to you and specified on the WebServer procedure, advanced tab.

if you request a page that doesn't exist, then you get a "Page not found"
error. (This is an error provided by the server.)

If the server is not running you get a browser side error - server doesn't
exist.

If you request a page, and your session has expired, then a new session is
automatically created for you.

If the page requires a login, then the login page is displayed. If it
doesn't require a login then the page is displayed.

Hence you shouldn't see an error if the session has expired - as long as the
page name is legal.

14
E-Mail - Share Knowledge / Sending HTML or RTF in body of e-mail
« on: June 17, 2007, 02:45:15 PM »
In the Newsgroups, Dan Scott asked:

Is this possible?
My customer would like to send a flyer to his customers every month.
I know I can add the flyer as attachment, but that won't due.

The flyer would be in HTML or RTF

I tried linking an HTML to the html text in Nettalk example, but it just
shows the Link in the email.
MyHtml = 'c:\docs\test.html'


Sean Cameron from Capesoft answered:

NetTalk allows both the HTML and Text parts to be specified, which is covered in the docs, along with how to embed images. You can also send RTF in the body, but only indirectly. To send an RTF file, including embedded images etc. I use OfficeInside to open the document (it can also be a .doc file etc.) in the background and use the SaveAs() method to save it to html, which actually saves a "web archive" or .mht file. This is actually just a standard EML file, which contains the full email, with all images embedded and encoded. NetTalk allows you to load this file, specify the recipients, from address etc. and send it. A very neat way to send .doc, .rtf and any other format that Word will open as HTML, with embedded images etc.

You can also use this approach to preview Word documents in your Clarion application using FileExplorer (which displays MHT and EML files very well indeed).

15
Web Server - Share Knowledge / Passing Parameters
« on: June 17, 2007, 02:38:04 PM »
From the newsgroups, Rudi Havenga asked:

On the NetWebForm you can call the URL On Save with parameters eg.

'SECONDFORM?bFile=Mailboxes&bKey=Key&IDField=MAI__MailboxNumber&Change_btn=Change&'

(I got this from example 24)

The only thing is that I can not find the place in SECONDFORM where these
parameters are received and interprated. How do I do that?

The second thing I would like to know is whether it is possible to put
variables in these parameters instead of hard coded values.

Chris C answered:

Passing parameters in NetTalk (and on the web in general) is more like using global variables between procedures than actually passing prototyped paramters.
Just by passing them in the request, places the variables in the request buffer. And can be gotten with p_web.getValue('bFile')
Also the values may also be stored more globally as Session Variables -p_web.GetSessionValue('IDField')
So even though you don't see them being stored in the source, doesn't necessarily mean that they aren't being stored. The WebHandler does this part.

And Bruce Johnson answered:

If another site is calling you with parameters, then you can access those parameters using the following methods.

value = p_web.GetValue('name')
and
x = p_web.IfExistsValue('name')

if you want to manipulate the parameters then use

p_web.SetValue('name',value)

In terms of passing parameters to another web site - yes you can use variables...

for example
'SECONDFORM?bFile=Mailboxes&bKey=Key&IDField='&p_web.GetSessionValue('whatever')&
'&Change_btn=Change&'

(all on one line)



Pages: [1] 2