PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → ComboBxx
ComboBxx
Débuté par Daniele, 24 avr. 2014 23:26 - 5 réponses
Membre enregistré
9 messages
Popularité : +2 (2 votes)
Posté le 24 avril 2014 - 23:26
HI,
after many years of WinDev Mobile eWindev (from Release 9), I'm also trying WebDev, but I still can not understand the logic.
if I fill a combo with a button
listadd (cmb_1, "1234")
listadd (cmb_1, "QWERTY")
listadd (cmb_1, "asdfgh")
Whi see the values ​​in the combo but if I select a row, her "value" is -1?

sorry for the banality of the question, but is it really so different from WinDev ....

Thx
Daniele

--
Dnl
Posté le 25 avril 2014 - 11:56
Hi Daniele

the reason of your problem is in one of the things that you are not
saying in your question:
- type of site (classic, awp or php)
- where you are trying to get the combo value (browser side, server
side, type and place of the code)
- etc...

THE big difference between webdev and all other environments is the
fact that part of the code is translated in JS to be run on the browser,
when the other part remains in wlanguage to be run on the server... And
of course that fact implies 2 different computers run in different
places at different times, so the COMMUNICATION between the two becomes
an extremely important part...

In your case, and without the information above, its impossible to say
for sure, but it looks like a case of one side (server cv browser)
knowing that the combo was selected while the other does not know it yet
(or has forgotten).. Very often, it's because the button where the
server code is situated does not have the SUBMIT type (send the value of
the fields to the server), and therefore the server does NOT know that
your user clicked on your combo... Of course, it coul be several other
cases.

Best regards

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

NEW: WXShowroom.com is available: Show your projects!
More information on http://www.fabriceharari.com


On 4/24/2014 3:26 PM, Daniele wrote:
HI, after many years of WinDev Mobile eWindev (from Release 9), I'm also
trying WebDev, but I still can not understand the logic. if I fill a
combo with a button listadd (cmb_1, "1234") listadd (cmb_1, "QWERTY")
listadd (cmb_1, "asdfgh") Whi see the values ​​in the combo but if I
select a row, her "value" is -1?

sorry for the banality of the question, but is it really so different
from WinDev ....

Thx
Daniele

--
Dnl
Membre enregistré
9 messages
Popularité : +2 (2 votes)
Posté le 28 avril 2014 - 09:11
HI Fabrice,
thx for your reply, and


My type is a Dynamic AWP

On the Server side of Submit Button
ListAdd(cmb_1,"VVV")
ListAdd(cmb_1,"111")
ListAdd(cmb_1,"2222")

I Can see the 3 value on the display but...

On "Wheneve Modifield of Cmb_1 (Server)
Edit1=MySelf..DisplayedValue
in this case the edt1 is empty

if i write
Edit1=MySelf
i can see on Edit1 then value 1, 2, 3

I just tried this on my pc without sending anything to the server, could this be the problem?

thx again
Daniele

--
Dnl
Posté le 28 avril 2014 - 14:32
Hi Daniele

OK, it's clearer now...

Here is how things are working

1- user does something on the browser side
2- data needs to be sent to the server
3- server does something with the data and MAY or MAY NOT need to
display something on the browser side


1 is easy, it's just the user clicking here and there

2 is more complex, as the data can be sent to the server side using a
SUBMIT button (or equivalent) with or without AJAX activated or via ajax
command or via specific fields...

In your particular case, data is sent automatically to the server side
by the combo box, BECAUSE you are placing some code in the 'whenever
modified section'

3 can also be complexe.
The server side can set a value in a field (like what you are doing),
but doing that means that ONLY the server knows about it.
For the browser side to be aware of it, you need to either do a
pagerefresh (the server tells the browser that something has changed) or
use AJAX. In your case, if you click on the barred AJAX label at the top
of your "whenever modified" section code, webdev should automatically
tell the browser side that your code put a value in the field.


Best regards


--
Fabrice Harari
Consultant WinDev, WebDev et WinDev Mobile International

NOUVEAU: WXShowroom.com est disponible : Montrez vos projets !
Plus d'information sur http://fabriceharari.com

On 4/28/2014 1:11 AM, Daniele wrote:
HI Fabrice,
thx for your reply, and


My type is a Dynamic AWP

On the Server side of Submit Button
ListAdd(cmb_1,"VVV")
ListAdd(cmb_1,"111")
ListAdd(cmb_1,"2222")

I Can see the 3 value on the display but...

On "Wheneve Modifield of Cmb_1 (Server)
Edit1=MySelf..DisplayedValue in this case the edt1 is empty

if i write Edit1=MySelf i can see on Edit1 then value 1, 2, 3
I just tried this on my pc without sending anything to the server, could
this be the problem?

thx again Daniele

--
Dnl
Membre enregistré
9 messages
Popularité : +2 (2 votes)
Posté le 28 avril 2014 - 22:13
hi Fabrice,
thx again...
I begin to think that it is too complicated...

if i click on the barred AJAX label, so having the word "ajax" crossed out, whenever I select a row in the combo, do a
pagerefresh and combo backs empty,
to fill it again I had to click on the Submit Button

If I keep "ajax enable", the cmb_1..DisplayedValue is empty

I understood what you wrote in step 3, but I did not understand what is the solution :-(

unfortunately I can not find an example to study from those of WebDev

thx again and sorry....

Daniele

--
Dnl
Posté le 30 avril 2014 - 12:01
Hi Daniele

what you are looking at is the problem that is happening in ANY web
programming... two separate computers trying to work together over the
web. The logic can be convoluted.

And the problem is also that its very difficult to give you a specific
solution. It may solve a specific problem that you describe and at the
same time modify the behavior of everything else in the page (but as I
do not know what else is in the page...)

So, if the ajax setting breaks your page behavior, you can also let it
barred and try to do a pagerefresh after setting your field... If that
doesn't work either, then the whol structure of your page may be faulty
(as in half of it is relaying on one type of method and the other on
another one)

Best regards


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

NEW: WXShowroom.com is available: Show your projects!
More information on http://www.fabriceharari.com


On 4/28/2014 2:13 PM, Daniele wrote:
hi Fabrice, thx again...
I begin to think that it is too complicated...

if i click on the barred AJAX label, so having the word "ajax" crossed
out, whenever I select a row in the combo, do a pagerefresh and combo
backs empty, to fill it again I had to click on the Submit Button

If I keep "ajax enable", the cmb_1..DisplayedValue is empty

I understood what you wrote in step 3, but I did not understand what is
the solution :-(

unfortunately I can not find an example to study from those of WebDev

thx again and sorry....

Daniele

--
Dnl