I'm slowly building up a pretty nice framework to handle the UI and
form/object graph processing functionality. For example, in the
screenshot you can see there is only one save button so that all of
the actions related to editing the customer details, creating/editing
authorizations, creating/editing trip legs, etc is all buffered and
only sent to the server when you hit save. This has an interesting
side affect for Delete. When you delete a record the record row
changes to show it as deleted but it's still there and allow the user
to undo, thus preventing the annoying "Are you sure you want to
delete?" question. When all changes are done, finally hitting Save
will send the delete operation (and any other changes) to the server.
This is truly starting to look like a full featured Fat Client app.
When I'm closer to done with this project I'm going to start working
on an Android UI framework so that I can write Android looking apps
using pyjamas and render them with WebView.
I realized that I gave you guys most of the important pieces to
replicate the form yourselves except for the Field class, so here it
is, enjoy!
class Field(Widget):
def __init__(self, desc, widget):
self.setElement(DOM.createDiv())
Widget.__init__(self, StyleName="field")
label = DOM.createLabel()
DOM.setInnerText(label, desc)
DOM.appendChild(self.getElement(), label)
DOM.appendChild(self.getElement(), widget.getElement())
self.widget = widget
def setValue(self, value):
if value is None:
self.widget.setText("")
else:
self.widget.setText(value)
self.originalValue = value
def getOriginalValue(self):
return self.originalValue
def getValue(self):
return self.widget.getText()
def isChanged(self):
if self.getOriginalValue() != self.getValue():
return True
return False
On Mon, Jan 23, 2012 at 2:48 PM, C Anthony Risinger <[email protected]> wrote:
> On Mon, Jan 23, 2012 at 7:40 AM, Lex Berezhny <[email protected]> wrote:
>>
>> I've attached a screenshot of an app that has solutions for both of
>> the things mentioned above: instructions underneath search box
>> (instead of inside) and all input boxes have field names inside them
>> on upper right hand corner.
>
> nice, that looks great :-) reminds me of a real paper form.
>
> i agree w/all the points about placeholders ... clicking on a field
> and forgetting what the instructions were happens more often that
> you'd think ... for some of us at least.
>
> relative parent + absolute child is a wicked combo ... and the basis
> of the GWT2.x layout system. i see too many Npx in that CSS file tho
> ... em and % will go much further, albeit at slightly more work in
> some places (and less in others) ...
>
> ... it's relatively little known that CSS is, in fact, awesome :-)
> fewer impl variations/bugs, and more constructs like
> variables/placeholders/etc, and it'll be superb. it's rapidly moving
> into the desktop/general-layout space (gnome3/windows8/??) so we'll
> see what happens.
>
> --
>
> C Anthony