PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WB20] Problem in the action of a button inside a LOOPER
[WB20] Problem in the action of a button inside a LOOPER
Iniciado por guest, 13,jul. 2017 17:33 - 3 respuestas
Publicado el 13,julio 2017 - 17:33
Hello developers!

I take a little of their time to see if they can give me a hand on a problem that I have been locked into for some time.

About 6 months ago I am learning and developing a project in WEBDEV at the same time. In this case a PHP project. So there are processes on some elements (tables, loopers for example) in which I burn a time to implement.

The question is this: I have a 'classic' looper which is loaded by means of a query, this looper is in the field of a browser that works with the behavior of a pop-up window. Each time I open this window depending on the parameter you send me will show different registers.

Inside the controls the looper has a button. This button in the 'on click' action (which does not have AJAX mode enabled) has this code in the PHP-Server section:

sRuta is string
HReadSeekFirst(d010_evidencias,Id_Evidencia,QRY_listaEvidencias.ATT_Id_Evidencia)

IF HFound(d010_evidencias) = True THEN
sRuta = LOOP_QRY_listaEvidencias[ATT_Id_Evidencia].STC_RutaArchivo
FileDisplay(sRuta,"application/unknown"
END

In my database I have stored the physical route which when I execute the query the dump in an STC Control (STC_RutaArchivo).

The problem is that when I run FileDisplay and show in a new tab the document (for example a .pdf) Always shows me the document associated with the last record loaded in the looper.

Do you know what the error is? By what he understood to identify the position of an element within the control looper is made use of "[]".

I have to say that I also did this test of working with buttons inside another element like the 'table control' setting the column as a '' container '' type but I was not lucky, which is why I am looking to implement it this way (using a looper control).

I hope they can guide me.
Greetings.
Publicado el 13,julio 2017 - 19:50
Hi Ezequiel,

it seems that ATT_ID_Evidencia is an attribute from the looper, which is good. What is NOT good is that you are not specifiying the LINE of the looper to reference.

So you should start by something like
iCurrentLine is int=looperselect(LooperName)
if iCurrentLine>0 then
Your existing code here, but with all Attributes of the looper followed by [iCurrentLine]
end

Best regards
Publicado el 14,julio 2017 - 14:05
Hi, Fabrice.

Good to cross you over here! Look, you know I tried to develop this in a Table Control and I have not had success.
Now I try to do it in a looper control, and I'm at the same crossroads: the time to execute FileDisplay programmed in a button. (I'm sweating the shirt a little :-)

The question in principle is this: I have seen in other examples, tutorials, the use of "Looper Select", but the problem is that the option is not allowed in PHP. And that is why I have tried several ways to 'capture' the position within the looper and get the result explained above.

I have implemented another looper with the functionality of implementing in a button the function "Page Display" (to dump on a series of Edit Control information of a table) and I had no problems.

Is there another way to achieve what I am looking for? That does not seem crazy, but the tool is working a little bit.

I hope I can reach a good port.

Greetings.
Publicado el 17,julio 2017 - 14:28
Hi again

sorry, but I cannot help you with the php part, as I NEVER use that mode.

It is much more limited in many ways than the regular and awp modes and
it does not give ANY advantage, as a basic webdev hosting cost only
5€/month.

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 7/14/2017 à 6:05 AM, Ezequiel Reverditto a écrit :
Hi, Fabrice.

Good to cross you over here! Look, you know I tried to develop this in a
Table Control and I have not had success.
Now I try to do it in a looper control, and I'm at the same crossroads:
the time to execute FileDisplay programmed in a button. (I'm sweating
the shirt a little :-)

The question in principle is this: I have seen in other examples,
tutorials, the use of "Looper Select", but the problem is that the
option is not allowed in PHP. And that is why I have tried several ways
to 'capture' the position within the looper and get the result explained
above.

I have implemented another looper with the functionality of implementing
in a button the function "Page Display" (to dump on a series of Edit
Control information of a table) and I had no problems.

Is there another way to achieve what I am looking for? That does not
seem crazy, but the tool is working a little bit.

I hope I can reach a good port.

Greetings.