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 ... 709 710 [711] 712 713 ... 736
10651
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


10652
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

10653
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


10654
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

10655
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

10656
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

10657
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

10658
Hi Dave,

Your posting here was helpful in isolating a small template bug. So please don't apologize for posting. The template code assumed the checkbox would have a numeric value set in the dict, and this isn't the case.

Your work-around is fine, no problems there, but you shouldn't have had to do it. I've fixed the template for the next build.

Mike -

<< I generally have found it better not to try to do much logic in the dictionary, but rather handle it in NetTalk Web (NTW) if possible.

It's always better if the template supports the dictionary settings directly without additional work. If you find dictionary settings that don't work please let me know - that's usually a bug.

Cheers
Bruce

10659
Web Server - Ask For Help / Re: Extra buttons on browse
« on: June 20, 2008, 02:53:29 AM »
Hi Murray,

Ok, adding the button under the browse is the easy bit, and I'll dealwith that in a second.

However, your understanding of Sessions and Threads is inaccurate, and far more important. First off a session <> a thread. Indeed, a single session will result in many, many threads happening.

Specifically in this case, if you use an In-Memory file to create a browse, and the file is /THREADED, then by the time the user _sees_ the browse, the file is already gone. In short, the thread that _generates_ the browse page lasts about 1 tenth of a second and then is no more.

Certainly it's no longer there when the user clicks on a button.

So the first thing you need to do is make the memory table so the data is available across threads, and add a "SessionId" field to the table so you can filter the table based on a specific session number.

Ok, back to the button. The best way to add extra controls to the browse, is to put the browse on a Form. In other words you'd have the Form (memory, not file based, no Save or cancel buttons, style probably "None") with a Browse as one field, and then a button as another.

Cheers
Bruce

10660
Web Server - Ask For Help / Re: Firefox 3 supported?
« on: June 20, 2008, 02:02:37 AM »
Hi Alan,

Well the good news is I can duplicate the effect here. Tracking down specifically what is different was tricky, but I'm glad to say the fix is very simple.

Obviously the fix will be included in all future builds. However, if you don't want to upgrade your NetTalk just yet, or if you need to "retro-fix" and older program then you can follow the steps below. If you need your program working in FF3 before I release the next build then also just apply the steps below.

1. Open the source file  \clarion6\libsrc\netweb.clw
2. search for a routine called Calc_ContentType. There is only one routine with this name in the file, so it should be easy to find.
Inside this routine is this snippet of code;

  if loc:z
    self.RequestBoundary = '--' & self._GetHeaderField('boundary',self.RequestContentType, 1, size(self.RequestContentType), 1, 1)
    self.RequestContentType = sub(self.RequestContentType,1,loc:z-1)
  end

An additional IF statement is required, resulting in this;

  if loc:z
    if instring('multipart/form-data',self.RequestContentType,1,1)
      self.RequestBoundary = '--' & self._GetHeaderField('boundary',self.RequestContentType, 1, size(self.RequestContentType), 1, 1)
    end
    self.RequestContentType = sub(self.RequestContentType,1,loc:z-1)
  end

If you have any questions about this please feel free to email me of course.

Cheers
Bruce





10661
Web Server - Ask For Help / Re: Retain row after changing record?
« on: June 19, 2008, 07:23:01 AM »
Hi Alan,

It should work as you require already.
What backend are you using?

Cheers
Bruce

10662
Web Server - Ask For Help / Re: Display extra fields in drop list?
« on: June 19, 2008, 07:22:02 AM »
Hi Alan,

yes, the dropped field can be an expression.
Although, in your case, a better expression would be

Description Field:
clip(EMP:FirstName) & ' ' & EMP:Lastname

Also, remember to add Emp:FirstName, and Emp:LastName to the hot-fields list for the drop down.

Cheers
Bruce

10663
Web Server - Ask For Help / Re: Extra buttons on browse
« on: June 19, 2008, 07:19:11 AM »
Hi Murray,

The last bit dictates the first bit.
Because you want to go to a new page (saying "emails sent") I'm gonna reword your problem a bit.

What you want to do is add a button to the browse, that takes you to a NetWebPage procedure. This procedure will send an email, then show the user a page saying "email sent".

Worded this way, the task becomes simple. Create a button on the browse row. Set the button to be an "other" button. And set the button type to be "Submit". The URL for the button is 'SendingEmail'

Then create a new procedure, a NetWebPage, called SendingEmail.
Inside this procedure code your SendEmail stuff, and then let the page say anything you like.

Cheers
Bruce

10664
Web Server - Ask For Help / Re: Browse Buttons (On the row)
« on: June 16, 2008, 03:31:24 AM »
Hi Ian,

I've just uploaded pre-release 4 of 4.31 to the pre-release page
http://www.capesoft.com/ftp/public/prerelease/index.htm

In this build, check out example 28 (Buttons). This now has buttons that demonstrate updating a cell, row, or whole browse when a button is pressed.

Cheers
Bruce

10665
News And Views / Re: NetTalk Pre-Release version 4.31 available
« on: June 16, 2008, 03:29:09 AM »
build 4 is now available.

This build includes an updated button example showing the refreshing of a cell, row, or browse when clicking on a "server side code" browse button.

Cheers
Bruce

Pages: 1 ... 709 710 [711] 712 713 ... 736