Wallaby Application Framework by FreshX

CouchDB-based blog-engine for nodejs released!

Posted Sat, 26 Jan 2013 18:02:15 GMT nodejs CouchDB

We just released the first public beta version of our blog software on Github. It is based on CouchDB, NodeJs and Elasticsearch.

Feel free to try it out and report bugs and feature requests on Github!

Getting started 02

Posted Wed, 16 Jan 2013 14:16:25 GMT first steps wallaby

The next step: editing and saving a document

First we add three more action-buttons to our app using the Qt Designer.

EDIT, SAVE and CANCEL

wlby --designer -a firstapp

As in the first tutorial we save and quit the designer and run our app by wlby command:

wlby -a firstapp

Open the Inspector by

CMD-ALT-O

As explained in the first tutorial we added the EditDocument Peer to load the requested document into the room. However its main purpose is the document editing logic which we will use now.

We add the new actionButtons into the "firstRoom" and again we add a triggered pillow to each actionButton.

  • EditButton: EditDocument.In.Edit
  • SaveButton: EditDocument.In.Save
  • CancelButton: EditDocument.In.Rollback

By switching off and on the overlay mode the overlays are updated and all widgets appear in the same room (color)... just to check.

Basically we´re done. We can use the edit, cancel and save button as we´re used to. But wouldn´t it be cool... if the buttons would be enabled or disabled due to the documents state? Therefor a enable pillow is thrown by the EnableDocument peer which we need to add into the "firstRoom". The state is promoted as payload (feathers) of the enable pillow. Following states can be adopted:

  • New
  • Edit
  • Undef
  • View
  • Dirty

These states are taken into consideration by the widgets enable-logic. The enable logic is located below the triggered pillow settings in the Wallaby Inspector.

The actionButtons should be enabled in the following states:

  • loadButton: View, Undef and Edit
  • editButton: View
  • saveButton: Dirty and New
  • cancelButton: Dirty and New

To emit the state while editing, the throwWhileEditing parameter of the plainTextEdit widget should be set to True.

Fork me on GitHub

Last posts:

Archive:

Categories: