Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

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.

Woher Information für korrektes Textfeld auslesen

Empfohlene Antworten

Veröffentlicht

Hallo

Ich habe zwei Textfelder. Zu jedem Textfeld gehört je ein Button, der bei jedem Button eine Suche startet.

Es kann nur in einem Textfeld Inhalt hineingeschrieben werden (anderes sperrt sich dann automatisch wenn ins andere Inhalt hineinkommt)

Dann starte ich die entsprechende Suche.

Nach dem Start muss ich wissen, welches Textfeld ich auslesen muss (welches das Inhalt hat).

if (Textfeld1 hat Inhalt) {

mach Dings1} else {

if(Textfeld 2 hat Inhalt) {

mach Dings2

}

Je nach dem verläuft die Suche etwas anders.

Was ich dabei nicht peil ist das hier: Woher bekomme ich die Information welches Textfeld jetzt Inhalt drin hat? Vom entsprechenden Buttonlistener? Oder vom Textfeld selbst (aber wie?)?

Wäre um eine Antwort sehr froh

Danke

Tinella


if(textField1.getText() != null && !("".equals(textField1.getText()) {

   dings1();

}

Womöglich kannst Du den ersten Teil der UND-Verknüpfung weg lassen. Weiß ich jetzt nicht. Das Prinzip ist aber klar: Über getText() des Textfelds bekommst Du den Inhalt. Wenn dieser nicht null und nicht leer ("") ist, führe Deine entsprechend angepaßte Suche aus.

Hi,

Du schreibst, dass das Textfeld gesperrt wird. Demnach könntest Du doch vielleicht den Status des Textfeldes (isEnabled oder isEditable) abfragen?

Gruß, Peter

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.