From ef1d4a7cf7ba3464adc851ec70585ddbd1a33302 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 11 Mar 2013 06:11:58 +0000 Subject: [PATCH] Knowledge search initialization is fixed. --- .../org/splat/simer/SearchKnowledgeAction.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Workspace/Siman/src/org/splat/simer/SearchKnowledgeAction.java b/Workspace/Siman/src/org/splat/simer/SearchKnowledgeAction.java index d8c83c1..8222dc2 100644 --- a/Workspace/Siman/src/org/splat/simer/SearchKnowledgeAction.java +++ b/Workspace/Siman/src/org/splat/simer/SearchKnowledgeAction.java @@ -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); -- 2.39.2