on 02-05-2007 5:50 PM
hi
i'm trying to get the value of an input field after the user hit enter.
i tried <i> input1.mappingOfOnEnter().addParameter("value",input1.getValue()); </i>
but got just the previous value of the field.
it also seems that i cant pass the whole element to the action with
<i>input1.mappingOfOnEnter().addSourceMapping().("nodeElement","nodeElement");</i> because it passes only null to the action
whats the way to do that ?
thanks
Roni
Roni,
You misinterpred the purpose of action parameters mapping.
However, in your cas it's note necessary at all, you may just use context:
wdContext.current<NameOfNode>Element().get<MyAttr>();
where <NameOfNode>.<MyAttr> is attribute of context node to wich InputField.value property is bound to.
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The meaning of the implicit "nodeElement" event parameter is differently: It gives you the node element representing a table row or tree node if the UI element is used as a table cell editor or tree node editor.
If your InputField is a table cell editor, mapping "nodeElement" event parameter to an action parameter would allow to get the table row in the action handler.
If not, the parameter contains a NULL value.
Armin
I solved the problem on my own:
I have inputField that bound to context <i>wdContext.OutputCloth.Pants_size</i>
When i passed it as a parameter to action i get null (i guess because of the wd phase model). So i passed the inputField.bindingOfValue (contains the name of the attribute : <i>wdContext.OutputCloth.Pants_size</i> and in the action i use
wdContext.getChildNode("OutputCloth",0).getCurrentElement().getAttributeAsText("Pants_size") to get my desired value.
Valery,
i double checked it on my application :
<i>wdContext.currentOutputClothElement().getPants_size()</i> returns null
<i>wdContext.getChildNode("OutputCloth",0).getCurrentElement().getAttributeAsText("Pants_size")</i> returns the value on the inputField.
that is in a method called from onActionSomething
thanks for your attention!
Hi Roni,
what you can do is, create a context n then bind it to the input field and then in the action collect the value of the context in some variable and then you can check the value of theat variable.
Jeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.