Wicket AJAX Tip

Just documenting my experiences with wicket and ran into a situation that took me a little time to figure out.  The case involves updating a component that is invisible.  Short story is that you can't!
Imagine you have the following components:

  • Search Form
  • Link to Detail Form
  • Detail form
  • Results table

Your search form will populate the Results table, and make the detail form invisible.
The Link To Detail Form makes the Results table invisible, and the detail for visible.
Now what if you click on the detail link, then use the search form, wouldn't you expect the results table to display?  However, when you have initiated you search in the search form (with the detail form displayed), the results table is invisible.  In the ajax call of the search, we make the results table visible and update it's data model.  This won't work because in the ajax response, it states that it needs to update the dom of the eventstable, and since the eventstable is not displayed, it's not in the dom, and thus, will not be updated with the new "visible table"
To summarize, DO not try to do ajax updates of components that are invisible.
 
 
 
 

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options