Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix enter key closes add maintainer dialog instead of search: https:/…
  • Loading branch information
Alex Eng committed Oct 2, 2012
1 parent 65a3c87 commit 2d1d0cb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
Expand Up @@ -71,6 +71,7 @@ public List<HAccount> getSearchResults()

public List<HAccount> search(Object input)
{
this.person = null;
String userInput = (String) input;
return accountDAO.searchQuery(userInput);
}
Expand Down
Expand Up @@ -8,14 +8,27 @@
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">

<script type="text/javascript">
function submitSearchOnEnter(e)
{
if(e.keyCode == 13 )
{
return false;
}
else
{
#{rich:element('nameLabel')}.innerHTML='';
#{rich:element('emailLabel')}.innerHTML='';
}
}
</script>

<h:panelGrid>
<s:decorate id="userField"
template="../layout/edit.xhtml">
<ui:define name="label">#{messages['jsf.Username']}</ui:define>
<h:inputText id="input" value="#{accountSearch.maintainer}" size="40" >

</h:inputText>
<rich:suggestionbox width="290" suggestionAction="#{accountSearch.search}" var="account" for="input">
<h:inputText id="input" value="#{accountSearch.maintainer}" size="40" onkeydown="return submitSearchOnEnter(event)"/>
<rich:suggestionbox width="290" suggestionAction="#{accountSearch.search}" var="account" for="input" nothingLabel="No results">
<a4j:support event="onselect" action="#{accountSearch.update}" reRender="results"/>
<h:column>
<h:outputText value="#{account.username}"/>
Expand All @@ -28,11 +41,11 @@
<h:panelGrid id="output" >
<s:decorate id="output1" template="../layout/display.xhtml">
<ui:define name="label">#{messages['jsf.Name']} </ui:define>
<h:outputText value="#{accountSearch.person.name}" />
<h:outputText value="#{accountSearch.person.name}" id="nameLabel" />
</s:decorate>
<s:decorate id="output2" template="../layout/display.xhtml">
<ui:define name="label">#{messages['jsf.Email']} </ui:define>
<h:outputText value="#{accountSearch.person.email}" />
<h:outputText value="#{accountSearch.person.email}" id="emailLabel" />
</s:decorate>
</h:panelGrid>
</div>
Expand Down
2 changes: 1 addition & 1 deletion zanata-war/src/main/webapp/project/assign_maintainer.xhtml
Expand Up @@ -11,7 +11,7 @@

<ui:define name="page_title">#{projectHome.instance.name}:#{messages['jsf.AddProjectMaintainer']}</ui:define>
<ui:define name="right_content">
<rich:panel>
<rich:panel rendered="#{s:hasPermission(projectMaintainerManageAction.project, 'update')}">
<f:facet name="header">#{messages['jsf.Actions']}</f:facet>
<a href="#" class="action_link" onclick="#{rich:component('maintainerAddPanel')}.show()">#{messages['jsf.AddProjectMaintainer']}</a>
</rich:panel>
Expand Down
Expand Up @@ -11,7 +11,7 @@

<ui:define name="page_title">#{messages['jsf.Groups']}:#{versionGroupMaintainerManageAction.group.name}:#{messages['jsf.AddGroupMaintainer']}</ui:define>
<ui:define name="right_content">
<rich:panel>
<rich:panel rendered="#{s:hasPermission(versionGroupMaintainerManageAction.group, 'update')}">
<f:facet name="header">#{messages['jsf.Actions']}</f:facet>
<a href="#" class="action_link" onclick="#{rich:component('maintainerAddPanel')}.show()">#{messages['jsf.AddGroupMaintainer']}</a>
</rich:panel>
Expand Down

0 comments on commit 2d1d0cb

Please sign in to comment.