Re: How to use WODisplayGroup
Re: How to use WODisplayGroup
- Subject: Re: How to use WODisplayGroup
- From: Ramsey Lee Gurley <email@hidden>
- Date: Sat, 06 Dec 2008 14:30:36 -0500
On Dec 6, 2008, at 9:11 AM, Francesco Romano wrote:
That could be an idea...
But... in this way a displayGroup is very similar to a simple
array.. What are the advantages?
Display groups have batching, qualifiers, auxiliary qualifiers, sort
orderings, and datasources. The display group does all the heavy
lifting for your view code. If you were to just use arrays, you'd end
up reinventing most of the display group. Combine display groups with
a batch navigation bar for more awesomeness :-)
By the way... a very simple request...
I want to bind a record attribute with a textfield.
I can do for a "read-only" page.
But is there a way to have a bidirectional bound?
I mean...this is the html
<wo:WORepetition list="$ipnDisplayGroup.displayedObjects"
item="$luogo">
<p><wo:textfield value = "$luogo.nome"></wo:textfield></p>
</wo:WORepetition>
</wo:if>
If I edit the text in the textfield how can this modify the item in
the displayGroup (so that the only thing to do is to call
saveChanges() on the editing context..
Yep. That's pretty much what it does. ORM... isn't it great? :-) Of
course, if you want to modify the object, you'll need to drop that
text field in a form element at the very least. I really like
w3schools page of html elements by function.
http://www.w3schools.com/TAGS/ref_byfunc.asp
Since a wo:form maps to the form element, your html should probably
look something like:
<wo:form>
<fieldset>
<legend>Hi I'm an informative legend!</legend>
<wo:loop> <!-- wo:loop is a shortcut for WORepetition -->
<label for="id1">I'm a textfield label!</label><wo:textfield
id="id1"/>
<!-- or -->
<label>I'm a label too<wo:textfield/></label>
</wo:loop>
<wo:submit action="$submitAction">
</fieldset>
</wo:form>
For other shortcuts... or to create your own, check your eclipse
preferences:

And, one last shortcut that might not be obvious is command clicking.
When you define action="$submitAction" and you get that red underline
telling you it isn't defined in your java file, just command-click it
and it will act like a hyperlink that creates the method and takes you
to it in your java file. Command clicks work in your java source too.
Ramsey
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden