[WishList] Sort for fillselect + [Error] fillselect inside e

X-Application Version: 3.1.1
Tamino Version : 3.1.1
Platform : NT, Win2k, Solaris, …
WebContainer : Tomcat 3.3
JDK Version : 1.3.1

Hi,

It would be great that tag had a “sort” attribute in order to make easy the selection in a dropdown menu. Is there any workaround?


Another problem I have found:

When I nest inside (for “modify.jsp”):
<bdm:edit …><bdm:fillselect …>
<option …>

the tag do not return me well-formed xml, so I have the error:

<The element type “option” must be terminated by the matching end-tag “”.>

plus if I use spanish accutes, the error:

<The entity “aacute” was referenced, but not declared.>

(also a problem of not well-formed xml)

Once again: Is there any workaround?


Thanks in advance

Antonio Sotomayor
InforNet

[This message was edited by Harald Wolf on 27 Feb 2002 at 16:35.]

Hello,

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?

Regards, Harald

Hello,

First of all, thanks a lot for your answer. That’s a great product with an even better support!! :slight_smile:

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 :slight_smile: 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!!)

Regards,
Antonio
FillSelectTag.java (10.4 KB)

Hello Antonio,

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.

Regards, Harald

Hello Harald,

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:
<

ANGUILLA
(…)
Antártida</option
(…)
at com.softwareag.xtools.xapplication.jsptaglib.util.HtmlStringParser.(HtmlStringParser.java:99)
at com.softwareag.xtools.xapplication.jsptaglib.EditTag.processField(EditTag.java:49)
(…)
>
X-Application Version: 3.1.1
Tamino Version : 3.1.1
Platform : NT, Win2k, Solaris, …
WebContainer : Tomcat 3.3
JDK Version : 1.3.1
errorpage.htm (29.6 KB)

Hello Antonio,

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)

Regards, Harald

the remaining problems should now be solved with X-Application 3.1.2.

Sorting is not implemented yet, but is planned to be provided via contribution forum.

Regards, Harald