You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by fh...@s-und-n.de on 2007/08/24 15:24:40 UTC

Antwort: Re: unknown Exception how to solve (solved)

The problem with this exception was the "double" refresh of components.
I tried it this way:

protected void onSubmit(AjaxRequestTarget target) {
        [...]
 
        target.addComponent(field);
        target.addComponent(form);
}

This throws the exception.

Just refresh the whole form and everything works fine.

Freundliche Grüße / With kind regards
Fabian Hagen

S&N AG
Klingenderstr. 5
D 33100 Paderborn

voice     +49 5251/1581- 862
fax       +49 5251/1581-71
eMail     fhagen@s-und-n.de
web       http://www.s-und-n.de

Vorstand
Klaus Beverungen
Josef Tillmann 

Vorsitzender des Aufsichtsrates
Heinz-Dieter Wendorff

Handelsregister
Amtsgericht Paderborn HRB 3270 



"Igor Vaynberg" <ig...@gmail.com> 
22.08.2007 17:27
Bitte antworten an
users@wicket.apache.org


An
users@wicket.apache.org
Kopie

Thema
Re: unknown Exception how to solve






looks like you are adding a component to the target that doesnt have a 
page?
you have to add the component first to the page hierarchy in the proper
place, and then also to the ajax target. ajax target is just a list of
components that need to be repainted.

-igor


On 8/22/07, fhagen@s-und-n.de <fh...@s-und-n.de> wrote:
>
> Hi,
>
> in my app i have a RefreshingView that gets a label an a TextField
> subclass MyAjaxTextField.
>
> <form wicket:id="form">
>         <table cellspacing="0" class="dataview">
>     <tr>
>         <th>Beschreibung</th>
>         <th>2004</th>
>     </tr>
>     <tr wicket:id="simple">
>         <td><span wicket:id="description">[description]</span></td>
>         <td><input type="text" wicket:id="value"></input> </td>
>     </tr>
>         </table>
> </form>
>
>
> 
##################################################################################
> public class MyRefrechingView extends RefreshingView{
> [...]
> protected void populateItem(Item item) {
>                  // populate the row of the repeater
>                 MyForm form = (MyForm)this.getParent();
>         IModel position = item.getModel();
>
>         final Label description = new Label("description", new
> PropertyModel(position, "description"));
>         item.add(description);
>
>         final MyAjaxTextField valueField = new MyAjaxTextField("value",
> new PropertyModel(position,"output"));
>         valueField.add(new MyAjaxFormSubmitBehavior(form,"onchange"));
>         valueField.setOutputMarkupId(true);
>         item.add(valueField);
>         }
>
> }
>
>
>
> 
##############################################################################
>
> public class MyAjaxTextField extends TextField{
>
>         MyOnChangeAjaxBehavior ajaxBehavior = new
> MyOnChangeAjaxBehavior();
>
>         public MyAjaxTextField(String arg0) {
>                 super(arg0);
>
>         }
>         public MyAjaxTextField(String arg0, IModel model) {
>                 super(arg0,model);
>                 //this.add(ajaxBehavior);
>                 PropertyModel pm = (PropertyModel)model;
>                 Position position = (Position)pm.getTarget();
>
>                 if(position.hasFormula()){
>                         this.add(new MyAjaxOnClickEvent("onclick"));
>                         this.add(new MyAjaxOnBlurEvent("onblur"));
>                 }
>         }
> }
>
> The Value of the TextField depends on some data stored at Position. It
> could be a normal double value or a formula.
> If i run the app, everything seems fine and all calculations and ajax
> updateing seems to work but i got this exception:
>
> 58023 [http-8080-Processor25] ERROR org.apache.wicket.RequestCycle - 
there
> was an error cleaning up target [AjaxRequestTarget@1723691750
> markupIdToComponent [{value6=[MarkupContainer [Component id = value, 
page
> = <No Page>, path = 1:value.MyAjaxTextField]], form5=[MarkupContainer
> [Component id = form, page = pages.ConfirmPage, path =
> 1:tabs:panel:form.MyForm, isVisible = true, isVersioned = false]]}],
> prependJavascript [[]], appendJavascript [[]].
> java.lang.IllegalStateException: No Page found for component
> [MarkupContainer [Component id = value, page = <No Page>, path =
> 1:value.MyAjaxTextField]]
>         at org.apache.wicket.Component.getPage(Component.java:1343)
>         at org.apache.wicket.ajax.AjaxRequestTarget.detach(
> AjaxRequestTarget.java:436)
>         at org.apache.wicket.RequestCycle.detach(RequestCycle.java:911)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1194)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(
> WicketFilter.java:257)
>         at org.apache.wicket.protocol.http.WicketServlet.doPost(
> WicketServlet.java:144)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:252)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:213)
>         at org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:178)
>         at org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:126)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:105)
>         at org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:107)
>         at org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:148)
>         at org.apache.coyote.http11.Http11Processor.process(
> Http11Processor.java:868)
>         at
>
> 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (
> Http11BaseProtocol.java:663)
>         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:527)
>         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
>         at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
>         at java.lang.Thread.run(Unknown Source)
>
>
>
> What do i have to change to avoid these exception. I don't have a clue
> where it comes from. Even the debugger doesn't help.
>
> Hope one of you could?
>
> Fabian