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
Hi Vincent,
Have you checked out http://foxincloud.com/tutotest/bs/RowSourceType.tuto?
Like always, I will need code to tell more.
my code contains nothing more than indicated.
I will recontact you in private support.
Thank you
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
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 ?
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);]))
Vincent,
In http://foxincloud.com/tutotest/bs/RowSourceType.tuto, changing .RowSource
in .Refresh_()
works perfectly; why should it be different in your app?
How do you call .Refresh()
when the list must change?
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