NetTalk Central

Author Topic: Form layout & procedure call problems  (Read 6411 times)

Poul Jensen

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • Email
Form layout & procedure call problems
« on: March 13, 2019, 01:20:23 AM »
Hi,

See attached pic with 3 issues:
1) How do I get rid of the tab.  I have removed the "General" but it still shows.
2) How do I properly align the second columns fields similar to first column.
3) On a button / OnClick tab I call a source procedure with a parameter.  Clicking this gives a 404 error:

Generated URL (looks OK): http://localhost:88/KoebeVare?UY9JW16LOIXWZ4CL

Debugview:
[st] [netTalk][thread=3] SendError = 404 The page cannot be found : The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. FileRequest=[KoebeVare]

From the logwindow:
GET /KoebeVare?UY9JW16LOIXWZ4CL HTTP/1.1
Host: localhost:88
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: http://localhost:88/UpdateAPPvarer
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,da;q=0.8
Cookie: SESSIONIDX=BXNiHdM0D1F0zMCD9l3isODFL3FDEM

What am I missing her.

tia

/Poul
 

Poul Jensen

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • Email
Re: Form layout & procedure call problems
« Reply #1 on: March 13, 2019, 05:01:33 AM »
I have now (partly) solved issue 1 & 2.  See attached.

Cheers
/Poul

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Form layout & procedure call problems
« Reply #2 on: March 13, 2019, 06:10:24 AM »
Hi,

To send a parameter you must also name the variable name in the url, like:
http://localhost:88/KoebeVare?myvar=UY9JW16LOIXWZ4CL

A second or 3rd or 10th parameter is separated by "&", like:
http://localhost:88/KoebeVare?myvar=UY9JW16LOIXWZ4CL&my2ndvar=3DEIH4XRTYUHN5jA

In the procedure, right after "CODE" you do:

p_web.storevalue('myvar')
p_web.storevalue('my2ndvar')

From that moment you have session variables "myvar" and "my2ndvar"at your disposal.

Cheers,
Rene

Rene Simons
NT14.14

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Form layout & procedure call problems
« Reply #3 on: March 13, 2019, 10:55:30 PM »
Hi Rene,

>> 3) On a button / OnClick tab I call a source procedure with a parameter.  Clicking this gives a 404 error:

Source procedures are not "pages" so you can't call them as a URL.
Either;
a) you are intending to goto a page, in which case use a NetWebBrowse, NetWebForm or NetWebPage template procedure or
b) you are intending to remain on this page, and just do "some server side code" - in which case remove your items from the OnClick tab and add your code to the Server-Side-Code on the Client-Side tab.

cheers
Bruce


Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Form layout & procedure call problems
« Reply #4 on: March 13, 2019, 11:34:27 PM »
Hi Bruce,

In my defence :
I only looked at the  url part in Poul's message,  where I noticed that the parameter part was not correct.

Ren

[Bruces note : sorry Rene, I meant to address the previous message to Poul - brain fart...]
« Last Edit: March 17, 2019, 10:50:20 PM by Bruce »
Rene Simons
NT14.14

Poul Jensen

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • Email
Re: Form layout & procedure call problems
« Reply #5 on: March 14, 2019, 02:20:15 AM »
Thanks Rene & Bruce,

Still strugling with this (been doing H5-work for a couple of years, and most things are much easier there, but of course with other limitations   ;)  ).

@Bruce:
Server-Side-Code on the Client-Side tab:  is this not javascript code I have to place here ?

I need to do some Clarion coding.  How do I do that ?

Cheers
/Poul
 

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Form layout & procedure call problems
« Reply #6 on: March 17, 2019, 10:52:00 PM »
Hi Poul,

Server-Side code runs on the server, in Clarion, so no, not JavaScript.
I recommend that you put something in there to "mark the place" then go back to the app tree, to the procedure, and take a look at the code "in context".

The key thing to remember here is that you always use and set Session values, not just raw variable values.


Cheers
Bruce

Poul Jensen

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • Email
Re: Form layout & procedure call problems
« Reply #7 on: March 21, 2019, 12:05:22 PM »
Thanks Bruce.