cancel
Showing results for 
Search instead for 
Did you mean: 

Event handling timing

Former Member
0 Kudos

Hi,

I've 1 main component and i sub component. The sub component contains a table. I use the sub component twice in the main component. The amount of visible rows have to be different for the 2 usages though. The way i figured, i created a method on the interface controller which enables you to set the amount of visible rows. In this method, the interface controller fires an event to which the view listens. The view gets the table and does the setAmount of visible rows....no problem.

The only things is that i want this to happen right when the component is shown so i put the setAmountOfVisbleRows() in the wdInit. It looks like the event is fired correctly and the set on the table is done but the view isnt updated. When i put it in the wdDoModifyView and i trigger this one, it works..... Can anyone enlighten me why my view isnt updated and how to fix this?

Much thanks,

Hugo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hugo,

<i>Can anyone enlighten me why my view isnt updated and how to fix this?</i>

At time when even fired the view is not visible, so view is not subscribed to event by WD framework yet.

Better option is to just use context mapping (all below are done inside inner component):

1. In interface controller create attribute VisibleRowsCount of type integer and set this attribute from interface controller method.

2. In view create mapped attribute VisibleRowCount, define source of mapping as attribute from interface controller

3. Bind Table.visibleRowCount to attribute defined in view.

4. Remove event/event handler

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Valery,

Cheers, thats a way better solution. Didnt know i could bind a context element to the visibleRow attribute of the table.

Thanks for the clear explanation.

best regards,

Hugo Hendriks

Answers (0)