I'm very stupid :(

I solved the "in-place modification"... I put a wo:link instead of the wo:submit...

A part from that I'll wait for your hints...

Francesco



On 07/dic/08, at 15:24, Johann Werner wrote:

Hi Francesco,

Am 07.12.2008 um 14:54 schrieb Francesco Romano:

I can't modify it..

This is the code: (inside a form)

<wo:form>
        <fieldset>
        <wo:if condition = "$isTableLuogo">
        
<wo:loop list = "$ipnDisplayGroup.displayedObjects" item = "$aLuogo">
                        <p><wo:textfield value = 
"$aLuogo.nome"></wo:textfield></p>
                </wo:loop>
        
        </wo:if>
        <p><wo:link action="$addItem"> aggiungiElemento</wo:link></p>
        <p> <wo:link action = "$applyChanges">Applica</wo:link>
        <wo:link action = "$cancelChanges">Annulla</wo:link>
        <wo:link action = "$saveChanges">Salva</wo:link></p>
        </fieldset>
</wo:form>

If I try to edit the field, and press "Apply" the record is not updated...
What is wrong?

(This is the code for applyChanges)
        
        public WOActionResults applyChanges() {
                session().defaultEditingContext().saveChanges();
                return null;
        }


First let me note that using the defaultEditingContext for modifying and saving objects is A Bad Thing™. Looking at your page code it should work but... the problems that could cause your page not function as you expect are:

1. when you submit the changes is it possible that your condition isTableLuogo changes during the takeValuesFromRequest phase?

2. what is the editingContext of your ipnDisplayGroup? If it is not using the default editing context of course you wont do anything by calling saveChanges on the defaultEditingContext.

Another little tip you should return context().page() instead of null. What is the difference of your applyChanges() and saveChanges()?

jw


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to