2012-05-17 1 views
0

SmartClient 쇼케이스처럼 XML 유형 DataSource의 데이터로 TreeGrid를 작성합니다.SmartGWT : TreeGrid가 빈 폴더를 확장하면 트리가 재설정됩니다.

Windows XP 및 SmartGWT 버전 3.0, GWT SDK 2.4.0 (Eclipse IDE 사용)을 사용 중입니다.

그러나, 문제는 빈 폴더를 확장 할 때 /를 트리 자체를 닫이며, 또한와 (내가 체크 박스 트리 선택 유형을 사용하고 있기 때문에) 없음에 대한 모든 선택을 재설정 및 재설정 그러나 그 해결책을 설명하지 않습니다,

[ERROR] [testtree] - 15:19:26.637:XRP0:WARN:ResultTree:isc_ResultTree_0 (created by: isc_TreeGrid_0):Adding node to tree with id property set to:1. A node with this ID is already present in this Tree - that node will be replaced. Note that this warning may be disabled by setting the reportCollisions attribute to false. 

이 실제로 매우 비슷하게이 (http://forums.smartclient.com/showthread.php?t=20167)와 인 :이 오류 (경고)를 얻었다. :(

이것은 내가 XML 데이터 소스에 사용하는 테스트 값이다 :이 문제의 스크린 샷이다

... 
<record> 
<id>1</id> 
<parentId>0</parentId> 
<name>test1</name> 
</record> 

<record> 
<id>2</id> 
<parentId>1</parentId> 
<name>test41</name> 
</record> 

<record> 
<id>3</id> 
<parentId>2</parentId> 
<name>test2</name> 
</record> 

<record> 
    <id>4</id> 
    <parentId>3</parentId> 
    <name>test212</name> 
</record> 

(죄송 충분하지 담당자 이미지를 게시 할 수 없습니다) 전에 내가 클릭 한 오, 내가 'test212'을 확장하려고하면 link

위의 이미지에 따르면,이 문제가 발생합니다 후, link (imgur image) 과 : 버튼을 확장 r 'test2'.

이 내 TreeGrid에 속성의 조각입니다 :

... 
TreeGrid test = new TreeGrid(); 
test.setAutoFetchData(true); 
test.setDataSource(SingletonDS.getInstance()); 
test.setSelectionAppearance(SelectionAppearance.CHECKBOX); 
test.setShowPartialSelection(true); 
test.setShowSelectedStyle(false); 

layout.addMember(test); 

이 내 단일 데이터 소스의 속성입니다 :

...  
singleton.setDataFormat(DSDataFormat.XML); 

singleton.setID("singletonDS"); 

DataSourceIntegerField idField = new DataSourceIntegerField("id", "ID"); 
idField.setPrimaryKey(true); 
DataSourceIntegerField parentIdField = new DataSourceIntegerField("parentId", "Parent ID"); 
parentIdField.setForeignKey(singleton.getID()+".id"); 
parentId.setRootValue(0); 
DataSourceTextField nameField = new DataSourceTextField("name", "Name"); 

singleton.setFields(idField, parentIdField, nameField); 
... 

참고 : XML 데이터가 이미 그리드에 제대로 전달 .

도움 주셔서 감사합니다. :)

+0

사용중인 SmartGWT의 버전은 무엇입니까? 지난 밤의 빌드를 사용해 보셨습니까? 때로는 이러한 종류의 오류는 프레임 워크 버그에서 비롯됩니다. 저희에게 알려주십시오. –

+0

안녕하세요, 늦게 답장을 드려 죄송합니다. Windows XP 및 SmartGWT 버전 3.0, GWT SDK 2.4.0 (Eclipse IDE 사용)을 사용하고 있습니다. 메인 포스트에서 업데이트됩니다. 아니, 야간 빌드를 시도하지 않았습니다. :) 당신의 도움을 주셔서 감사합니다! – dvdchr

+0

다른 ID를 사용하면 어떻게됩니까? 위 코드에서 10시에 시작하십시오. 이것은 "automaticaly"생성 된 노드 (루트 노드)와 관련이있을 수 있습니까? –

답변

1

나는 마침내 해결책을 찾았다 고 생각한다. 이것은 버그가 아니며, 그것은 내 자신의 서투른 잘못입니다.

프로젝트를 광범위하게 디버깅 한 후에 GET 매개 변수에 idParent 매개 변수가 있음을 발견했으며 처리하지 못했습니다. 결과적으로 서블릿은 항상 전체 XML 데이터를 출력하므로이 오류가 발생합니다.