Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ Full details in [WEB/codeX PKI Manager](https://www.webcodex.de/index.html?menu=

## :bulb: Examples

Try 15 live examples (after local docker containers have been started):
Try 16 live examples (after local docker containers have been started):

```
http://x0-app.x0.localnet/python/Index.py?appid=example1
...
http://x0-app.x0.localnet/python/Index.py?appid=example15
http://x0-app.x0.localnet/python/Index.py?appid=example16
```

Most examples now include a descriptive video: [./example/README.md](./example/README.md).
Expand Down
1 change: 1 addition & 0 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ get started quickly.
- [net_messages](https://github.com/WEBcodeX1/x0/tree/main/example/net_messages) - Network messaging between sessions
- [object_instances](https://github.com/WEBcodeX1/x0/tree/main/example/object_instances) - Dynamic object instancing (experimental)
- [open_close_container](https://github.com/WEBcodeX1/x0/tree/main/example/open_close_container) - Collapsible container sections
- [object_editor](https://github.com/WEBcodeX1/x0/tree/main/example/object_editor) - In-browser object/screen editor with runtime drag & drop
- [screen_overlay](https://github.com/WEBcodeX1/x0/tree/main/example/screen_overlay) - Modal overlay functionality
- [tree_simple](https://github.com/WEBcodeX1/x0/tree/main/example/tree_simple) - Hierarchical tree structures with navigation

Expand Down
26 changes: 26 additions & 0 deletions example/object_editor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Example #16 (Object Editor)

This example provides an in-browser x0 editor application with runtime object and screen editing.

## URL

Open URL: `http://x0-app.x0.localnet/python/Index.py?appid=example16`

## Features

- Main object bar with:
- **screen section** (add, remove, switch screen)
- **system-object section** (all registered x0 system objects)
- Object properties form with editable JSON attributes.
- Workspace/canvas for drag and drop object placement.
- Drag and drop for:
- adding new objects from system-object section
- reparenting existing connected objects
- Runtime updates of:
- `sysFactory.DataObject.XMLRPCResultData` (object.json structure)
- `sysFactory.DataSkeleton.XMLRPCResultData` (skeleton.json structure)

## Notes

- Changes are runtime/in-memory only.
- No backend persistence endpoint is included in this example.
11 changes: 11 additions & 0 deletions example/object_editor/sql/sys-config.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
INSERT INTO system.config (app_id, config_group, "value") VALUES ('example16', 'index_title', 'x0 Example Object Editor');
INSERT INTO system.config (app_id, config_group, "value") VALUES ('example16', 'debug_level', '10');
INSERT INTO system.config (app_id, config_group, "value") VALUES ('example16', 'display_language', 'en');
INSERT INTO system.config (app_id, config_group, "value") VALUES ('example16', 'default_screen', 'Screen1');
INSERT INTO system.config (app_id, config_group, "value") VALUES ('example16', 'parent_window_url', 'null');
INSERT INTO system.config (app_id, config_group, "value") VALUES ('example16', 'subdir', '/examples/object_editor');
INSERT INTO system.config (app_id, config_group, "value") VALUES ('example16', 'config_file_menu', 'menu.json');
INSERT INTO system.config (app_id, config_group, "value") VALUES ('example16', 'config_file_object', 'object.json');
INSERT INTO system.config (app_id, config_group, "value") VALUES ('example16', 'config_file_skeleton', 'skeleton.json');
INSERT INTO system.config (app_id, config_group, "value") VALUES ('example16', 'template_file', 'examples/object_editor/sysObjObjectEditor.js');
INSERT INTO system.config (app_id, config_group, "value") VALUES ('example16', 'setup_class', "['ObjectEditor']=sysObjObjectEditor");
1 change: 1 addition & 0 deletions example/object_editor/static/menu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
8 changes: 8 additions & 0 deletions example/object_editor/static/object.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ObjectEditor1": {
"Type": "ObjectEditor",
"Attributes": {
"Style": "container-fluid py-3"
}
}
}
9 changes: 9 additions & 0 deletions example/object_editor/static/skeleton.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Screen1": [
{
"ObjectEditor1": {
"RefID": "Screen1"
}
}
]
}
Loading