PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 21 → Pass ID as a parameter from a TABLE to a popup page using BrowserOpen().
Pass ID as a parameter from a TABLE to a popup page using BrowserOpen().
Débuté par Ezequiel Reverditto, 05 avr. 2017 17:45 - 9 réponses
//hostimage.webdev.info/avatars/default.gif
Posté le 05 avril 2017 - 17:45
Hello developers.

Almost 3 months I'm learning and at the same time programming a project in WEBDEV (version 20) I find myself stuck in a part and therefore my query here. It is with respect to the step of parameters to another page that I look for to work in a popup form, this implementing the BrowserOpen () function. I have tried in these ways:

- Using global variables that save the value of the column in the table.
- Storing the parameter as a result of the onClick event on the button.
- Finding some variant of PageDisplay () that allows me to open a popup page and not in the same browser.

My idea in general is to get this ID, which links to a table of my BD and from there in another browser dump the values ​​into a series of tags. Also use it as input parameter to a query.

I hope you understand that I am looking to do and I hope you can help me.


Greetings and in advance Thanks!
//hostimage.webdev.info/avatars/default.gif
Posté le 05 avril 2017 - 19:39
Ezquiel I quite do not understand why you would want to open a Popop window on another page ?

Popups are used inside the same page, so the "weight" of the page is lighter

You could easily pass a parameter to another page, but using pagedisplay instead of browseropen
//hostimage.webdev.info/avatars/default.gif
Posté le 05 avril 2017 - 20:09
Hi Ezequiel

browseopen accepts a FULL url, ie WITH parameters...

So what's the hold up?

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Le 4/5/2017 à 9:45 AM, Ezequiel Reverditto a écrit :
Hello developers.

Almost 3 months I'm learning and at the same time programming a project
in WEBDEV (version 20) I find myself stuck in a part and therefore my
query here. It is with respect to the step of parameters to another page
that I look for to work in a popup form, this implementing the
BrowserOpen () function. I have tried in these ways:

- Using global variables that save the value of the column in the table.
- Storing the parameter as a result of the onClick event on the button.
- Finding some variant of PageDisplay () that allows me to open a popup
page and not in the same browser.

My idea in general is to get this ID, which links to a table of my BD
and from there in another browser dump the values ​​into a series of
tags. Also use it as input parameter to a query.

I hope you understand that I am looking to do and I hope you can help me.


Greetings and in advance Thanks!
//hostimage.webdev.info/avatars/default.gif
Posté le 10 avril 2017 - 17:49
Hi Diego.

Yes, my idea is to implement a popup window, but in reality what I define is another instance of Browser. I do this for a matter of information views. With PageDisplay () I can not do this ...
This is why I'm looking for a way to pass a value as a parameter using the BrowserOpen () function, but I can not do it yet.

If you know anything that can help or guide me, I would be grateful.

Regards!
//hostimage.webdev.info/avatars/default.gif
Posté le 10 avril 2017 - 21:01
again, browseopen accepts a FULL url, ie WITH parameters...

So what is the problem ? What code are you using that does not work?

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com

Le 4/10/2017 à 9:49 AM, Ezequiel Reverditto a écrit :
Hi Diego.

Yes, my idea is to implement a popup window, but in reality what I
define is another instance of Browser. I do this for a matter of
information views. With PageDisplay () I can not do this ...
This is why I'm looking for a way to pass a value as a parameter using
the BrowserOpen () function, but I can not do it yet.

If you know anything that can help or guide me, I would be grateful.

Regards!
//hostimage.webdev.info/avatars/default.gif
Posté le 11 avril 2017 - 14:13
Hi, Fabrice. Thanks for the reply.

Yes, I understand the part where using BrowserOpen () I can pass parameters, I have seen it in an example of the tool (WWParam). What's more, that's where I get the idea for what I'm looking to do. But you may not be able to implement it for the following reasons:

1- The example does it using dynamic pages and I want to implement it in a PHP project.

2- Also in this example when you pass the parameters, you do it from one project to another and I want to implement it between pages of the same site.

I spent a bit of what I did for you to take a look.

I have 2 pages (actionsXplan.php and loadEvidencia.php).

* In actionsXplan.php:

-- Global declaration of actionsXplan.php --
gnAccion is int // here I want to store the ID


-- click of BTN loadEvent (PHP server) --
gnAccion = TABLE_QRY_TBL_ShowAcciones.COL_Id_Accion
Info (gnAccion)

 // I take the ID of the field that I want to pass as parameter to loadEvidencia.php


-- return from AJAX process after clicking BTN loadEvidence --
sNombrePag is string = "loadEvidencia.php"
BrowserOpen (sNombrePag & gnAccion, "EVIDENCES", ONSimple, 1100,575,110,50)

// even if I do not throw a compilation error, I know it is not correct to say "sNamePag & gnAccion", since I am concatenating values. But it was another of my tests ...


* In uploading.php:

-- Global declaration of loadEvidencia --
PROCEDURE loadEvidencia (gnAccion is int)


-- Initialization of loadEvidencia --

nIdAccion is int
nIdAccion = gnAccion

Info (nIdAccion)
HExecuteQuery (QRY_LBL_datasAction, hQueryDefault, nIdAccion)


I hope you can understand more or less what it is that I seek to do. And hopefully you can give me a hand, I've been stuck on this for days.

Greetings and thanks again!
//hostimage.webdev.info/avatars/default.gif
Posté le 11 avril 2017 - 15:33
Hi

1- The example does it using dynamic pages and I want to implement it in
a PHP project.


Same difference. What we are talking about is the universal passing of
parameters in a URL. ALL pages of ALL types support it

2- Also in this example when you pass the parameters, you do it from one
project to another and I want to implement it between pages of the same
site.


Same diference, AGAIN.



In your code, you are not constructing the URL correctly.

Look at any url displayed in your browser window and how parameters are
passed. It's something like
http://domain.ext/ParamName=ParamValue&Param2Name=Param2Value ...


So, you need to build that url string by code till you have exactly it
in your sNombrePag variable THEN do the browser open...

In other words, BrowserOpen is equivalent to you typing a complete URL
in your browser address field.

best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com

I spent a bit of what I did for you to take a look.

I have 2 pages (actionsXplan.php and loadEvidencia.php).

* In actionsXplan.php:

-- Global declaration of actionsXplan.php --
gnAccion is int // here I want to store the ID


-- click of BTN loadEvent (PHP server) --
gnAccion = TABLE_QRY_TBL_ShowAcciones.COL_Id_Accion
Info (gnAccion)

// I take the ID of the field that I want to pass as parameter to
loadEvidencia.php


-- return from AJAX process after clicking BTN loadEvidence --
sNombrePag is string = "loadEvidencia.php"
BrowserOpen (sNombrePag & gnAccion, "EVIDENCES", ONSimple, 1100,575,110,50)

// even if I do not throw a compilation error, I know it is not correct
to say "sNamePag & gnAccion", since I am concatenating values. But it
was another of my tests ...


* In uploading.php:

-- Global declaration of loadEvidencia --
PROCEDURE loadEvidencia (gnAccion is int)


-- Initialization of loadEvidencia --

nIdAccion is int
nIdAccion = gnAccion

Info (nIdAccion)
HExecuteQuery (QRY_LBL_datasAction, hQueryDefault, nIdAccion)


I hope you can understand more or less what it is that I seek to do. And
hopefully you can give me a hand, I've been stuck on this for days.

Greetings and thanks again!
//hostimage.webdev.info/avatars/default.gif
Posté le 11 avril 2017 - 17:30
Hey Fabrice! Thank you for your time again.

Just when I read your message I could find a solution to this problem. The idea is well as you commented to build the URL based on the page where I redirected and the parameters I'm going to pass.

I did it, then I did what I did.

* In actionsXplan.php

- click of BTN loadEvent (PHP server) -
gnAccion = TABLE_QRY_TBL_ShowAcciones.COL_Id_Accion
Info (gnAccion)

gsComLine = "IDACCION =" + (gnAccion)


- return from AJAX process after clicking -
sNameSite is string = "loadEvidencia.php"
sComLine is string = sNameSite + "?" + gsComLine
BrowserOpen (sComLine, "EVIDENCES", ONSimple, 1100,575,110,50)



* In loadEvidencia.php

- Global Declarations of loadEvidencia (PHP server)
gnIdAccion is int = PageParameter ("IDACCION")


- Initialization of loadEvidencia (PHP server)
nAction is int
nAccion = gnIdAccion

HExecuteQuery (QRY_LBL_datasAction, hQueryDefault, nAccion)
FileToPage (loadEvidencia, actionsXplan)
Info (nAccion)


And as a result the url that the Browse shows me is for example:
Http: // localhost: 8080 / SYS_PLANIFICACIONAMSE_WEB / ES / loadEvidencia.php?% 20IDACCION = 91


Now the question is that when I run a simple query and I want to dump the data into a series of labels, I can not properly linke the values ​​for what I tried.

This is the query: QRY_LBL_datasAccion

SELECT
D005_acciones.Id_Accion AS ACTION_ID,
D005_acciones.Id_Persona AS Id_Persona,
D005_acciones.Id_Estado AS Status_Id,
D005_acciones.Description AS Description,
D005_acciones.Fecha_Limite AS Date_Limite,
D005_acciones.Presupuesto AS Budget
DESDE
D005_accciones
WHERE
D005_acciones.Id_Accion LIKE {nAccion}


Thanks again. Gradually I find the light at the end of the tunnel.
:-)
//hostimage.webdev.info/avatars/default.gif
Posté le 11 avril 2017 - 20:09
Hi Ezequiel,

it looks like you have a lot of extra spaces in yor URL, and you need to
remove them (you even have one that was translated at %20)

As for the query thing, it looks like it's a separate question that
should go in a separate thread, and with much more details, as currently
I have no idea what the question is

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com




Le 4/11/2017 à 9:30 AM, Ezequiel Reverditto a écrit :
Hey Fabrice! Thank you for your time again.

Just when I read your message I could find a solution to this problem.
The idea is well as you commented to build the URL based on the page
where I redirected and the parameters I'm going to pass.

I did it, then I did what I did.

* In actionsXplan.php

- click of BTN loadEvent (PHP server) -
gnAccion = TABLE_QRY_TBL_ShowAcciones.COL_Id_Accion
Info (gnAccion)

gsComLine = "IDACCION =" + (gnAccion)


- return from AJAX process after clicking -
sNameSite is string = "loadEvidencia.php"
sComLine is string = sNameSite + "?" + gsComLine
BrowserOpen (sComLine, "EVIDENCES", ONSimple, 1100,575,110,50)



* In loadEvidencia.php

- Global Declarations of loadEvidencia (PHP server)
gnIdAccion is int = PageParameter ("IDACCION")


- Initialization of loadEvidencia (PHP server)
nAction is int
nAccion = gnIdAccion

HExecuteQuery (QRY_LBL_datasAction, hQueryDefault, nAccion)
FileToPage (loadEvidencia, actionsXplan)
Info (nAccion)


And as a result the url that the Browse shows me is for example:
Http: // localhost: 8080 / SYS_PLANIFICACIONAMSE_WEB / ES /
loadEvidencia.php?% 20IDACCION = 91


Now the question is that when I run a simple query and I want to dump
the data into a series of labels, I can not properly linke the values ​​
for what I tried.

This is the query: QRY_LBL_datasAccion

SELECT
D005_acciones.Id_Accion AS ACTION_ID,
D005_acciones.Id_Persona AS Id_Persona,
D005_acciones.Id_Estado AS Status_Id,
D005_acciones.Description AS Description,
D005_acciones.Fecha_Limite AS Date_Limite,
D005_acciones.Presupuesto AS Budget
DESDE
D005_accciones
WHERE
D005_acciones.Id_Accion LIKE {nAccion}


Thanks again. Gradually I find the light at the end of the tunnel.
:-)
//hostimage.webdev.info/avatars/default.gif
Posté le 12 avril 2017 - 18:05
Hi, Fabrice.

If so. When I set the string to pass the URL it takes a space when I store the string "gsComLine =" IDACCION = "+ (gnAction)", I have corrected it. And it has stayed like this: "http://localhost:8080/SYS_PLANIFICACIONAMSE_WEB/ES/loadEvidencia.php…"

Even so both ways I can pass the parameter to loadEvidencia.php using the BrowserOpen () function.

I have been able to conclude with this concern. For the other question that was presented to me, I will detail it in another thread.


Thanks for the help!