TimoMeister
Occasional Collector

getFormData prüfen ob Variable existiert

Jump to solution

Hallo Community,

wie prüfe ich, ob eine Variable existiert?

#nav.ref.page.getFormData().get(#global.language, "pt_system")

Das wirft mir ein Fehler zurück, wenn die Variable nicht existiert.

Würde den Fehler gerne unterdrücken.

Viele Grüße

Timo

Labels (1)
1 Solution

Accepted Solutions
mbergmann
Crownpeak employee
Crownpeak employee

Re: getFormData prüfen ob Variable existiert

Jump to solution

Hallo Timo,

hier muss man ins GOM "abbiegen", um die NoSuchFormFieldException zu umgehen:

#nav.ref.page.getFormData().getForm().findEditor("pt_system")!=null

Viele Grüße

Michael

View solution in original post

0 Kudos
2 Replies
mbergmann
Crownpeak employee
Crownpeak employee

Re: getFormData prüfen ob Variable existiert

Jump to solution

Hallo Timo,

hier muss man ins GOM "abbiegen", um die NoSuchFormFieldException zu umgehen:

#nav.ref.page.getFormData().getForm().findEditor("pt_system")!=null

Viele Grüße

Michael

0 Kudos
TimoMeister
Occasional Collector

Re: getFormData prüfen ob Variable existiert

Jump to solution

Hallo Michael,

super!! Danke für die schnelle Antwort.

Viele Grüße

Timo

0 Kudos