NetTalk Central

Author Topic: Problem with reset fields  (Read 7161 times)

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Problem with reset fields
« on: December 28, 2011, 03:36:58 AM »
Hello,

I can't refresh fields on a form.

I have a few display fields, which are hyperlinks to the other form on my site.
For example I have filed name: 'About'
In Client-Side tab of this field I set Reset field 'Contact'
When I click on 'About' nothing happens.

I saw that Validate::About routine is called in one place: event:accepted of lower('xxx_About_value') which is case statement of lower(p_web.PageName) in CallDiv routine.
CallDiv routine is called in case statement of p_stage at the beginning of CODE.

So after clicked on 'About' server is not calling Validate::About where is
do Refresh::Contact and I can't refresh that field.

Any advice?

In NetTalk 5.44 everything works fine. This problem is on version 6.12.

Regards,
Matthew
« Last Edit: December 28, 2011, 03:39:39 AM by Matthew »

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Problem with reset fields
« Reply #1 on: December 28, 2011, 03:48:46 AM »
Matthew,

Whenever you set fields in the serverside code, that are to be used with resetting other fields after the server side code is executed, the sessionValue "version" of those fields must be set.

E.g.

contact = 'some value'
p_web.ssv('contact',contact)

Resetting works with sessionValues.

Cheers,
Rene
Rene Simons
NT14.14

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Re: Problem with reset fields
« Reply #2 on: December 28, 2011, 04:07:59 AM »
Thank You for your reply Rene Simons.

I forgot to add, that I need reset field not to change value of this field, but change css style of this field. For example change color from black to blue after clicked on.

But after clicked on filed no server side code is running.

I don't understand what is the sessionValue "version". Should I set this value for every filed?
You mean something like: p_web.SSV('version', 1)?

Regards,
Matthew

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Problem with reset fields
« Reply #3 on: December 28, 2011, 04:35:13 AM »
can you post an example Matthew? I'm not at all sure I follow your explanation 100%, and an example makes it easier to duplicate, and give correct advice.

cheers
Bruce

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Re: Problem with reset fields
« Reply #4 on: December 29, 2011, 01:03:34 AM »
Problem is with display control since NetTalk 6.

I discribe my problem in few steps:

1. I added new field on form called 'Testing' which was display field.
2. In 'OnClick tab' I set URL to another form.
3. In 'Client-Server' tab I ticked on option "Send new value to server" and add some code in "Server Code" for example MESSAGE('I am here')
4. When I open my website, go to that form and click 'Testing', the message 'I am here' doesn't show.

So even if message doesn't show then I can't reset any field because it's on the same place in code.

In NetTalk 6 server code in display field is not running.
In NetTalk 5 it works.

Regards,
Matthew
« Last Edit: December 29, 2011, 01:08:09 AM by Matthew »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Problem with reset fields
« Reply #5 on: December 29, 2011, 03:08:24 AM »
Hi Matthew,

This change is party "by design" - so tell me more why you want the "send click to server" _and_ the URL to be set.
In NT5 this generates 2 requests, one to notify of the click, another to "fetch" the URL.

But this is (usually) a bad combination because there's no guarantee they'll run in a specific order. This leads people to all kinds of problems.

So tell me more about what you have in mind here.

cheers
Bruce


Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Re: Problem with reset fields
« Reply #6 on: December 29, 2011, 05:46:31 AM »
First of all menu in my website is a form.

I have few tabs and display field on each tab which are menu options.
Every field has URL to different procedures for example 'about us', 'contact', etc.
I have two css class which describe active and inactive menu option.

For example:

.inactive{
 text-color: black;
 font-weight: normal;
}

.active{
 text-color: black;
 font-weight: bold;
}

So when I clicked on menu option I would like to change css class from inactive to active for current menu option and change css class from active to inactive previous menu option.
I did this in NetTalk 5 using reset field and it was warking :)

Regards,
Matthew
« Last Edit: December 29, 2011, 05:48:23 AM by Matthew »

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Re: Problem with reset fields
« Reply #7 on: January 01, 2012, 11:00:34 PM »
I hope that my problem is now understood.

Does anyone have a solution for my problem?

Regards,
Matthew

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Problem with reset fields
« Reply #8 on: January 02, 2012, 12:06:32 AM »
Hi Matthew,
an example would be appreciated.

My key question though is that if your Menu is a form, and you go to the (say) About Us page, is that form then embedded on that page?
I suspect I'll have more questions based on the answer to that - which is why an example would help speed things along.

Cheers
Bruce

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Re: Problem with reset fields
« Reply #9 on: January 02, 2012, 02:04:05 AM »
I send small example describe my problem.

I attach;
 - ResetField.aap
 - web\theme\ResetField with ResetField.css

Regards,
Matthew

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Problem with reset fields
« Reply #10 on: January 02, 2012, 02:48:29 AM »
you're using Frames! - ahh such a small detail, but it makes a lot more sense now...

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Problem with reset fields
« Reply #11 on: January 02, 2012, 05:09:14 AM »
changed in 6.13

cheers
Bruce