NetTalk Central

Author Topic: Top radio set on a memory form changes back to first value  (Read 6113 times)

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Top radio set on a memory form changes back to first value
« on: August 28, 2013, 05:13:11 AM »
Hi Bruce / All,

Nettalk 7.21, C8.

Am in the process of upgrading from NT6 to 7.

On a memory form, I have a radio set plus a few other fields, a button, then a browse.

* The button is a basic button, which refreshes the browse (no embed code).
* The radio set is the first field in the form.

On loading the page I set the radio value.

Page loads, and the correct value is selected in the radio button. In this example the value is the 3rd in the radio set.

ISSUE #1: I click on a different value (say the 4th), and the radio value flips to the first value. I click on the 4th value again, and it sets correctly.

ISSUE #2: When the page loads, I click on the Button. The radio value flips to the first value.

** If I move a field, say a string field, above the radio set in the form, this issue seems to disappear. Although I then get issues with the button actually working (which is probably something different).

Any thoughts?
Cheers,

Stu Andrews

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Top radio set on a memory form changes back to first value
« Reply #1 on: August 28, 2013, 10:54:21 PM »
>> On loading the page I set the radio value.

my guess is this part is wrong. What code are you using, and specifically where are you putting it?

aside: you might want to turn on Debugview, and tick on the template option "send stage to debugview" on the form. That will give you a better idea of what bits of code are running with each event.

cheers
Bruce

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Top radio set on a memory form changes back to first value
« Reply #2 on: August 28, 2013, 11:18:18 PM »
Hey Bruce,

In the GenerateForm embed, under the "Start" section, I run the following code:

Code: [Select]
if ~p_web.IfExistsSessionValue('search:Listing_Status')
  p_web.SSV('search:Listing_Status','Active')
end

"search:Listing_Status" being the radio field. And "Active" being a value that is not first in the radio set.
Cheers,

Stu Andrews

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Top radio set on a memory form changes back to first value
« Reply #3 on: August 28, 2013, 11:43:12 PM »
perhaps tweak one of the shipping example sot show the technique you are using, then post the app & dict here so I can take a look.

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Top radio set on a memory form changes back to first value
« Reply #4 on: August 29, 2013, 12:05:14 AM »
Blurg. I've had to revert back to NT6 for the moment .. Too many things to do before tomorrow, and just not enough time to get around these issues.

Hopefully next week or thereafter I'll get a couple of days straight to look at it. Will look at getting examples then.

But it's definitely an issue.

See ISSUE #2 .. The value is fine on loading, but then changes back sometime between loading and me clicking on the button.

** The big problem for my system is that I have most of my big browses wrapped in memory forms with radio button sets as the first thing (Date Range, eg. "Today", "This Week", ..). And when "All" is the first value, and it flicks back to "All" automatically, then when the user comes back from the browse form, or just goes somewhere else then returns, the ALL browse is loaded (in these cases, the browses a file loaded, with strict filters).

It's probably something on my end, just haven't got the hours left this time.
Cheers,

Stu Andrews

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Top radio set on a memory form changes back to first value
« Reply #5 on: August 30, 2013, 04:07:50 AM »
Shipping example attached (Accounts).

* "UpdateTest" procedure.
* See the "Radio Test" link under the "STU" menu.

Is a memory form, with a local string variable.

[attachment deleted by admin]
Cheers,

Stu Andrews

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Top radio set on a memory form changes back to first value
« Reply #6 on: September 02, 2013, 03:44:06 AM »
ok, in the example the form has a single field - the radio button.
Radio is set to "today" when the form in generated (ie hand-code in GenerateForm routine).

so select whatever you like in the radio (that seems fine) but then everytime you select "Radio test from the menu it resets to Today.

All that seems fine - what am I supposed to be looking for?

cheers
Bruce

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Top radio set on a memory form changes back to first value
« Reply #7 on: September 02, 2013, 03:17:49 PM »
Perhaps we need a teamviewer session. It doesn't work for me.

That example, when you click on the radio button after the page loads, EVERY TIME WILL SKIP TO FIRST VALUE (whatever that value is).

It only happens on the first time you load the page. But it happens every time.

1. Click on "Radio Test".
2. Click on the "This Week" value.
3. Selected radio will skip to "All".

Tested in Chrome, Firefox, IE.
Cheers,

Stu Andrews

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Top radio set on a memory form changes back to first value
« Reply #8 on: September 09, 2013, 02:15:33 AM »
Okay, tracked this down.

Let's say my radio button had 3 possible values .. "All", "Today" and "Tomorrow".

The "Today" value is the primed value.

On loading the window, everything is fine.

Then when I click on the radio field (any of the options):

1. The Validate:: routine is run.

2. In here the ValidateValue:: routine is run, where there is a single line of code:

Code: [Select]
if loc:invalid = '' then p_web.SetSessionValue('loc:RadioString',loc:RadioString).
3. BEFORE this code, a _trace() shows the value is set to "Today".

4. AFTER this code, a _trace() shows the value is set to "All".

We have to ask why loc:RadioString is set to "All" and not "Today", so we go back to the Validate:: routine.

The code in question is:

Code: [Select]
If p_web.Ajax = 1 and p_web.ifExistsValue('NewValue')
  loc:RadioString = p_web.GetValue('NewValue')
ElsIf p_web.IfExistsValue('Value') !FormFieldPicture =   !FieldPicture =
  loc:RadioString = p_web.GetValue('Value')
End

A _trace() before this code shows that the GetValue() of "Value" is set to "All".

AHA!

But now it gets beyond me. I'm not sure what to do from here. Am going to go google radio buttons and issues with default.

[attachment deleted by admin]
Cheers,

Stu Andrews

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Top radio set on a memory form changes back to first value
« Reply #9 on: September 09, 2013, 11:12:18 PM »
try in 7.24 when 7.24 is up.

cheers
bruce

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Top radio set on a memory form changes back to first value
« Reply #10 on: September 10, 2013, 12:49:48 AM »
Thanks Bruce, will do!
Cheers,

Stu Andrews

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Top radio set on a memory form changes back to first value
« Reply #11 on: September 10, 2013, 11:50:43 PM »
Don't want to get too excited, but it looks to have fixed the issue!

At least, the example works.

Will compile the big fella system and see how we do.
Cheers,

Stu Andrews