Infowindow:Previous recordSelectedData don't clear before process run
Description
Environment
Attachments
- 01 Jun 2016, 06:01 AM
Activity

Hiep Lq June 8, 2016 at 1:27 PM
hi like i mean on prev comment, i worry your fix will get break IDEMPIERE-2230.
did you test it? or you just don't use this feature?
my patch already fix your issue with no break anything.
if you still get issue when apply my patch, please point out me with your test case, so i can improve my patch.
Peter Shepetko June 8, 2016 at 10:15 AM
Hi Hieplq,
Can you check it?
I added one line to class InfoPanel and it work as we need:
-------------
@Override
public void onEvent(Event event) throws Exception {
ProcessModalDialog processModalDialog = (ProcessModalDialog)event.getTarget();
if (DialogEvents.ON_BEFORE_RUN_PROCESS.equals(event.getName())){
+ recordSelectedData.clear();//#IDEMPIERE-3094
updateListSelected();
// store in T_Selection table selected rows for Execute Process that retrieves from T_Selection in code.
DB.createT_SelectionNew(pInstanceID, getSaveKeys(getInfoColumnIDFromProcess(processModalDialog.getAD_Process_ID())),
null);
-------------

Hiep Lq June 7, 2016 at 2:49 PM
hi i misunderstand your idea in "But we can reset recordSelectedData before this process will start because old items exist recordSelectedData and process will run for them too. But it is mistake for us."
and i still not yet know how to redo like you
Peter Shepetko June 6, 2016 at 10:12 AM
Yes, I agree to you about un-select records at other pages if we reset recordSelectedData always.
But we can reset recordSelectedData before this process will start because old items exist recordSelectedData and process will run for them too. But it is mistake for us.

Hiep Lq June 3, 2016 at 6:26 PM
i can't redo this issue when i apply patch.
if you reset recordSelectedData it will affect IDEMPIERE-2230. selected record at other pages also un-select
i just think one condition to redo, your process change data of selected record, is it?
Peter Shepetko June 2, 2016 at 7:51 AM
hieplq, I added manually your patch and checked it.
I had this bug again because I think you didn't clean recordSelectedData which contains old items.

Hiep Lq June 1, 2016 at 6:08 AM
root cause:
when do requery after run process, it call function InfoWindow.prepareTable
this function will let call function ListModelTable.ensureRowSize
ensureRowSize will set all item of all record of model to null
so let line 1291 of class infoPanel always false and let to this issue
if (recordSelected.equals(candidateRecord)) {
in ListModelTable.ensureRowSize
list.add(null); is necessary but i not sure list.remove(i - 1); is necessary

Hiep Lq May 31, 2016 at 1:19 PM
i got it. thanks a lot
Peter Shepetko May 31, 2016 at 1:16 PM
Hi Hiepq,
Thank you for you answer.
I added comment to this issue.
Best Regards,
Peter
–
*Best regars,------------------Peter Shepetkoskype: peter.shepetkoemail:
peter@fina.net.ua <peter@fina2.net.ua>*
Peter Shepetko May 31, 2016 at 1:09 PM
Hi hieplq,
Maybe I discribed badly this bug.
I created short video for this.
https://drive.google.com/file/d/0B0zzpoF2_ds-akZFT0RYcFZZUHc/view?usp=sharing
Peter

Hiep Lq May 31, 2016 at 9:24 AM
hi , after run process, it don't clear prev selection record.
you have to manual clear it by use reset button.
think about case when you want run some kind of process on same collection record.
also refer to IDEMPIERE-2230,
Details
Details
Assignee

Step-byStep:
1) We selected 2 records
2) We run some process
3) We selected another 3 records
4) We run the same process again
5) Process did 5 records (2+3) and selected 5 records in infowindow
This is mistake!
Solution:
We added one line to package org.adempiere.webui.panel.InfoPanel.InfoPanel
updateListSelected(){
+ recordSelectedData.clear();
...
}