Row visibility in tables (empty rows)

Hi,

I have a question about rows in a table using embedded data.

The end user can add “Type undersøkelse” (Examinations) to a drop down list and fill in more information in the different columns . If they want to cancel the examination, they can check the checkbox called “Avlyst” (Cancelled). Then this examination appears in the next view which is located in the tab called "Avlyste undersøkelser” (Cancelled examinations) were the end user needs to fill in the reason for the cancellation and the date of the cancellation. The problem is that all examinations that are selected in the table on the first tab called "Undersøkelser” (Examinations) that is not cancelled, are also displayed as empty rows in the same view. I want only the examinations that are checked as cancelled to be visible in this view. If there are ten examinations selected, it can quickly become messy and confusing when there are empty rows they don’t need to see. Is there any way to hide these rows in the view in tab 2 "Avlyste undersøkelser”?

I hope the question made sense.

Anne

Hello @Anne.B.Roed

I have few questions before giving any suggestions,

  1. Are you adding the examination entries to table (First Tab) using the Add Examination button or do you have any pre-populated entries on load?
  2. When you click on Add Examination with a new row added in the table, is the user choosing an option from the dropdown in the first column and then the dropdown is disabled for any further selection with other columns getting populated from the dropdown selection (May be from a data table record) ?
  3. I see that you have a delete icon displayed for row. If we have an option of removing the unnecessary entries from the table, do we need again an additional tab to show specific cancelled entries again in a table after manually selecting the cancelled option? This question will make sense only if you are not pre-populating any records on load in the table.

Just giving thoughts to rethink about the UI design and implementation to make it more simpler.

Regardless of the above questions, below is my suggestion to your situation.

You can extend the pyRefreshData DT in your work class with proper entry conditions to your implementation.

Maintain two different lists for All examinations and Cancelled examinations. On the Cancelled checkbox column add Visibility Condition as When Rule > Always. This will ensure that with every data modification in the table, you pyRefreshData DT will be invoked. So be very sure to add proper entry conditions in your DT.’

In pyRefreshData, loop through the All Examinations pagelist and when you have Cancelled flag as true for any entry, copy this entry and append to your Cancelled list. Also user can uncheck after checking it. So write your logic to handle that situation as well.

Below is my pyRefreshData logic,

If the above is implemented you should see something like below

Hope this helps

Regards

JC

1 Like

1.The user use the add examinations tab to fill the table. It is empty at first, so no pre-populated entries on load.

2/3.The selected examination is just locked so the end user don’t accidentally change the examinations later. When they have chosen the prefered examination, they can fill inn the dates related to this option as the patient comes further along in the patient pathway. The examination could be cancelled later on in the patient pathway, and then we need statistics on why it is cancelled. This is why it opens up in the other tab, to enter the reason and date for cancellation. So the delete option is only there to remove the row if they selected the wrong examination (since it locks on entry). Could be disabled, but we don’t won’t the endusers to change the examination by accident.

Thank you so much, I will test this out!

I’m getting somewhere, but now I experience a different challenge. I have made the “Avlyste undersøkelser” (CancelledExaminationsList) view different from “Undersøkelser” (ExaminationsEmbedded). We also experience an issue when an examination is cancelled and I want to fill in the date and the reason for the cancellation. As you can see in the video, another row appears. I guess this has to do with the ExaminationRowKey. The reason this field is present is to make it possible to add an active Examination with the same name as one that is cancelled earlier. But it will not appear on the clipboard if it is not visible in the table. How can I make sure each row get it’s unique ID when the user selects it in ExaminationsEmbedded?

So to sum this up: What I’m after is that the table CancelledExaminationsList only contains the cancelled examinations from the ExaminationsEmbedded list, that it is possible to add both the date and a reason and a possibility to add a new examination with the same name as one that is already cancelled.

Hello @Anne.B.Roed

When you implement pyRefreshData, you need to handle all the refresh actions from the UI accordingly in it.

Below is the implementation from my end, which will ensure that you will not see those duplicate entries.

Adjust it according to your requirement

You will see a function RemoveDeletedEntries function which you will not find in your code base as i have saved it from RemoveDeletedObjects OOTB function.

The problem with OOTB function is that it will not work for embedded lists. So save as the function with a different name and make below changes.

This approach should work for you

Hope this helps

Regards

JC

@Anne.B.Roed this is a good Constellation based question, i’m going to move this to our User Experience Expert Circle so it can be found with other related content. Please join the expert circle if you haven’t already done so.

If you post a Constellation question in the future, you can use this category to post to help it get more visiblity / categorisation.

1 Like