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

Pages: 1 ... 716 717 [718] 719 720 ... 744
10756
Web Server - Ask For Help / Re: SSL DLL's in path
« on: June 27, 2008, 07:29:03 AM »
SSL needs the following 4;

libeay32.dll
libssl32.dll
ssleay32.dll
msvcr71.dll

Cheers
Bruce

10757
Web Server - Ask For Help / Re: Generating Excel sheet
« on: June 26, 2008, 10:46:05 PM »
Hi Majodi,

If you are using OfficeInside then you can convert your report output to Excel in the same way you can convert a report to PDF. I'll see if I can put together an example of this at some point soon.

Cheers
Bruce

10758
Web Server - Ask For Help / Re: RestoreValue(), GetSessionValue()
« on: June 26, 2008, 10:44:01 PM »
Ok, now for the harder bit... This bit is about the use of StoreValue, and RestoreValue.

a) they are not complimentary functions. In other words, one is not the opposite of the other. They perform 2 separate roles, and their behavior is not related to each other. Indeed RestoreValue is only used in a small number of special cases, and you should not need to use it much, if ever. On the other hand StoreValue is very useful, and something that should definitely be in your arsenal.

b) a "Value" in much of my discussion refers to a specific parameter passed in via the browser request. There are 3 "ways" a parameter can be sent - in the URL itself, as a cookie, or as POST data. Regardless of the way, NetTalk parses all 3 out for you and stores these in the "ValueQueue". Functions like GetValue, SetValue and IfExistsValue are all common when dealing with the Value queue.

c) The danger with Values, especially fi you are new to web programming, is understanding when they are _not_ available. Consider the following case;

1) a Form is called, with a bunch of Values as parameters

2) The user clicks on a lookup button, selects a record, then "returns to" the form by clicking Select.

3) At this point the original Values _do not exist_. Because the parameters passed from the _lookup_ browse are different to the values passed from the _original_ browse.

Thus it would be dangerous to use the _GetValue_ method at anytime during the Form. Instead you make sure he Value is in the SessionQueue, and use GetSessionValue instead.

Ok, here's the crucial bit...

the most common technique folk used for storing the Value was
p_web.SSV('parameter',p_web.GetValue('parameter'))

But this is wrong. why? Because if the parameter _does not exist_ then the _session value_ will be cleared. The correct way to write this code would be

If p_web.IfExistsValue('parameter')
  p_web.SSV('parameter',p_web.GetValue('parameter'))
End

Since I got tired of writing this out all  over the place, I created a single method call which effectively just does these 3 lines. ie

p_web.StoreValue('parameter')

helpful?

Cheers
Bruce




10759
Web Server - Ask For Help / Re: RestoreValue(), GetSessionValue()
« on: June 26, 2008, 10:33:27 PM »
Hi Guys,

whew - lots of questions, let's deal with the easy ones first...

>> What is the lifespan of a SessionValue? Is it killed only when the session is closed?

yes, it's killed when the Session is deleted. For the rest of the time think of it as "global" but limited to a single "user".

>> ... one user has it's own unique SessionId during the use of the complete app (all pages served). Correct?

correct. The session variable is "global" across all procedures.

>> So if I put something in the SessionQ from one procedure I can get it in another procedure. So I can signal values between procedures like Global data. Right?

absolutely right.

>> what happens if the same "variable" name is used more then once?

Each Session Value has 1 name, so it's the same as a (global) variable. If you use it in 2 places, you're actually using the same variable.




10760
Web Server - Ask For Help / Re: SSL DLL's in path
« on: June 26, 2008, 10:20:18 PM »
Hi Majodi,

Having the DLL's in the path is not ideal. I strongly recommend always having them in the application directory. The 4 DLL's work together, and the ones I've seen in various paths are not always of the same version. So, as with all DLL's, having them in the application folder is a very quick way to avoid all kinds of versioning hassles.

Cheers
Bruce

10761
Hi Mike,

The code is in the rico.js file, but the style is in accordion.css (and thus all.css.)

Cheers
BRuce

10762
Web Server - Ask For Help / Re: Generating Excel sheet
« on: June 25, 2008, 03:22:40 AM »
Hi Cyber,

I'm not sure.
I suppose during the Office install you might start by just limiting it to Excel. And of course there are lots of different Excel options you can probably exclude.

If Excel needs some functionality it will prompt you and install that "on the fly". So if your app is completely consistent, then all you need to install is the minimal excel install, then generate some spreadsheets until the Office no longer pops up the "insert CD" message.

Personally though, I'd go the other way. Because this is a server you never know when some unexpected thing will occur that might need the Office CD. Maybe a client embeds a new graphic image type, or uses Korean or something like that. For this reason I'd install _everything_ to do with Excel. I don't want it to "install on demand" I want it to install _everything_ just once.
Disk space is really really cheap, and this seems to me to be the least likely approach to cause problems later (especially when the CD has been filed away somewhere.)

Cheers
Bruce



10763
Web Server - Ask For Help / Re: Generating Excel sheet
« on: June 24, 2008, 11:53:57 PM »
Hi Majodi,

You can create the Excel spreadsheet, on the server, using whatever normal approach you use for Excel.

This might be creating a XLS file with something like Office Inside, or it might be as simple as a simple CSV file.

Once you've created the file on the server, you need to tell the browser that it "belongs" to Excel, and hence that excel must open (at the client) when the file arrives.

The way you do this depends on how the browser _asked_ for the file.
a) if the URL which "asked" for the file contains the .XLS or .CSV extension then the "content type" is automatically set for you. So there's nothing to do. However

b) If the URL was "generic" and the _server_ is deciding to send back a file that should be opened in Excel, then the server needs to set the "Content Type" to 'application/vnd.ms-excel'

How exactly all this happens does depend a lot on how you are generating the Excel file. Are you generating it on the fly, or are you going to use the output of a report, converted to Excel?

cheers
Bruce


10764
Web Server - Ask For Help / Re: Put text somewhere on a form
« on: June 24, 2008, 11:34:00 PM »
Hi Majodi,

Yes it is difficult to visualise a form until you get the hang of it.

The "comment" field is explicitly designed for "explanatory text" about a field. This is the web so more explaining is necessary, and that's what the comment is there for.

Display fields also work well, but I'd recommend the comment first.

Cheers
Bruce


10765
Web Server - Ask For Help / Re: RestoreValue(), GetSessionValue()
« on: June 24, 2008, 11:31:42 PM »
Hi Majodi,

>> what is set
>> where it is set
>> what is safe to use

_ParentProc is often set if one procedure is "embedded" in another. For example if a browse is on a form, or if something is a BrowseChild and so on.
If it's working for you then it's probably ok.

In general terms though, it's hard to be specific about what is set, and where it's set, since there's obviously a lot of things being set.
In general, you should always use items from the SessionQueue, not "field values". You should also set the session Queue, not "Field Values".

Of course, a lot of the "magic" is happening under the skin, and this can be disturbing because you can't see the "big picture". And understanding the whole big picture is also very complex. So the best thing to do is have a look at the generated code if you're not sure about something.

>> when to use RestoreValue() and when to use GetSessionValue

GetSessionValue gets a value out the Session Queue. You will almost always use this.

RestoreValue is used to set a file field to the "best setting". Specifically it uses the ValueQueue (ie something passed on the URL) if that exists. If that doesn't exist it uses the Session value. If that doesn't exists it leaves the variable alone.

In almost all cases you will use GetSessionValue, not RestoreValue.

In the case where you are expecting values to be passed as part of the URL, or a cookie, or POST data, then you may be tempted to use GetValue instead of GetSessionValue. In almost all cases where I've seen this done, it's wrong.

If you want to Store a Value into the SessionQueue (if the Value exists) then use a call to p_web.StoreValue('something')

So if you want a "best practice" bit of advice;
a) use StoreValue to "save" passed parameters and
b) Always use GetSessionValue (or GSV for short) everywhere else.

and remember
c) If you set a File Field to something in hand-code, do a SetSessionValue (SSV for short) of the field as well.

Cheers
Bruce

10766
Web Server - Ask For Help / Re: Using EIP (4.31)
« on: June 24, 2008, 07:57:52 AM »
Hi Murray,

Make sure the button doesn't have a URL set.
If that's not it, then I'm afraid I'm back to the "send example" position.

>> Or any better solutions to selecting records ..

A checkbox (ie EIP on the browse column) is one solution. There is an example (Tagging I think) that shows this.

Cheers
Bruce


10767
Web Server - Ask For Help / Re: Using EIP (4.31)
« on: June 22, 2008, 10:58:46 PM »
Hi Murray,

No, there's no trick to this. It should work fine, as long as the template settings are set correctly. However it's difficult to comment on what may be wrong without an example. Any chance you could post an example of what you're doing so I can take a look?

Cheers
Bruce

10768
Hi Dave,

>> On a browse, after upgrading to 4.31 a Unique,unchanging key field became blank.

I'm not 100% sure about this. As far as I can tell it's not that it makes it blank, it's more that it suddenly, absolutely, requires it to be filled in. In earlier versions if it was blank it used the Key set under the "tables" button, and failing that used the file's primary key.

In 4.31 though, I've made it stricter - the uniquekey _must_ be set.

Cheers
Bruce

10769
Web Server - Ask For Help / Re: Remember TAB after SAVE record?
« on: June 20, 2008, 03:20:03 AM »
Hi Alan,

Which "tab" style are you using?
XP-Tabs?

Cheers
Bruce

10770
Web Server - Ask For Help / Re: Suggestion for prime on form
« on: June 20, 2008, 03:17:58 AM »
I agree Alan. Done for the next build.

Cheers
Bruce

Pages: 1 ... 716 717 [718] 719 720 ... 744