Hi SmartClient team,
I'm experiencing an issue with binary field URL generation after upgrading from
SmartClient 12.1 to 14.1. The viewFile and downloadFile operations are generating
malformed URLs that don't work correctly.
Environment:
- SmartClient version: 14.1p_2025-07-26 (upgraded from 12.1)
- Server: Java with SmartClient Server Framework
- Application context path: /dev/
Problem Description:
In SmartClient 12.1, binary fields with type="binary" in ListGrids correctly generated
URLs like:
/dev/smartclient.form?isc_rpc=1&_transaction=<encoded-request>
After upgrading to SmartClient 14.1, the same binary fields now generate malformed URLs
like:
smartclient.form/filename.pdf?isc_rpc=1&_transaction=<encoded-request>
Issues:
1. Missing application context path (/dev/)
2. Filename incorrectly appended as path segment instead of using query parameters
3. Results in 404 errors since the URL doesn't resolve correctly
DataSource Configuration:
<DataSource ID="DepartmentFile" dataURL="smartclient.form">
<fields>
<field name="attachedFile" type="binary">
<title>Attached File</title>
</field>
<field name="attachedFile_filename" type="text">
<title>File Name</title>
</field>
</fields>
</DataSource>
Current Workaround:
I've implemented a temporary client-side fix that intercepts the generated HTML and
corrects the URLs:
isc.ListGrid.addProperties({
dataChanged: function() {
this.Super("dataChanged", arguments);
var self = this;
setTimeout(function() {
var gridElement = self.getHandle();
if (gridElement) {
var brokenLinks =
gridElement.querySelectorAll('img[onclick*="smartclient.form/"]');
for (var i = 0; i < brokenLinks.length; i++) {
var onclick = brokenLinks[i].getAttribute('onclick');
if (onclick) {
onclick = onclick.replace(/smartclient\.form\/[^?&]+(\?)/g,
'/dev/smartclient.form$1');
brokenLinks[i].setAttribute('onclick', onclick);
}
}
}
}, 100);
}
});
Questions:
1. Was this a deliberate change in SmartClient 14.1's binary field URL generation?
2. Is there a proper configuration setting to fix this without client-side workarounds?
3. Should the dataURL in datasource definitions now include the full context path?
Additional Context:
- Normal fetch/add/update operations work correctly with the same
dataURL="smartclient.form"
- Only viewFile/downloadFile operations are affected
- URL resolution methods like isc.Page.getURL("smartclient.form") return the relative
path without context resolution
Any guidance on the correct way to handle this in SmartClient 14.1 would be greatly
appreciated.
Thanks!
I'm experiencing an issue with binary field URL generation after upgrading from
SmartClient 12.1 to 14.1. The viewFile and downloadFile operations are generating
malformed URLs that don't work correctly.
Environment:
- SmartClient version: 14.1p_2025-07-26 (upgraded from 12.1)
- Server: Java with SmartClient Server Framework
- Application context path: /dev/
Problem Description:
In SmartClient 12.1, binary fields with type="binary" in ListGrids correctly generated
URLs like:
/dev/smartclient.form?isc_rpc=1&_transaction=<encoded-request>
After upgrading to SmartClient 14.1, the same binary fields now generate malformed URLs
like:
smartclient.form/filename.pdf?isc_rpc=1&_transaction=<encoded-request>
Issues:
1. Missing application context path (/dev/)
2. Filename incorrectly appended as path segment instead of using query parameters
3. Results in 404 errors since the URL doesn't resolve correctly
DataSource Configuration:
<DataSource ID="DepartmentFile" dataURL="smartclient.form">
<fields>
<field name="attachedFile" type="binary">
<title>Attached File</title>
</field>
<field name="attachedFile_filename" type="text">
<title>File Name</title>
</field>
</fields>
</DataSource>
Current Workaround:
I've implemented a temporary client-side fix that intercepts the generated HTML and
corrects the URLs:
isc.ListGrid.addProperties({
dataChanged: function() {
this.Super("dataChanged", arguments);
var self = this;
setTimeout(function() {
var gridElement = self.getHandle();
if (gridElement) {
var brokenLinks =
gridElement.querySelectorAll('img[onclick*="smartclient.form/"]');
for (var i = 0; i < brokenLinks.length; i++) {
var onclick = brokenLinks[i].getAttribute('onclick');
if (onclick) {
onclick = onclick.replace(/smartclient\.form\/[^?&]+(\?)/g,
'/dev/smartclient.form$1');
brokenLinks[i].setAttribute('onclick', onclick);
}
}
}
}, 100);
}
});
Questions:
1. Was this a deliberate change in SmartClient 14.1's binary field URL generation?
2. Is there a proper configuration setting to fix this without client-side workarounds?
3. Should the dataURL in datasource definitions now include the full context path?
Additional Context:
- Normal fetch/add/update operations work correctly with the same
dataURL="smartclient.form"
- Only viewFile/downloadFile operations are affected
- URL resolution methods like isc.Page.getURL("smartclient.form") return the relative
path without context resolution
Any guidance on the correct way to handle this in SmartClient 14.1 would be greatly
appreciated.
Thanks!
Comment