Skip to Content
avatar image
Former Member

iCommand applet removing leading spaces from query output!!

Hi,

I am using an iCommand applet to retrieve data from a table. In some of the records we got values like ' xyz'(with initial spaces). But when I use document.appletname.getValue(1,1) to get value, then in that it is showing value as 'xyz' instead of ' xyz'. Please suggest what I need to do, if in case it is a bug. This is the product version 11.5.3 b66.

Thanks,

Ravi Kumar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Sep 09, 2008 at 10:56 AM

    Ravi,

    My first question is why would you have leading spaces? Generally that indicates data entry error.

    Second, do you have direct access to the database? If so I would run a query in the database to see if the query also strips out the spaces. It may not be MII causing your data change.

    Regards,

    Mike

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Ravi,

      I think I understand what you are doing. From what I am reading, it looks like it may be a an html issue. My previous link does not apply.

      This from [http://www.w3schools.com/html/html_primary.asp]

      "HTML will truncate the spaces in your text. Any number of spaces count as one. Some extra information: In HTML a new line counts as one space. "

      I suspect that it is trimming spaces where you don't want it too, including the leading spaces and trailing spaces. It should be pretty easy to test this directly in html.

      Since you are trying to use html to get around the unavailable CLOB handling, I suspect that you will need to do some more coding in javascript to handle the xml properly, but I am not sure what to suggest.

      Good luck,

      Mike

  • avatar image
    Former Member
    Sep 09, 2008 at 11:55 AM

    Ravi, the applets always trim leading and trailing spaces from string data types (whereas when you view the query output directly, it will not trim them). Instead of using the iCommand object, use an AJAX-based approach and execute the query using the Illuminator servlet, returning the data as XML. I also have a working prototype of an MII action that returns an MII dataset as a JSON object (which makes client side scripting much easier).

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Oh Ok. I thought it was bug. Then if trimming of spaces happens then it would cause lot of problems in my case.

      Could you just through some more light on how that url will look like. Because I don't know what parameters I need to use for building the url. I searched the help file. But I didn't get that.

      Once again thanks for that info.

      Ravi Kumar.

  • Sep 09, 2008 at 01:44 PM

    In your Oracle query if you add a single character at the beginning and end of your column value then the standard applet trimming will not give you a problem. Then after .getValue() from the iCommand just strip off these 2 characters.

    Regards,

    Jeremy

    Add comment
    10|10000 characters needed characters exceeded