Skip to Content
0

Fragment in a table cell

Jun 05, 2017 at 01:53 PM

62

avatar image

Hi All,

I want to show master detail information using table.

The requirement is, when user selects a row in the parent table, child table should be visible under that row, displaying additional data.

I am using XML view and I have created an XML fragment for the child table and in parent table, I have added a column with demandPopin=true and in columns, I have added just a Text field. I want to use this column to display the child table using the fragment.

I tried following steps in the selectionChange event of the table.

Initially in the selectionChange event of the table, I tried to get the last cell of the table as an object, instantiated the fragment, and finally added the fragment

1.Get selected row.

2.Get last cell of the row.

3.Instantiate the fragment

4.Delete the last cell

5. Add the fragment as the Cell of the row.

It did not work as expected. When I select the table, the code is executed but the table is not visible. It is visible when I select the row again. It is not visible at the first time.

Can someone advise me what can be done best in this situation?

Thanks in advance and Regards

Abhi

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Akhilesh Upadhyay Jun 06, 2017 at 08:34 AM
0

so the issue is, on first time row selection fragment is not opening ? let me check your row selection code if all ok, then you may need to shift your code place to onafterrendering etc.

share your code of row selection to help you better.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Akhilesh,

First of all, thanks for your response. I did not get an chance to come back and see if someone has replied.

I have fixed the issue. Now I can get the child table appear under each row.

However, I bound the child table to a model, and now if I concurrently open more than one child table in a row, all child tables show same data. Trying to work out a solution for this.

0