// Copyright (C) 2024 Robert J.A. Wagner; Am Kiefernwald 49b; D-64297 Darmstadt - All Rights Reserved 

import toParent from "./oFormElem_10_base.js";


export default class toFormElem_upload extends toParent {
    constructor() {
        super();
    }
    setThisFE() {
        this.setFE({
            GenericUpload: { elem: { FE_Title: "Upload" }, FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' }, ynSkipSave: 'Y', ynReadOnly: 'Y', ynSkipOnSummary: 'Y' },
        });
    }
    //------------------------------
    //  render-functions
    //------------------------------
    render_ojsonElemForm(next, form, control, item, cell, arg, FGM_Key) {
        if ((item.ynReadOnlyAll == 'Y')
            || (item.ynShowAsReference == 'Y')
            || (item.ynReportStyle == 'Y')) {
            return; // nothing to do!
        }
        let ojson = XRW.dom.uploadCompressed(this, form, control, item, cell, arg, FGM_Key);
        next.push(ojson);
    }
    renderFinalize(form, cell, obj) {
        XRW.dom.uploadFinalize(this, form, cell, cell.item, obj);
    }
}

new toFormElem_upload();
