You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jesse Kuhnert (JIRA)" <de...@tapestry.apache.org> on 2007/05/13 02:32:15 UTC

[jira] Closed: (TAPESTRY-1455) EventListener fails to update PropertySelection in Internet Explorer-only

     [ https://issues.apache.org/jira/browse/TAPESTRY-1455?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Kuhnert closed TAPESTRY-1455.
-----------------------------------

    Resolution: Cannot Reproduce
      Assignee: Jesse Kuhnert

This particular thing I know works as I'm using the exact same logic in my own project.  The only difference is that I'm not getting a NumberFormatException in my page when attempting to parse an empty "" string.  ;)

p.s. You don't need submitForm = "foo" anymore, it gets wired automatically. 

> EventListener fails to update PropertySelection in Internet Explorer-only
> -------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1455
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1455
>             Project: Tapestry
>          Issue Type: Bug
>          Components: XHR/dhtml/Ajax
>    Affects Versions: 4.1.2
>         Environment: Tapestry 4.1.2 snapshot from 5-9, WinXP
>            Reporter: Ben Dotte
>         Assigned To: Jesse Kuhnert
>
> I have an EventListener that is trying to take the input from one PropertySelection and update a second PropertySelection asynchronously based on the input from the first one. It works great in Firefox 2 but fails in IE7. In IE7, when I pick a value on the first dropdown, all values from the second dropdown disappear and a stacktrace appears on the console. I couldn't get it to work in IE6 either but I can't tell if it is the same problem or something else going on in the page.
> Here is some example code that demonstrates the problem:
> .html:
> <form jwcid="theForm@Form">
> 	<span jwcid="numbers@PropertySelection" value="ognl:selectedNumber" model="ognl:numberModel" />
> 	<br />
> 	<br />
> 	<span jwcid="letters@PropertySelection" value="ognl:selectedLetter" model="ognl:letterModel" />
> </form>
> .java:
> @InitialValue("1")
> public abstract Integer getSelectedNumber();
> 	
> public abstract String getSelectedLetter();
> 	
> public IPropertySelectionModel getNumberModel()
> {
> 	List<Integer> numbers = Arrays.asList(1, 2);
> 	return getBasicModel(numbers);
> }
> 	
> public IPropertySelectionModel getLetterModel()
> {
> 	if (getSelectedNumber().intValue() == 1)
> 	{
> 		List<String> letters = Arrays.asList("a", "b", "c");
> 		return getBasicModel(letters);
> 	}
> 	List<String> letters = Arrays.asList("d", "e", "f");
> 	return getBasicModel(letters);
> }
> 	
> private IPropertySelectionModel getBasicModel(final List items)
> {
> 	return new IPropertySelectionModel()
> 	{
> 		public String getLabel(int index)
> 		{
> 			return items.get(index).toString();
> 		}
> 		public Object getOption(int index)
> 		{
> 			return items.get(index);
> 		}
> 		public int getOptionCount()
> 		{
> 			return items.size();
> 		}
> 		public String getValue(int index)
> 		{
> 			return Integer.toString(index);
> 		}
> 		public boolean isDisabled(int index)
> 		{
> 			return false;
> 		}
> 		public Object translateValue(String value)
> 		{
> 			return getOption(Integer.parseInt(value));
> 		}
> 	};
> }
> 	
> @EventListener(targets="numbers", events="onchange", submitForm="theForm")
> public void numberSelected(IRequestCycle cycle)
> {
> 	try
> 	{
> 		cycle.getResponseBuilder().updateComponent("letters");
> 	}
> 	catch (Exception e)
> 	{
> 		e.printStackTrace();
> 	}
> }
> The stacktrace I get on the console is as follows:
> org.apache.hivemind.ApplicationRuntimeException: For input string: "" [context:/WEB-INF/app/DirectorAccount.html]
> 	at org.apache.tapestry.engine.RequestCycle.rewindForm(RequestCycle.java:474)
> 	at org.apache.tapestry.form.Form.trigger(Form.java:289)
> 	at org.apache.tapestry.engine.DirectService.triggerComponent(DirectService.java:166)
> 	at org.apache.tapestry.engine.DirectService.service(DirectService.java:142)
> 	at $IEngineService_1127198abca.service($IEngineService_1127198abca.java)
> 	at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:72)
> 	at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:246)
> 	at org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:54)
> 	at $WebRequestServicer_1127198aba3.service($WebRequestServicer_1127198aba3.java)
> 	at $WebRequestServicer_1127198ab9f.service($WebRequestServicer_1127198ab9f.java)
> 	at org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:61)
> 	at $ServletRequestServicer_1127198ab81.service($ServletRequestServicer_1127198ab81.java)
> 	at org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
> 	at $ServletRequestServicerFilter_1127198ab7d.service($ServletRequestServicerFilter_1127198ab7d.java)
> 	at $ServletRequestServicer_1127198ab83.service($ServletRequestServicer_1127198ab83.java)
> 	at collective.ui.custom.HibernateFilter.service(HibernateFilter.java:37)
> 	at $ServletRequestServicerFilter_1127198ab7b.service($ServletRequestServicerFilter_1127198ab7b.java)
> 	at $ServletRequestServicer_1127198ab83.service($ServletRequestServicer_1127198ab83.java)
> 	at collective.ui.custom.LuceneIndexFilter.service(LuceneIndexFilter.java:24)
> 	at $ServletRequestServicerFilter_1127198ab79.service($ServletRequestServicerFilter_1127198ab79.java)
> 	at $ServletRequestServicer_1127198ab83.service($ServletRequestServicer_1127198ab83.java)
> 	at org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
> 	at $ServletRequestServicerFilter_1127198ab77.service($ServletRequestServicerFilter_1127198ab77.java)
> 	at $ServletRequestServicer_1127198ab83.service($ServletRequestServicer_1127198ab83.java)
> 	at org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
> 	at $ServletRequestServicerFilter_1127198ab7f.service($ServletRequestServicerFilter_1127198ab7f.java)
> 	at $ServletRequestServicer_1127198ab83.service($ServletRequestServicer_1127198ab83.java)
> 	at $ServletRequestServicer_1127198ab70.service($ServletRequestServicer_1127198ab70.java)
> 	at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
> 	at collective.ui.CollectiveApplicationServlet.doService(CollectiveApplicationServlet.java:71)
> 	at org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:168)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
> 	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:832)
> 	at collective.servlet.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:32)
> 	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:823)
> 	at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
> 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:556)
> 	at org.mortbay.http.HttpContext.handle(HttpContext.java:1563)
> 	at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:623)
> 	at org.mortbay.http.HttpContext.handle(HttpContext.java:1515)
> 	at org.mortbay.http.HttpServer.service(HttpServer.java:956)
> 	at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
> 	at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
> 	at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
> 	at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
> 	at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
> 	at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> Caused by: java.lang.NumberFormatException: For input string: ""
> 	at java.lang.NumberFormatException.forInputString(Unknown Source)
> 	at java.lang.Integer.parseInt(Unknown Source)
> 	at java.lang.Integer.parseInt(Unknown Source)
> 	at collective.md.ui.pages.DirectorAccount$1.translateValue(DirectorAccount.java:89)
> 	at org.apache.tapestry.form.PropertySelection.rewindFormComponent(PropertySelection.java:120)
> 	at org.apache.tapestry.form.AbstractFormComponent.renderComponent(AbstractFormComponent.java:94)
> 	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:724)
> 	at org.apache.tapestry.services.impl.DojoAjaxResponseBuilder.render(DojoAjaxResponseBuilder.java:590)
> 	at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:537)
> 	at org.apache.tapestry.form.FormSupportImpl.rewind(FormSupportImpl.java:603)
> 	at org.apache.tapestry.form.Form.renderComponent(Form.java:205)
> 	at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:724)
> 	at org.apache.tapestry.services.impl.DojoAjaxResponseBuilder.render(DojoAjaxResponseBuilder.java:590)
> 	at org.apache.tapestry.form.Form.rewind(Form.java:278)
> 	at org.apache.tapestry.engine.RequestCycle.rewindForm(RequestCycle.java:453)
> 	... 48 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org