Return type net.sf.json.JSONObject can not be handled
Hello, Is it possible to configure return types? In one of my event methods I was trying to return net.sf.json.JSONObject instead of org.apache.tapestry5.json.JSONObject and got this error message: [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: A component event handler method returned the value {birthDay:,birthMonth:,birthYear:,gender:male,postOfficeNumberAndName:1236 Trzin}. Return type net.sf.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.ajax.MultiZoneUpdate, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. org.apache.tapestry5.runtime.ComponentEventException: A component event handler method returned the value {birthDay:,birthMonth:,birthYear:,gender:male,postOfficeNumberAndName:1236 Trzin}. Return type net.sf.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.ajax.MultiZoneUpdate, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. [at context:Index.tml, line 20] My event method: @OnEvent(component = email, value = blur) public JSONObject checkIfUserWithThisEmailExists(String value) { UserData userData = new UserData(); if(value.equals(b...@example.com)) { userData.setPostOfficeNumberAndName(1236 Trzin); userData.setGender(male); } else { logger.info(Bob does not exist.); } JSONObject jsonObject = (JSONObject) JSONSerializer.toJSON(userData); return jsonObject; } The reason I used net.sf.json.JSONObject is because it offers great conversion and construction capabilities to/from JavaBeans/XML/JSON. Have a look at http://json-lib.sourceforge.net/snippets.html. Is it possible or do I have to construct the org.apache.tapestry5.json.JSON object by hand? Thanks, Borut
Re: Return type net.sf.json.JSONObject can not be handled
Hi You will have to create your own ComponentEventResultProcessor and contribute it in your AppModule class : public void contributeComponentEventResultProcessor( MappedConfigurationClass, ComponentEventResultProcessor configuration) { configuration.addInstance(net.sf.json.JSONObject.class, YouProcessor.class); } 2010/7/8 Borut Bolčina borut.bolc...@gmail.com Hello, Is it possible to configure return types? In one of my event methods I was trying to return net.sf.json.JSONObject instead of org.apache.tapestry5.json.JSONObject and got this error message: [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: A component event handler method returned the value {birthDay:,birthMonth:,birthYear:,gender:male,postOfficeNumberAndName:1236 Trzin}. Return type net.sf.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.ajax.MultiZoneUpdate, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. org.apache.tapestry5.runtime.ComponentEventException: A component event handler method returned the value {birthDay:,birthMonth:,birthYear:,gender:male,postOfficeNumberAndName:1236 Trzin}. Return type net.sf.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.ajax.MultiZoneUpdate, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. [at context:Index.tml, line 20] My event method: @OnEvent(component = email, value = blur) public JSONObject checkIfUserWithThisEmailExists(String value) { UserData userData = new UserData(); if(value.equals(b...@example.com)) { userData.setPostOfficeNumberAndName(1236 Trzin); userData.setGender(male); } else { logger.info(Bob does not exist.); } JSONObject jsonObject = (JSONObject) JSONSerializer.toJSON(userData); return jsonObject; } The reason I used net.sf.json.JSONObject is because it offers great conversion and construction capabilities to/from JavaBeans/XML/JSON. Have a look at http://json-lib.sourceforge.net/snippets.html. Is it possible or do I have to construct the org.apache.tapestry5.json.JSON object by hand? Thanks, Borut -- Regards, Christophe Cordenier. Committer on Apache Tapestry 5 Co-creator of wooki @wookicentral.com
Re: Return type net.sf.json.JSONObject can not be handled
You'll probably want to contribute it to AjaxComponentEventResultProcessor though. On 08.07.2010 12:36, Christophe Cordenier wrote: Hi You will have to create your own ComponentEventResultProcessor and contribute it in your AppModule class : public void contributeComponentEventResultProcessor( MappedConfigurationClass, ComponentEventResultProcessor configuration) { configuration.addInstance(net.sf.json.JSONObject.class, YouProcessor.class); } 2010/7/8 Borut Bolčinaborut.bolc...@gmail.com Hello, Is it possible to configure return types? In one of my event methods I was trying to return net.sf.json.JSONObject instead of org.apache.tapestry5.json.JSONObject and got this error message: [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: A component event handler method returned the value {birthDay:,birthMonth:,birthYear:,gender:male,postOfficeNumberAndName:1236 Trzin}. Return type net.sf.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.ajax.MultiZoneUpdate, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. org.apache.tapestry5.runtime.ComponentEventException: A component event handler method returned the value {birthDay:,birthMonth:,birthYear:,gender:male,postOfficeNumberAndName:1236 Trzin}. Return type net.sf.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.ajax.MultiZoneUpdate, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. [at context:Index.tml, line 20] My event method: @OnEvent(component = email, value = blur) public JSONObject checkIfUserWithThisEmailExists(String value) { UserData userData = new UserData(); if(value.equals(b...@example.com)) { userData.setPostOfficeNumberAndName(1236 Trzin); userData.setGender(male); } else { logger.info(Bob does not exist.); } JSONObject jsonObject = (JSONObject) JSONSerializer.toJSON(userData); return jsonObject; } The reason I used net.sf.json.JSONObject is because it offers great conversion and construction capabilities to/from JavaBeans/XML/JSON. Have a look at http://json-lib.sourceforge.net/snippets.html. Is it possible or do I have to construct the org.apache.tapestry5.json.JSON object by hand? Thanks, Borut - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return type net.sf.json.JSONObject can not be handled
Thanks for ultra fast responses. I guess they went through AjaxComponentEventResultProcessor :-) Until I try implementing the processor class, I found a compromise. return org.apache.tapestry5.json.JSONObject jsonObject = new org.apache.tapestry5.json.JSONObject(JSONSerializer.toJSON(userData).toString()); I found out that org.apache.tapestry5.json.JSONObject has a constructor with a String form of a JSON object. Thanks! Borut 2010/7/8 Ulrich Stärk u...@spielviel.de You'll probably want to contribute it to AjaxComponentEventResultProcessor though. On 08.07.2010 12:36, Christophe Cordenier wrote: Hi You will have to create your own ComponentEventResultProcessor and contribute it in your AppModule class : public void contributeComponentEventResultProcessor( MappedConfigurationClass, ComponentEventResultProcessor configuration) { configuration.addInstance(net.sf.json.JSONObject.class, YouProcessor.class); } 2010/7/8 Borut Bolčinaborut.bolc...@gmail.com Hello, Is it possible to configure return types? In one of my event methods I was trying to return net.sf.json.JSONObject instead of org.apache.tapestry5.json.JSONObject and got this error message: [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: A component event handler method returned the value {birthDay:,birthMonth:,birthYear:,gender:male,postOfficeNumberAndName:1236 Trzin}. Return type net.sf.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.ajax.MultiZoneUpdate, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. org.apache.tapestry5.runtime.ComponentEventException: A component event handler method returned the value {birthDay:,birthMonth:,birthYear:,gender:male,postOfficeNumberAndName:1236 Trzin}. Return type net.sf.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.ajax.MultiZoneUpdate, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. [at context:Index.tml, line 20] My event method: @OnEvent(component = email, value = blur) public JSONObject checkIfUserWithThisEmailExists(String value) { UserData userData = new UserData(); if(value.equals(b...@example.com)) { userData.setPostOfficeNumberAndName(1236 Trzin); userData.setGender(male); } else { logger.info(Bob does not exist.); } JSONObject jsonObject = (JSONObject) JSONSerializer.toJSON(userData); return jsonObject; } The reason I used net.sf.json.JSONObject is because it offers great conversion and construction capabilities to/from JavaBeans/XML/JSON. Have a look at http://json-lib.sourceforge.net/snippets.html. Is it possible or do I have to construct the org.apache.tapestry5.json.JSON object by hand? Thanks, Borut - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return type net.sf.json.JSONObject can not be handled
It's more fun to create your own ResultProcessor, though :) You'll get to try out the real power of T5. On Thu, Jul 8, 2010 at 1:28 PM, Borut Bolčina borut.bolc...@gmail.comwrote: Thanks for ultra fast responses. I guess they went through AjaxComponentEventResultProcessor :-) Until I try implementing the processor class, I found a compromise. return org.apache.tapestry5.json.JSONObject jsonObject = new org.apache.tapestry5.json.JSONObject(JSONSerializer.toJSON(userData).toString()); I found out that org.apache.tapestry5.json.JSONObject has a constructor with a String form of a JSON object. Thanks! Borut 2010/7/8 Ulrich Stärk u...@spielviel.de You'll probably want to contribute it to AjaxComponentEventResultProcessor though. On 08.07.2010 12:36, Christophe Cordenier wrote: Hi You will have to create your own ComponentEventResultProcessor and contribute it in your AppModule class : public void contributeComponentEventResultProcessor( MappedConfigurationClass, ComponentEventResultProcessor configuration) { configuration.addInstance(net.sf.json.JSONObject.class, YouProcessor.class); } 2010/7/8 Borut Bolčinaborut.bolc...@gmail.com Hello, Is it possible to configure return types? In one of my event methods I was trying to return net.sf.json.JSONObject instead of org.apache.tapestry5.json.JSONObject and got this error message: [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: A component event handler method returned the value {birthDay:,birthMonth:,birthYear:,gender:male,postOfficeNumberAndName:1236 Trzin}. Return type net.sf.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.ajax.MultiZoneUpdate, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. org.apache.tapestry5.runtime.ComponentEventException: A component event handler method returned the value {birthDay:,birthMonth:,birthYear:,gender:male,postOfficeNumberAndName:1236 Trzin}. Return type net.sf.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.ajax.MultiZoneUpdate, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. [at context:Index.tml, line 20] My event method: @OnEvent(component = email, value = blur) public JSONObject checkIfUserWithThisEmailExists(String value) { UserData userData = new UserData(); if(value.equals(b...@example.com)) { userData.setPostOfficeNumberAndName(1236 Trzin); userData.setGender(male); } else { logger.info(Bob does not exist.); } JSONObject jsonObject = (JSONObject) JSONSerializer.toJSON(userData); return jsonObject; } The reason I used net.sf.json.JSONObject is because it offers great conversion and construction capabilities to/from JavaBeans/XML/JSON. Have a look at http://json-lib.sourceforge.net/snippets.html. Is it possible or do I have to construct the org.apache.tapestry5.json.JSON object by hand? Thanks, Borut - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
You need to make sure that the form's zone parameter is set to the id and not just the t:id of the Zone. I started generating my own xml id's from a root name and the actual database id of the object I was about to use. I can't speak to mixing in the custom javascript, except that when the Ajax submit is working properly, the response should effectively clear the display:none that you just set before sending the request. Your response need's to indicate that the style of the form should be hidden - or don't even return a form, return some text to indicate it's been dealt with. If that is the case, then you won't need the custom javascript anyway. You might also want to consider setting the context of the form. I've bumped my head on problems with loop state and forms before, but it does depend what you are looping over. Nested loops can be fun. JB On Thu, Jun 24, 2010 at 12:52 AM, SakshiAgarwal sakshi.a...@gmail.comwrote: Hi, I did check this example, but it helped me only to some extent. The main problem in my case is: the structure of my TML file is like this: Loop Zone Form (defined photoZOne here) Submit the main problem is: counter value for first form does not function properly...it gives very unpredictable results..for rest of the subsequent forms ( from the loop) works properly... Any suggestions/advice ? http://old.nabble.com/file/p28978902/photos.tml photos.tml I hope I am clear in my problem stmt. Looking fwd for solution for my problem. regards sakshi P.S. The reason I use zone here is: I have 'reported catergory' attached to each photo. and if I disapprove I need to submit it with the reason i.e. 'reported category' that particular photo. So i can't submit the entire form( as it contains multiple photos). I also need to add java script in my code as I want to hide the photo as soon as i take action on it. (i.e. approve/disapprove) Looked at many examples but nothing works fine with everything in place, i.e. zone,loop,form,javascript all together Geoff Callender-2 wrote: Does this example help? http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/ajaxform On 23/06/2010, at 3:06 PM, SakshiAgarwal wrote: Hi, Thanks a lot for the reply. It works now. I have been struggling hard to make zone work with Form Submit component. I read on http://www.infoq.com/articles/tapestry5-intro, how to make AJAX request. So accordingly from my attached Photos.tml file, I should make onSuccessFromDisapprovePhoto and from this method I should return Zone body. But in my case, none of the methods are getting invoked - eg: onSelectedFromDisapprovePhoto/onSuccessFromDisapprovePhoto They work fine with ActionLink but not otherwise. http://old.nabble.com/file/p28967834/Photos.java Photos.java http://old.nabble.com/file/p28967834/Photos.tml Photos.tml In my case, I have tried JSON, Mixin for javascript code. but none works with zone. How to make it a AJAX request?? Please guide me. regards sakshi -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28967834.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28978902.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Jonathan Barker ITStrategic
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
Thanks a lot..now this works for me...I am so happy about it as I have been struggling through it since many days... my another doubt is - if i replace submit component with linksubmit; my javascript method onclick is not getting invoked... Whereas, if i use JSON or mixin my script is invoked only on page render. i.e when I open my Photo page(and that time, counter value is not even set, so no way to inform which form to hide) and it doesn't get called again on submitting the sub form. Any workaround for that ? Regards Sakshi Jonathan Barker wrote: You need to make sure that the form's zone parameter is set to the id and not just the t:id of the Zone. I started generating my own xml id's from a root name and the actual database id of the object I was about to use. I can't speak to mixing in the custom javascript, except that when the Ajax submit is working properly, the response should effectively clear the display:none that you just set before sending the request. Your response need's to indicate that the style of the form should be hidden - or don't even return a form, return some text to indicate it's been dealt with. If that is the case, then you won't need the custom javascript anyway. You might also want to consider setting the context of the form. I've bumped my head on problems with loop state and forms before, but it does depend what you are looping over. Nested loops can be fun. JB On Thu, Jun 24, 2010 at 12:52 AM, SakshiAgarwal sakshi.a...@gmail.comwrote: Hi, I did check this example, but it helped me only to some extent. The main problem in my case is: the structure of my TML file is like this: Loop Zone Form (defined photoZOne here) Submit the main problem is: counter value for first form does not function properly...it gives very unpredictable results..for rest of the subsequent forms ( from the loop) works properly... Any suggestions/advice ? http://old.nabble.com/file/p28978902/photos.tml photos.tml I hope I am clear in my problem stmt. Looking fwd for solution for my problem. regards sakshi P.S. The reason I use zone here is: I have 'reported catergory' attached to each photo. and if I disapprove I need to submit it with the reason i.e. 'reported category' that particular photo. So i can't submit the entire form( as it contains multiple photos). I also need to add java script in my code as I want to hide the photo as soon as i take action on it. (i.e. approve/disapprove) Looked at many examples but nothing works fine with everything in place, i.e. zone,loop,form,javascript all together Geoff Callender-2 wrote: Does this example help? http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/ajaxform On 23/06/2010, at 3:06 PM, SakshiAgarwal wrote: Hi, Thanks a lot for the reply. It works now. I have been struggling hard to make zone work with Form Submit component. I read on http://www.infoq.com/articles/tapestry5-intro, how to make AJAX request. So accordingly from my attached Photos.tml file, I should make onSuccessFromDisapprovePhoto and from this method I should return Zone body. But in my case, none of the methods are getting invoked - eg: onSelectedFromDisapprovePhoto/onSuccessFromDisapprovePhoto They work fine with ActionLink but not otherwise. http://old.nabble.com/file/p28967834/Photos.java Photos.java http://old.nabble.com/file/p28967834/Photos.tml Photos.tml In my case, I have tried JSON, Mixin for javascript code. but none works with zone. How to make it a AJAX request?? Please guide me. regards sakshi -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28967834.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28978902.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Jonathan Barker ITStrategic -- View this message in context:
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
Does this example help? http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/ajaxform On 23/06/2010, at 3:06 PM, SakshiAgarwal wrote: Hi, Thanks a lot for the reply. It works now. I have been struggling hard to make zone work with Form Submit component. I read on http://www.infoq.com/articles/tapestry5-intro, how to make AJAX request. So accordingly from my attached Photos.tml file, I should make onSuccessFromDisapprovePhoto and from this method I should return Zone body. But in my case, none of the methods are getting invoked - eg: onSelectedFromDisapprovePhoto/onSuccessFromDisapprovePhoto They work fine with ActionLink but not otherwise. http://old.nabble.com/file/p28967834/Photos.java Photos.java http://old.nabble.com/file/p28967834/Photos.tml Photos.tml In my case, I have tried JSON, Mixin for javascript code. but none works with zone. How to make it a AJAX request?? Please guide me. regards sakshi -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28967834.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
Hi, I did check this example, but it helped me only to some extent. The main problem in my case is: the structure of my TML file is like this: Loop Zone Form (defined photoZOne here) Submit the main problem is: counter value for first form does not function properly...it gives very unpredictable results..for rest of the subsequent forms ( from the loop) works properly... Any suggestions/advice ? http://old.nabble.com/file/p28978902/photos.tml photos.tml I hope I am clear in my problem stmt. Looking fwd for solution for my problem. regards sakshi P.S. The reason I use zone here is: I have 'reported catergory' attached to each photo. and if I disapprove I need to submit it with the reason i.e. 'reported category' that particular photo. So i can't submit the entire form( as it contains multiple photos). I also need to add java script in my code as I want to hide the photo as soon as i take action on it. (i.e. approve/disapprove) Looked at many examples but nothing works fine with everything in place, i.e. zone,loop,form,javascript all together Geoff Callender-2 wrote: Does this example help? http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/ajaxform On 23/06/2010, at 3:06 PM, SakshiAgarwal wrote: Hi, Thanks a lot for the reply. It works now. I have been struggling hard to make zone work with Form Submit component. I read on http://www.infoq.com/articles/tapestry5-intro, how to make AJAX request. So accordingly from my attached Photos.tml file, I should make onSuccessFromDisapprovePhoto and from this method I should return Zone body. But in my case, none of the methods are getting invoked - eg: onSelectedFromDisapprovePhoto/onSuccessFromDisapprovePhoto They work fine with ActionLink but not otherwise. http://old.nabble.com/file/p28967834/Photos.java Photos.java http://old.nabble.com/file/p28967834/Photos.tml Photos.tml In my case, I have tried JSON, Mixin for javascript code. but none works with zone. How to make it a AJAX request?? Please guide me. regards sakshi -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28967834.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28978902.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
Hi Did u get the solution to ur problem. I am facing the same problem component event handler method returned the value Block[Body of Photos:photozone, at context:Photos.tml, line 28]. Return type org.apache.tapestry5.internal.structure.BlockImpl can not be handled regards sakshi -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28956471.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
On Tue, 22 Jun 2010 03:09:56 -0300, SakshiAgarwal sakshi.a...@gmail.com wrote: Hi Hi! Did u get the solution to ur problem. I am facing the same problem component event handler method returned the value Block[Body of Photos:photozone, at context:Photos.tml, line 28]. Return type org.apache.tapestry5.internal.structure.BlockImpl can not be handled This happens when you return a Block in a non-AJAX request. @Inject Request and use its isXHR() method to check if the current request is an AJAX one or not. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
Hi, Thanks a lot for the reply. It works now. I have been struggling hard to make zone work with Form Submit component. I read on http://www.infoq.com/articles/tapestry5-intro, how to make AJAX request. So accordingly from my attached Photos.tml file, I should make onSuccessFromDisapprovePhoto and from this method I should return Zone body. But in my case, none of the methods are getting invoked - eg: onSelectedFromDisapprovePhoto/onSuccessFromDisapprovePhoto They work fine with ActionLink but not otherwise. http://old.nabble.com/file/p28967834/Photos.java Photos.java http://old.nabble.com/file/p28967834/Photos.tml Photos.tml In my case, I have tried JSON, Mixin for javascript code. but none works with zone. How to make it a AJAX request?? Please guide me. regards sakshi -- View this message in context: http://old.nabble.com/Updating-a-Zone-with-Actionlink-doesn%27t-work-%28Return-type-can-not-be-handled%29-tp27355636p28967834.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Render phase return type equivalent to void
Hi, I have build a RestrictedVisibility Mixin which shows or hides an entire component by returning true or false in the @SetupRender method [1]. This works well but I just realized there is one drawback. When I return true, setup render skips to the next step (@BeginRender) where I would like it to continue down the line so @SetupRender of the component it is mixed in is also executed. I have partially solved this by annotating the mixing with @MixinAfter, but now I execute the setup render methods of components that are never shown which not ideal. Is there another return type or another way to achieve this? Or are there better ways to achieve my visibility restriction. Thanks, Joost [1] (simplified) @SetupRender private Object setup() { if(showComponent) { return true; } return false; } - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Render phase return type equivalent to void
On Mon, 07 Jun 2010 04:36:08 -0300, Joost Schouten (ml) joost...@jsportal.com wrote: Hi, Hi! Render phase return type equivalent to void: null. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Render phase return type equivalent to void
So simple, I could have guessed that ;-) Thanks, Joost Thiago H. de Paula Figueiredo wrote: On Mon, 07 Jun 2010 04:36:08 -0300, Joost Schouten (ml) joost...@jsportal.com wrote: Hi, Hi! Render phase return type equivalent to void: null. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Updating a Zone with Actionlink doesn't work (Return type can not be handled)
Hi there, I'm currently writing an application, which uses Tapestry 5.1. So far, I have no problems, but now I try to add some AJAX support. I want to update a Zone on my page, if the user clicks an actionlink. For this, I use the following code: t:zone t:id=catsZone t:actionlink t:id=myActionlink zone=catsZonetext/t:actionlink /t:zone und in der Java Datei @InjectComponent private Zone _catsZone; Object onActionFromMyActionlink(){ return _catsZone.getBody(); } The same problem occures, if I use a Beaneditform in a Zone: t:zone t:id=myZone t:beaneditform object=myUser zone=myZone/ /t:zone In both versions, I get the following error: Return type org.apache.tapestry5.internal.structure.BlockImpl can not be handled. Configured return types are... Could you please help me with this issue? I don't know, where my error is :( A test with request.isXHR() always returns false... Thanks a lot! - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
Make sure Javascript is enabled and there are no Javascript errors in your page. By the way, when Request.isXHR() returns false, you should return null to refresh the page. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
Wow, that was fast, thank you very much... I don't use any custom javascript and other thinks like a autocomplete work, so I don't think, it's a problem with my configuration. To return null is what I do if(request.isXHR) { return zone.getBody(); } else return null; On 28.01.2010 14:13, Thiago H. de Paula Figueiredo wrote: Make sure Javascript is enabled and there are no Javascript errors in your page. By the way, when Request.isXHR() returns false, you should return null to refresh the page. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
On Thu, 28 Jan 2010 11:36:07 -0200, Alexander Muthmann amuthm...@dev-eth0.de wrote: I don't use any custom javascript and other thinks like a autocomplete work, so I don't think, it's a problem with my configuration. To return null is what I do if(request.isXHR) { return zone.getBody(); } else return null; Use Firebug and/or Web Developer (Firefox addons) to check if anything is going wrong in the Javascript side. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Updating a Zone with Actionlink doesn't work (Return type can not be handled)
The only error is caused by prototype: Error: throw $continue is deprecated, use return instead { message=throw $continue is deprecated, use return instead, more...} Line: 4159 File: https://localhost/assets/scriptaculous/5.1.0.5/prototype.js Nothing else On 28.01.2010 14:45, Thiago H. de Paula Figueiredo wrote: On Thu, 28 Jan 2010 11:36:07 -0200, Alexander Muthmann amuthm...@dev-eth0.de wrote: I don't use any custom javascript and other thinks like a autocomplete work, so I don't think, it's a problem with my configuration. To return null is what I do if(request.isXHR) { return zone.getBody(); } else return null; Use Firebug and/or Web Developer (Firefox addons) to check if anything is going wrong in the Javascript side.
Return type
A beginner question. A short answer will be enough. What is the difference between returning a .class and an object from the same class, by a method handler? Thank you, Mite -- View this message in context: http://www.nabble.com/Return-type-tp26058940p26058940.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return type
Em Mon, 26 Oct 2009 10:34:37 -0200, Mite mitemeis...@gmail.com escreveu: A beginner question. A short answer will be enough. What is the difference between returning a .class and an object from the same class, by a method handler? None. :) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return type
Em Mon, 26 Oct 2009 10:39:05 -0200, cordenier christophe christophe.corden...@gmail.com escreveu: Hi Hi! The difference is that you will be able to call accessors on the object that will allow to persist datas between request. Use @Persist on persisted properties for the target page. Or properties that are populated from activation context values. In this case, don't forget to add an onPassivate() method that returns the activation context value. This way, you avoid using the session. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return type
Thanks Thiago, my response was to quick :) 2009/10/26 Thiago H. de Paula Figueiredo thiag...@gmail.com Em Mon, 26 Oct 2009 10:39:05 -0200, cordenier christophe christophe.corden...@gmail.com escreveu: Hi Hi! The difference is that you will be able to call accessors on the object that will allow to persist datas between request. Use @Persist on persisted properties for the target page. Or properties that are populated from activation context values. In this case, don't forget to add an onPassivate() method that returns the activation context value. This way, you avoid using the session. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return type
Thanks for the answers. :) -- View this message in context: http://www.nabble.com/Return-type-tp26058940p26059228.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return type org.apache.tapestry5.json.JSONObject can not be handled
I wondered that also, and I'm waiting on an answer. Does disabling JavaScript make the Ajax stuff invisible to Tapestry? If so, it'd be great to have a better error message. AJAX is all about using Javascript to update a part of a page without refreshing it. ;) Thus, no Javascript, no AJAX. Yes, I realize that. What I meant was, rather than just saying I don't know what to do with a JSONObject, it would be more helpful to the developer if it said You can't return a JSONObject to a non-AJAX request. The former message leaves me wondering if I've somehow misconfigured Tapestry. The latter message gives me a much better clue as to where to start looking for the problem. -- View this message in context: http://n2.nabble.com/Return-type-org.apache.tapestry5.json.JSONObject-can-not-be-handled-tp3295186p3311089.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return type org.apache.tapestry5.json.JSONObject can not be handled
Okay, I've heard, indirectly, from the customer. The laptop does have JavaScript enabled. However, it does not have networking fully configured and is never used on the Internet. They say This laptop has no IP address. (They are very security-conscious; perhaps this is to to make unauthorized access more difficult.) I believe they are using FireFox 3.0. Dojo is generating the should-be-AJAX requests. Perhaps this is ultimately a Dojo problem, that the laptop's configuration is causing Dojo to omit the XHR header. If you have any other ideas, I'd love to hear them, but otherwise, thanks for your time. Howard Lewis Ship wrote: To expand: that error is associated with an event handler method returning a value (JSONObject) that is appropriate for an Ajax response, but doing so during a traditional (i.e., non-Ajax) request. So for some reason, either it was a traditional request, or something on the browser side prevented Tapestry from recognizing the request as Ajax (it looks for an XHR header). -- View this message in context: http://n2.nabble.com/Return-type-org.apache.tapestry5.json.JSONObject-can-not-be-handled-tp3295186p3311186.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return type org.apache.tapestry5.json.JSONObject can not be handled
I wondered that also, and I'm waiting on an answer. Does disabling JavaScript make the Ajax stuff invisible to Tapestry? If so, it'd be great to have a better error message. From: Howard Lewis Ship (via Nabble) ml-user+45099-44142...@n2.nabble.com To: Franz Amador fgama...@yahoo.com Sent: Tuesday, July 21, 2009 11:04:05 PM Subject: Re: Return type org.apache.tapestry5.json.JSONObject can not be handled Is JavaScript disabled for that client's laptop? On Tue, Jul 21, 2009 at 10:55 AM, Franz Amadorfgama...@... wrote: Our Tapestry5/Dojo web app works just fine everywhere except on one customer's laptop. There he gets this error: Return type org.apache.tapestry5.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, java.net.URL, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.runtime.Component. We're using Tapestry 5.1.0.5 on Java 6, the laptop runs the Japanese version of Windows (XP, I assume), and the whole system (our webapp running on Tomcat with Oracle) is installed there. This configuration works great on our laptops (which aren't Japanese, though I don't know if that's relevant). I'm baffled. What could possibly have caused the AjaxComponentEventResultProcessor not to be available there (which I assume is the problem)? Any suggestions very much appreciated. -- View this message in context: http://n2.nabble.com/Return-type-org.apache.tapestry5.json.JSONObject-can-not-be-handled-tp3295186p3295186.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@... For additional commands, e-mail: users-h...@... -- Howard M. Lewis Ship Creator of Apache Tapestry Director of Open Source Technology at Formos - To unsubscribe, e-mail: users-unsubscr...@... For additional commands, e-mail: users-h...@... View message @ http://n2.nabble.com/Return-type-org.apache.tapestry5.json.JSONObject-can-not-be-handled-tp3295186p3300097.html To unsubscribe from Return type org.apache.tapestry5.json.JSONObject can not be handled, click here. -- View this message in context: http://n2.nabble.com/Return-type-org.apache.tapestry5.json.JSONObject-can-not-be-handled-tp3295186p3304209.html Sent from the Tapestry Users mailing list archive at Nabble.com.
Return type org.apache.tapestry5.json.JSONObject can not be handled
Our Tapestry5/Dojo web app works just fine everywhere except on one customer's laptop. There he gets this error: Return type org.apache.tapestry5.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, java.net.URL, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.runtime.Component. We're using Tapestry 5.1.0.5 on Java 6, the laptop runs the Japanese version of Windows (XP, I assume), and the whole system (our webapp running on Tomcat with Oracle) is installed there. This configuration works great on our laptops (which aren't Japanese, though I don't know if that's relevant). I'm baffled. What could possibly have caused the AjaxComponentEventResultProcessor not to be available there (which I assume is the problem)? Any suggestions very much appreciated. -- View this message in context: http://n2.nabble.com/Return-type-org.apache.tapestry5.json.JSONObject-can-not-be-handled-tp3295186p3295186.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return type org.apache.tapestry5.json.JSONObject can not be handled
Is JavaScript disabled for that client's laptop? On Tue, Jul 21, 2009 at 10:55 AM, Franz Amadorfgama...@yahoo.com wrote: Our Tapestry5/Dojo web app works just fine everywhere except on one customer's laptop. There he gets this error: Return type org.apache.tapestry5.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, java.net.URL, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.runtime.Component. We're using Tapestry 5.1.0.5 on Java 6, the laptop runs the Japanese version of Windows (XP, I assume), and the whole system (our webapp running on Tomcat with Oracle) is installed there. This configuration works great on our laptops (which aren't Japanese, though I don't know if that's relevant). I'm baffled. What could possibly have caused the AjaxComponentEventResultProcessor not to be available there (which I assume is the problem)? Any suggestions very much appreciated. -- View this message in context: http://n2.nabble.com/Return-type-org.apache.tapestry5.json.JSONObject-can-not-be-handled-tp3295186p3295186.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry Director of Open Source Technology at Formos - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Return type org.apache.tapestry5.json.JSONObject can not be handled
To expand: that error is associated with an event handler method returning a value (JSONObject) that is appropriate for an Ajax response, but doing so during a traditional (i.e., non-Ajax) request. So for some reason, either it was a traditional request, or something on the browser side prevented Tapestry from recognizing he request as Ajax (it looks for an XHR header). On Tue, Jul 21, 2009 at 11:06 AM, Howard Lewis Shiphls...@gmail.com wrote: Is JavaScript disabled for that client's laptop? On Tue, Jul 21, 2009 at 10:55 AM, Franz Amadorfgama...@yahoo.com wrote: Our Tapestry5/Dojo web app works just fine everywhere except on one customer's laptop. There he gets this error: Return type org.apache.tapestry5.json.JSONObject can not be handled. Configured return types are java.lang.Class, java.lang.String, java.net.URL, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.runtime.Component. We're using Tapestry 5.1.0.5 on Java 6, the laptop runs the Japanese version of Windows (XP, I assume), and the whole system (our webapp running on Tomcat with Oracle) is installed there. This configuration works great on our laptops (which aren't Japanese, though I don't know if that's relevant). I'm baffled. What could possibly have caused the AjaxComponentEventResultProcessor not to be available there (which I assume is the problem)? Any suggestions very much appreciated. -- View this message in context: http://n2.nabble.com/Return-type-org.apache.tapestry5.json.JSONObject-can-not-be-handled-tp3295186p3295186.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry Director of Open Source Technology at Formos -- Howard M. Lewis Ship Creator of Apache Tapestry Director of Open Source Technology at Formos - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: ILink return type for page listener.
Your page class define (Example YourBasePageClass): @InjectObject(engine-service:external) public abstract IEngineService getExternalService(); public ILink getExternalLink(String pageName, Object[] parameters) { ExternalServiceParameter esp = new ExternalServiceParameter(pageName, parameters); return getExternalService().getLink(false, esp); } Your require parameters page class: public abstract class YourPageClass extends BasePage implements IExternalPage { public abstract void setName(String name); public void activateExternalPage(Object[] parameters, RequestCycle cycle) { setName(parameters[0].toString())); } } invoke: public ILink yourListenerMethod(){ return getExternalLink(YourPageClass,your name); } Leo Sakhvoruk wrote: I'm trying to figure out how to use an ILink return type for a listener method in my page. I'm wanting to use it for the purpose of redirect-after-post in order so that the page the user is sent to displays the correct URL for it for page refreshes and user tracking statistics. It seems ok for pages that don't require parameters but how would I construct an ILink for a page that renders data that is passed to it via parameters and such? The page service doesn't handle that so what service should I use when constructing a link or is there even a way to do that? Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ILink return type for page listener.
I'm trying to figure out how to use an ILink return type for a listener method in my page. I'm wanting to use it for the purpose of redirect-after-post in order so that the page the user is sent to displays the correct URL for it for page refreshes and user tracking statistics. It seems ok for pages that don't require parameters but how would I construct an ILink for a page that renders data that is passed to it via parameters and such? The page service doesn't handle that so what service should I use when constructing a link or is there even a way to do that? Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]