Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • iseries database character fields have trailing spaces

    Hello,

    We are accessing an iSeries database. It is good to see support for that - thank you. I retrieve some values from a record and show them in a DynamicForm. This is all good. The only odd thing is that you can tell that the character fields have trailing spaces up to the length defined for that field. I wonder if there is a setting to enable them to be stripped? Perhaps there could be a setting?

    Thanks very much.

  • #2
    Hi maw,

    I'm pretty sure this is normal behavior and not related to SmartGWT - in Oracle this would be the difference between CHAR and VARCHAR. Can you check if this differentiation also exists for iSeries?
    Nevertheless you could always use a customSelectExpression="trim(yourfield)". You'll then also need a customUpdateExpression of customUpdateExpression="$yourField" in order to be able to also edit the field.

    Best regards
    Blama

    Comment


    • #3
      Hi @Blama,

      Thanks for your reply. You are right that this is normal behavior for iSeries DB and nothing wrong with SmartGwt. Thanks for the hint in improving the situation. However we do have a great many fields and I was rather hoping for a built-in method of stripping the trailing spaces.

      Thanks again,
      Mark.

      Comment


      • #4
        This should be easy with RegExp search & replace, but you could also create your own type like I do here - you need to load the type with your DataSourceLoader-call at the very beginning.
        Then it's just an easy search & replace without RegExp and less complex. Still not built-in, but very easy to do.

        Best regards
        Blama

        Comment


        • #5
          Thanks for that I will look into it. I have yet to find a use for retaining the trailing spaces and can only think it would only be needed in exceptional cases. Oh well, perhaps I will add it to the wish list.

          Thanks again, Mark.

          Comment

          Working...
          X