You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Event Action - #event {}
...
...
If the 'actions' attribute is set (inherited from action base), then these actions will be run when this event is triggered. This attributed can be set to a list of actions, a single action, or an Erlang string, which will be run as Javascript.
Within the Javascript, you can use obj('id') where id is the id of a Nitrogen element. You can also use obj('me') to refer to the target of the current action.
If I use obj('mytextbox').value, the following code successfully alert's the value of a textbox:
However, according to the quote I posted above from the docs, I should also be able to set target=mytextbox and then use obj('me') in place of obj('mytextbox') in the js, but the alert does not popup when I try that:
Instead, a class is added to the class attribute, e.g. wfid_mytextbox. Why is that? I think at the very least the Base Element docs should mention that the id field does not actually set the id attribute of the html element. It's really confusing for a nitrogen beginner to set the id field of an element, then write some js, e.g. document.getElementById('theId'), and not be able to access the element.
The text was updated successfully, but these errors were encountered:
BuildInfo.txt:
According to the docs:
If I use
obj('mytextbox').value
, the following code successfully alert's the value of a textbox:However, according to the quote I posted above from the docs, I should also be able to set
target=mytextbox
and then useobj('me')
in place ofobj('mytextbox')
in the js, but the alert does not popup when I try that:My javascript console shows the following error:
I don't see any errors in the nitrogen shell. I tried the code in Safari, Chrome, and Firefox.
Finally, when I look at the html source, I notice that the id attribute is not set for the button or the textbox:
Instead, a class is added to the class attribute, e.g. wfid_mytextbox. Why is that? I think at the very least the
Base Element
docs should mention that theid
field does not actually set the id attribute of the html element. It's really confusing for a nitrogen beginner to set the id field of an element, then write some js, e.g.document.getElementById('theId')
, and not be able to access the element.The text was updated successfully, but these errors were encountered: