cancel
Showing results for 
Search instead for 
Did you mean: 

changing lead selection to the corresponding row of a column.

Former Member
0 Kudos

Hi all,

I have a table with 5 rows and a column with Input feild. All the 5 rows are active and lead selection is on the first row.

My requirement is such that when i click on the input feild in the 4 row, i need my lead selection to be set automatically to row 4.

Is this possible.? Any help will be appreciated.

Thanks in advance,

Jithin.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Changing Lead selection is not possible as there is no event triggered when we click insisde an IF.

Former Member
0 Kudos

No, this is not possible because there is no event triggered when you click inside the InputField. But why do you need to change the lead-selection in this case?

A workaround could be to make the InputField only editable in the lead-selected row. Then the user would have to change the selection before he can start editing.

Armin

Former Member
0 Kudos

Hi Jithin,

In the wdModifyView method View

1) Get the currentlead selection of the table

2) set it in the above lead selection of table.

Rgds

-SS

pravesh_verma
Active Contributor
0 Kudos

Hi Jithin,

Input field does not come with any even of onClick. However there is an event called onEnter.

Therefore what you can do is you can enter thevalue and hit the enter. On this event you can get the leadselection to the desired row.

However you requirement of getting the leadselection on click is not possible.

Please revert back if you need the code for setting the leadselection on event onEnter.

Hope this helps you!!

Thanks and Regards,

Pravesh

Former Member
0 Kudos

Dear Pravesh,

Is there any method to get my cursor position.? Say when my cursor is in 4th row, set the lead selection to row 4.

My exact requirement is, i have an OVS attached to my IFeild. When i click on the 4th row and select a value, it is getting set in the 1st row. This is because my lead selectiuon is in first row.

If i select the row and then select a value, its working fine.

So i need need my lead selection to be set to the corresponding row where i intend to set the value.

Former Member
0 Kudos

Hi,

You need to bind the inputfield to an atribute that is part of the table element.

So if there are 5 table rows, there will be 5 attribute values for the input element.

From what you describe, the inputfield is now part of a single element. So each tablerow input element is bound to the same context attribute.

Good luck, Roelof

Former Member
0 Kudos

Hi,

If this for you to know the selected row to make changes try to use source mapping

Ex:

IWDInputField inputField;

inputField.mappingOfOnEnter().addSourceMapping(sourceName, newName)

If you search the forumn you will get more details on the same.

Regards

Ayyapparaj

Former Member
0 Kudos

Dear Knibbe,

Can u please elaborate a little on the below statement

From what you describe, the inputfield is now part of a single element. So each tablerow input element is bound to the same context attribute.

Jithin

Former Member
0 Kudos

Hi,

Each element is part of a node that can contain 0, 1 or more elements. This is determined by the cardinality of the node (0..1, 1..1, 1..n, etc.)

It looks like your table is bound to a context node with cardinality 0..n (probably determined by some backend call). So far so good. The input element however seems to be bound to an element from a different node. So when you click a tablerow (and thus the leadselection in the context node to which the table is bound is changed) this has no impact for the lead selection of the node to which the inputfield is bound.

Solution: all fields in your table must be bound to attributes of the same nodeelement.

If the your table is currently bound to a model node, you need to convert this to a value node (durich which you can add the required attribute that can be bound to the input field.)

Hope this clarifies. Good luck, Roelof

pravesh_verma
Active Contributor
0 Kudos

Hi Jithin,

If you have an OVS then you can capture the event of the on change of value and set the lead selection to the desired row. You can use the creationof the calculated attributes.

However if you are just entering the value then it is quite impossible.

Regards

Pravesh

Former Member
0 Kudos

Hi Pravesh,

you can capture the event of the on change of value and set the lead selection to the desired row

Can u please tell me how to do this.

Former Member
0 Kudos

Hi,

On change event for the inputfield is available only from CE EHP1. Are you using this?

Regards

Ayyapparaj

pravesh_verma
Active Contributor
0 Kudos

Hi Jithin,

Please refer to this post. I have faced the similar issue long back. I have used this method. I am sure you will be able to fix this issue using the calculated attributed created at runtime.

[|]

NOTE: This will apply only if you want the leadselection to be set when you select some value from OVS.

Hope this helps you!!

Regards

Pravesh