Announcement

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

    view/download icons missing when using ViewFileItem

    SmartClient Version: v13.1p_2025-11-25/AllModules Development Only (built 2025-11-25)

    Hi, I’m trying to use ViewFileItem with the #upload example.
    After uploading a file successfully, and selecting the record in the grid, I would expect to see the preview and download icons in the viewForm, but they don’t show up.
    Here is the code I’m using:
    Code:
    <DataSource ID="mediaLibrary" serverType="sql" tableName="mediaLibrary">
        <fields>
            <field name="pk" type="sequence" hidden="true" primaryKey="true"/>
            <field name="title"/>
            <field name="image" type="binary" maxFileSize="5242880" required="true"/>
        </fields>
    </DataSource>
    Code:
    isc.DynamicForm.create({
        autoDraw: false,
        ID: "uploadForm", width: 300,
        dataSource: mediaLibrary,
        fields: [
            { name: "title", required: true },
            { name: "image", type: "imageFile", multiple:false, hint: "Maximum file size is 5 MiB" },
            { title: "Save", type: "button",
                click: function () {
                    this.form.saveData("if(dsResponse.status>=0) uploadForm.editNewRecord()");
                }
            }
        ]
    });
    
    isc.DynamicForm.create({
        autoDraw: false,
        ID: "viewForm",
        dataSource: mediaLibrary,
        width: "100%",
        fields: [
            { name: "title", title: "Title", type: "text", width: "*" },
            { name: "image", title: "image", editorType: "ViewFileItem", showFileInline:false,
                startRow: false, endRow: false
            }
        ]
    });
    
    isc.ListGrid.create({
        autoDraw: false,
        ID: "mediaListGrid",
        width: "100%",
        height: 224,
        autoFetchData: true,
        recordClick:"viewForm.editRecord(record)",
        dataSource: mediaLibrary
    });
    
    isc.VLayout.create({
        autoDraw: false,
        ID:"mainLayout",
        width:500,
        height:250,
        members:[viewForm, mediaListGrid]
    });
    
    isc.HStack.create({
        width:"100%",
        membersMargin: 10,
        members:[uploadForm, mainLayout]
    });
    Is there an issue or am I missing something?

    #2
    We just tested your sample code from the showcase and both icons are present and functioning correctly. Tested with various skins from the Flat and Enterprise series.

    For instance:
    Tahoe:
    Click image for larger version

Name:	ksnip_20251127-160150.png
Views:	0
Size:	15.5 KB
ID:	276747

    Stratus:

    Click image for larger version

Name:	ksnip_20251127-160234.png
Views:	0
Size:	15.8 KB
ID:	276748



    Please retest and let us know if there is anything else in your code that was not included in your post.

    Regards
    Isomorphic Software

    Comment


      #3
      Hi, I wasn’t referring to the icons on the grid records, but to the icons on the ViewFileItem inside the viewForm (above the grid).

      The documentation for ViewFileItem explicitly mentions them:
      Displays one of two UIs, according to the value of showFileInline. If showFileInline is false, this Item displays the View and Download icons and the filename. Otherwise, it streams the image-file and displays it inline.
      Last edited by claudiobosticco; Today, 12:46.

      Comment

      Working...
      X