cancel
Showing results for 
Search instead for 
Did you mean: 

Problem refreshing UI after document deletion

pibou_Bouvret
Elite Collaborator
Elite Collaborator

Hi,

i'm trying to implement a permanent deletion feature : I created a document type that lists the deleted documents for a given user, so that he can permanently delete the selected ones.

Everything runs fine ... for the first deletion

It seems that the previsously selected documents are still cached somewhere in the UI (my "permanently delete" button is enabled although selection is empty), so that if i try to delete a second batch of docs, i get a "No such document" error.

I tried to use the Seam.Refresh operation, but it doesn't seem to work.

Any idea ?

1 ACCEPTED ANSWER

Laurent_Doguin
Star Collaborator
Star Collaborator

Actually we're missing a 'Clear Selection' operation, a bit like 'Clear Clipboard' works.

The code of your operation would look like that:

@OperationMethod
public void run() {
    OperationHelper.getDocumentListManager().resetWorkingList(
            DocumentsListsManager.CURRENT_DOCUMENT_SELECTION);
}

This will empty the current selection. The refresh UI operation only invalidates queries cache.

View answer in original post

8 REPLIES 8

Laurent_Doguin
Star Collaborator
Star Collaborator

quick question, does it work when you click on the refresh button from the UI?

pibou_Bouvret
Elite Collaborator
Elite Collaborator

No,

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

Can you give us your operation chain you used to implement the permanent deletion ?

pibou_Bouvret
Elite Collaborator
Elite Collaborator

That is simply

pibou_Bouvret
Elite Collaborator
Elite Collaborator

Same kind of problems with my new "validate button"

Laurent_Doguin
Star Collaborator
Star Collaborator

Actually we're missing a 'Clear Selection' operation, a bit like 'Clear Clipboard' works.

The code of your operation would look like that:

@OperationMethod
public void run() {
    OperationHelper.getDocumentListManager().resetWorkingList(
            DocumentsListsManager.CURRENT_DOCUMENT_SELECTION);
}

This will empty the current selection. The refresh UI operation only invalidates queries cache.

Thx.

pibou_Bouvret
Elite Collaborator
Elite Collaborator

the 'Clear Selection' operation works fine : I can select documents after a deletion, nevertheless i still have to refresh the list with my "refresh" automation chain.