]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Knowledge search initialization is fixed.
authorrkv <rkv@opencascade.com>
Mon, 11 Mar 2013 06:11:58 +0000 (06:11 +0000)
committerrkv <rkv@opencascade.com>
Mon, 11 Mar 2013 06:11:58 +0000 (06:11 +0000)
Workspace/Siman/src/org/splat/simer/SearchKnowledgeAction.java

index d8c83c1f686967ccd78d201281bbc9faf090cff3..8222dc2da0ef92a21c02ddc2c5ee6a73ce712254 100644 (file)
@@ -52,16 +52,18 @@ public class SearchKnowledgeAction extends
                                Constants.OPEN);
 
                String res = SUCCESS;
+               // Final initialization of the form
+               _knowledgeTypes = buildKnowledgeTypesOptions();
+               setCandidates(); // not selected by default
+               setContextTypeOptions(getInvolvedContexts()); // not selected by default
+               loadFilter();
+               // Select the first knowledge type by default
+               Long ktypeId = getKnowledgeTypes().keySet().iterator().next();
+               if (ktypeId != null) {
+                       getFilter().setKtype(String.valueOf(ktypeId));
+               }
                try {
-                       loadFilter();
                        doSearch();
-
-                       // Final initialization of the form
-                       _knowledgeTypes = buildKnowledgeTypesOptions();
-                       getKnowledgeElementTypeService().selectTypesWhere(
-                                       ProgressState.APPROVED);
-                       setCandidates();
-                       setContextTypeOptions(getInvolvedContexts());
                } catch (Exception error) {
                        // No need to roll back the transaction as it is read only
                        LOG.error("Reason: ", error);