2015-01-20 2 views
0

DualListField에서 선택한 항목을 가져 오는 방법에 대해 알지 못합니다. 누군가 나를 도울 수 있습니까? 그래서 여기 DualListField에 대한 나의 코드가있다. 그리고 txtCat을 TextCell을 제외하고 선택된 항목의 컨테이너로 만들고 싶습니다. 그리고 또한 내가 선택한 항목이 최신 GXT3 버전 DualListField에서의 IDCategoryDualListField에서 선택한 항목을 가져 오는 방법은 무엇입니까?

final DualListField<Category, String> field = new DualListField<Category, String>(category, toCategory, catProp.strName(), txCell); 
     field.addValidator(new EmptyValidator<List<Category>>()); 
     field.setEnableDnd(true); 
     field.setMode(Mode.INSERT); 
     vlc.add(new FieldLabel(field, "Categories"), new VerticalLayoutData(1, -1, new Margins(10))); 

     txtCat = new TextField(); 
     txtCat.setEmptyText("Value"); 
     txtCat.addFocusHandler(new FocusEvent.FocusHandler() { 

      @Override 
      public void onFocus(FocusEvent event) { 
       field.getFromStore(); 
      } 
     }); 
     vlc.add(new FieldLabel(txtCat, "Chosen Categories"), new VerticalLayoutData(-18, -1, new Margins(10))); 
+0

이 gwt 또는 gxt입니까? –

+0

당신은 어떤 생각이 있습니까? –

+1

[GWT에 DualListField 없음] (http://www.gwtproject.org/javadoc/latest/allclasses-noframe.html)이 있습니다. 커뮤니티는 사용자 정의 클래스 작동 방식을 알지 못합니다. –

답변

0

에 변환하고자하는, 당신 수 field.getValue() 방법을 통해 ToView 부분에 선택한 항목을 얻을. 다음과 같이 ToView의 모든 데이터를 가져옵니다. field.getToView() .getStore(). getAll(). hth

+0

thanks @ Wall-E DualListField에서 편집기를 추가하는 방법에 대한 아이디어가 있습니까? –

+0

@alynallamedo 편집기 클래스 란 무엇입니까? 충분한 정보로 질문을 업데이트 할 수 있습니까? http://stackoverflow.com/help/how-to-ask – nayakam

+0

이것은 내 카테고리의 columnConfig 선언입니다. ColumnConfig catConfig = new ColumnConfig (properties.categories(), 150); catConfig.setHeader ("Categories"); cfgs.add (catConfig); 및 catConfig를 클릭 할 때마다 편집되도록하고 싶습니다. 그래서 어떻게 내가 DualListField에 대한 편집기 (GridRowEditor)를 추가 할 수 있는지 알고 싶습니다 –

관련 문제