Data Endpoints
A vendor grid pulls JSON from a postback URL handled in the widget's
WebRequest event, and the same grid, next to it, gets its rows from a [WebMethod] it
calls and awaits. The Network card lists every request, response and call.
Nothing here is deployed anywhere; it is a plain Wisej.NET 4 project that runs on your machine.
Run it
cd "LearnWisej-Samples/Application Integration Course/Module 8/IntegrationLab"
dotnet run -f net10.0 --urls http://localhost:5078
Then open http://localhost:5078. (Visual Studio: open IntegrationLab.slnx, press F5.)
Requirements: .NET 10 SDK, the Wisej-4 4.1.0 NuGet package.
Build check: dotnet build -nologo -v q (warning CS7022 about Program.Main is expected).
What to try in the Work Orders page
| Action | What you should see |
|---|---|
| (page load) | both grids show 10 work orders starting at WO-1042, footer page 1 / 12; the Network card shows ⇄ HTTP [postback] GET …&action=load… → 200 application/json for the left grid and ← [webmethod] App.MainPage.GetWorkOrders {…} → → return PageResult {…} for the middle one |
| the grid's ‹ Prev / Next › buttons | each grid fetches the next page through its own transport (GET with page=2 / a WebMethod call with "page":2) |
| a click on a column header | sorts by that column (a second click toggles descending); sort is whitelisted on the server |
| a click on a row | a small toast names the selected work order (rowClick event) |
Failures surface as an error toast plus the vendor grid's red error row. To see the rejections,
re-send the grid's postback request from DevTools with action=delete or size=1000 (answered
400 {"error"}), or call App.MainPage.GetWorkOrdersAsync(1, 1000, "", false) in the console
(ArgumentException, Wisej popup, the Promise resolves null).
Where things live
IntegrationLab/
├─ Data/
│ ├─ WorkOrder.cs entity + the WorkOrderRow DTO mapping
│ ├─ WorkOrderService.cs 120 deterministic work orders, LoadPage(page, size, sort, desc)
│ ├─ PageRequest.cs the validation both endpoints share (bounds + sort whitelist)
│ └─ PageResult.cs wire shape {rows,total,page,size,sort,desc}
├─ Widgets/
│ ├─ GridWidget.cs postback path: WebRequest += grid_WebRequest
│ ├─ LookupWidget.cs WebMethod path: ExecuteGetWorkOrders, called by MainPage.GetWorkOrders
│ └─ GridEventArgs.cs event payload types (data, never behavior)
├─ wwwroot/
│ ├─ vendor-grid.js / .css the "third-party" VendorGrid library (Packages)
│ ├─ grid-init.js adapter: transport.read.url = this.getPostbackUrl() + "&action=load"
│ └─ lookup-init.js adapter: load(query) awaits App.MainPage.GetWorkOrdersAsync(...)
├─ docs/ the three deliverables
├─ MainPage.cs / .Designer.cs IntegrationLab — Work Orders (Application.MainPage, [WebMethod] GetWorkOrders)
├─ Program.cs Wisej.NET session entry point
└─ Startup.cs Kestrel host (app.UseWisej())