Search in sources :

Example 1 with INGWebObjectContext

use of com.servoy.j2db.server.ngclient.property.INGWebObjectContext in project servoy-client by Servoy.

the class DataproviderTypeSabloValue method attachToBaseObject.

@Override
public void attachToBaseObject(IChangeListener changeNotifier, IWebObjectContext webObjectCntxt) {
    this.changeMonitor = changeNotifier;
    this.webObjectContext = webObjectCntxt;
    if (webObjectCntxt instanceof INGWebObjectContext)
        this.dataAdapterList = ((INGWebObjectContext) webObjectCntxt).getDataAdapterList();
    computeShouldResolveValuelistConfig();
    // register data link and find mode listeners as needed
    dataLinks = ((DataproviderPropertyType) dpPD.getType()).getDataLinks(dataProviderID, servoyDataConverterContext.getForm() != null ? servoyDataConverterContext.getForm().getForm() : null);
    dataAdapterList.addDataLinkedProperty(this, dataLinks);
    // they weren't cached in form element; get them again
    boolean isFindModeAware = ((DataproviderPropertyType) dpPD.getType()).isFindModeAware(dataProviderID, servoyDataConverterContext.getForm() != null ? servoyDataConverterContext.getForm().getForm() : null);
    if (isFindModeAware)
        dataAdapterList.addFindModeAwareProperty(this);
    DataproviderConfig config = (DataproviderConfig) dpPD.getConfig();
    String dtpn = config.getDisplayTagsPropertyName();
    Object dtPropVal = null;
    if (dtpn != null) {
        dtPropVal = webObjectCntxt.getProperty(dtpn);
        if (dtPropVal == null)
            dtPropVal = Boolean.FALSE;
    }
    displaysTags = dtpn != null && ((Boolean) dtPropVal).booleanValue() == true || (dtpn == null && config.shouldDisplayTags());
    dataProviderOrRecordChanged(dataAdapterList.getRecord(), null, false, false, false);
}
Also used : INGWebObjectContext(com.servoy.j2db.server.ngclient.property.INGWebObjectContext) DataproviderConfig(com.servoy.j2db.server.ngclient.property.DataproviderConfig)

Aggregations

DataproviderConfig (com.servoy.j2db.server.ngclient.property.DataproviderConfig)1 INGWebObjectContext (com.servoy.j2db.server.ngclient.property.INGWebObjectContext)1