Pop-Up Fenster beim öffnen eines Eintrags

78 views
Skip to first unread message

Hans H.

unread,
May 11, 2023, 2:25:09 PM5/11/23
to mementodatabase
Hallo an alle,
wie kann ich ein Pop-up Fenster erstellen das beim öffnen eines Eintrags aufpoppt.
Das Pop-up Fenster soll nur dann aufpoppen, wenn in einem Textfeld in dem zu öffnendem Eintag ein Text enthalten ist.
Das Pop-up Fenster soll dabei den Text des Textfelds enthalten.


Hello everyone,
How can I create a pop-up window that opens when an entry is opened.
The pop-up window should only pop up if there is text in a text field in the entry to be opened.
The pop-up window should contain the text of the text field.

mfg. Hans

Bill Crews

unread,
May 11, 2023, 2:45:39 PM5/11/23
to Hans H., mementodatabase
A trigger that happens when an entry is opened can interact with the used in only a limited fashion. The Memento JavaScript message() global function may be called.

On a mobile device, this merely displays the value passed to it at the bottom of the screen for 2 or 3 seconds, when it then disappears. If you field is called "My text", the statement would be message(entry().field("My text"));

On a computer, I believe a pop-up panel is opened with the contents of the "My text" field in it, and I think it stays until closed by the used. I haven't used Memento on a computer very much, so I'm not sure.


--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/c0025185-49ba-45fd-bb47-fa170f312017n%40googlegroups.com.

Er Mo

unread,
May 11, 2023, 3:28:48 PM5/11/23
to mementodatabase
Hallo Hans
Wie Bill schon Schrieb heißt der Befehl messags() . In der PC Version bleibt die Nachricht bestehen bis sie Geschlossen wird oder deuch einen Neue ersetzt wird . Wenn du die Nachricht nur brauchst wenn das Feld einen Inhalt hatt , musst du mit
if( " dein Feldname " != null) vorher überbrüfen .

Hello Hans
As Bill already wrote, the command is called messags() . In the PC version, the message remains until it is closed or replaced with a new one. If you only need the message if the field had content, you have to go with it
if( " your field name " != null) check beforehand.

Ernst

Hans H.

unread,
May 11, 2023, 3:55:48 PM5/11/23
to mementodatabase
Danke Bill u. Ernst,
funktioniert soweit, nur die if Abfrage geht nicht. Mein Feldname ist "PopUp" 
PopUp Fenster kommt trotz fehlendem Textfeldeintrag

if("PopUp"!= null)
message(entry().field("PopUp"))

was ist falsch?

und gibt es eine Möglichkeit das Popupfenster länger als 3 Sekunden zu sehen, oder größe, oder Position zu verändern?

Er Mo

unread,
May 12, 2023, 11:27:48 AM5/12/23
to mementodatabase
Hallo
Die IF Anweisung ist NICHT das Skript sonder ein Hinweiß darauf . Der Skript muss so sien ( nicht getestet )

var popup = entry().field("PopUp")
if(popup != null){
 message( popup)
}

Ernst

Hans H.

unread,
May 12, 2023, 4:33:16 PM5/12/23
to mementodatabase
Hallo Ernst,
es hat sich eigentlich nichts geändert, ob ich 

message(entry().field("PopUp"))
oder 
var popup = entry().field("PopUp")
if(popup != null){message( popup)}

schreibe ist egal, es ändert sich nichts, es wir nach wie vor das PopUp Fenster trotz fehlendem Textfeldeintrag angezeigt.

Kannst du mir nochmal helfen?

Hans

Bill Crews

unread,
May 12, 2023, 6:36:26 PM5/12/23
to Hans H., mementodatabase
Der Wert eines Textfelds kann leer erscheinen, wenn es einen Wert enthält, wenn dieser Wert „“ oder eine beliebige Anzahl von Leerzeichen oder anderen Leerzeichen wie Tabulatoren ist.  Ernsts Test auf Null funktioniert unter normalen Umständen korrekt. Wenn Sie jedoch einen Benutzer oder ein Skript haben, das Leerzeichen in ein solches Feld einfügt, ist es nicht leer, aber es scheint so zu sein.
__________

A text field's value can appear to be empty when it does contain a value if that value is "" or any number of spaces or other whitespace characters, like tabs. Ernst's test for null will work correctly in normal circumstances, but if you have a user or a script that puts blanks into such a field, then it will not be empty, but it will appear to be so.


Er Mo

unread,
May 13, 2023, 1:21:52 PM5/13/23
to mementodatabase
Hallo
Dann versuchen wir es über die Länge den Strings . Du kannst versuchen die Zahl 0 zu erhöhen wenn es nicht funktionirt

var a = entry().field(" PopUp ")
var al = a.length
if(al>0)message(a)

Hans H.

unread,
May 14, 2023, 10:42:55 AM5/14/23
to mementodatabase
Hallo Ernst und Bill
Danke, funktioniert, gut Idee 
Gruß Hans

Hello Ernst and Bill
Thanks, works, good idea
Reply all
Reply to author
Forward
0 new messages