summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-03-05 01:59:21 (EST)
committerManik Kishore2012-06-19 07:19:02 (EDT)
commitbb68b8723e57a2b58f27318d6a9e0e6d14cf5e80 (patch)
tree3096ec77e2a865aec449e62ccf3684674f144e7f
parent8bab999625bd1ae9aab14e230b1fcbec5ff0f8a0 (diff)
downloadorg.eclipse.stardust.ui.web-bb68b8723e57a2b58f27318d6a9e0e6d14cf5e80.zip
org.eclipse.stardust.ui.web-bb68b8723e57a2b58f27318d6a9e0e6d14cf5e80.tar.gz
org.eclipse.stardust.ui.web-bb68b8723e57a2b58f27318d6a9e0e6d14cf5e80.tar.bz2
Jira-ID: CRNT-24009
1)Added searchPriority() method in priorityAutocompleteSelector.java and moved code from searchValueChanged(event). 2)Added equals method to PriorityAutoCompleteItem.java. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@54287 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/PriorityAutoCompleteItem.java15
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/PriorityAutocompleteSelector.java42
-rw-r--r--views-common/src/main/resources/META-INF/xhtml/common/priorityAutocompleteSingleSelector.xhtml2
3 files changed, 47 insertions, 12 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/PriorityAutoCompleteItem.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/PriorityAutoCompleteItem.java
index d31bde3..4f9dde7 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/PriorityAutoCompleteItem.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/PriorityAutoCompleteItem.java
@@ -84,5 +84,20 @@ public class PriorityAutoCompleteItem extends DefaultRowModel
{
priorityAutocompleteSelector.removePriority(this);
}
+
+ @Override
+ public boolean equals(Object equateTo)
+ {
+ if (null != equateTo && equateTo instanceof PriorityAutoCompleteItem)
+ {
+ PriorityAutoCompleteItem eTo = (PriorityAutoCompleteItem) equateTo;
+ if (eTo.getLabel().equals(getLabel()))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
}
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/PriorityAutocompleteSelector.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/PriorityAutocompleteSelector.java
index 6b83618..338b684 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/PriorityAutocompleteSelector.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/PriorityAutocompleteSelector.java
@@ -50,6 +50,7 @@ public class PriorityAutocompleteSelector extends AutocompleteMultiSelector<Prio
protected boolean showAutocompletePanel;
protected boolean showSelectedList;
+ private SelectInputText autoComplete;
/**
* @param provider
@@ -104,7 +105,7 @@ public class PriorityAutocompleteSelector extends AutocompleteMultiSelector<Prio
/**
* Overridden - to first check if the given event is in INVOKE_APPLICATION phase - this
- * is needed as the participant data provider uses bean members and we must wait till
+ * is needed as the Priority data provider uses bean members and we must wait till
* their values are set.
*
*/
@@ -122,17 +123,9 @@ public class PriorityAutocompleteSelector extends AutocompleteMultiSelector<Prio
{
if (event.getComponent() instanceof SelectInputText)
{
- SelectInputText autoComplete = (SelectInputText) event.getComponent();
+ autoComplete = (SelectInputText) event.getComponent();
selectedItem = autoComplete.getSelectedItem();
- if (selectedItem != null)
- {
- autoComplete.setValue(selectedItem.getLabel());
- if (autocompleteSelectorListener != null)
- {
- autocompleteSelectorListener.actionPerformed(autoComplete, selectedItem);
- }
- }
- else
+ if (selectedItem == null)
{
String newWord = (String) event.getNewValue();
newWord = newWord.trim();
@@ -155,6 +148,26 @@ public class PriorityAutocompleteSelector extends AutocompleteMultiSelector<Prio
}
/**
+ * Action method called on selection of Priority
+ */
+ public void searchPriority()
+ {
+ if (null != autoComplete)
+ {
+ selectedItem = autoComplete.getSelectedItem();
+
+ if (selectedItem != null)
+ {
+ autoComplete.setValue(selectedItem.getLabel());
+ if (autocompleteSelectorListener != null)
+ {
+ autocompleteSelectorListener.actionPerformed(autoComplete, selectedItem);
+ }
+ }
+ }
+ }
+
+ /**
* @param priorityItem
*/
public void removePriority(PriorityAutoCompleteItem priorityItem)
@@ -256,6 +269,13 @@ public class PriorityAutocompleteSelector extends AutocompleteMultiSelector<Prio
{
this.showSelectedList = showSelectedList;
}
+
+ public SelectInputText getAutoComplete()
+ {
+ return autoComplete;
+ }
+
+
}
/**
diff --git a/views-common/src/main/resources/META-INF/xhtml/common/priorityAutocompleteSingleSelector.xhtml b/views-common/src/main/resources/META-INF/xhtml/common/priorityAutocompleteSingleSelector.xhtml
index 8a45c60..b02ae9b 100644
--- a/views-common/src/main/resources/META-INF/xhtml/common/priorityAutocompleteSingleSelector.xhtml
+++ b/views-common/src/main/resources/META-INF/xhtml/common/priorityAutocompleteSingleSelector.xhtml
@@ -17,7 +17,7 @@
valueChangeListener="#{component.searchValueChanged}"
disabled="#{component.disabled}" partialSubmit="false" width="95%"
listVar="priorityItem" listValue="#{component.matchingData}"
- style="margin: 0px 0px 9px 2px;">
+ style="margin: 0px 0px 9px 2px;" action="#{component.searchPriority}">
<f:facet name="selectInputText">
<ice:panelGrid columns="2">
<ice:outputText value="#{priorityItem.label}" escape="false"