PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WEBDEV 2024 → Populate Combo's in a looper or amend a Combo data in a Displayed Looper
Populate Combo's in a looper or amend a Combo data in a Displayed Looper
Iniciado por Tony Turner, 10,abr. 2014 10:48 - 8 respuestas
Publicado el 10,abril 2014 - 10:48
Hi

I have a WebDev looper populated by looper add.

Lets say the looper has 2 results.

A Phone Number
A Calls feature package

Both rows has a comb box to allow the user to change the calls package or the call feature package

1 combo box should show Calls Packages other should show Call feature packages

How do I populate the combo's with different packages?

Also can you amend a combo on a row in a displayed looper result set?

I'd like it to populate the combo's based on categoryID of the phone number they are buying and then if no categoryID I have else to populate the Call Feature Package in the second row result which displays Call Feature packages.


// Browse the file
HReadFirst(cart, id)
WHILE NOT HOut()
// Insert your process here

IF cart.usercookie = gsuser THEN

// populate the looper

LooperAdd(LOOP_SetupNumbers,cart.id + TAB + cart.item + TAB + cart.description + TAB + cart.Package + TAB + "£"+cart.cost)

// how do I populate the combo's with different data or how can I amend re populate a combo in a looper row
// the combo is in the looper but I don't know how to populate it, I don't want to do from DB

// Find the first element
HReadSeekFirst(cart, item, cart.item)
// Browse the records
WHILE HFound()
// Insert your process here
IF cart.CategoryID = 1 THEN
ListAdd(COMBO_Call_Package_Standard,"Monthly 3 @ £2.99 per month"+CR+...
"Monthly 5 @ £4.99 per month"+CR+...
"Monthly 10 @ £9.99 per month"+CR+...
"Monthly 15 @ £14.99 per month"+CR+...
"Monthly 25 @ £24.99 per month"+CR+...
"Monthly 35 @ £34.99 per month"+CR+...
"Monthly 50 @ £49.99 per month"+CR+...
"Monthly 75 @ £74.99 per month")

ELSE IF cart.CategoryID = 2 THEN

ListAdd(COMBO_Call_Package_Standard,"Monthly 3 @ £2.99 per month"+CR+...
"Monthly 5 @ £4.99 per month"+CR+...
"Monthly 10 @ £9.99 per month"+CR+...
"Monthly 15 @ £14.99 per month"+CR+...
"Monthly 25 @ £24.99 per month"+CR+...
"Monthly 35 @ £34.99 per month"+CR+...
"Monthly 50 @ £49.99 per month"+CR+...
"Monthly 75 @ £74.99 per month")

ELSE IF cart.CategoryID = 3 THEN

ListAdd(COMBO_Call_Package_Standard,"Monthly 10 @ £9.99 per month"+CR+...
"Monthly 15 @ £14.99 per month"+CR+...
"Monthly 25 @ £24.99 per month"+CR+...
"Monthly 35 @ £34.99 per month"+CR+...
"Monthly 50 @ £49.99 per month"+CR+...
"Monthly 75 @ £74.99 per month")

ELSE IF cart.CategoryID = 4 THEN

ListAdd(COMBO_Call_Package_Standard,"Monthly 25 @ £24.99 per month"+CR+...
"Monthly 35 @ £34.99 per month"+CR+...
"Monthly 50 @ £49.99 per month"+CR+...
"Monthly 75 @ £74.99 per month")

ELSE IF cart.CategoryID = 5 THEN

ListAdd(COMBO_Call_Package_Standard,"Monthly £34.99 @ £34.99 per month"+CR+...
"Monthly £50 @ £50.00 per month"+CR+...
"Monthly £75 @ £75.00 per month")

ELSE IF cart.CategoryID = 6 THEN

ListAdd(COMBO_Call_Package_Standard,"Monthly £49.99 @ £49.99 per month"+CR+...
"Monthly £49.99 @ £49.99 per month")

ELSE IF cart.CategoryID = 7 THEN
ListAdd(COMBO_Call_Package_Standard,"Monthly £74.99 @ £74.99 per month")
ELSE

// Add to Call Feature Packages to the second combo
//
ListAdd(COMBO_Call_Package_Standard,"Call Feature package Business Pro @ £7 per month")

END
HReadNext(cart, item)
END

END

HReadNext(cart, id)
END
Publicado el 10,abril 2014 - 13:53
Hi Tony

if I understand correctly your question

On 4/10/2014 2:48 AM, Tony Turner wrote, you need to add an attribute to
your looper, link it to the INITIAL CONTENT property of your combo, and
fill it in the LINE DISPLAY code of your looper

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

Hi

I have a WebDev looper populated by looper add.

Lets say the looper has 2 results.

A Phone Number
A Calls feature package

Both rows has a comb box to allow the user to change the calls package
or the call feature package

1 combo box should show Calls Packages other should show Call feature
packages

How do I populate the combo's with different packages?

Also can you amend a combo on a row in a displayed looper result set?

I'd like it to populate the combo's based on categoryID of the phone
number they are buying and then if no categoryID I have else to populate
the Call Feature Package in the second row result which displays Call
Feature packages.


// Browse the file
HReadFirst(cart, id)
WHILE NOT HOut()
// Insert your process here

IF cart.usercookie = gsuser THEN

// populate the looper

LooperAdd(LOOP_SetupNumbers,cart.id + TAB + cart.item + TAB +
cart.description + TAB + cart.Package + TAB + "£"+cart.cost)

// how do I populate the combo's with different data or how can I
amend re populate a combo in a looper row
// the combo is in the looper but I don't know how to populate it,
I don't want to do from DB

// Find the first element
HReadSeekFirst(cart, item, cart.item)
// Browse the records
WHILE HFound()
// Insert your process here
IF cart.CategoryID = 1 THEN
ListAdd(COMBO_Call_Package_Standard,"Monthly 3 @ £2.99
per month"+CR+...
"Monthly 5 @ £4.99 per month"+CR+...
"Monthly 10 @ £9.99 per month"+CR+...
"Monthly 15 @ £14.99 per month"+CR+...
"Monthly 25 @ £24.99 per month"+CR+...
"Monthly 35 @ £34.99 per month"+CR+...
"Monthly 50 @ £49.99 per month"+CR+...
"Monthly 75 @ £74.99 per month")

ELSE IF cart.CategoryID = 2 THEN

ListAdd(COMBO_Call_Package_Standard,"Monthly 3 @ £2.99
per month"+CR+...
"Monthly 5 @ £4.99 per month"+CR+...
"Monthly 10 @ £9.99 per month"+CR+...
"Monthly 15 @ £14.99 per month"+CR+...
"Monthly 25 @ £24.99 per month"+CR+...
"Monthly 35 @ £34.99 per month"+CR+...
"Monthly 50 @ £49.99 per month"+CR+...
"Monthly 75 @ £74.99 per month")

ELSE IF cart.CategoryID = 3 THEN

ListAdd(COMBO_Call_Package_Standard,"Monthly 10 @ £9.99
per month"+CR+...
"Monthly 15 @ £14.99 per month"+CR+...
"Monthly 25 @ £24.99 per month"+CR+...
"Monthly 35 @ £34.99 per month"+CR+...
"Monthly 50 @ £49.99 per month"+CR+...
"Monthly 75 @ £74.99 per month")

ELSE IF cart.CategoryID = 4 THEN

ListAdd(COMBO_Call_Package_Standard,"Monthly 25 @
£24.99 per month"+CR+...
"Monthly 35 @ £34.99 per month"+CR+...
"Monthly 50 @ £49.99 per month"+CR+...
"Monthly 75 @ £74.99 per month")

ELSE IF cart.CategoryID = 5 THEN

ListAdd(COMBO_Call_Package_Standard,"Monthly £34.99 @
£34.99 per month"+CR+...
"Monthly £50 @ £50.00 per month"+CR+...
"Monthly £75 @ £75.00 per month")

ELSE IF cart.CategoryID = 6 THEN

ListAdd(COMBO_Call_Package_Standard,"Monthly £49.99 @
£49.99 per month"+CR+...
"Monthly £49.99 @ £49.99 per month")

ELSE IF cart.CategoryID = 7 THEN
ListAdd(COMBO_Call_Package_Standard,"Monthly £74.99 @
£74.99 per month")
ELSE

// Add to Call Feature Packages to the second combo
// ListAdd(COMBO_Call_Package_Standard,"Call
Feature package Business Pro @ £7 per month")

END
HReadNext(cart, item)
END

END

HReadNext(cart, id)
END
Publicado el 10,abril 2014 - 16:09
Hi Fabrice

Thank you for replying.

I hope attached image shows.

If a customer goes to buy a phone number they get 2 products in the cart and they are are shown a confirmation page, they can change using the combo's the products at this stage:-

Change Call Feature Package
Change Call Inclusive Minutes Packages

I use Loopadd add to populate the looper.

I can't use listadd in the loop for adding the combo data as the data in the combo gets repeated for each row of the looper so I am confused

How do I populate the combo's in a looper using listadd? The combos have different options depending on the phone number category they buy.

For every phone number they buy they get a Call Feature package so you always see 2 rows for each ordered item, 10 items ordered shows 20 rows. 1 for each phone number, 1 for each Call Feature package.

So if there were 20 rows the 10 combo's for changing the call inclusive minute packages are likely to be different data for each.

All the Call Feature packages in the second rows (combo) of each pair is the same data.






Please see attached screen shot.

kind regards

Tony Turner
Publicado el 10,abril 2014 - 16:28
Hi Tony

I'm not sure what else I can tell you than what I told you in my
previous email:

- you need to add an attribute to your looper,
- link it to the INITIAL CONTENT property of your combo,
- and fill it in the LINE DISPLAY code of your looper

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/10/2014 8:09 AM, Tony Turner wrote:
Hi Fabrice

Thank you for replying.

I hope attached image shows.

If a customer goes to buy a phone number they get 2 products in the cart
and they are are shown a confirmation page, they can change using the
combo's the products at this stage:-

Change Call Feature Package
Change Call Inclusive Minutes Packages

I use Loopadd add to populate the looper.

I can't use listadd in the loop for adding the combo data as the data in
the combo gets repeated for each row of the looper so I am confused

How do I populate the combo's in a looper using listadd? The combos have
different options depending on the phone number category they buy.

For every phone number they buy they get a Call Feature package so you
always see 2 rows for each ordered item, 10 items ordered shows 20 rows.
1 for each phone number, 1 for each Call Feature package.

So if there were 20 rows the 10 combo's for changing the call inclusive
minute packages are likely to be different data for each.

All the Call Feature packages in the second rows (combo) of each pair is
the same data.







Please see attached screen shot.

kind regards

Tony Turner
Publicado el 10,abril 2014 - 17:59
Hi,

Yep that's the trouble easy when you know how but that doesn't mean anything to me.

Unless I seen an example 2 lines tell me nothing.

- link it to the INITIAL CONTENT property of your combo,
- and fill it in the LINE DISPLAY code of your looper

Sometimes that's the trouble with Windev/Webdev which I use daily since v11 to now 19 and Webdev daily since v16.

If I don't see it I can't get it and end up developing using a work around which is bad ....

Now this I have tried for a week on.

I see support conferencing being useful now....

It may be easy I just don't get it ...

regards

Tony
Publicado el 10,abril 2014 - 20:28
Hi again Tony

when you create an attribute in a looper, you have to tel webdev:
- what field the attribute works on
- what PROPERTY of the field is used

that is what at I'm talking about when I say to link the attribute to
the INITIAL CONTENT property of the combo field...

This is the BASIS of using looper, you have to do it to display anything
in it.

Then in the the code matching the line display event of your combo, you
have to set this attribute with the content you want displayed in the
combo (ie a CR separated string, with each line to be displayed on a
line) and that technique is the BASIS of using a combo..

It has to be done in the line display so as to be sure that each line
combo has a different content

Is that clearer ?

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/10/2014 9:59 AM, Tony Turner wrote:
Hi,

Yep that's the trouble easy when you know how but that doesn't mean
anything to me.

Unless I seen an example 2 lines tell me nothing.

- link it to the INITIAL CONTENT property of your combo,
- and fill it in the LINE DISPLAY code of your looper

Sometimes that's the trouble with Windev/Webdev which I use daily since
v11 to now 19 and Webdev daily since v16.

If I don't see it I can't get it and end up developing using a work
around which is bad ....

Now this I have tried for a week on.

I see support conferencing being useful now....

It may be easy I just don't get it ...

regards

Tony
Publicado el 13,abril 2014 - 14:02
Hi again Fabrice,

OK so initial content set as in screen shot I still don't get how I use that in relation to the combo.





Can you please correct code below as simple example.

Please assume the looper has 3 fields:

id, Package, combo/initial content

we populate 1 looper row:
LooperAdd(LOOP_SetupNumbers,1+TAB+"0203 390 1000 Monthly 50"+TAB+(Initlal Content Combo how?))

Populate Initial Row Combo how do I do that?

ListAdd(Combo_Call_Packages,"Package 1" + CR + "Package 2" + CR + "Package 3")

I guess this is really easy when you know how.

Thanks

Tony



Fabrice Harari wrote:
Hi again Tony

when you create an attribute in a looper, you have to tel webdev:
- what field the attribute works on
- what PROPERTY of the field is used

that is what at I'm talking about when I say to link the attribute to
the INITIAL CONTENT property of the combo field...

This is the BASIS of using looper, you have to do it to display anything
in it.

Then in the the code matching the line display event of your combo, you
have to set this attribute with the content you want displayed in the
combo (ie a CR separated string, with each line to be displayed on a
line) and that technique is the BASIS of using a combo..

It has to be done in the line display so as to be sure that each line
combo has a different content

Is that clearer ?

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/10/2014 9:59 AM, Tony Turner wrote:
Hi,

Yep that's the trouble easy when you know how but that doesn't mean
anything to me.

Unless I seen an example 2 lines tell me nothing.

- link it to the INITIAL CONTENT property of your combo,
- and fill it in the LINE DISPLAY code of your looper

Sometimes that's the trouble with Windev/Webdev which I use daily since
v11 to now 19 and Webdev daily since v16.

If I don't see it I can't get it and end up developing using a work
around which is bad ....

Now this I have tried for a week on.

I see support conferencing being useful now....

It may be easy I just don't get it ...

regards

Tony
Publicado el 13,abril 2014 - 16:39
Hi Tony

You just do
ATT_CallPackage[MyCurrentLineNumber]="Content
line1"+cr+"ContentLine2"+cr+...

The same way that you do for any other thing in a looper

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/13/2014 6:02 AM, Tony Turner wrote:
Hi again Fabrice,

OK so initial content set as in screen shot I still don't get how I use
that in relation to the combo.






Can you please correct code below as simple example.

Please assume the looper has 3 fields:

id, Package, combo/initial content

we populate 1 looper row:
LooperAdd(LOOP_SetupNumbers,1+TAB+"0203 390 1000 Monthly
50"+TAB+(Initlal Content Combo how?))

Populate Initial Row Combo how do I do that?

ListAdd(Combo_Call_Packages,"Package 1" + CR + "Package 2" + CR +
"Package 3")

I guess this is really easy when you know how.

Thanks

Tony



Fabrice Harari wrote:
Hi again Tony

when you create an attribute in a looper, you have to tel webdev:
- what field the attribute works on
- what PROPERTY of the field is used

that is what at I'm talking about when I say to link the attribute to
the INITIAL CONTENT property of the combo field...

This is the BASIS of using looper, you have to do it to display
anything in it.

Then in the the code matching the line display event of your combo,
you have to set this attribute with the content you want displayed in
the combo (ie a CR separated string, with each line to be displayed on
a line) and that technique is the BASIS of using a combo..

It has to be done in the line display so as to be sure that each line
combo has a different content

Is that clearer ?

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/10/2014 9:59 AM, Tony Turner wrote:
Hi,

Yep that's the trouble easy when you know how but that doesn't mean
anything to me.

Unless I seen an example 2 lines tell me nothing.

- link it to the INITIAL CONTENT property of your combo,
- and fill it in the LINE DISPLAY code of your looper

Sometimes that's the trouble with Windev/Webdev which I use daily since
v11 to now 19 and Webdev daily since v16.

If I don't see it I can't get it and end up developing using a work
around which is bad ....

Now this I have tried for a week on.

I see support conferencing being useful now....

It may be easy I just don't get it ...

regards

Tony
Publicado el 15,abril 2014 - 12:49
Hi Fabrice,

Now only problem I now have is accessing data from combo box. Says initial content not accessible from browser code.

Info(ATT_CallPackage..Value) // not accessible from browser code

from server combo onchange AJAX
Info(ATT_CallPackage..Value) // returns all rows not selected row

Only way I could populate combo the control method you suggested I could not get that to work.

I ended doing:-

x is int =0
loop(5)
sComboVals is string
sComboVals = "i am diff"+x +CR+"test"+x + CR + "test3";
LooperAdd(LOOP_SetupNumbers,x + TAB + sProduct + TAB + sProduct + TAB + sProduct + TAB + sPrice+TAB+ sComboVals)
x = x +1
END

Now I tried using glink to get the selected row to no avail.

sComboVals is string
sComboVals = "Montgomery"+gLink("Montgomery")+CR+"test"+gLink("test")+CR+"test3"+gLink("test3");

after looper add
gLinkActivate(COMBO_Call_Package_Standard,True)

kind regards

Tony