Custom QuickEntry with with editor context menu - Need Help!

56 views
Skip to first unread message

reua...@gmail.com

unread,
Jul 30, 2022, 8:12:09 AMJul 30
to iDempiere
Hello Community,

I am currently working on a customized QuickEntry that comes with editor context menus.
https://gist.github.com/Soundbytes/4f76bc7a49c7a353af450ebfe2b476ef
The idea is to reduce the amount of window juggling that is required when a number of cascaded records has to be created. The current implementation only allows to select from existing WTableDirEditor entries. Our solution will allow to add a new record using a cascaded QuickEntry.  
Everything seems to work just fine. I can invoke the secondary QuickEntry and create a record there. On clicking OK that record appears correctly in the calling WTableDirEditor of the primary WQuickEntry. 
However that is also where the trouble starts:
it looks like the value change event is fired but then the GridField callout is not executed. Also the value of the WTableDirEditor is set to null as soon as the value of another Editor is changed. This does not happen when the WTableDirEditor looses focus but only when I type a new value into the other Editor.
I have spent quite a while trying to understand what is going on here but could not make enough sense out of it. Can anybody help?

Thanks very much!

Andreas

reua...@gmail.com

unread,
Jul 31, 2022, 4:32:38 AMJul 31
to iDempiere
I found it: The error was caused by a bug in WTableDirEditor.actionQuickEntry().
I'll provide a pull request soon together with the finished plugin. 

protected void actionQuickEntry (boolean newRecord)
{
    (...)
    WEditor editor = this;  <---- new line added 
    vqe.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
        @Override
        public void onEvent(Event event) throws Exception {
            (...)
            ValueChangeEvent changeEvent = new ValueChangeEvent(editor, getColumnName(), oldValue, newValue);  <---- replaced the erroneous 'this' with the correct argument 'editor'
            (...)
        }
    });
    (...)       
}    //    actionQuickEntry
Reply all
Reply to author
Forward
0 new messages