You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Vasu Srinivasan <va...@gmail.com> on 2009/05/06 17:07:14 UTC

Avoiding 'WicketMessage: Unable to find component with id' error

Im a wicket newbie ..

I have a Search Page with some search criteria inputs and below it, the list
of data based on search.

The first time the page is hit, the listView component is not still present,
because Im adding that only onSubmit() -- like this:

class XPage extends WebPage {
  ....
  class XForm extends Form {
   ...

   @Override public void onSubmit() {
     List resultList = searchDao.search(searchOptions);
     add(new ListView ("listView", resultList ) {
     });
   }
}

The html is straightforward..

<form ...>

</form>

<div id="resultArea">
 <table>
    <tr wicket:id="listView">
    ...
    </tr>
 </table>
</div>

Even at first hit of the page, wicket shows up the message "Unable to find
component with id listView" ..

Is there a way to make Wicket not worry about unfound components or is there
any other standard way of handling it ?

Appreciate any help...

-- 
Regards,
Vasu

Re: Avoiding 'WicketMessage: Unable to find component with id' error

Posted by Sven Meier <sv...@meiers.net>.
You should add the listView right away and keep it invisible until a
search result is available.

Sven

On Mi, 2009-05-06 at 10:07 -0500, Vasu Srinivasan wrote:
> Im a wicket newbie ..
> 
> I have a Search Page with some search criteria inputs and below it, the list
> of data based on search.
> 
> The first time the page is hit, the listView component is not still present,
> because Im adding that only onSubmit() -- like this:
> 
> class XPage extends WebPage {
>   ....
>   class XForm extends Form {
>    ...
> 
>    @Override public void onSubmit() {
>      List resultList = searchDao.search(searchOptions);
>      add(new ListView ("listView", resultList ) {
>      });
>    }
> }
> 
> The html is straightforward..
> 
> <form ...>
> 
> </form>
> 
> <div id="resultArea">
>  <table>
>     <tr wicket:id="listView">
>     ...
>     </tr>
>  </table>
> </div>
> 
> Even at first hit of the page, wicket shows up the message "Unable to find
> component with id listView" ..
> 
> Is there a way to make Wicket not worry about unfound components or is there
> any other standard way of handling it ?
> 
> Appreciate any help...
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org