FoxInCloud
Combo - RowSource
Gravatar is a globally recognized avatar based on your email address. Combo - RowSource
  Vincent H.
  All
  Nov 1, 2019 @ 05:35am

Hi Thierry,

In a combo, rowSourceType = 1

IF Condition = .T.
   THIS.RowSource = "Liste1, Liste2"
ELSE
   THIS.RowSource = "Liste3, Liste4"
ENDIF

I have tried to put this code in combo.Refresh(), combo.Init() and MyForm.Init().
Always the same result: the first time the screen is launched, it's good. The second, the list is empty. The 3rd is filled ... Always, 1 time out of 2.
An idea ?
thank you in advance

Gravatar is a globally recognized avatar based on your email address. re: Combo - RowSource
  Vincent H.
  FoxInCloud Support - Thierry N.
  Nov 1, 2019 @ 10:28am

my code contains nothing more than indicated.
I will recontact you in private support.
Thank you

Gravatar is a globally recognized avatar based on your email address. re: Combo - RowSource
  Vincent H.
  FoxInCloud Support - Thierry N.
  Nov 2, 2019 @ 02:36am

I finally succeeded, after several hours ...
This code does not work because at the 2nd launch, the list is empty:

IF Ficl.Datemardiv < {^1966-02-01}
   THIS.RowSource = "\Community of acquests (without contract), Community furniture and acquests (marriage before February 1966), Community (with contract), Separation of property, Participation in Acquests, Universal Community, Separation of Body"
ELSE
   THIS.RowSource = "Community of acquests (without contract), \Community furniture and acquests (marriage before February 1966), Community (with contract), Separation of property, Participation in Acquests, Universal Community, Separation"
ENDIF

I had to recreate the combo in wcHTMLGen () and refresh with a wcScriptJSadd()
In this case, it is essential to leave RowSource and RowSourceType blank

Gravatar is a globally recognized avatar based on your email address. re: Combo - RowSource
  Vincent H.
  Vincent H.
  Nov 2, 2019 @ 02:42am

Damned ...
Of course, the display works but no more interActiveChange ()

Gravatar is a globally recognized avatar based on your email address. re: Combo - RowSource
  Vincent H.
  Vincent H.
  Nov 2, 2019 @ 05:56am

I did not give up ...
The solution (or one of them) is to go through AddItem () which refreshes well, with a .Clear before
However, .AddItem ("\Option") does not disable it. How to do ?

Gravatar is a globally recognized avatar based on your email address. re: Combo - RowSource
  Vincent H.
  Vincent H.
  Nov 2, 2019 @ 07:11am

Definitely, nothing to do ...
In .Refresh_(), this code does not work either (no worries with the Firefox console):

Mcontient = IIF (Mcondition, "sans contrat", "mariage avant")
THISFORM.wcScriptJSadd(TEXTMERGE([jQuery('#<<THIS.wcID>> option:contains("<<Mcontient>>")').attr('disabled', true);]))
Gravatar is a globally recognized avatar based on your email address. re: Combo - RowSource
  Vincent H.
  FoxInCloud Support - Thierry N.
  Nov 4, 2019 @ 01:24am

Very simply

.refresh_()
IF ...
   THIS.RowSource = "..."
ELSE
...
ENDIF

But the list does not empty until the 2nd launch of the screen which contains it (4th, 6th ...)

I finally changed my program to no longer have this dynamic change

Gravatar is a globally recognized avatar based on your email address. re: Combo - RowSource
  FoxInCloud Support - Thierry N.
  Vincent H.
  Nov 4, 2019 @ 02:55am

I need to see what happens in VFP and the browser developer tools

© 1996-2024