NetTalk Central

Author Topic: PopUp problem  (Read 3548 times)

Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
PopUp problem
« on: January 14, 2014, 06:37:54 AM »
I have a quite strange problem. During last NetTalk User Group meeting I discuss with Bruce about ajax and he stressed that my problem is related with popup form not with ajax. I agreed with him, so I make my table and popup form in a way that Bruce showed.
My problem is that my popup form is not populated with data I need every time I click on a record but it works randomly. It is very strange cause I defined in browse Unique Key same as I am using in a form to retrieve data from database.
Sometimes data is retrieve record I asked previously, sometimes it works as I expect but never works for first data in a table. So I made my plan to trap an error and setup DebugView points to track key fields which I am using to retrieve data in a form. I attached short DebugView log that described my problem.
First debug point is when I click button in a browse CallClicked and second is in a form I use as popup on GenerateForm. Sometimes key fields are same in a browse as in a popup form and somtimes are not but for the first record even when fields are the same I could not display data in a form.
In a both case I use p_web.gsv() function to retrieve value from NetTalk. In a browse value is always good but in a popup even I use tha same method to retrieve data it is not same value.
Browse procedure is named as Receipts and popup form is named as ShowTheBill.
Key fields are Serial and RNum.

What am I doing wrong?

Best regards,

Djordje Radovanovic

[attachment deleted by admin]

Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: PopUp problem
« Reply #1 on: January 16, 2014, 02:50:23 AM »
My problem so I have to dig.

In log file is sequence

00000030   10:53:15   [4716] [netTalk][thread=3] ShowTheBill START p_stage=16384  net:web:Init Event=   
00000031   10:53:15   [4716] [netTalk][thread=3] ShowTheBill END p_stage=16384  net:web:Init Event=   
00000032   10:53:15   [4716] [netTalk][thread=3] ShowTheBill START p_stage=0  net:web:Generate Event=   
00000033   10:53:15   [4716] [netTalk][thread=4] Receipts: Event: RowClicked   
00000034   10:53:15   [4716] [netTalk][thread=4] Receipts CallClicked Serial SDC999888001   
00000035   10:53:15   [4716] [netTalk][thread=4] Receipts CallClicked RNum   1   
00000036   10:53:15   [4716] [netTalk][thread=4] Receipts END Event=rowclicked   
00000037   10:53:15   [4716] [netTalk][thread=3] ShowTheBill START p_stage=16384  net:web:Init Event=   
00000038   10:53:15   [4716] [netTalk][thread=3] ShowTheBill END p_stage=16384  net:web:Init Event=   
00000039   10:53:15   [4716] [netTalk][thread=3] ShowTheBIll Generate Form Serial SDC999888001   
00000040   10:53:15   [4716] [netTalk][thread=3] ShowTheBIll Generate Form RNum   1   
00000041   10:53:15   [4716] [netTalk][thread=3] ShowTheBill END p_stage=0  net:web:Generate Event=   
00000042   10:54:08   [4716] [netTalk][thread=4] Receipts: Event: Gain Focus refresh=cancelled   
00000043   10:54:08   [4716] [netTalk][thread=4] Receipts END Event=gainfocus   

This sequence shows that when I clicked on button firstly it calls popup procedure than it fired RowClicked when popup is already shown and then after that program entered into generating form. It is late so data is not displayed as I expected.

Best regards,

Djordje Radovanovic

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11242
    • View Profile
Re: PopUp problem
« Reply #2 on: January 17, 2014, 02:06:13 AM »
>> Sometimes data is retrieve record I asked previously, sometimes it works as I expect but never works for first data in a table.

my guess is you embedded code into the Rowclicked routine. This is wronf. You must not embed code into the _calling- browse, you must only embed code into the called procedure. NTUG Webinar 3 for a discussion on this starting at around 1:04

cheers
Bruce

Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: PopUp problem
« Reply #3 on: January 17, 2014, 05:59:58 PM »
Unfortunately I put code into calling-browse just for examination, main embedded code is in called procedure and this code is responsible to read rest of data to be shown.

As Bruce always ask here is a little example. Plane NetTalk 7.32, one small TPS file with 5 records.
I was afraid that my problem is hard to duplicate cause I have a lot of relational records and ODBC connection but it was not.

Behavior is very similar that I have in my application.

And one more question. I tried to set textarea in ShowTheBill procedure as fix-pitch font but could not found proper place for that.

Best regards,

Djordje Radovanovic

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11242
    • View Profile
Re: PopUp problem
« Reply #4 on: January 19, 2014, 11:54:20 PM »
Hi Djordje,

The first problem appears to be a small bug in the class. I've fixed that for the 7.33 build.

>> I tried to set textarea in ShowTheBill procedure as fix-pitch font but could not found proper place for that.

Text Field, CSS tab, Entry Class
' nt-fixed-pitch'

That class is declared in netweb.css as

.nt-fixed-pitch{font-family: "Courier New"!important;}

You can create your own class with a different fixed-width font if you like.

cheers
Bruce


Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: PopUp problem
« Reply #5 on: January 20, 2014, 06:36:02 AM »
Thank you Bruce.

Best regards,

Djordje Radovanovic