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.


Messages - John Hickey

Pages: 1 2 [3]
31
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!

32
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.


33
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.

34
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'

35
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



36
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.

37
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

38
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.

39
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).

40
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)



41
Web Server - Share Knowledge / Example code for logging in a user
« on: June 17, 2007, 02:35:18 PM »
From the newsgroup, Steve Ellis asked:

Does anyone have an example of how to do a logon that verifies a userid and password against a server database?

Nick L answered:

Yes,
Include the tables you need to validate against but use the web form to
memory and local Li/Pw variables.
I validate 2 tables, the "users"(AFF) and "user group(UGRP)".

In the embed "Validate Update" I do a lookup to the "Users" using the key
login and then the user group to compare with the local vars to pass the
login and password. I then lookup the group to get the group access level
then set some session variables as in the example below. Any suggestions to
streamline this would be appreciated, anyone??

!Get login credentials
 If Loc:Login<>''
    If upper(Loc:Login) = upper(AFF:Login) and upper(Loc:Password) =
upper(AFF:Password)
            p_web.SetSessionValue('AffiliateID',clip(AFF:AffiliateID))
            p_web.SetSessionValue('AFFLevel1',clip(UGRP:AccessLevel))
            p_web.ValidateLogin()
            !p_web.SetSessionLoggedIn(1)
    Else
            p_web.SetSessionValue('LoginMessage','Try again')
    End !If
 Else
            p_web.SetSessionValue('LoginMessage','Login required, try
again')
End !If

****end example*****

42
Web Server - Share Knowledge / Re: Setting Form to view only
« on: June 17, 2007, 02:28:56 PM »
Gregg Matteson then replied:


I know about the "view only if" prompt but your suggestion got me headed in the right direction.

in the generate Form | Start

I placed :

if p_web.GetSessionValue('UpdateInvoices_CurrentAction') = ChangeRecord AND Accesslevel = 0
        loc:viewonly = 1
        else
        loc:viewonly = 0
    end

the Accesslevel is assigned in the form setup from a session variable.

The result is users with limited access can enter an order but NOT edit orders.

What ever the client wants ;>)

43
Web Server - Share Knowledge / Setting Form to view only
« on: June 17, 2007, 02:27:50 PM »
On the Newsgroups, Gregg Matteson asked:

How do you set a form to view only , only while the form is in change mode?

I tried setting a session variable at the browse then using that value in a local variable in the form but no luck so far.

Bruce Johnson Answered:

on the advanced tab is
"View Only IF:"
field.

In this you can put any expression.

In your case the expression would be

p_web.GetSessionValue('UpdateInvoices_CurrentAction') = ChangeRecord
where "UpdateInvoices" is the name of this form procedure.

In 4.26 I'll be making it a little easier to test the "current action" as this is something that came up a few times on tour.

Incidentally if your code to determine whether it should be View only or not is too big, then you can set the variable
loc:viewonly in the form in the Generate Form embed point to 1.

Cheers
Bruce

44
Web Server - Share Knowledge / Changing text on buttons
« on: June 17, 2007, 02:25:33 PM »
Question from Greg Bailey on the newsgroups:

I need to be able to change the text on an insert change or delete button at the procedure level (not globally).  The end user wants text specific to a particular browse on the buttons. Is this possible?

Answer from Wolfgang Orth:

yes:

at the Generate Form - StartEmbed

 p_web.site.InsertButton.TextValue = 'New'
 p_web.site.DeleteButton.TextValue = 'Dump it!'
 p_web.site.SaveButton.TextValue = 'Store Date'

45
News And Views / Welcome to the Forums!
« on: June 16, 2007, 01:58:31 PM »
What a fantastic product NetTalk is!  This forum is designed to be a central place where Clarion developers using NetTalk can come for answers to questions, and/or to share tips, code, and apps!

Now that you're here, what can you do?  Post your questions and tips about NetTalk in the appropriate sections.  You can also upload apps and code here, or in the Download/Upload section.

Thanks for participating!

--John Hickey

Pages: 1 2 [3]