myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <andreas.mit...@magnasteyr.com>
Subject AW: {Filename?} German Umlauts with InputSuggestAjax, Stylesheets and Speed of Code with InputSuggestAjax
Date Thu, 24 Nov 2005 07:18:10 GMT
That's for answering..

1)Problems with german Umlauts
Is there a possibility to encode the response before its send?
How can I do that?

2)Stylesheets:
Can you give me a hint, where I can set them. Do I have to set it in the InputSuggestAjaxRenderer?


Regards
Andy

-----Ursprüngliche Nachricht-----
Von: Volker Weber [mailto:users.myfaces@weber-oldenburg.de]
Gesendet: Mittwoch, 23. November 2005 15:47
An: MyFaces Discussion
Betreff: Re: {Filename?} German Umlauts with InputSuggestAjax,
Stylesheets and Speed of Code with InputSuggestAjax


Hi Andy,



andreas.mitter@magnasteyr.com wrote:
> Hi all!
> 
> I have now achieved that the InputSuggestAjax Component works, but I
> have still three questions and I would be terribly grateful, if somebody
> could answer me:
> 
> 1) How can I add stylesheet attributes for the List and the Inputfield.
> I have already tried to add a styleClass attribute, but it doesn't work
> like I want it.

No idea, i think this is not supported yet. Martin?

> 
> 2) I have Problems with German Umlauts like äöü .. They are display with
> a ? in the List... How can I change this? Is this done per purpose or is
> this a bug?

This is a bug i think, the response is not specialy encoded before send.

> 
> ole0.bmp
> 
> 
> 3) My code works, but I'm afraid that it will be too slow, if the list
> contains too much records. Perhaps some of you can tell me, if there
> could be problems with my code and what I can do better
> 
> (I get the List of Fnames from an Hibernate Query)
> 
>         public List getItems(String prefix, Integer maxSize) {
> 
>                 qh = (QueryHelper) FacesUtil.getManagedBean("queryHelper");
>                 Iterator it = qh.getFnames().iterator();
> 
>                 List li = new ArrayList();
> 
>                 try {
>                         while (it.hasNext()) {
> 
>                                 EtCompany company = (EtCompany) it.next();
> 
>                                 String fname =
> company.getCompany().toUpperCase();
>                                                        
>                                 if
> (fname.startsWith(prefix.toUpperCase())) {
>                                         if(li.size()<maxSize.intValue())
>                                         {
>                                         li.add(fname);
>                                         }
>                                 }
> 
>                         }
>                 }
>                 catch (Exception e) {
>                         e.printStackTrace();
>                 }
>                 return li;
>         }
> 

1. get the prefix.toUpperCase() out of the loop.
2. break the loop if maxSize is reached, don't continue looping without
any adding to result list:

  int max = maxSize.intValue() - 1;
  String upperCasePrefix = prefix.toUpperCase();

  while (it.hasNext()) {
    if (li.size() > max) {
      break;
    }
    EtCompany company = (EtCompany) it.next();
    String fname = company.getCompany().toUpperCase();

    if (fname.startsWith(upperCasePrefix)) {
      li.add(fname);
    }
  }

Regards,

  Volker



> Regards
> Andy
> 
-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.


______________________________________________________________________

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
your system manager.
 
This footnote also confirms that this email message has been swept
for the presence of computer viruses. 
______________________________________________________________________

Mime
View raw message