Jump to content
View in the app

A better way to browse. Learn more.

FGX Native

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Select a item by code

Message added by Yaroslav Brovin,

Please be aware that these comments were copied here from another source and that the date and time shown for each comment may not be accurate.

  • Status: Fixed
  • Priority: Normal
  • Resolution: Fixed
  • Platform: Android
  • Affects version 1.18.2.0
  • Fix version: 1.18.2.1

Hi,

How to select a item by code ?

With fgComboBox.ItemIndex the item is selected but y can not modify the selection with the finger.

Thierry.

User Feedback

Recommended Comments

  • Administrators

Hello,

What do you mean "y can not modify the selection with the finger"?

Do you mean TComboEdit functionality?

Thank you,
Yaroslav

Thierry

Active subscription

Hello Yaroslav,

image.thumb.png.2ad7ae4b6779c682940dcc0b08a2db38.png

In this form, i fill the combox "cbbSerie" with a query from a database. When i close the form i save the modification to database and no problem at this point.

When a reopen the form (for modification for example), i want to select the datas form the database with this code :

procedure TFormTempsSaisie.fgFormShow(Sender: TObject);
var
  vlRQ: TUniQuery;
begin
  ListerSerie;
  ListerPoste;
  if vfAM = 'A' then
  begin
    nvbMain.Subtitle := 'Nouvelle saisie';
  end
  else
  begin
    nvbMain.Subtitle := 'Modification saisie n° ' + IntToStr(vfIDTemps);
    vlRQ := TUniQuery.Create(nil);
    with vlRQ do
    begin
      Connection := dmdDatas.conBase;
      SQL.Add('Select TE_SERIE, TE_DEBUT, TE_FIN, PO_NOM');
      SQL.Add('From Temps');
      SQL.Add('Join Poste On Poste.PO_COMPTEUR = Temps.TE_POSTE');
      SQL.Add('Where TE_COMPTEUR = :TE_COMPTEUR');
      ParamByName('TE_COMPTEUR').AsInteger := vfIDTemps;
      Open;
      if not Eof Then
      begin
        cbbSerie.ItemIndex := vfListeSerie.IndexOf(FieldByName('TE_SERIE').AsString);
      end;
      Close;
    end;

    FreeAndNil(vlRQ);
  end;
end;

The Combobox Item is correctly selected from the database, but the combox is "like" readonly, i can not select another item.

I suppose the problem is the "ItemIndex" property ?

I have join the complete code of the project.

Thanks for your help.

 

PBC_Menuiserie_Mobile.7z

  • Administrators

Update: I wrote my demo sample with filling items  and selecting ItemIndex after it in OnShow event. And it works fine. So please, provide another sample without UniDAC.

  • Administrators

Thank you for such detail description. I will have a look and return back with results.

Thank you

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.