Пример #1
0
  private void init() {
    getComponent().setWidth("200px");
    getComponent().setAutocomplete(true);
    getComponent().setAutodrop(true);
    getComponent().addEventListener(Events.ON_BLUR, this);

    boolean zoom = false;
    if (lookup != null) {
      lookup.addListDataListener(this);
      // always need the empty item for zk to work correctly
      lookup.setMandatory(false);

      if ((lookup.getDisplayType() == DisplayType.List
              && Env.getContextAsInt(Env.getCtx(), "#AD_Role_ID") == 0)
          || lookup.getDisplayType() != DisplayType.List) {
        zoom = true;
      }

      // no need to refresh readonly lookup
      if (isReadWrite()) lookup.refresh();
      refreshList();
      actionRefresh();
    }

    if (mField != null) {
      popupMenu = new WEditorPopupMenu(zoom, true, true);
      if (mField != null && mField.getGridTab() != null) {
        WFieldRecordInfo.addMenu(popupMenu);
      }
      getComponent().setContext(popupMenu.getId());
    }
  }
 public void onMenu(ContextMenuEvent evt) {
   if (WEditorPopupMenu.ZOOM_EVENT.equals(evt.getContextEvent())) {
     actionZoom();
   } else if (WEditorPopupMenu.CHANGE_LOG_EVENT.equals(evt.getContextEvent())) {
     WFieldRecordInfo.start(gridField);
   }
 }
Пример #3
0
 @Override
 public void onMenu(ContextMenuEvent evt) {
   if (WEditorPopupMenu.CHANGE_LOG_EVENT.equals(evt.getContextEvent())) {
     WFieldRecordInfo.start(gridField);
   } else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) {
     if (isShowPreference())
       ValuePreference.start(getComponent(), this.getGridField(), getValue());
   }
 }
Пример #4
0
 public void onMenu(ContextMenuEvent evt) {
   if (WEditorPopupMenu.REQUERY_EVENT.equals(evt.getContextEvent())) {
     actionRefresh();
   } else if (WEditorPopupMenu.ZOOM_EVENT.equals(evt.getContextEvent())) {
     actionZoom();
   } else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) {
     if (MRole.getDefault().isShowPreference())
       ValuePreference.start(this.getGridField(), getValue());
     return;
   } else if (WEditorPopupMenu.CHANGE_LOG_EVENT.equals(evt.getContextEvent())) {
     WFieldRecordInfo.start(mField);
   }
 }
  private void initComponents() {
    getComponent().setButtonImage("images/PAttribute10.png");
    getComponent().addEventListener(Events.ON_CLICK, this);

    m_WindowNo = gridField.getWindowNo();
    m_mPAttribute = gridField.getLookup();
    m_C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "C_BPartner_ID");

    //	Popup
    popupMenu = new WEditorPopupMenu(true, false, false);
    getComponent().getTextbox().setContext(popupMenu.getId());
    if (gridField != null && gridField.getGridTab() != null) {
      WFieldRecordInfo.addMenu(popupMenu);
    }

    getComponent().getTextbox().setReadonly(true);
  }