You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by WarnerJan Veldhuis <wa...@qprcostcontrol.com> on 2009/04/20 15:46:24 UTC

FormTable and Submit

Hello,

I am having a fight with the FormTable and theSubmit that is on it. This
is the code I am using in my class that extends FormTable:

public ObjectFormTable () {
<snip>
   setupColumns();//adding FieldColumns here
   getForm().add( new Submit("save", getMessage("button_submit"), this,
"onSave"));
<snip>
}

I also have the method onSave:
public boolean onSave() {
<snip>
}

When I set a breakpoint in onSave, it's not hit. Any other breakpoint
works so I can't blame the debugger... Why does the Submit button not
trigger the onSave method?? Do I need to do anything special when using
a FormTable?

Cheers,

WarnerJan Veldhuis




Re: FormTable and Submit

Posted by Malcolm Edgar <ma...@gmail.com>.
Hi Warner,

This look OK, I would recommend putting a break point on the Form
onProcess() method.  You should see it being executed when the form is
submitted, and it should process the Submit button which will detect
the click event and register an actionEvent to be fired.

regards Malcolm Edgar

On Wed, Apr 22, 2009 at 11:05 PM, WarnerJan Veldhuis
<wa...@qprcostcontrol.com> wrote:
> Thanks for looking into this.
>
> Its superclass AbstractFormTable inherits from FormTable and contains no
> Click specific code, only some shared application specific logic.
>
>
> public class ObjectFormTable extends AbstractFormTable {
>     private static final Logger log =
> Logger.getLogger(ObjectFormTable.class);
>
>     private List<AttributeDefinitionVO> attributes;
>     private List<ModelObjectVO> objects;
>
>     public ObjectFormTable(String name, MetaLayerVO metaLayer,
> Set<ModelObjectVO> objects, AttributeDefinitionVO[] attributes, boolean
> editable) {
>         super(name, metaLayer, editable);
>         this.objects = new ArrayList<ModelObjectVO>(objects);
>         this.attributes = Arrays.asList(attributes);
>         setClass("object_view");
>
>         setupColumns();
>         getForm().add( new HiddenField("metalayersymbol",
> metaLayer.getSymbol()));
>
>         getForm().setButtonAlign("right");
>         getForm().setButtonStyle("buttons");
>         getForm().add( new Submit("save", getMessage("button_submit"), this,
> "onSave"));
>
>     }
>
>     protected void setupColumns() {
>         int displayOptions = getDisplayOptions();
>
>         MetaModelVO metaModelVO = getMetaModel(getCostModelId());
>
>         FieldColumn nameC = new ObjectAttributeColumn(metaModelVO,
> metaLayer, SystemAttributeDefinitionHelper.NAME, false);
>         FieldColumn symbolC = new ObjectAttributeColumn(metaModelVO,
> metaLayer, SystemAttributeDefinitionHelper.SYMBOL, false);
>         switch (displayOptions) {
>             case AppConstants.OBJECT_DISPLAY_OPTIONS_NAME_ONLY_INT:
>                 addColumn(nameC);
>                 break;
>             case AppConstants.OBJECT_DISPLAY_OPTIONS_NAME_SYMBOL_INT:
>                 addColumn(nameC);
>                 addColumn(symbolC);
>                 break;
>             case AppConstants.OBJECT_DISPLAY_OPTIONS_SYMBOL_ONLY_INT:
>                 addColumn(symbolC);
>                 break;
>             case AppConstants.OBJECT_DISPLAY_OPTIONS_SYMBOL_NAME_INT:
>                 addColumn(symbolC);
>                 addColumn(nameC);
>                 break;
>         }
>
>         for (AttributeDefinitionVO attribute : attributes) {
>             AbstractAttributeColumn c = new
> ObjectAttributeColumn(metaModelVO, metaLayer, attribute, isEditable());
>             if (attribute.isNumeric()) {
>                 c.setDataStyle("text-align", "right");
>             }
>             addColumn(c);
>         }
>
>     }
>
>     public List getRowList() {
>         return objects;
>     }
>
>
>
>     public boolean onSave() {
>         log.info("onSave");
>         return false;
>     }
>
>
> }
>
>
>
>
>
>
>
>
>
>
>
>
> On Wed, 2009-04-22 at 22:51 +1000, Malcolm Edgar wrote:
>
> OK this looks fine, but not listener invoked. Can you post your
> ObjectFormTable source
>
> On Wed, Apr 22, 2009 at 10:50 PM, WarnerJan Veldhuis
> <wa...@qprcostcontrol.com> wrote:
>> Ok, then here you go, the entire logging:
>>
>> In case you wonder, I *do* have 9 forms on the screen, names form0 to
>> form9. Each form is a new instance of a FormTable, each with a new
>> instance of a save(submit)-button
>>
>>
>> [Click] [debug] POST http://10.0.0.100:18080/WebClientV2/editObjects.htm
>> [Click] [trace]    request param: SA_13_0=-
>> [Click] [trace]    request param: SA_13_1=-
>> [Click] [trace]    request param: SA_13_2=-
>> [Click] [trace]    request param: SA_13_3=-
>> [Click] [trace]    request param: SA_13_4=-
>> [Click] [trace]    request param: SA_13_5=-
>> [Click] [trace]    request param: SA_15_0=0,00
>> [Click] [trace]    request param: SA_15_1=0,00
>> [Click] [trace]    request param: SA_15_2=15.000,00
>> [Click] [trace]    request param: SA_15_3=7.000,00
>> [Click] [trace]    request param: SA_15_4=8.000,00
>> [Click] [trace]    request param: SA_15_5=7.500,00
>> [Click] [trace]    request param: SA_25_0=0,00
>> [Click] [trace]    request param: SA_25_1=0,00
>> [Click] [trace]    request param: SA_25_2=0,00
>> [Click] [trace]    request param: SA_25_3=0,00
>> [Click] [trace]    request param: SA_25_4=0,00
>> [Click] [trace]    request param: SA_25_5=0,00
>> [Click] [trace]    request param: ascending=
>> [Click] [trace]    request param: column=
>> [Click] [trace]    request param: form_name=form6_form
>> [Click] [trace]    request param: metalayersymbol=10
>> [Click] [trace]    request param: page=
>> [Click] [trace]    request param: save=Save
>> [Click] [trace]    invoked: EditObjectsPage.<<init>>
>> [Click] [trace]    invoked: EditObjectsPage.onSecurityCheck() : true
>> [Click] [trace]    invoked: EditObjectsPage.onInit()
>> [Click] [trace]    invoked: 'logoffLink' ActionLink.onInit()
>> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
>> [Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
>> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
>> true
>> [Click] [trace]    invoked: Control listeners : true
>> [Click] [trace]    invoked: EditObjectsPage.onPost()
>> [Click] [trace]    invoked: EditObjectsPage.onRender()
>> [Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
>> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
>> [Click] [trace]    invoked: 'form0' ObjectFormTable.onRender()
>> [Click] [trace]    invoked: 'form1' ObjectFormTable.onRender()
>> [Click] [trace]    invoked: 'form2' ObjectFormTable.onRender()
>> [Click] [trace]    invoked: 'form3' ObjectFormTable.onRender()
>> [Click] [trace]    invoked: 'form4' ObjectFormTable.onRender()
>> [Click] [trace]    invoked: 'form5' ObjectFormTable.onRender()
>> [Click] [trace]    invoked: 'form6' ObjectFormTable.onRender()
>> [Click] [trace]    invoked: 'form7' ObjectFormTable.onRender()
>> [Click] [trace]    invoked: 'form8' ObjectFormTable.onRender()
>> [Click] [trace]    invoked: 'form9' ObjectFormTable.onRender()
>> [Click] [info ]
>> renderTemplate: /editObjects.htm,/templates/base-template.htm - 48 ms
>> [Click] [trace]    invoked: 'logoffLink' ActionLink.onDestroy()
>> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onDestroy()
>> [Click] [trace]    invoked: 'form0' ObjectFormTable.onDestroy()
>> [Click] [trace]    invoked: 'form1' ObjectFormTable.onDestroy()
>> [Click] [trace]    invoked: 'form2' ObjectFormTable.onDestroy()
>> [Click] [trace]    invoked: 'form3' ObjectFormTable.onDestroy()
>> [Click] [trace]    invoked: 'form4' ObjectFormTable.onDestroy()
>> [Click] [trace]    invoked: 'form5' ObjectFormTable.onDestroy()
>> [Click] [trace]    invoked: 'form6' ObjectFormTable.onDestroy()
>> [Click] [trace]    invoked: 'form7' ObjectFormTable.onDestroy()
>> [Click] [trace]    invoked: 'form8' ObjectFormTable.onDestroy()
>> [Click] [trace]    invoked: 'form9' ObjectFormTable.onDestroy()
>> [Click] [trace]    invoked: EditObjectsPage.onDestroy()
>> [Click] [info ] handleRequest:  /editObjects.htm - 496 ms
>>
>>
>>
>>
>> On Wed, 2009-04-22 at 22:36 +1000, Malcolm Edgar wrote:
>>> Hi Warner,
>>>
>>> The post parameters are important as they determine whether the action
>>> listener will be fired.
>>>
>>> regards Malcolm Edgar
>>>
>>> On Wed, Apr 22, 2009 at 10:25 PM, WarnerJan Veldhuis
>>> <wa...@qprcostcontrol.com> wrote:
>>> > I am going insane. What in the sweet name of anything that's holy am I
>>> > doing wrong here?
>>> >
>>> > This is what my logging tells me (sorry for the long paste):
>>> >
>>> > [Click] [debug] POST
>>> > http://10.0.0.100:18080/WebClientV2/editObjects.htm
>>> > <<snip>>
>>> > [Click] [trace]    request param: Whole lot of my params here
>>> > <</snip>>
>>> > [Click] [trace]    request param: ascending=
>>> > [Click] [trace]    request param: column=
>>> > [Click] [trace]    request param: form_name=form6_form
>>> > [Click] [trace]    request param: page=
>>> > [Click] [trace]    request param: save=Save
>>> > [Click] [trace]    invoked: EditObjectsPage.<<init>>
>>> > [Click] [trace]    invoked: EditObjectsPage.onSecurityCheck() : true
>>> > [Click] [trace]    invoked: EditObjectsPage.onInit()
>>> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onInit()
>>> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
>>> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
>>> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
>>> > true
>>> > [Click] [trace]    invoked: Control listeners : true
>>> > [Click] [trace]    invoked: EditObjectsPage.onPost()
>>> > [Click] [trace]    invoked: EditObjectsPage.onRender()
>>> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
>>> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
>>> > [Click] [trace]    invoked: 'form6' ObjectFormTable.onRender()
>>> > [Click] [info ]
>>> > renderTemplate: /editObjects.htm,/templates/base-template.htm - 16 ms
>>> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onDestroy()
>>> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onDestroy()
>>> > [Click] [trace]    invoked: 'form6' ObjectFormTable.onDestroy()
>>> > [Click] [trace]    invoked: EditObjectsPage.onDestroy()
>>> > [Click] [info ] handleRequest:  /editObjects.htm - 2705 ms
>>> >
>>> > The line with "save=Save" tells me that the save button is clicked. I
>>> > don't see any hint anywhere that it hits the onSave() code, no log-line
>>> > (which I put there), no breakpoint, nothing. The ActionListener is
>>> > non-existent. The method ControlRegistry#hasActionEvents even returns
>>> > false. ControlRegistry#eventListenerList is null.
>>> >
>>> > Since my loginform works like a charm and is built the same way EXCEPT
>>> > for the use of FormTable, I am slowly getting frustrated why this
>>> > doesnt' work.
>>> >
>>> > Here's the line that adds the button to the form in the FormTable:
>>> >
>>> > getForm().add( new Submit("save", getMessage("button_submit"), this,
>>> > "onSave"));
>>> >
>>> > "this" actually refers to the FormTable, and it DOES contain the method
>>> > "boolean onSave(){}"
>>> >
>>> >
>>> > Please shed some light on this, cuz I am going bald soon...
>>> >
>>> > Cheers,
>>> >
>>> > WarnerJan
>>> >
>>> >
>>> >
>>> >
>>> > On Tue, 2009-04-21 at 11:44 +0200, Bob Schellink wrote:
>>> >> One other thing, if you set the app in trace mode Click will print out
>>> >> the events as they are processed.
>>> >>
>>> >> For example you should see something like:
>>> >>
>>> >>    [Click] [trace]    invoked: 'table' FormTable.onInit()
>>> >>    [Click] [trace]    invoked: 'table' FormTable.onProcess() : true
>>> >>
>>> >> meaning the FormTable.onInit was called and then its onProcess event
>>> >> was called.
>>> >>
>>> >> kind regards
>>> >>
>>> >> bob
>>> >>
>>> >>
>>> >> Bob Schellink wrote:
>>> >> > Hi WarnerJan,
>>> >> >
>>> >> >
>>> >> > WarnerJan Veldhuis wrote:
>>> >> >>
>>> >> >> I am having a fight with the FormTable and theSubmit that is on it.
>>> >> >> This
>>> >> >> is the code I am using in my class that extends FormTable:
>>> >> >>
>>> >> >> public ObjectFormTable () {
>>> >> >> <snip>
>>> >> >>    setupColumns();//adding FieldColumns here
>>> >> >>    getForm().add( new Submit("save", getMessage("button_submit"),
>>> >> >> this,
>>> >> >> "onSave"));
>>> >> >> <snip>
>>> >> >> }
>>> >> >>
>>> >> >> I also have the method onSave:
>>> >> >> public boolean onSave() {
>>> >> >> <snip>
>>> >> >> }
>>> >> >
>>> >> >
>>> >> > Is the onSave method declared on the ObjectFormTable or the Page?
>>> >> > According to your ObjectFormTable declaration the onSave method
>>> >> > should
>>> >> > be declared on the ObjectFormTable itself. If you declare the onSave
>>> >> > on
>>> >> > the Page that would be one reason why your breakpoint isn't hit.
>>> >> >
>>> >> > I also assume you use the FormTable internal Form and don't
>>> >> > associate it
>>> >> > with an external Form?
>>> >> >
>>> >> > Let us know.
>>> >> >
>>> >> > kind regards
>>> >> >
>>> >> > bob
>>> >> >
>>> >
>>> >
>>> >
>>
>>
>>
>
> WarnerJan Veldhuis
>
> QPR CostControl BV
> Clarissenhof 15
> 4133 AB Vianen
> Tel: +31(0)347 355023
> Helpsdesk: +31(0)347 355027
>
>
>

Re: FormTable and Submit

Posted by WarnerJan Veldhuis <wa...@qprcostcontrol.com>.
Thanks for looking into this.

Its superclass AbstractFormTable inherits from FormTable and contains no
Click specific code, only some shared application specific logic.


public class ObjectFormTable extends AbstractFormTable {
    private static final Logger log =
Logger.getLogger(ObjectFormTable.class);

    private List<AttributeDefinitionVO> attributes;
    private List<ModelObjectVO> objects;

    public ObjectFormTable(String name, MetaLayerVO metaLayer,
Set<ModelObjectVO> objects, AttributeDefinitionVO[] attributes, boolean
editable) {
        super(name, metaLayer, editable);
        this.objects = new ArrayList<ModelObjectVO>(objects);
        this.attributes = Arrays.asList(attributes);
        setClass("object_view");

        setupColumns();
        getForm().add( new HiddenField("metalayersymbol",
metaLayer.getSymbol()));

        getForm().setButtonAlign("right");
        getForm().setButtonStyle("buttons");
        getForm().add( new Submit("save", getMessage("button_submit"),
this, "onSave"));

    }

    protected void setupColumns() {
        int displayOptions = getDisplayOptions();

        MetaModelVO metaModelVO = getMetaModel(getCostModelId());
        
        FieldColumn nameC = new ObjectAttributeColumn(metaModelVO,
metaLayer, SystemAttributeDefinitionHelper.NAME, false);
        FieldColumn symbolC = new ObjectAttributeColumn(metaModelVO,
metaLayer, SystemAttributeDefinitionHelper.SYMBOL, false);
        switch (displayOptions) {
            case AppConstants.OBJECT_DISPLAY_OPTIONS_NAME_ONLY_INT:
                addColumn(nameC);
                break;
            case AppConstants.OBJECT_DISPLAY_OPTIONS_NAME_SYMBOL_INT:
                addColumn(nameC);
                addColumn(symbolC);
                break;
            case AppConstants.OBJECT_DISPLAY_OPTIONS_SYMBOL_ONLY_INT:
                addColumn(symbolC);
                break;
            case AppConstants.OBJECT_DISPLAY_OPTIONS_SYMBOL_NAME_INT:
                addColumn(symbolC);
                addColumn(nameC);
                break;
        }

        for (AttributeDefinitionVO attribute : attributes) {
            AbstractAttributeColumn c = new
ObjectAttributeColumn(metaModelVO, metaLayer, attribute, isEditable());
            if (attribute.isNumeric()) {
                c.setDataStyle("text-align", "right");
            }
            addColumn(c);
        }

    }

    public List getRowList() {
        return objects;
    }



    public boolean onSave() {
        log.info("onSave");
        return false;
    }


}












On Wed, 2009-04-22 at 22:51 +1000, Malcolm Edgar wrote:

> OK this looks fine, but not listener invoked. Can you post your
> ObjectFormTable source
> 
> On Wed, Apr 22, 2009 at 10:50 PM, WarnerJan Veldhuis
> <wa...@qprcostcontrol.com> wrote:
> > Ok, then here you go, the entire logging:
> >
> > In case you wonder, I *do* have 9 forms on the screen, names form0 to
> > form9. Each form is a new instance of a FormTable, each with a new
> > instance of a save(submit)-button
> >
> >
> > [Click] [debug] POST http://10.0.0.100:18080/WebClientV2/editObjects.htm
> > [Click] [trace]    request param: SA_13_0=-
> > [Click] [trace]    request param: SA_13_1=-
> > [Click] [trace]    request param: SA_13_2=-
> > [Click] [trace]    request param: SA_13_3=-
> > [Click] [trace]    request param: SA_13_4=-
> > [Click] [trace]    request param: SA_13_5=-
> > [Click] [trace]    request param: SA_15_0=0,00
> > [Click] [trace]    request param: SA_15_1=0,00
> > [Click] [trace]    request param: SA_15_2=15.000,00
> > [Click] [trace]    request param: SA_15_3=7.000,00
> > [Click] [trace]    request param: SA_15_4=8.000,00
> > [Click] [trace]    request param: SA_15_5=7.500,00
> > [Click] [trace]    request param: SA_25_0=0,00
> > [Click] [trace]    request param: SA_25_1=0,00
> > [Click] [trace]    request param: SA_25_2=0,00
> > [Click] [trace]    request param: SA_25_3=0,00
> > [Click] [trace]    request param: SA_25_4=0,00
> > [Click] [trace]    request param: SA_25_5=0,00
> > [Click] [trace]    request param: ascending=
> > [Click] [trace]    request param: column=
> > [Click] [trace]    request param: form_name=form6_form
> > [Click] [trace]    request param: metalayersymbol=10
> > [Click] [trace]    request param: page=
> > [Click] [trace]    request param: save=Save
> > [Click] [trace]    invoked: EditObjectsPage.<<init>>
> > [Click] [trace]    invoked: EditObjectsPage.onSecurityCheck() : true
> > [Click] [trace]    invoked: EditObjectsPage.onInit()
> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onInit()
> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
> > true
> > [Click] [trace]    invoked: Control listeners : true
> > [Click] [trace]    invoked: EditObjectsPage.onPost()
> > [Click] [trace]    invoked: EditObjectsPage.onRender()
> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
> > [Click] [trace]    invoked: 'form0' ObjectFormTable.onRender()
> > [Click] [trace]    invoked: 'form1' ObjectFormTable.onRender()
> > [Click] [trace]    invoked: 'form2' ObjectFormTable.onRender()
> > [Click] [trace]    invoked: 'form3' ObjectFormTable.onRender()
> > [Click] [trace]    invoked: 'form4' ObjectFormTable.onRender()
> > [Click] [trace]    invoked: 'form5' ObjectFormTable.onRender()
> > [Click] [trace]    invoked: 'form6' ObjectFormTable.onRender()
> > [Click] [trace]    invoked: 'form7' ObjectFormTable.onRender()
> > [Click] [trace]    invoked: 'form8' ObjectFormTable.onRender()
> > [Click] [trace]    invoked: 'form9' ObjectFormTable.onRender()
> > [Click] [info ]
> > renderTemplate: /editObjects.htm,/templates/base-template.htm - 48 ms
> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onDestroy()
> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onDestroy()
> > [Click] [trace]    invoked: 'form0' ObjectFormTable.onDestroy()
> > [Click] [trace]    invoked: 'form1' ObjectFormTable.onDestroy()
> > [Click] [trace]    invoked: 'form2' ObjectFormTable.onDestroy()
> > [Click] [trace]    invoked: 'form3' ObjectFormTable.onDestroy()
> > [Click] [trace]    invoked: 'form4' ObjectFormTable.onDestroy()
> > [Click] [trace]    invoked: 'form5' ObjectFormTable.onDestroy()
> > [Click] [trace]    invoked: 'form6' ObjectFormTable.onDestroy()
> > [Click] [trace]    invoked: 'form7' ObjectFormTable.onDestroy()
> > [Click] [trace]    invoked: 'form8' ObjectFormTable.onDestroy()
> > [Click] [trace]    invoked: 'form9' ObjectFormTable.onDestroy()
> > [Click] [trace]    invoked: EditObjectsPage.onDestroy()
> > [Click] [info ] handleRequest:  /editObjects.htm - 496 ms
> >
> >
> >
> >
> > On Wed, 2009-04-22 at 22:36 +1000, Malcolm Edgar wrote:
> >> Hi Warner,
> >>
> >> The post parameters are important as they determine whether the action
> >> listener will be fired.
> >>
> >> regards Malcolm Edgar
> >>
> >> On Wed, Apr 22, 2009 at 10:25 PM, WarnerJan Veldhuis
> >> <wa...@qprcostcontrol.com> wrote:
> >> > I am going insane. What in the sweet name of anything that's holy am I
> >> > doing wrong here?
> >> >
> >> > This is what my logging tells me (sorry for the long paste):
> >> >
> >> > [Click] [debug] POST http://10.0.0.100:18080/WebClientV2/editObjects.htm
> >> > <<snip>>
> >> > [Click] [trace]    request param: Whole lot of my params here
> >> > <</snip>>
> >> > [Click] [trace]    request param: ascending=
> >> > [Click] [trace]    request param: column=
> >> > [Click] [trace]    request param: form_name=form6_form
> >> > [Click] [trace]    request param: page=
> >> > [Click] [trace]    request param: save=Save
> >> > [Click] [trace]    invoked: EditObjectsPage.<<init>>
> >> > [Click] [trace]    invoked: EditObjectsPage.onSecurityCheck() : true
> >> > [Click] [trace]    invoked: EditObjectsPage.onInit()
> >> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onInit()
> >> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
> >> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
> >> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
> >> > true
> >> > [Click] [trace]    invoked: Control listeners : true
> >> > [Click] [trace]    invoked: EditObjectsPage.onPost()
> >> > [Click] [trace]    invoked: EditObjectsPage.onRender()
> >> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
> >> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
> >> > [Click] [trace]    invoked: 'form6' ObjectFormTable.onRender()
> >> > [Click] [info ]
> >> > renderTemplate: /editObjects.htm,/templates/base-template.htm - 16 ms
> >> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onDestroy()
> >> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onDestroy()
> >> > [Click] [trace]    invoked: 'form6' ObjectFormTable.onDestroy()
> >> > [Click] [trace]    invoked: EditObjectsPage.onDestroy()
> >> > [Click] [info ] handleRequest:  /editObjects.htm - 2705 ms
> >> >
> >> > The line with "save=Save" tells me that the save button is clicked. I
> >> > don't see any hint anywhere that it hits the onSave() code, no log-line
> >> > (which I put there), no breakpoint, nothing. The ActionListener is
> >> > non-existent. The method ControlRegistry#hasActionEvents even returns
> >> > false. ControlRegistry#eventListenerList is null.
> >> >
> >> > Since my loginform works like a charm and is built the same way EXCEPT
> >> > for the use of FormTable, I am slowly getting frustrated why this
> >> > doesnt' work.
> >> >
> >> > Here's the line that adds the button to the form in the FormTable:
> >> >
> >> > getForm().add( new Submit("save", getMessage("button_submit"), this,
> >> > "onSave"));
> >> >
> >> > "this" actually refers to the FormTable, and it DOES contain the method
> >> > "boolean onSave(){}"
> >> >
> >> >
> >> > Please shed some light on this, cuz I am going bald soon...
> >> >
> >> > Cheers,
> >> >
> >> > WarnerJan
> >> >
> >> >
> >> >
> >> >
> >> > On Tue, 2009-04-21 at 11:44 +0200, Bob Schellink wrote:
> >> >> One other thing, if you set the app in trace mode Click will print out
> >> >> the events as they are processed.
> >> >>
> >> >> For example you should see something like:
> >> >>
> >> >>    [Click] [trace]    invoked: 'table' FormTable.onInit()
> >> >>    [Click] [trace]    invoked: 'table' FormTable.onProcess() : true
> >> >>
> >> >> meaning the FormTable.onInit was called and then its onProcess event
> >> >> was called.
> >> >>
> >> >> kind regards
> >> >>
> >> >> bob
> >> >>
> >> >>
> >> >> Bob Schellink wrote:
> >> >> > Hi WarnerJan,
> >> >> >
> >> >> >
> >> >> > WarnerJan Veldhuis wrote:
> >> >> >>
> >> >> >> I am having a fight with the FormTable and theSubmit that is on it. This
> >> >> >> is the code I am using in my class that extends FormTable:
> >> >> >>
> >> >> >> public ObjectFormTable () {
> >> >> >> <snip>
> >> >> >>    setupColumns();//adding FieldColumns here
> >> >> >>    getForm().add( new Submit("save", getMessage("button_submit"), this,
> >> >> >> "onSave"));
> >> >> >> <snip>
> >> >> >> }
> >> >> >>
> >> >> >> I also have the method onSave:
> >> >> >> public boolean onSave() {
> >> >> >> <snip>
> >> >> >> }
> >> >> >
> >> >> >
> >> >> > Is the onSave method declared on the ObjectFormTable or the Page?
> >> >> > According to your ObjectFormTable declaration the onSave method should
> >> >> > be declared on the ObjectFormTable itself. If you declare the onSave on
> >> >> > the Page that would be one reason why your breakpoint isn't hit.
> >> >> >
> >> >> > I also assume you use the FormTable internal Form and don't associate it
> >> >> > with an external Form?
> >> >> >
> >> >> > Let us know.
> >> >> >
> >> >> > kind regards
> >> >> >
> >> >> > bob
> >> >> >
> >> >
> >> >
> >> >
> >
> >
> >

WarnerJan Veldhuis

QPR CostControl BV
Clarissenhof 15
4133 AB Vianen
Tel: +31(0)347 355023
Helpsdesk: +31(0)347 355027



Re: FormTable and Submit

Posted by Malcolm Edgar <ma...@gmail.com>.
OK this looks fine, but not listener invoked. Can you post your
ObjectFormTable source

On Wed, Apr 22, 2009 at 10:50 PM, WarnerJan Veldhuis
<wa...@qprcostcontrol.com> wrote:
> Ok, then here you go, the entire logging:
>
> In case you wonder, I *do* have 9 forms on the screen, names form0 to
> form9. Each form is a new instance of a FormTable, each with a new
> instance of a save(submit)-button
>
>
> [Click] [debug] POST http://10.0.0.100:18080/WebClientV2/editObjects.htm
> [Click] [trace]    request param: SA_13_0=-
> [Click] [trace]    request param: SA_13_1=-
> [Click] [trace]    request param: SA_13_2=-
> [Click] [trace]    request param: SA_13_3=-
> [Click] [trace]    request param: SA_13_4=-
> [Click] [trace]    request param: SA_13_5=-
> [Click] [trace]    request param: SA_15_0=0,00
> [Click] [trace]    request param: SA_15_1=0,00
> [Click] [trace]    request param: SA_15_2=15.000,00
> [Click] [trace]    request param: SA_15_3=7.000,00
> [Click] [trace]    request param: SA_15_4=8.000,00
> [Click] [trace]    request param: SA_15_5=7.500,00
> [Click] [trace]    request param: SA_25_0=0,00
> [Click] [trace]    request param: SA_25_1=0,00
> [Click] [trace]    request param: SA_25_2=0,00
> [Click] [trace]    request param: SA_25_3=0,00
> [Click] [trace]    request param: SA_25_4=0,00
> [Click] [trace]    request param: SA_25_5=0,00
> [Click] [trace]    request param: ascending=
> [Click] [trace]    request param: column=
> [Click] [trace]    request param: form_name=form6_form
> [Click] [trace]    request param: metalayersymbol=10
> [Click] [trace]    request param: page=
> [Click] [trace]    request param: save=Save
> [Click] [trace]    invoked: EditObjectsPage.<<init>>
> [Click] [trace]    invoked: EditObjectsPage.onSecurityCheck() : true
> [Click] [trace]    invoked: EditObjectsPage.onInit()
> [Click] [trace]    invoked: 'logoffLink' ActionLink.onInit()
> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
> [Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
> true
> [Click] [trace]    invoked: Control listeners : true
> [Click] [trace]    invoked: EditObjectsPage.onPost()
> [Click] [trace]    invoked: EditObjectsPage.onRender()
> [Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
> [Click] [trace]    invoked: 'form0' ObjectFormTable.onRender()
> [Click] [trace]    invoked: 'form1' ObjectFormTable.onRender()
> [Click] [trace]    invoked: 'form2' ObjectFormTable.onRender()
> [Click] [trace]    invoked: 'form3' ObjectFormTable.onRender()
> [Click] [trace]    invoked: 'form4' ObjectFormTable.onRender()
> [Click] [trace]    invoked: 'form5' ObjectFormTable.onRender()
> [Click] [trace]    invoked: 'form6' ObjectFormTable.onRender()
> [Click] [trace]    invoked: 'form7' ObjectFormTable.onRender()
> [Click] [trace]    invoked: 'form8' ObjectFormTable.onRender()
> [Click] [trace]    invoked: 'form9' ObjectFormTable.onRender()
> [Click] [info ]
> renderTemplate: /editObjects.htm,/templates/base-template.htm - 48 ms
> [Click] [trace]    invoked: 'logoffLink' ActionLink.onDestroy()
> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onDestroy()
> [Click] [trace]    invoked: 'form0' ObjectFormTable.onDestroy()
> [Click] [trace]    invoked: 'form1' ObjectFormTable.onDestroy()
> [Click] [trace]    invoked: 'form2' ObjectFormTable.onDestroy()
> [Click] [trace]    invoked: 'form3' ObjectFormTable.onDestroy()
> [Click] [trace]    invoked: 'form4' ObjectFormTable.onDestroy()
> [Click] [trace]    invoked: 'form5' ObjectFormTable.onDestroy()
> [Click] [trace]    invoked: 'form6' ObjectFormTable.onDestroy()
> [Click] [trace]    invoked: 'form7' ObjectFormTable.onDestroy()
> [Click] [trace]    invoked: 'form8' ObjectFormTable.onDestroy()
> [Click] [trace]    invoked: 'form9' ObjectFormTable.onDestroy()
> [Click] [trace]    invoked: EditObjectsPage.onDestroy()
> [Click] [info ] handleRequest:  /editObjects.htm - 496 ms
>
>
>
>
> On Wed, 2009-04-22 at 22:36 +1000, Malcolm Edgar wrote:
>> Hi Warner,
>>
>> The post parameters are important as they determine whether the action
>> listener will be fired.
>>
>> regards Malcolm Edgar
>>
>> On Wed, Apr 22, 2009 at 10:25 PM, WarnerJan Veldhuis
>> <wa...@qprcostcontrol.com> wrote:
>> > I am going insane. What in the sweet name of anything that's holy am I
>> > doing wrong here?
>> >
>> > This is what my logging tells me (sorry for the long paste):
>> >
>> > [Click] [debug] POST http://10.0.0.100:18080/WebClientV2/editObjects.htm
>> > <<snip>>
>> > [Click] [trace]    request param: Whole lot of my params here
>> > <</snip>>
>> > [Click] [trace]    request param: ascending=
>> > [Click] [trace]    request param: column=
>> > [Click] [trace]    request param: form_name=form6_form
>> > [Click] [trace]    request param: page=
>> > [Click] [trace]    request param: save=Save
>> > [Click] [trace]    invoked: EditObjectsPage.<<init>>
>> > [Click] [trace]    invoked: EditObjectsPage.onSecurityCheck() : true
>> > [Click] [trace]    invoked: EditObjectsPage.onInit()
>> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onInit()
>> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
>> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
>> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
>> > true
>> > [Click] [trace]    invoked: Control listeners : true
>> > [Click] [trace]    invoked: EditObjectsPage.onPost()
>> > [Click] [trace]    invoked: EditObjectsPage.onRender()
>> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
>> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
>> > [Click] [trace]    invoked: 'form6' ObjectFormTable.onRender()
>> > [Click] [info ]
>> > renderTemplate: /editObjects.htm,/templates/base-template.htm - 16 ms
>> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onDestroy()
>> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onDestroy()
>> > [Click] [trace]    invoked: 'form6' ObjectFormTable.onDestroy()
>> > [Click] [trace]    invoked: EditObjectsPage.onDestroy()
>> > [Click] [info ] handleRequest:  /editObjects.htm - 2705 ms
>> >
>> > The line with "save=Save" tells me that the save button is clicked. I
>> > don't see any hint anywhere that it hits the onSave() code, no log-line
>> > (which I put there), no breakpoint, nothing. The ActionListener is
>> > non-existent. The method ControlRegistry#hasActionEvents even returns
>> > false. ControlRegistry#eventListenerList is null.
>> >
>> > Since my loginform works like a charm and is built the same way EXCEPT
>> > for the use of FormTable, I am slowly getting frustrated why this
>> > doesnt' work.
>> >
>> > Here's the line that adds the button to the form in the FormTable:
>> >
>> > getForm().add( new Submit("save", getMessage("button_submit"), this,
>> > "onSave"));
>> >
>> > "this" actually refers to the FormTable, and it DOES contain the method
>> > "boolean onSave(){}"
>> >
>> >
>> > Please shed some light on this, cuz I am going bald soon...
>> >
>> > Cheers,
>> >
>> > WarnerJan
>> >
>> >
>> >
>> >
>> > On Tue, 2009-04-21 at 11:44 +0200, Bob Schellink wrote:
>> >> One other thing, if you set the app in trace mode Click will print out
>> >> the events as they are processed.
>> >>
>> >> For example you should see something like:
>> >>
>> >>    [Click] [trace]    invoked: 'table' FormTable.onInit()
>> >>    [Click] [trace]    invoked: 'table' FormTable.onProcess() : true
>> >>
>> >> meaning the FormTable.onInit was called and then its onProcess event
>> >> was called.
>> >>
>> >> kind regards
>> >>
>> >> bob
>> >>
>> >>
>> >> Bob Schellink wrote:
>> >> > Hi WarnerJan,
>> >> >
>> >> >
>> >> > WarnerJan Veldhuis wrote:
>> >> >>
>> >> >> I am having a fight with the FormTable and theSubmit that is on it. This
>> >> >> is the code I am using in my class that extends FormTable:
>> >> >>
>> >> >> public ObjectFormTable () {
>> >> >> <snip>
>> >> >>    setupColumns();//adding FieldColumns here
>> >> >>    getForm().add( new Submit("save", getMessage("button_submit"), this,
>> >> >> "onSave"));
>> >> >> <snip>
>> >> >> }
>> >> >>
>> >> >> I also have the method onSave:
>> >> >> public boolean onSave() {
>> >> >> <snip>
>> >> >> }
>> >> >
>> >> >
>> >> > Is the onSave method declared on the ObjectFormTable or the Page?
>> >> > According to your ObjectFormTable declaration the onSave method should
>> >> > be declared on the ObjectFormTable itself. If you declare the onSave on
>> >> > the Page that would be one reason why your breakpoint isn't hit.
>> >> >
>> >> > I also assume you use the FormTable internal Form and don't associate it
>> >> > with an external Form?
>> >> >
>> >> > Let us know.
>> >> >
>> >> > kind regards
>> >> >
>> >> > bob
>> >> >
>> >
>> >
>> >
>
>
>

Re: FormTable and CayenneForm

Posted by Stefan Klein <st...@gmx.de>.
Hi Bob,

> > Should i read the value of FO_ID on my own, construct the dataobject and
> use setDataObject to set it or is there a cleaner/better way to solve
> this?
> 
> 
> You are right, you need to ensure the oidField contains its value 
> *before* onProcess in order to populate the FormTable.
> 
> You could encapsulate this "early binding" with a custom CayenneForm 
> so that the oidField and classField values are available before 
> onProcess. For example:
> 
>    public class MyCayenneForm extends CayenneForm {
> 
>      public MyCayenneForm(String name) {
>        super(name);
> 
>        // Bind the oidField and classField to request parameters
>        oidField.bindRequestValue();
>        classField.bindRequestValue();
>      }
>    }
> 
> Hope this helps.

thank you, it works with a little change, I must not bind the requestvalue of the classField. If I do so, setting the DataObject on an get request fails since the value of cause is null and setDataObject checks if the given object is of the right class.

kind regards,
Stefan
-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a

Re: FormTable and CayenneForm

Posted by Bob Schellink <sa...@gmail.com>.
Hi Stefan,

Stefan Klein wrote:
> 
> I wanted to use a FormTable with an CayenneForm, using getDataObject().get/toManyRelationShip/() to set the rowlist of the FormTable.
> getDataObject() tries to construct the dataobject by using the oidField which holds the primary key. Well, the oidField only holds the primary key after it is proccessed. So to get the column fields of the FormTable get processed it needs to have it's rows filled befor onProcess, but i only get the row list after onProcess (if i am using the suplied getter).
> 
> Should i read the value of FO_ID on my own, construct the dataobject and use setDataObject to set it or is there a cleaner/better way to solve this?


You are right, you need to ensure the oidField contains its value 
*before* onProcess in order to populate the FormTable.

You could encapsulate this "early binding" with a custom CayenneForm 
so that the oidField and classField values are available before 
onProcess. For example:

   public class MyCayenneForm extends CayenneForm {

     public MyCayenneForm(String name) {
       super(name);

       // Bind the oidField and classField to request parameters
       oidField.bindRequestValue();
       classField.bindRequestValue();
     }
   }

Hope this helps.

kind regards

bob

FormTable and CayenneForm (was: Re: FormTable and Submit)

Posted by Stefan Klein <st...@gmx.de>.
-------- Original-Nachricht --------
> Datum: Thu, 23 Apr 2009 12:12:39 +0200
> Von: Bob Schellink <sa...@gmail.com>
> An: click-user@incubator.apache.org
> Betreff: Re: FormTable and Submit

> With FormTable your options are more limited because the FormTable 
> rows must be filled *before* onProcess occurs, otherwise the Field and 
> Button values won't be processed and their actions won't be invoked.

I wanted to use a FormTable with an CayenneForm, using getDataObject().get/toManyRelationShip/() to set the rowlist of the FormTable.
getDataObject() tries to construct the dataobject by using the oidField which holds the primary key. Well, the oidField only holds the primary key after it is proccessed. So to get the column fields of the FormTable get processed it needs to have it's rows filled befor onProcess, but i only get the row list after onProcess (if i am using the suplied getter).

Should i read the value of FO_ID on my own, construct the dataobject and use setDataObject to set it or is there a cleaner/better way to solve this?

Stefan
-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a

Re: FormTable and Submit

Posted by Bob Schellink <sa...@gmail.com>.
Hi WarnerJan,

WarnerJan Veldhuis wrote:

> I am too :) I read somewhere in the docs that database access and
> similar operations should be done in the onRender method. I guess I
> never questioned that method.
> 
> Lesson learned: always create your form and stuff in the constructor or
> the onInit() method, correct?


Yes most the time you should place expensive operations in onRender, 
while the creation of the control is best done in constructor or 
onInit. Why this practice?

Consider the case where you could navigate away from the Page via a 
redirect:

   public void onInit() {
     Table t = new Table("t");

     // Expensive operation below
     t.setRows(selectRowsFromDb());
   }

   public boolean onSave() {
     // Save stuff to db
     ...

     setRedirect(OtherPage.class);
     // Since we're redirecting, don't process any further
     return false;
   }

The onInit above contains a potentially expensive operation because it 
selects rows from the db.

And since you might be redirecting to another page via the onSave 
method, the table is never displayed and the db hit was redundant.

By moving the call "t.setRows(selectRowsFromDb())" to the onRender 
method you save yourself the database hit if you were to redirect 
because onRender won't be invoked since onSave returns false.

Thing is though, if you don't redirect or forward to another Page, 
then it really doesn't matter where you place the setRows method.

With FormTable your options are more limited because the FormTable 
rows must be filled *before* onProcess occurs, otherwise the Field and 
Button values won't be processed and their actions won't be invoked.

Also note that you still have access to HttpServletRequest and can 
inspect it for certain parameters and conditionally render the 
FormTable in the onInit method.

kind regards

bob


Re: FormTable and Submit

Posted by WarnerJan Veldhuis <wa...@qprcostcontrol.com>.
> My guess is that you only add the FormTable's in the
> EditObjectPage.onPost or EditObjectPage.onRender method which occurs 
> after the onProcess event.

That was the problem. The adding of the tables was in the onRender method. Gee, do I feel stupid :)

> If you add the FormTables in your onInit event things should start
> working.

And it did. Well, sort off. The Ognl is trying to set the values to my
valueobject, but it doesn't have the usual getters/setters for those
values. It's a bit more complex than that. But I'll start another topic
about that.

> I'm curious though why you only add the FormTables in the
> onPost/onRender method of the Page?

I am too :) I read somewhere in the docs that database access and
similar operations should be done in the onRender method. I guess I
never questioned that method. 

Lesson learned: always create your form and stuff in the constructor or
the onInit() method, correct?

Cheers, and thanks for the help. Keep up the good work. Loving it :)

WarnerJan




On Wed, 2009-04-22 at 17:25 +0200, Bob Schellink wrote: 
> Hi WarnerJan,
> 
> WarnerJan Veldhuis wrote:
> 
> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
> > true
> > [Click] [trace]    invoked: Control listeners : true
> > [Click] [trace]    invoked: EditObjectsPage.onPost()
> > [Click] [trace]    invoked: EditObjectsPage.onRender()
> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
> > [Click] [trace]    invoked: 'form0' ObjectFormTable.onRender()
> > [Click] [trace]    invoked: 'form1' ObjectFormTable.onRender()
> > [Click] [trace]    invoked: 'form2' ObjectFormTable.onRender()
> 
> 
>  From the log it seems you only add the FormTables *after* the 
> onProcess event, meaning your listeners won't be called.
> 
> My guess is that you only add the FormTable's in the 
> EditObjectPage.onPost or EditObjectPage.onRender method which occurs 
> after the onProcess event.
> 
> If you add the FormTables in your onInit event things should start 
> working.
> 
> I'm curious though why you only add the FormTables in the 
> onPost/onRender method of the Page?
> 
> kind regards
> 
> bob



Re: FormTable and Submit

Posted by Bob Schellink <sa...@gmail.com>.
Hi WarnerJan,

WarnerJan Veldhuis wrote:

> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
> [Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
> true
> [Click] [trace]    invoked: Control listeners : true
> [Click] [trace]    invoked: EditObjectsPage.onPost()
> [Click] [trace]    invoked: EditObjectsPage.onRender()
> [Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
> [Click] [trace]    invoked: 'form0' ObjectFormTable.onRender()
> [Click] [trace]    invoked: 'form1' ObjectFormTable.onRender()
> [Click] [trace]    invoked: 'form2' ObjectFormTable.onRender()


 From the log it seems you only add the FormTables *after* the 
onProcess event, meaning your listeners won't be called.

My guess is that you only add the FormTable's in the 
EditObjectPage.onPost or EditObjectPage.onRender method which occurs 
after the onProcess event.

If you add the FormTables in your onInit event things should start 
working.

I'm curious though why you only add the FormTables in the 
onPost/onRender method of the Page?

kind regards

bob

Re: FormTable and Submit

Posted by WarnerJan Veldhuis <wa...@qprcostcontrol.com>.
Ok, then here you go, the entire logging:

In case you wonder, I *do* have 9 forms on the screen, names form0 to
form9. Each form is a new instance of a FormTable, each with a new
instance of a save(submit)-button


[Click] [debug] POST http://10.0.0.100:18080/WebClientV2/editObjects.htm
[Click] [trace]    request param: SA_13_0=-
[Click] [trace]    request param: SA_13_1=-
[Click] [trace]    request param: SA_13_2=-
[Click] [trace]    request param: SA_13_3=-
[Click] [trace]    request param: SA_13_4=-
[Click] [trace]    request param: SA_13_5=-
[Click] [trace]    request param: SA_15_0=0,00
[Click] [trace]    request param: SA_15_1=0,00
[Click] [trace]    request param: SA_15_2=15.000,00
[Click] [trace]    request param: SA_15_3=7.000,00
[Click] [trace]    request param: SA_15_4=8.000,00
[Click] [trace]    request param: SA_15_5=7.500,00
[Click] [trace]    request param: SA_25_0=0,00
[Click] [trace]    request param: SA_25_1=0,00
[Click] [trace]    request param: SA_25_2=0,00
[Click] [trace]    request param: SA_25_3=0,00
[Click] [trace]    request param: SA_25_4=0,00
[Click] [trace]    request param: SA_25_5=0,00
[Click] [trace]    request param: ascending=
[Click] [trace]    request param: column=
[Click] [trace]    request param: form_name=form6_form
[Click] [trace]    request param: metalayersymbol=10
[Click] [trace]    request param: page=
[Click] [trace]    request param: save=Save
[Click] [trace]    invoked: EditObjectsPage.<<init>>
[Click] [trace]    invoked: EditObjectsPage.onSecurityCheck() : true
[Click] [trace]    invoked: EditObjectsPage.onInit()
[Click] [trace]    invoked: 'logoffLink' ActionLink.onInit()
[Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
[Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
[Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
true
[Click] [trace]    invoked: Control listeners : true
[Click] [trace]    invoked: EditObjectsPage.onPost()
[Click] [trace]    invoked: EditObjectsPage.onRender()
[Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
[Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
[Click] [trace]    invoked: 'form0' ObjectFormTable.onRender()
[Click] [trace]    invoked: 'form1' ObjectFormTable.onRender()
[Click] [trace]    invoked: 'form2' ObjectFormTable.onRender()
[Click] [trace]    invoked: 'form3' ObjectFormTable.onRender()
[Click] [trace]    invoked: 'form4' ObjectFormTable.onRender()
[Click] [trace]    invoked: 'form5' ObjectFormTable.onRender()
[Click] [trace]    invoked: 'form6' ObjectFormTable.onRender()
[Click] [trace]    invoked: 'form7' ObjectFormTable.onRender()
[Click] [trace]    invoked: 'form8' ObjectFormTable.onRender()
[Click] [trace]    invoked: 'form9' ObjectFormTable.onRender()
[Click] [info ]
renderTemplate: /editObjects.htm,/templates/base-template.htm - 48 ms
[Click] [trace]    invoked: 'logoffLink' ActionLink.onDestroy()
[Click] [trace]    invoked: 'closeModelLink' ActionLink.onDestroy()
[Click] [trace]    invoked: 'form0' ObjectFormTable.onDestroy()
[Click] [trace]    invoked: 'form1' ObjectFormTable.onDestroy()
[Click] [trace]    invoked: 'form2' ObjectFormTable.onDestroy()
[Click] [trace]    invoked: 'form3' ObjectFormTable.onDestroy()
[Click] [trace]    invoked: 'form4' ObjectFormTable.onDestroy()
[Click] [trace]    invoked: 'form5' ObjectFormTable.onDestroy()
[Click] [trace]    invoked: 'form6' ObjectFormTable.onDestroy()
[Click] [trace]    invoked: 'form7' ObjectFormTable.onDestroy()
[Click] [trace]    invoked: 'form8' ObjectFormTable.onDestroy()
[Click] [trace]    invoked: 'form9' ObjectFormTable.onDestroy()
[Click] [trace]    invoked: EditObjectsPage.onDestroy()
[Click] [info ] handleRequest:  /editObjects.htm - 496 ms




On Wed, 2009-04-22 at 22:36 +1000, Malcolm Edgar wrote:
> Hi Warner,
> 
> The post parameters are important as they determine whether the action
> listener will be fired.
> 
> regards Malcolm Edgar
> 
> On Wed, Apr 22, 2009 at 10:25 PM, WarnerJan Veldhuis
> <wa...@qprcostcontrol.com> wrote:
> > I am going insane. What in the sweet name of anything that's holy am I
> > doing wrong here?
> >
> > This is what my logging tells me (sorry for the long paste):
> >
> > [Click] [debug] POST http://10.0.0.100:18080/WebClientV2/editObjects.htm
> > <<snip>>
> > [Click] [trace]    request param: Whole lot of my params here
> > <</snip>>
> > [Click] [trace]    request param: ascending=
> > [Click] [trace]    request param: column=
> > [Click] [trace]    request param: form_name=form6_form
> > [Click] [trace]    request param: page=
> > [Click] [trace]    request param: save=Save
> > [Click] [trace]    invoked: EditObjectsPage.<<init>>
> > [Click] [trace]    invoked: EditObjectsPage.onSecurityCheck() : true
> > [Click] [trace]    invoked: EditObjectsPage.onInit()
> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onInit()
> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
> > true
> > [Click] [trace]    invoked: Control listeners : true
> > [Click] [trace]    invoked: EditObjectsPage.onPost()
> > [Click] [trace]    invoked: EditObjectsPage.onRender()
> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
> > [Click] [trace]    invoked: 'form6' ObjectFormTable.onRender()
> > [Click] [info ]
> > renderTemplate: /editObjects.htm,/templates/base-template.htm - 16 ms
> > [Click] [trace]    invoked: 'logoffLink' ActionLink.onDestroy()
> > [Click] [trace]    invoked: 'closeModelLink' ActionLink.onDestroy()
> > [Click] [trace]    invoked: 'form6' ObjectFormTable.onDestroy()
> > [Click] [trace]    invoked: EditObjectsPage.onDestroy()
> > [Click] [info ] handleRequest:  /editObjects.htm - 2705 ms
> >
> > The line with "save=Save" tells me that the save button is clicked. I
> > don't see any hint anywhere that it hits the onSave() code, no log-line
> > (which I put there), no breakpoint, nothing. The ActionListener is
> > non-existent. The method ControlRegistry#hasActionEvents even returns
> > false. ControlRegistry#eventListenerList is null.
> >
> > Since my loginform works like a charm and is built the same way EXCEPT
> > for the use of FormTable, I am slowly getting frustrated why this
> > doesnt' work.
> >
> > Here's the line that adds the button to the form in the FormTable:
> >
> > getForm().add( new Submit("save", getMessage("button_submit"), this,
> > "onSave"));
> >
> > "this" actually refers to the FormTable, and it DOES contain the method
> > "boolean onSave(){}"
> >
> >
> > Please shed some light on this, cuz I am going bald soon...
> >
> > Cheers,
> >
> > WarnerJan
> >
> >
> >
> >
> > On Tue, 2009-04-21 at 11:44 +0200, Bob Schellink wrote:
> >> One other thing, if you set the app in trace mode Click will print out
> >> the events as they are processed.
> >>
> >> For example you should see something like:
> >>
> >>    [Click] [trace]    invoked: 'table' FormTable.onInit()
> >>    [Click] [trace]    invoked: 'table' FormTable.onProcess() : true
> >>
> >> meaning the FormTable.onInit was called and then its onProcess event
> >> was called.
> >>
> >> kind regards
> >>
> >> bob
> >>
> >>
> >> Bob Schellink wrote:
> >> > Hi WarnerJan,
> >> >
> >> >
> >> > WarnerJan Veldhuis wrote:
> >> >>
> >> >> I am having a fight with the FormTable and theSubmit that is on it. This
> >> >> is the code I am using in my class that extends FormTable:
> >> >>
> >> >> public ObjectFormTable () {
> >> >> <snip>
> >> >>    setupColumns();//adding FieldColumns here
> >> >>    getForm().add( new Submit("save", getMessage("button_submit"), this,
> >> >> "onSave"));
> >> >> <snip>
> >> >> }
> >> >>
> >> >> I also have the method onSave:
> >> >> public boolean onSave() {
> >> >> <snip>
> >> >> }
> >> >
> >> >
> >> > Is the onSave method declared on the ObjectFormTable or the Page?
> >> > According to your ObjectFormTable declaration the onSave method should
> >> > be declared on the ObjectFormTable itself. If you declare the onSave on
> >> > the Page that would be one reason why your breakpoint isn't hit.
> >> >
> >> > I also assume you use the FormTable internal Form and don't associate it
> >> > with an external Form?
> >> >
> >> > Let us know.
> >> >
> >> > kind regards
> >> >
> >> > bob
> >> >
> >
> >
> >



Re: FormTable and Submit

Posted by Malcolm Edgar <ma...@gmail.com>.
Hi Warner,

The post parameters are important as they determine whether the action
listener will be fired.

regards Malcolm Edgar

On Wed, Apr 22, 2009 at 10:25 PM, WarnerJan Veldhuis
<wa...@qprcostcontrol.com> wrote:
> I am going insane. What in the sweet name of anything that's holy am I
> doing wrong here?
>
> This is what my logging tells me (sorry for the long paste):
>
> [Click] [debug] POST http://10.0.0.100:18080/WebClientV2/editObjects.htm
> <<snip>>
> [Click] [trace]    request param: Whole lot of my params here
> <</snip>>
> [Click] [trace]    request param: ascending=
> [Click] [trace]    request param: column=
> [Click] [trace]    request param: form_name=form6_form
> [Click] [trace]    request param: page=
> [Click] [trace]    request param: save=Save
> [Click] [trace]    invoked: EditObjectsPage.<<init>>
> [Click] [trace]    invoked: EditObjectsPage.onSecurityCheck() : true
> [Click] [trace]    invoked: EditObjectsPage.onInit()
> [Click] [trace]    invoked: 'logoffLink' ActionLink.onInit()
> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
> [Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
> true
> [Click] [trace]    invoked: Control listeners : true
> [Click] [trace]    invoked: EditObjectsPage.onPost()
> [Click] [trace]    invoked: EditObjectsPage.onRender()
> [Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
> [Click] [trace]    invoked: 'form6' ObjectFormTable.onRender()
> [Click] [info ]
> renderTemplate: /editObjects.htm,/templates/base-template.htm - 16 ms
> [Click] [trace]    invoked: 'logoffLink' ActionLink.onDestroy()
> [Click] [trace]    invoked: 'closeModelLink' ActionLink.onDestroy()
> [Click] [trace]    invoked: 'form6' ObjectFormTable.onDestroy()
> [Click] [trace]    invoked: EditObjectsPage.onDestroy()
> [Click] [info ] handleRequest:  /editObjects.htm - 2705 ms
>
> The line with "save=Save" tells me that the save button is clicked. I
> don't see any hint anywhere that it hits the onSave() code, no log-line
> (which I put there), no breakpoint, nothing. The ActionListener is
> non-existent. The method ControlRegistry#hasActionEvents even returns
> false. ControlRegistry#eventListenerList is null.
>
> Since my loginform works like a charm and is built the same way EXCEPT
> for the use of FormTable, I am slowly getting frustrated why this
> doesnt' work.
>
> Here's the line that adds the button to the form in the FormTable:
>
> getForm().add( new Submit("save", getMessage("button_submit"), this,
> "onSave"));
>
> "this" actually refers to the FormTable, and it DOES contain the method
> "boolean onSave(){}"
>
>
> Please shed some light on this, cuz I am going bald soon...
>
> Cheers,
>
> WarnerJan
>
>
>
>
> On Tue, 2009-04-21 at 11:44 +0200, Bob Schellink wrote:
>> One other thing, if you set the app in trace mode Click will print out
>> the events as they are processed.
>>
>> For example you should see something like:
>>
>>    [Click] [trace]    invoked: 'table' FormTable.onInit()
>>    [Click] [trace]    invoked: 'table' FormTable.onProcess() : true
>>
>> meaning the FormTable.onInit was called and then its onProcess event
>> was called.
>>
>> kind regards
>>
>> bob
>>
>>
>> Bob Schellink wrote:
>> > Hi WarnerJan,
>> >
>> >
>> > WarnerJan Veldhuis wrote:
>> >>
>> >> I am having a fight with the FormTable and theSubmit that is on it. This
>> >> is the code I am using in my class that extends FormTable:
>> >>
>> >> public ObjectFormTable () {
>> >> <snip>
>> >>    setupColumns();//adding FieldColumns here
>> >>    getForm().add( new Submit("save", getMessage("button_submit"), this,
>> >> "onSave"));
>> >> <snip>
>> >> }
>> >>
>> >> I also have the method onSave:
>> >> public boolean onSave() {
>> >> <snip>
>> >> }
>> >
>> >
>> > Is the onSave method declared on the ObjectFormTable or the Page?
>> > According to your ObjectFormTable declaration the onSave method should
>> > be declared on the ObjectFormTable itself. If you declare the onSave on
>> > the Page that would be one reason why your breakpoint isn't hit.
>> >
>> > I also assume you use the FormTable internal Form and don't associate it
>> > with an external Form?
>> >
>> > Let us know.
>> >
>> > kind regards
>> >
>> > bob
>> >
>
>
>

Re: FormTable and Submit

Posted by WarnerJan Veldhuis <wa...@qprcostcontrol.com>.
I am going insane. What in the sweet name of anything that's holy am I
doing wrong here?

This is what my logging tells me (sorry for the long paste):

[Click] [debug] POST http://10.0.0.100:18080/WebClientV2/editObjects.htm
<<snip>>
[Click] [trace]    request param: Whole lot of my params here
<</snip>>
[Click] [trace]    request param: ascending=
[Click] [trace]    request param: column=
[Click] [trace]    request param: form_name=form6_form
[Click] [trace]    request param: page=
[Click] [trace]    request param: save=Save
[Click] [trace]    invoked: EditObjectsPage.<<init>>
[Click] [trace]    invoked: EditObjectsPage.onSecurityCheck() : true
[Click] [trace]    invoked: EditObjectsPage.onInit()
[Click] [trace]    invoked: 'logoffLink' ActionLink.onInit()
[Click] [trace]    invoked: 'closeModelLink' ActionLink.onInit()
[Click] [trace]    invoked: 'logoffLink' ActionLink.onProcess() : true
[Click] [trace]    invoked: 'closeModelLink' ActionLink.onProcess() :
true
[Click] [trace]    invoked: Control listeners : true
[Click] [trace]    invoked: EditObjectsPage.onPost()
[Click] [trace]    invoked: EditObjectsPage.onRender()
[Click] [trace]    invoked: 'logoffLink' ActionLink.onRender()
[Click] [trace]    invoked: 'closeModelLink' ActionLink.onRender()
[Click] [trace]    invoked: 'form6' ObjectFormTable.onRender()
[Click] [info ]
renderTemplate: /editObjects.htm,/templates/base-template.htm - 16 ms
[Click] [trace]    invoked: 'logoffLink' ActionLink.onDestroy()
[Click] [trace]    invoked: 'closeModelLink' ActionLink.onDestroy()
[Click] [trace]    invoked: 'form6' ObjectFormTable.onDestroy()
[Click] [trace]    invoked: EditObjectsPage.onDestroy()
[Click] [info ] handleRequest:  /editObjects.htm - 2705 ms

The line with "save=Save" tells me that the save button is clicked. I
don't see any hint anywhere that it hits the onSave() code, no log-line
(which I put there), no breakpoint, nothing. The ActionListener is
non-existent. The method ControlRegistry#hasActionEvents even returns
false. ControlRegistry#eventListenerList is null.

Since my loginform works like a charm and is built the same way EXCEPT
for the use of FormTable, I am slowly getting frustrated why this
doesnt' work.

Here's the line that adds the button to the form in the FormTable:

getForm().add( new Submit("save", getMessage("button_submit"), this,
"onSave"));

"this" actually refers to the FormTable, and it DOES contain the method
"boolean onSave(){}"


Please shed some light on this, cuz I am going bald soon... 

Cheers,

WarnerJan




On Tue, 2009-04-21 at 11:44 +0200, Bob Schellink wrote:
> One other thing, if you set the app in trace mode Click will print out 
> the events as they are processed.
> 
> For example you should see something like:
> 
>    [Click] [trace]    invoked: 'table' FormTable.onInit()
>    [Click] [trace]    invoked: 'table' FormTable.onProcess() : true
> 
> meaning the FormTable.onInit was called and then its onProcess event 
> was called.
> 
> kind regards
> 
> bob
> 
> 
> Bob Schellink wrote:
> > Hi WarnerJan,
> > 
> > 
> > WarnerJan Veldhuis wrote:
> >>
> >> I am having a fight with the FormTable and theSubmit that is on it. This
> >> is the code I am using in my class that extends FormTable:
> >>
> >> public ObjectFormTable () {
> >> <snip>
> >>    setupColumns();//adding FieldColumns here
> >>    getForm().add( new Submit("save", getMessage("button_submit"), this,
> >> "onSave"));
> >> <snip>
> >> }
> >>
> >> I also have the method onSave:
> >> public boolean onSave() {
> >> <snip>
> >> }
> > 
> > 
> > Is the onSave method declared on the ObjectFormTable or the Page? 
> > According to your ObjectFormTable declaration the onSave method should 
> > be declared on the ObjectFormTable itself. If you declare the onSave on 
> > the Page that would be one reason why your breakpoint isn't hit.
> > 
> > I also assume you use the FormTable internal Form and don't associate it 
> > with an external Form?
> > 
> > Let us know.
> > 
> > kind regards
> > 
> > bob
> > 



Re: FormTable and Submit

Posted by Bob Schellink <sa...@gmail.com>.
One other thing, if you set the app in trace mode Click will print out 
the events as they are processed.

For example you should see something like:

   [Click] [trace]    invoked: 'table' FormTable.onInit()
   [Click] [trace]    invoked: 'table' FormTable.onProcess() : true

meaning the FormTable.onInit was called and then its onProcess event 
was called.

kind regards

bob


Bob Schellink wrote:
> Hi WarnerJan,
> 
> 
> WarnerJan Veldhuis wrote:
>>
>> I am having a fight with the FormTable and theSubmit that is on it. This
>> is the code I am using in my class that extends FormTable:
>>
>> public ObjectFormTable () {
>> <snip>
>>    setupColumns();//adding FieldColumns here
>>    getForm().add( new Submit("save", getMessage("button_submit"), this,
>> "onSave"));
>> <snip>
>> }
>>
>> I also have the method onSave:
>> public boolean onSave() {
>> <snip>
>> }
> 
> 
> Is the onSave method declared on the ObjectFormTable or the Page? 
> According to your ObjectFormTable declaration the onSave method should 
> be declared on the ObjectFormTable itself. If you declare the onSave on 
> the Page that would be one reason why your breakpoint isn't hit.
> 
> I also assume you use the FormTable internal Form and don't associate it 
> with an external Form?
> 
> Let us know.
> 
> kind regards
> 
> bob
> 


Re: FormTable and Submit

Posted by Bob Schellink <sa...@gmail.com>.
Hi WarnerJan,


WarnerJan Veldhuis wrote:
> 
> I am having a fight with the FormTable and theSubmit that is on it. This
> is the code I am using in my class that extends FormTable:
> 
> public ObjectFormTable () {
> <snip>
>    setupColumns();//adding FieldColumns here
>    getForm().add( new Submit("save", getMessage("button_submit"), this,
> "onSave"));
> <snip>
> }
> 
> I also have the method onSave:
> public boolean onSave() {
> <snip>
> }


Is the onSave method declared on the ObjectFormTable or the Page? 
According to your ObjectFormTable declaration the onSave method should 
be declared on the ObjectFormTable itself. If you declare the onSave 
on the Page that would be one reason why your breakpoint isn't hit.

I also assume you use the FormTable internal Form and don't associate 
it with an external Form?

Let us know.

kind regards

bob