Sort in fillselect Some tips how to implement sorting in fillselect:
add an parameter in the tld (tag library description) at the fillselect tag:
sort false
The tld file is located in you yourdir/WEB-INF/jsp
in class com.softwareag.xtools.xapplication.jsptaglib.FillSelectTag add the parameter sort similar to the parameter distinct (member variable, setSort()-method, evaluation of the parameter).
implement the sort at the same location where distinct parameter is evaluated (look for “if (bDistinct==true)”
call build.cmd at the xapplication installation directory and copy the generated ./lib/debug/xapplication.jar to yourdir/WEB-INF/lib
Hints how to use fillselect in an edit field in Post “Fill combobx from another schema” you can find some hints how to fill a drop down box with fillselect.
Note, that fillselect iterates through the complete result set of the query.
spanish accutes Could you give some more information about this problem? Do you use this character in the query or content or schema?
First of all, thanks a lot for your answer. That’s a great product with an even better support!!
Concerning my questions:
Sort in fillselect I have followed your advices and it works fine. I attach to this reply my new code of FillSelectTag.java. As Java programming is only one of my 158.235 daily duties I really appreciate your censorship/blessing about the changes. (I have use TreeMap for the sorting, so JDK1.2 is needed. I hope that won´t be a problem)
Hints how to use fillselect in an edit field The easy way I have found to avoid the non well-formed xml is to substitute the HTML serializer for a XHTML serializer. So in HtmlStringParser.java I have change:
public String toHtml() throws IOException { StringWriter sw=new StringWriter(); //new HTMLSerializer(sw, new OutputFormat()).serialize(root); new XHTMLSerializer(sw, new OutputFormat()).serialize(root); //return sw.toString().substring(110); return sw.toString().substring(117); }
That solves partially (see later) the problem, but I am not sure if collateral effects will arise.
spanish accutes The offending characters is in the content:
BELGIUM Bélgica BE BEL 056
when I do: <bdm:fillselect module=“bdProp” schema=“country” value=“/country/code” text=“/country/name[2]” sort=“true”>
“Bélgica” return as “Bélgica” with the error: <The entity “eacute” was referenced, but not declared.>
([WishList]: if we could use: text=“/country/name[@lang=‘es’]” would be great!!)
spanish characters did you check the mail for i18n of applications I18N fix for X-Application? I18n issues comprise also non standard ascii characters. Could you give more information about this error (e.g. a complete stacktrace)?
Wishlist we´ve included your wishes to the wishlist. X-Application 3.1.2 (coming soon) will not contain all wishes but we will provide an improved version of fillselect in the contribution forum as soon as possible after the 3.1.2 release.
spanish characters > did you check the mail for i18n of applications
yes, I applied the patch and change the charset to UTF-8
> Could you give more information about this error (e.g. a complete stacktrace)?
I attach here the complete error page and I write down a few lines of the error.
Regards, Antonio
------------------------------------------------- !Error! An error occurred in the application program. Please report the following problem to your webmaster. Exception is: < X-Application Runtime Exception > Exception error message: <The entity “aacute” was referenced, but not declared.> content in question is: <
I´ve tried something similar with the upcoming version of X-Application and had no problems.
We have refactored that area for the next release so my assumption is that it is probably caused by the (X)HTMLSerializer that is no longer used in our current development version. I assume that the serializer replaces these characters by entity references.
My proposals now are: - serialize the output by “hand” - or avoid (spanish) accents for now and wait for our next release (coming really soon)