Hi Marcelo,
>From the FormTable javadoc:
"When using the FormTable control its rowList property must be populated
before the control
is processed so that any submitted data values can be applied to the
rowList objects."
Thus in order for the FormTable to process the Field values and apply it to
the Table rows, the rows must be available during the onProcess phase.
The only way is to populate the FormTable during the onInit phase.
There are ways around it for example you could manually invoke
FormTable#onProcess() in the listener after you set the FormTable rows.
Why do you need to populate the FormTable from the listener? Are there
certain conditions you need to check?
If there is you could check for the conditions in the onInit method:
public void onInit() {
//manually process the button to see if it was clicked
myButton.onProcess()
if(myButton.isClicked()) {
// specify conditions
// populate FormTable
}
}
Alternatively instead of using the bulk edit FormTable pattern instead look
at using a Master/Detail pattern?
kind regards
bob
On Fri, Dec 19, 2008 at 12:38 PM, Marcelo Grassi Franco Melgaço <
[email protected]> wrote:
> Hi, i resolved the problem.
> Now i have another.
> The Formtable.getRowList() is empty in my submit method.
> The formtable is populated when the user click on a button.
> I saw in the examples that the formtable must be populated in the onInit
> method.
> How can i can populate the formtable when the user click on a button?
>
> Thanks
>
>
> 2008/12/19 Marcelo Grassi Franco Melgaço <[email protected]>
>
> Hello,
>> i have a page with a FormTable.
>> The problem is that the submit button doesn't call the method in my page.
>> Here is the declaration of the submit on the constructor of the page:
>>
>> this.tableEvolucao.getForm().add(new Submit("gravar", "Gravar", this,
>> "onGravarClick"));
>>
>> when i click on the button the page reloads, but the method onGravarClick
>> is not called.
>> Anyone know what can be the problem?
>> I'm using click-1.5
>>
>> Thanks
>>
>
>
>
> --
> Marcelo Grassi
> www.rumotecnologia.com.br
> (31) 9307-1268
>
--
http://incubator.apache.org/click/