You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by easydoor <ch...@valdoise.fr> on 2010/07/12 12:15:33 UTC

Validation TableForm dosn't work if there is another form in the page

Hi all,

The problem was soon described on JIRA (CLK-582) but isn't solved, so i post it
again

When i generally built a page with a FormTable and another search Form (to
select rows in the FormTable), the required fields not filled are not displayed
in yellow when you submit the TableForm.

It seems that the Form cancels the table.getForm.isValid() function


Re: Validation TableForm dosn't work if there is another form in the page

Posted by Bob Schellink <sa...@gmail.com>.
On 12/07/2010 20:15, easydoor wrote:
> 
> When i generally built a page with a FormTable and another search Form (to
> select rows in the FormTable), the required fields not filled are not displayed
> in yellow when you submit the TableForm.
> 
> It seems that the Form cancels the table.getForm.isValid() function


This doesn't sound right. Forms are independent and don't influence each other. Also Forms are
stateless which is where there might be some misunderstanding. If your searchform has a field called
Filter, which value is used to filter the formtable, how do you ensure that the Filter field value
is remembered when you post the formtable? See the process below:

Request 1:
1. SearchForm posts the value -> country=France
2. On the server the "country" value is used to only select customers in France

Request 2:
3. FormTable is posted to the server -> as this is a separate Form the country value is not posted
to the server
4. On the server no country value was posted so the FormTable isn't filtered for this request.

Are you running into the problem in Step 4?

Bob

Re: Validation TableForm dosn't work if there is another form in the page

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

I'm happy to answer questions on how things work in Click. However I am not prepared to build your
applications for you. If you send a Click Page referencing your application entities, DAOs and
Services, how do you expect us to run that code?

I strongly suggest you see this article:

http://catb.org/esr/faqs/smart-questions.html

The better your formulate your question the better we can answer it.

Kind regards

Bob


On 26/07/2010 17:20, easydoor wrote:
> Hi Bob, 
> Could you take a look on my problem, please ?
> 
> Thank you in advance
> 


Re: Validation TableForm dosn't work if there is another form in the page

Posted by easydoor <ch...@valdoise.fr>.
Hi Bob, 
Could you take a look on my problem, please ?

Thank you in advance





Re: Validation TableForm dosn't work if there is another form in the page

Posted by easydoor <ch...@valdoise.fr>.
easydoor <christophe.foiret <at> valdoise.fr> writes:

> 
> Hi all,
> 
> The problem was soon described on JIRA (CLK-582) but isn't solved, so i post it
> again
> 
> When i generally built a page with a FormTable and another search Form (to
> select rows in the FormTable), the required fields not filled are not displayed
> in yellow when you submit the TableForm.
> 
> It seems that the Form cancels the table.getForm.isValid() function
> 
> 
Hi Bob,

Refer to this page on http://elus-dev.cg95.fr/elus/img/TableForm.jpg
I put this page stateful and it solves the problem explained before. 

But I meet another difficulty, I'd like to apply the value filled 
in the bottom Field <Montant> (it's a default value) on ALL the 
lines <Montant> of the TableForm after clicking on 
the Button <Appliquer aux lignes>.

The TableForm is never refreshed with the new Montant 
and keeps the old values

I build this code in the method called by the button

//Get the row List in a List
List <LigneDotation> ligs = table.getRowList();         		
        	
//Iteration in the List to modify the montant Value
int index=0;
for (Iterator iterator = lig.iterator(); iterator.hasNext();) {
      LigneDotation lig = (LigneDotation) iterator.next();
        			
      lig.setMontant(new Double(montantDef.getValue()));
      ligs.set(index,lig);
      index++;
}
//Set the row list to modify Montant value in the TableForm
table.setRowList(ligs); 

Thank you in advance