Chris,

Hmmm, I'm always tossing up between keeping the examples simple and making them 
complete. Your request is pretty compelling so I'll consider it for the next 
release. In the meantime, here's what I use in simple entities...

        private java.sql.Timestamp createdAt;
        private java.sql.Timestamp modifiedAt;

        @PrePersist
        public void prePersist() throws ValidationException {
                validate();
                createdAt = new java.sql.Timestamp(System.currentTimeMillis());
                modifiedAt = createdAt;
        }

        @PreUpdate
        public void preUpdate() throws ValidationException {
                validate();
                modifiedAt = new java.sql.Timestamp(System.currentTimeMillis());
        }

instead of...

        @PrePersist
        @PreUpdate
        public void validate() throws ValidationException {
                // etc...
        }

For entities that have more complex state changes than just create, change, and 
delete this isn't enough, but that's another story.

HTH,

Geoff

On 14/07/2010, at 10:47 PM, Chris Mylonas wrote:

> Geoff that's a great example of some more advanced layout/theme possibilities.
> 
> Sorry to hijack the thread somewhat,
> Any chance of adding to jumpstart a "Date added" and/or "Last modified" 
> section to each example?
> 
> 
> Cheers
> Chris
> 
> On 14/07/2010, at 7:01 AM, Geoff Callender wrote:
> 
>> Can't stop to consider the difference right now (maybe later today) but you 
>> can see it working in this example:
>> 
>>      
>> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajaxcomponentscrud
>> 
>> HTH,
>> 
>> Geoff
>> 
>> On 13/07/2010, at 10:04 PM, Paul Stanton wrote:
>> 
>>> thanks geoff,
>>> 
>>> your last post where you put the confirm mixin on a <span> within the <a> 
>>> is interesting .. wouldn't that be rendered as the equivalent of:
>>> 
>>> <a ....><span onclick="return confirm('?');">text</span></a>
>>> 
>>> or at least the prototypesque version of this:
>>> 
>>> <a ....><span id="spanId">text</span></a>
>>> Event.observe($("spanId"), 'click', function(e){if (!confirm('?')) 
>>> e.stop();});
>>> 
>>> i have tried both of these approaches but neither cancel the event on the 
>>> <a>... if yours works what is the fundamental difference?
>>> 
>>> regards, p.
>>> 
>>> Geoff Callender wrote:
>>>> http://tapestry-users.832.n2.nabble.com/Confirm-mixin-won-t-cancel-when-in-zone-td5048950.html#a5048950
>>>> 
>>>> On 13/07/2010, at 12:31 PM, Paul Stanton wrote:
>>>> 
>>>> 
>>>>> Hi all,
>>>>> 
>>>>> I was hoping to be able to use a simple js confirm in order to 
>>>>> (conditionally) cancel the callback from an async event link:
>>>>> 
>>>>> <a t:type="eventLink" event="DeleteRecord" context="record.id" 
>>>>> zone="myZone" onclick="return confirm('sure?');">delete</a>
>>>>> 
>>>>> Unfortunately, even when 'Cancel' is clicked, the callback is executed.
>>>>> 
>>>>> What is the simplest way to add one stage of logic to this process?
>>>>> 
>>>>> Thanks, Paul.
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>> 
>>>> 
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 

Reply via email to