Browser Constraints
This chapter covers browser constraints and limitations when working with DWC applications.
Overview
The browser environment has certain constraints that differ from traditional GUI applications. Understanding these constraints helps you design better DWC applications.
Handling Client Files
The browser does not support direct access to client files. This section describes how to implement file uploads and downloads with DWC.

File Uploads
rem Create a file chooser for uploads
fileChooser! = wnd!.addFileChooser()
fileChooser!.setCallback(BBjFileChooser.ON_FILE_SELECTED, "onFileSelected")
File Downloads
rem Trigger a file download
web! = BBjAPI().getWebManager()
web!.download(serverFilePath$, clientFileName$)
Printing and Print Preview
The browser does not offer direct access to printers. Modern webapp printing is typically done by:
- Displaying the printout in the client
- Using the browser's print selection
Printing Options
| Method | Description |
|---|---|
SYSPRINT | Server-side printing |
BBjPrinter | BBj's printer interface |
Jasper Reports | Generate PDF reports for download |
Print Preview
rem Generate a PDF for preview
rem Then download or display in browser
web!.download(pdfPath$, "report.pdf")
Security Constraints
Browsers enforce security policies that affect DWC apps:
- Same-Origin Policy - Restricts cross-domain requests
- HTTPS Requirements - Some features require secure connections
- Cookie Limitations - Third-party cookie restrictions
Local Storage
For storing client-side data:
rem Store data in browser
web!.setSessionStorage("key", "value")
rem Retrieve data
value$ = web!.getSessionStorage("key")
Clipboard Access
Clipboard operations require user interaction:
rem Copy to clipboard (requires user gesture)
web!.copyToClipboard(text$)
Best Practices
- Design for the web - Don't expect desktop behaviors
- Handle offline scenarios - Consider network interruptions
- Use progressive enhancement - Basic functionality should work everywhere
- Test on multiple browsers - Chrome, Firefox, Edge, Safari