on 01-07-2015 11:46 AM
Hello Experts,
I have a textField column in a table.
I need to listen to the 'blur' event of each textField cell.
I use the following code:
<textField>.attachBrowserEvent("blur", onBlur);
The code works and I can get the textField's value (by using this.getLiveValue()).
However, I need to get other property from the model (from the same row).
How can I get the model from the 'blur' function? (get the exact row properties)
I can always add a hidden column and use jQuery sibling etc to get the value but I'm sure there is more elegant way (-:
Regards,
Omri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kai,
Thanks but the code doesn't work.
'e.currentTarget.id' and 'this.getId()' will return the id of the object.
When attaching browser events 'this' is actually the ui5 control and control methods like getBindingContext() are available. The problem is that 'getBindingContext()' method returns null.
I can create JSBin but I think it is not needed in this case.
Regards,
Omri
Hi Robin,
this.getBindingContext().getObject() doesn't work see jsbin:
http://jsbin.com/papata/4/edit?html,console,output
Regards,
Omri
Hi Kai,
See jsbin:
http://jsbin.com/papata/4/edit?html,console,output
From the 'theDate' cell I need to get the corresponding 'someText' or 'anotherText' fields of the model.
Regards,
Omri
Hi Omri,
I've found the problem ... there is no ContextBinding, when you use named binding.
So, if you bind the model without a name like the following it is working:
oTable.setModel(oModel);
oTable.bindRows("/modelData");
I know that named binding is important, but I don't know why it's not working with that.
Maybe an expert can explain that, or is it just a known bug???
This is not entirely correct. The method getBindingContext does take a parameter, which is the model name. So you can do something like this.getBindingContext("tblModel")
Here's the working example: http://jsbin.com/qedupuhepo/2/
- Max
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.