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 - bshields

Pages: 1 ... 23 24 [25] 26
361
Web Server - Ask For Help / Re: How to do an automatic logout?
« on: March 31, 2009, 04:24:10 PM »
Hi Jill,

It all depends upon how you want it to work.

I have a program that you can click on the Logout menu option. When they do that a small sexy centered screen thanks them for their patronage. I then have links on that screen for what they might need to do next.

To do this, just create a standard NetWebPage make it look nice. Add the logout code below into it (so when the page is called you get logged out). Meanwhile a pretty page will be displayed, overwriting whatever was on there browser before it.

The above is a nice clean why of doing it. However, sometimes you may want to force the user to a new page, whilst within an existing one. You can only do this if the existing one hasn't began rendering the HTML. To do this simple call the page within code and return after it.ie:

IF p_web.GSV('ShouldIBeSomeWhereElse') = 1
  MainPage(p_web)
  RETURN
.


Again this isn't safe to do if the page you are on has begum sending HTML to the browser, you'd get two pages mixed together in a mess.

Regards
Bill

362
Web Server - Ask For Help / Re: How to do an automatic logout?
« on: March 30, 2009, 10:24:49 PM »
Hi Jill,

I can help with the first question.

Run this piece of code

p_web.SetSessionLoggedIn(0)

I also delete any login related session variables (not really necessary just habit I think)

p_web.DeleteSessionValue('_loginName')

Regarding the second question I usually have my session timeout set accordingly to achieve this. Not sure why you'd want a session to continue after you log them out!

Regards
Bill

363
Web Server - Ask For Help / Re: Multiple users, multiple file sets
« on: March 30, 2009, 10:17:29 PM »
Exactly.

I pass the identifier which indicates which database to use on the URL, So i use GetValue not GSV. But that should also work.

Bill



364
Web Server - Ask For Help / Re: Multiple users, multiple file sets
« on: March 30, 2009, 05:55:46 AM »
Hi Ron,

This is a question i put to Bruce at the Australian Dev Con in 2007. With his and Geoff Thomsons' assistance I got it working.

What I wanted was separate customers being able to log into a single version of my nettalk app, however they opened up their own separate copy of their data, rather than a consolidated database with CustomerID segment prefix everywhere.

I got it working using Postgres and FM3. In summary, at the WebServerHandler function prior to anything happening I would resolve which customer was on the given request and set all the database filenames appropriately. So that when NetTalk opens the file it is the file in question.

Its all heavily threaded, so files are opened for each thread and closed. So this approach is possible.

Regards
Bill

365
Web Server - Ask For Help / Re: icon or picture in browse
« on: March 29, 2009, 04:23:47 PM »
Hi Ron,

You can use a variable or literal ('images/mypic.png'). Just remember it all starts at the web folder within your programs folder. You can either set the width and height or ignore it and the browser will decide. Just depends upon what you want.

Oh, but you can't use .ICO files. Browsers don't like them. I convert the ones i use in my web apps to PNGs.

Regards
Bill Shields


366
Web Server - Ask For Help / Re: Calling a page in my site
« on: March 29, 2009, 05:03:53 AM »
Hi Greg,

Depending upon exactly what you want i can see two methods.

1. A permanent (or 301) redirect to the page passed in URLToGoTo. Use this to completely hand off the page, either within your own website or to another site. I use this technique for a Email Marketing Campaign system. All links in my HTML email are "wrapped" by Nettalk for statistics. eg. http://campaign.inhabit.com.au/wrap.do?l=http://ebay.com.au. If you want this approach let me know and i'll post the code.

2. Just call the page in question from your code. Lets say you are in a certain page and suddendly realise you need to run another page instead (due to validation, an error or a special paramater) or most often in NetTalks case, the customer hasn't logged in and there are trying to access a page that requires login. Just call the page at the moment you need to. eg.

LoginPage(p_web)
Return

Regards
Bill Shields

367
Hi,

On the login form, inside the "ValidateUpdate 2.End" embed point. Verify they have logged in correctly then save SiteID in session queue.

p_web.SetSessionValue('_siteID',SiteID)

I use a leading _ to help me know my session values that are special, you don't want to accidently use the field name again somewhere.

In a browse use a filter like this:

'XYZ:SiteID = '&p_web.GSV('_siteID')

Thats it!

Regards
Bill Shields

368
Web Server - Ask For Help / Re: SELECT(?field)
« on: March 28, 2009, 11:01:20 PM »
Hi Alberto,

Go to the embed point "After setting SelectField" and add this line.

p_web.SetValue('SelectField',clip(loc:formname) & '.placeyourfieldnamehere')

Make sure you get your field name right (might wanna be careful of case as javascript is picky).

Regards
Bill Shields

369
Web Server - Ask For Help / Re: icon or picture in browse
« on: March 28, 2009, 10:34:35 PM »
Hi Ron,

Add a String field to your browse, give it any old equate that makes sense, but nothing else. Then go to the "conditional" section. Add a condition for true and place the true picture in the image field. You can either add another condition for false or just set the default "image" section to your false picture.

Don't forget to make the fields you are using for the condition to be hot fields.

Regards
Bill Shields

370
Web Server - Share Knowledge / Re: Example Nettalk Sites
« on: February 18, 2009, 04:31:47 AM »
Hi Alberto,

Sorry for not being clear.

Normally your first procedure (mine is called MAIN) would have an Extension called "Nettalk or NetSimple Object".

Then going into the "Settings" tab and then the "Scripts" tab within it.

You should see "Include HTML Editor", tick that box and all the TinyMCE scripts will be included for you, and therefore your XHTML text box should turn into the HTML editor, tinyMCE.

I'm a couple of versions behind so hopefully Bruce hasn't moved it!

Regards
Bill

371
Web Server - Share Knowledge / Re: Example Nettalk Sites
« on: February 15, 2009, 03:24:03 PM »
Hi Alberto,

Thats the TinyMCE control thats part of NetTalk (mostly!).

I have a Text field, i have ticked the "Allow XHTML".

I know i had problems with this control, it appears to have a 16K limit (internal NetTalk restriction I think), dispite me telling it otherwise.

Also, in your main procedure, in extensions for NetTalk, find "Include HTML Editor" and tick it. This will includes the javascript libraries required.

TinyMCE has lots of options that NetTalk currently doesn't support. There is a place where you can hack this around within NetTalk (i have a little).

Regards
Bill

372
Web Server - Share Knowledge / Re: Example Nettalk Sites
« on: February 10, 2009, 05:52:48 AM »
Hi Michelis,

I'm not 100% sure what you mean.

The only thing slightly odd on the form is the "Display" field for the word "security".

If you mean that, its a display field with the value 'Security' in the "Text" option.

Regards
Bill

373
Hi Terry and Johan,

I did this a year or so ago on a test project.

It was ugly. But worked.

I had a radio button and depending upon its value it turned on and off certain tabs.

Firstly i needed to save all fields values in session variables to save their state.

I then had to save the client side value.

I added this handcoded JS to the control.

'sv(''LIS__PropertyType'',''listingupdate_lis__propertytype_value'',1,FieldValue(this)); window.open(''ListingUpdate?SessionID='&p_web.SessionID&''',''MainRight'')'

My variable that dictated the tab changes was LIS:PropertyType.

When the user selected a value, it would reload (yes full page refresh) the page, but the tabs would be redrawn correctly and work.

Its awful I know, but it worked.

Regards
Bill

374
Web Server - Ask For Help / Re: How to span fields in a form
« on: February 01, 2009, 02:03:14 AM »
Hi Michelis,

If you use Firebug to diagnose you'll see that city and zip are in different <TD> or columns.

In this case you just need to tell Nettalk to turn off "last on line" and "last in cell", for the field preceeding the one you want adjacent (ie. city). The "cell" corresponds to to <TD>.

Regards
Bill

375
Web Server - Share Knowledge / Re: Example Nettalk Sites
« on: January 28, 2009, 04:29:33 PM »
Hi Chris,

The admin section of our websites are all stock nettalk with our added CSS, to get things like the XP menu to resize correctly and to get dropdown boxes to size consistency across browsers. Nothing real exciting there. I spent a fair amount of time get getting a reasonably nice look to the stock Nettalk, but its still looks very "business like" and not that pretty. http://litehouse.com.au is probably the best example of this. Its a pretty straight forward nettalk app except for its ability to render a nettalk style form from a dynamic definition and save and load the data from XML.

Most of the other sites are a mix of technologies. Firstly Nettalk is the server always. Nettalk is really good at the more complicated database stuff. Nothing is faster at building medium to complex forms and data entry. So it is really well suited to the "Admin" side of websites.

To get the general public side of our websites looking nice, we build on top of nettalk a simple merging engine. That way we take HTML and merge data into it. Not dissimilar to PHP or ASP. With the massive benefit of Clarion being our server language.

I feel now we have a good blend of technologies and can use the appropriate tools for the job. But it does require reasonable skills in HTML/CSS and Javascript.

Regards
Bill


Pages: 1 ... 23 24 [25] 26