Thanks, for the exelent explainations,

but even manual entered list entries the famous "...." button gives an ugly beep as respons, is this a bug or are am i doging something wrong ?

Frank Schönheit - Sun Microsystems Germany wrote:
Hi Fernand,

again the secrets are in the control :-)

oform = thisComponent.drawpage.forms.getbyname( "Ingave")
omodel = oform.CbxTaal
oControl = ThisComponent.CurrentController.getControl( omodel)
ocontrol.selectitem("N", true)

This indeed changes the selection at the control only, not at the model,
which means that when you save the document, the current selection in
the listbox will not persist (since it's only the model which is saved).

For your concrete problem of setting the selection programmatically, I
am not sure if you really want to set the *default selection* (which is
applied, for instance, when you call .reset at the control model), or
the *current selection* (which is what you see immediately in the control.

For the current selection,
is what you need to change.

  Dim nSelection(1) as Integer
  nSelection(0) = ...
  nSelection(1) = ...
  oControlModel.SelectedItems = nSelection()

The values in the array need to be the 0-based indexes of the entries
you want to select.

For the default selection (which upon setting it is used as current
selection, too, though you can change the current selection without
changing the default selection),
works out, the very same way as SelectedItems.

still have the question how to set a Default value with the GUI !!

The *current selection* cannot be changed via the UI, for ... hmm, for
no apparent reasons (except historical ones). What you can change is the
*default selectio*, which, as said above, also changes the current
selection when changed itself. For this, just press the "..." button in
the "Default selection" line in the property browser, but make sure
beforehand the list box actually has list entries.


To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to