• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

use of checkboxes and tapestry 5

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I've got some problemes with checkbox & t5 for a while. I'd just like to display a page which could contains some checkbox, then submit this page in order to treat the various item corresponding to the ticked checkbox then redirect to the same page with the same checkbox ticked. It is simple with JSP however seems complicated to me to realize with T5



Howard Lewis Ship advise to use the http request without using t5 component in this cas. That was I've done. However for the display when returning to this page after submission documentField.checked is always to false

Perhaps I'm missing something moreover I think I'm making a "usine à gaz".

On the onActivate() I've got :


on the onSuccess() :


on the getDocumentField()


It sux cause getDocumentField() is called much more times than the item displayed. Is it the good way to go ?

If I use a t:checkbox component I see that there isn't a selected property as in T3 for knowing which one is selected.http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Checkbox.html)

Can you help me resolve this case ?

Regards,
Blured.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe you're making it too complicated?

You might try changing all the other loops to formState="values" or just volatile="true". When checked="documentField.checked", Tapestry sets documentField.checked to true, is this all you're trying to do? Then in onSuccess():

If you want the changes to show up the next time the page is refreshed, you have to persist them in a database and load them again in setupRender(), or mark them with @Persist.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic