How do I create Wt widgets for a new entity?
Widget layout, signal conventions, and file locations are in Wt entity patterns. The codegen-add-wt-entity skill drives this process.
Question
How do I add Wt UI components for a new entity in ores.wt.service?
Answer
Phase 1 — list widget (PR: [wt] Add {Entity} list widget):
- Define
{entity}_rowstruct and{entity}_list_widgetclass ininclude/ores.wt.service/app/{entity}_list_widget.hpp. - Implement the widget (
setup_toolbar,setup_table,populate_table, signals) insrc/app/{entity}_list_widget.cpp. - Build:
cmake --build --preset linux-clang-debug-ninja --target ores.wt.service.lib.
Phase 2 — detail dialog (PR: [wt] Add {Entity} dialog):
- Create
{entity}_dialog.hpp/.cppwith the detail form, field editors, andsave_requestedsignal. - Build and verify.
Phase 3 — application integration (PR: [wt] Integrate {Entity} into application):
- Add list widget and service member to the page/controller class.
- Connect signals: add → open dialog; edit → populate dialog; save → call service; delete → confirm + call service.
- Register in the application's navigation setup.
- Build and exercise in the browser.
Tested by
Start ores.wt and navigate to the entity page; verify list loads,
add dialog opens, edits persist, and deletes work.
See also
- Wt entity patterns — widget layout, signal conventions, file locations.
- codegen-add-wt-entity — skill that drives this workflow.
- Entity lifecycle — layer ordering overview.