Announcement

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

    Problem display image in a ListGrid

    I have a grid that shows different images in a column, status0 (gray ball), status1 (green ball), status2 (yellow ball), status3 (red ball), like a trafficlight. The image name is assembled by:
    • prefix: setImageURLPrefix("trafficlight/status")
    • value: 0 or 1 or 2 or 3
    • suffix: setImageURLSuffix(".png")
    The problem:

    Any of 1, 2, 3 are displayed properly, but 0 not. Even the image is in the right place into the server.
    Normal behavior (status1.png): Click image for larger version

Name:	2017-02-02 08_08_15-SCA - Shipping and Customs Assistance.png
Views:	59
Size:	5.0 KB
ID:	242587


    My concern (should be status0.png): Click image for larger version

Name:	2017-02-02 08_09_15-SCA - Shipping and Customs Assistance.png
Views:	53
Size:	5.5 KB
ID:	242588


    IMPORTANT - None image tag has been assembled for the second one.
    Any idea what should be the problem?

    Thanks in advance and best regards,

    Vitor Eduardo
    Last edited by vitor.eduardods; 2 Feb 2017, 02:35.

    #2
    Hi vitor.eduardods,

    is it really "0" or a DB Null?
    Also, if you inspect the Cell with your Browser's inspect tool, can you see that there is no img-tag in the latter case?

    Best regards
    Blama

    Comment


      #3
      Hk Blama, thank for answesring.

      This is the snippet of SQL code that feeds that column:
      Code:
      COALESCE((SELECT STATUS FROM "+getSchema()+"STOPLIGHT_SCA_PLAUSIBILITY PL WHERE PL.PLAUSIBILITY_ID="+Constants.PLAUSIBILITY_PART_AGREEMENT_MAPPING+" AND PL.SENDNR=TK.SENDNR AND PL.JAHR=TK.IYEAR ), CAST(0 AS SMALLINT)) AS COMPLETELY
      As I said before, no img-tag was placed in the cell.

      Comment


        #4
        Hi vitor.eduardods

        well COALESCE looks like you wont be getting any NULL values.
        Can you see that there really is the "0" returned as value for the field in the servers response in Developer Tool's RPC Tab?

        If so, I have no idea other than that there is also sth. else going on? ValueMap for the field? Some extra formatter?

        Best regards
        Blama

        Comment


          #5
          Nothing different for this field let me show you:
          Code:
                  ListGridField vollstandigField = new ListGridField("completelyStatus", scatext.fields_vollstandig());
                  vollstandigField.setType(ListGridFieldType.IMAGE);
                  vollstandigField.setAlign(Alignment.CENTER);
                  vollstandigField.setImageURLPrefix("trafficlight/status");
                  vollstandigField.setImageURLSuffix(".png");
                  vollstandigField.setCanEdit(false);

          Comment


            #6
            Hi vitor.eduardods

            can you see that there really is the "0" returned as value for the field in the servers response in Developer Tool's RPC Tab?

            Best regards
            Blama

            Comment


              #7
              Yes could, but I just fixed the problem by change the data type for the column value, from int to String. Everything works fine now.

              Thank you.

              Comment

              Working...
              X