Skip to content

Commit

Permalink
max 100 caracteres sur le champ de recherche
Browse files Browse the repository at this point in the history
  • Loading branch information
cdubois54 committed Oct 31, 2023
1 parent cc44da9 commit 1f6d286
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,13 @@ public class AutoComplete extends TextField{


public void showChoices(List<ResultatDeRecherche> text, Layout layout, Button btnRecherche, boolean touchkitMobileDisplay) {


//Si du texte est saisi
if(text.size()>0){

//Si la popup est déjà instanciée, on la masque
if(choicesPopup!=null){
choicesPopup.setPopupVisible(false);

}


//Si c'est la première fois que l'on affiche la popup
if(choices==null){
//On créé la table contenant les propositions
Expand All @@ -81,7 +76,7 @@ public void showChoices(List<ResultatDeRecherche> text, Layout layout, Button bt
}

choices.setImmediate(true);

//Gestion du clic sur une ligne de la table -> on met la valeut de la ligne dans le textField de saisie
choices.addItemClickListener(new ItemClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public void init() {
champRecherche.setWidth(100, Unit.PERCENTAGE);
champRecherche.setEnabled(true);
champRecherche.setImmediate(true);
champRecherche.setMaxLength(100);
champRecherche.focus();
champRecherche.setTextChangeEventMode(TextChangeEventMode.EAGER);
champRecherche.addTextChangeListener(new TextChangeListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public void init() {
champRecherche.setWidth(700, Unit.PIXELS); //540
champRecherche.setEnabled(true);
champRecherche.setImmediate(true);
champRecherche.setMaxLength(100);
champRecherche.focus();
champRecherche.setTextChangeEventMode(TextChangeEventMode.EAGER);
champRecherche.addTextChangeListener(new TextChangeListener() {
Expand Down

0 comments on commit 1f6d286

Please sign in to comment.