cancel
Showing results for 
Search instead for 
Did you mean: 

Lead selection on tables and static attributes bindings

matteo_montalto
Contributor
0 Kudos

Hi experts,


I've got some doubts on a simple task and would like to get an hint on the best approach to do it.

Simply: I've got a table, which is bound to a node with cardinality 0:n.

When the user sets a lead selection, then details are shown (a list on inputfields) on a box below the table.

Since the logic that manages "enable" and "visible" properties of each inputfields are quite complex, I created these inputfield statically and bound to the Context node.

So:

when the user selects an item in table, then all the fields of the item are shown as inputfield in a TransparentContainer that follows.

Problem:

if the table is empty, I get a dump as there's no node/element for the binding.


How can I overcome the problem? Obviously, setting cardinality to 1:n is *not* a solution, as the fact the table could be empty is absolutely correct by specifications.

Do I have to make it via dynamic programming? I'd like to avoid this, as many of the properties of these input fields are set statically...

Any hint is welcome

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Create another Node with cardinality 1:1 and bind the input fields to that node instead of binding to the table's Node. Then in onLeadSelect read the selected row and set it to the input field's Node.

Regards,

Kiran

Answers (3)

Answers (3)

matteo_montalto
Contributor
0 Kudos

Thanks everybody,

the workaround suggested by Kiran worked flawlessy

venkat_ratnam3
Explorer
0 Kudos

agree with Kiran you can create an on lead selection event, set the node: which is bound to the UI element .

Regards ,

Venkat Ratnam Naidu

ramakrishnappa
Active Contributor
0 Kudos

Hi Matteo,

I agree with Kiran's suggestion but you can resolve your issue by hiding whole block of input fields if table is empty.

Solution1:

Create a context attribute VISIBILITY.

Bind the visibility property of the container ui element in which input fields are located to a context attribute

During table entries population, set the value to context attribute VISIBILITY to none if table is empty else set to "visible"

Solution2:

i.e. get the container element in which your input fields are placed

lo_container ?= view->get_element( 'container_name' ).

if so you can set inpout fields visibility property to "none",

lo_container->set_visible( value = cl_wd_uielement=>e_visible-none ).

else.

lo_container->set_visible( value = cl_wd_uielement=>e_visible-visible ).

endif.

Hope this helps you.

Regards,

Rama