Re: T4.1.4-SNAPSHOT issue migrating from 4.0.2 with PopupLinkSubmit
OK we updated the generated Javascript with the new version of the Javascript function function submitPopupLink(form, elementId, url) { var windowName = 'RDQGraphPopup'; var randomNumber = Math.floor(Math.random()*1000); windowName = windowName+randomNumber; aWindow = window.open(url, windowName, 'width=840, height=550, scrollbars=yes,resizable=yes', false); aWindow.focus(); var form = document.getElementById(form); form.target=windowName; tapestry.form.submit(form, elementId); form.target=''; } this seems to allow the popup link to work but we're still getting the errors in the back end. They don't seem to have any ill effect but they are generated each time the page serves. For script generation we are using the version of the call passing this: getScript().execute(this, cycle, pageRenderSupport, symbols); (If this is the call Jessie meant) Any ideas as to what is causing the error? Even though it does not seem to be causing any problems I've a feeling it's gonna bite us in the ass at some point... Here's PopupLinkSubmit.java if it's any help. As I mentioned before it's mostly copied from the online example I cited before. public abstract class PopupLinkSubmit extends CustomSubmit { /** * The name of an [EMAIL PROTECTED] org.apache.tapestry.IRequestCycle}attribute in which * the current submit link is stored. LinkSubmits do not nest. */ public static final String ATTRIBUTE_NAME = actualis.web.tapestry.PopupLinkSubmit; public static final String ATTRIBUTE_NAME_SCRIPT = actualis.web.tapestry.PopupLinkSubmitScript; /** * The name of an [EMAIL PROTECTED] org.apache.tapestry.IRequestCycle}attribute in which * the link submit component that generates the javascript function is stored. * The function is only required once per page (containing a form with a * non-disabled LinkSubmit) */ public static final String ATTRIBUTE_FUNCTION_NAME = actualis.web.tapestry.PopupLinkSubmit_function; @InjectObject(engine-service:external) public abstract IEngineService getExternalService(); @Parameter(required=false) public abstract String getStyleClass(); @Parameter(defaultValue=900, required=false) public abstract String getWindowHeight(); @Parameter(defaultValue=600, required=false) public abstract String getWindowWidth(); /** * Checks the submit name ([EMAIL PROTECTED] FormConstants#SUBMIT_NAME_PARAMETER}) to * see if it matches this LinkSubmit's assigned element name. */ @Override protected boolean isClicked(IRequestCycle cycle, String name) { String value = cycle.getParameter(FormConstants.SUBMIT_NAME_PARAMETER); return name.equals(value); } /** * * @param cycle * @return */ public ILink getLink(IRequestCycle cycle) { Object[] pageParameters = DirectLink.constructServiceParameters(getPopupParameters()); ExternalServiceParameter esp = new ExternalServiceParameter( getPopupPage(), pageParameters); return getExternalService().getLink(false, esp); } public abstract Object getPopupParameters(); public abstract String getPopupPage(); /** * @see org.apache.tapestry.form.AbstractFormComponent#renderFormComponent(org.apache.tapestry.IMarkupWriter, * org.apache.tapestry.IRequestCycle) */ @Override @SuppressWarnings(unchecked) protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle) { boolean disabled = isDisabled(); if (!disabled) { PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle,this); if (cycle.getAttribute(ATTRIBUTE_NAME_SCRIPT) == null) { BodyBuilder builder = new BodyBuilder(); builder.addln(); builder.addln(function {0}(form, elementId, url), submitPopupLink); builder.begin(); builder.addln(var windowName = 'RDQGraphPopup';); builder.addln(var randomNumber = Math.floor(Math.random()*1000);); builder.addln(windowName = windowName+randomNumber;); builder.addln(aWindow = window.open(url, windowName, + 'width=+getWindowWidth()+, height=+getWindowHeight() + , scrollbars=yes,resizable=yes' + , false);); builder.addln(aWindow.focus();); builder.addln(var form = document.getElementById(form);); builder.addln(form.target=windowName;); builder.addln(tapestry.form.submit(form, elementId);); builder.addln(form.target='';); builder.end(); pageRenderSupport.addBodyScript( this, builder.toString()); cycle.setAttribute(ATTRIBUTE_NAME_SCRIPT, this); } IForm form = getForm(); String slink = getLink(cycle).getURL(null, true); Map symbols =
Re: T4.1.4-SNAPSHOT issue migrating from 4.0.2 with PopupLinkSubmit
FYI, if we remove the PopupLinkSubmit component we don't get the errors appearing in the logs so it's definitely related to something in that component Dom --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T4.1.3 loop index issues, migrating from 4.0.2
Thanks for your help Jessie. Fix you applied to the 4.1.4-SNAPSHOT has fixed our issue. We have run into another issue in the migration which I'll post about separately... Dom Couldwell Global Markets Research +1(212)250-7082 --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T4.1.4-SNAPSHOT issue migrating from 4.0.2 with PopupLinkSubmit
We have a link on a page that does a submit and pops up a new window once the form has been submitted. The code is based on the PopupLinkSubmit example here: http://wiki.apache.org/tapestry/PopupLinkSubmit This all works fine on 4.0.2 but under 4.1.4-SNAPSHOT we get the following error when the page opens up: 2007-11-06 18:35:10,197, ERROR, [org.apache.tapestry.services.impl.HiveMindExpressionCompiler], line 227, Error generating OGNL statements for expression class with root {href=javascript:submitPopupLink('editorForm', 'PopupLinkSubmit','/GQ/Waiting.page');, [EMAIL PROTECTED]/editor.editorForm], class=action, popupLink=/GQ/Waiting.page, name=PopupLinkSubmit} org.apache.hivemind.ApplicationRuntimeException: Unable to add method void set(ognl.OgnlContext, java.lang.Object, java.lang.Object) to class $ASTProperty_116174fa4f8: [source error] put(java.lang.String,java.lang.Object) not found in java.lang.Object at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278) at org.apache.tapestry.services.impl.HiveMindExpressionCompiler.compileExpression(HiveMindExpressionCompiler.java:217) at ognl.OgnlRuntime.compileExpression(OgnlRuntime.java:523) at ognl.Ognl.compileExpression(Ognl.java:141) ... Caused by: javassist.CannotCompileException: [source error] put(java.lang.String,java.lang.Object) not found in java.lang.Object at javassist.CtBehavior.setBody(CtBehavior.java:347) at javassist.CtBehavior.setBody(CtBehavior.java:316) at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:272) ... 137 more Caused by: compile error: put(java.lang.String,java.lang.Object) not found in java.lang.Object at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:716) at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:681) at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:156) at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45) at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:235) at javassist.compiler.CodeGen.atStmnt(CodeGen.java:323) at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49) at javassist.compiler.CodeGen.atStmnt(CodeGen.java:344) at javassist.compiler.ast.Stmnt.accept(Stmnt.java:49) at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:285) at javassist.compiler.Javac.compileBody(Javac.java:212) at javassist.CtBehavior.setBody(CtBehavior.java:341) ... 139 more Here's what's on the page: a href=# jwcid=@PopupLinkSubmit listener=listener:openEditorGraph popuppage=Waiting styleClass=action windowWidth=840 windowHeight=550 Generate Plot /a Here's PopupLinkSubmit.script ?xml version=1.0? !DOCTYPE script PUBLIC -//Apache Software Foundation//Tapestry Script Specification 3.0//EN http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd; script input-symbol key=name class=java.lang.String required=yes/ input-symbol key=popupLink class=java.lang.String required=yes/ input-symbol key=form class=org.apache.tapestry.IForm required=yes/ input-symbol key=class class=java.lang.String required=no/ let key=href javascript:submitPopupLink('${form.name}', '${name}','${popupLink}'); /let let key=class ${class} /let /script Which comes out as: a href=javascript:submitPopupLink('editorForm', 'PopupLinkSubmit','/GQ/Waiting.page'); class=action Generate Plot /a The Javascript we're rendering in PopupLinkSubmit.java comes out as: function submitPopupLink(form, elementId, url) { var windowName = 'RDQGraphPopup'; var randomNumber = Math.floor(Math.random()*1000); windowName = windowName+randomNumber; aWindow = window.open(url, windowName, 'width=840, height=800, scrollbars=yes,resizable=yes', false); aWindow.focus(); var form = document.getElementById(form); form.target=windowName; form.events.submit(elementId); form.target=''; } I can supply the rest of the source if required but it's basically following the example I mentioned at the top. The rendered versions of the link and the Javascript are the same as under 4.0.2 but we get the above error in the back end and the link does not work. We get a Javascript error stating that 'events' is null or not an object. This is referring to this line: form.events.submit(elementId); Which seems to be related to issues mentioned here http://tapestry.apache.org/tapestry4.1/usersguide/upgrade4.0.html Can anyone let me know what we should be doing instead of form.events.submit? The documentation does not make it clear what the replacement is If we fix the form.events issues will that also fix the error we see when the page loads up or is that an unrelated error? Any ideas would be appreciated. Dom --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail
Re: T4.1.3 loop index issues, migrating from 4.0.2
Any ideas as to when we might get a fix for this? We're stuck in terms of migrating to 4.1.3 until we get a fix. Thanks, Dom --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T4.1.3 loop index issues, migrating from 4.0.2
Tried Andy's work around but no joy (stack track below). Have raised another JIRA (http://jira.opensymphony.com/browse/OGNL-131) yell if you need more details. Dom 2007-10-25 09:09:57,763, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException 2007-10-25 09:09:57,763, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to parse OGNL expression 'getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).[currentFilterIndex]': Malformed OGNL expression: getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).[currentFilterIndex] 2007-10-25 09:09:57,763, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-25 09:09:57,779, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, binding|ExpressionBinding[Home/$Search getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).[currentFilterIndex]] location|context:/WEB-INF/Search.html, line 109 2007-10-25 09:09:57,779, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.hivemind.ApplicationRuntimeException 2007-10-25 09:09:57,779, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to parse OGNL expression 'getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).[currentFilterIndex]': Malformed OGNL expression: getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).[currentFilterIndex] 2007-10-25 09:09:57,779, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-25 09:09:57,779, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, 2007-10-25 09:09:57,779, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, ognl.ExpressionSyntaxException 2007-10-25 09:09:57,795, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Malformed OGNL expression: getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).[currentFilterIndex] 2007-10-25 09:09:57,795, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-25 09:09:57,795, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, 2007-10-25 09:09:57,795, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, ognl.ParseException 2007-10-25 09:09:57,795, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Encountered [ at line 1, column 69. Was expecting one of: ( ... { ... IDENT ... 2007-10-25 09:09:57,795, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, Was expecting one of: ( ... { ... IDENT ... ognl.OgnlParser.generateParseException(OgnlParser.java:3161) ... Jesse Kuhnert [EMAIL PROTECTED] mTo Tapestry users 10/24/2007 04:59 users@tapestry.apache.org PMcc Subject Please respond to Re: T4.1.3 loop index issues, Tapestry users migrating from 4.0.2 [EMAIL PROTECTED] ache.org Another ognl jira ticket with as much specific information as possible would help me either way. Since you are getting errors that mention OgnlRuntime I'm thinking this isn't a compile time issue at all so would probably consider it more important than most to fix. (assuming I'm able to re-produce it in a simple non tapestry environment unit test) On 10/24/07, andyhot [EMAIL PROTECTED] wrote: well, it must be ognl related after all... In http://jira.opensymphony.com/browse/OGNL-130 you mentioned you tried selected=ognl:getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex) Well, I'm wondering if selected=ognl:getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).[currentFilterIndex] would work... Dom Couldwell wrote: Updated first For loop to: select jwcid=@Select multiple=literal:false size=10 onchange=ognl:'searchSubmit(\''[EMAIL PROTECTED]@INSTRUMENT_GROUP+'\',0);' div jwcid=@For source=ognl:tab.searchItems
T4.1.3 loop index issues, migrating from 4.0.2
Thanks to Jessie for his help fixing our last issue (We've updated to the ognl 2.7.2 snapshot which fixed it) but and have run into another issue migrating form 4.0.2 to 4.1.3. The following works fine under 4.0.2: select jwcid=@Select multiple=literal:false size=10 onchange=ognl:'searchSubmit(\''[EMAIL PROTECTED]@INSTRUMENT_GROUP+'\',0);' div jwcid=@For source=ognl:tab.searchItems value=ognl:currentSearchItem index=ognl:currentSearchItemIndex option jwcid=@Option selected=ognl:tab.searchItems[currentSearchItemIndex].selected label=ognl:tab.searchItems[currentSearchItemIndex].displayName /option /div /select Under 4.1.3 the page renders but then when the users selects an option and submits the form we get the following error: 2007-10-24 13:41:15,206, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException 2007-10-24 13:41:15,206, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to false: source is null for getProperty(null, currentSearchItemIndex) 2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, binding|ExpressionBinding[Home/$Search tab.searchItems[currentSearchItemIndex].selected] location|context:/WEB-INF/Search.html, line 82 2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.hivemind.ApplicationRuntimeException 2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to false: source is null for getProperty(null, currentSearchItemIndex) 2007-10-24 13:41:15,237, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-24 13:41:15,253, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, component|[EMAIL PROTECTED]/$Search] location|context:/WEB-INF/Home.html, line 51 2007-10-24 13:41:15,253, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, ognl.OgnlException 2007-10-24 13:41:15,253, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, source is null for getProperty(null, currentSearchItemIndex) 2007-10-24 13:41:15,253, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1993) ... It looks like the index variable is going out of scope or something equally strange. If we update the template to: select jwcid=@Select multiple=literal:false size=10 onchange=ognl:'searchSubmit(\''[EMAIL PROTECTED]@INSTRUMENT_GROUP+'\',0);' div jwcid=@For source=ognl:tab.searchItems value=ognl:currentSearchItem index=ognl:currentSearchItemIndex option jwcid=@Option selected=ognl:currentSearchItem.selected label=ognl:tab.searchItems[currentSearchItemIndex].displayName /option /div /select The page renders and submits correctly. In 4.0.2 we had avoided this syntax as it did not reliably save the value back into the correct element, has this syntax changed in 4.1.3? Unfortunately even with the above work around we hit a similar problem again later in the form select jwcid=@Select multiple=literal:false size=10 onchange=ognl:'searchSubmit(\''[EMAIL PROTECTED]@FILTER+'\', '+currentFilterGroupIndex+');' div jwcid=@For source=ognl:currentFilterGroup value=ognl:currentFilter index=ognl:currentFilterIndex option jwcid=@Option selected=ognl:tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] label=ognl:currentFilter /option /div /select The above renders OK but then the form submits we get: 2007-10-24 13:49:21,134, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException 2007-10-24 13:49:21,134, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to false: source is null for getProperty(null, currentFilterGroupIndex) 2007-10-24 13:49:21,134, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-24 13:49:21,134, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, binding|ExpressionBinding[Home/$Search tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex]] location|context:/WEB-INF/Search.html, line 106 2007-10-24 13:49:21,134, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.hivemind.ApplicationRuntimeException 2007-10-24 13:49:21,149, ERROR,
Re: T4.1.3 loop index issues, migrating from 4.0.2
, [com.db.rdq.web.tapestry.html.RDQException], line 23, source is null for getProperty(null, currentFilterGroupIndex) 2007-10-24 15:05:16,020, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1993) ... Do we also need to consider the match parameter? We did look at the Hints on the For page previously and a couple of them would involve a fair amount of re writing. The above is only a sample of pages we have and if we need to use IPrimaryKeyConverter or Squeeze adapters for all our For loops it's going to be a lot of work. Do you think these issues are down to the OGNL upgrade? Dom andyhot [EMAIL PROTECTED] To Sent by: Andreas Tapestry users Andreouusers@tapestry.apache.org [EMAIL PROTECTED]cc m Subject Re: T4.1.3 loop index issues, 10/24/2007 02:39 migrating from 4.0.2 PM Please respond to Tapestry users [EMAIL PROTECTED] ache.org looks like an issue during rewind - take a look at all those parameters and the hints for the @For component at http://tapestry.apache.org/tapestry4.1/components/general/for.html If the form worked in 4.0 and you weren't getting any |StaleLinkExceptions|, then using volatile=true should probably fix this Dom Couldwell wrote: Thanks to Jessie for his help fixing our last issue (We've updated to the ognl 2.7.2 snapshot which fixed it) but and have run into another issue migrating form 4.0.2 to 4.1.3. The following works fine under 4.0.2: select jwcid=@Select multiple=literal:false size=10 onchange=ognl:'searchSubmit(\''[EMAIL PROTECTED]@INSTRUMENT_GROUP+'\',0);' div jwcid=@For source=ognl:tab.searchItems value=ognl:currentSearchItem index=ognl:currentSearchItemIndex option jwcid=@Option selected=ognl:tab.searchItems[currentSearchItemIndex].selected label=ognl:tab.searchItems[currentSearchItemIndex].displayName /option /div /select Under 4.1.3 the page renders but then when the users selects an option and submits the form we get the following error: 2007-10-24 13:41:15,206, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException 2007-10-24 13:41:15,206, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to false: source is null for getProperty(null, currentSearchItemIndex) 2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, binding|ExpressionBinding[Home/$Search tab.searchItems[currentSearchItemIndex].selected] location|context:/WEB-INF/Search.html, line 82 2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.hivemind.ApplicationRuntimeException 2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to false: source is null for getProperty(null, currentSearchItemIndex) 2007-10-24 13:41:15,237, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-24 13:41:15,253, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, component|[EMAIL PROTECTED]/$Search] location|context:/WEB-INF/Home.html, line 51 2007-10-24 13:41:15,253, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, ognl.OgnlException 2007-10-24 13:41:15,253, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, source is null for getProperty(null
Re: Tap 4.0.2 to 4.1.2 migration loop / ognl issue
Anything in particular that you would suggest? Some of the underlying code is dictating some of this (e.g. the use of the 2D array of booleans). Dom Couldwell Global Markets Research +1(212)250-7082 andyhot [EMAIL PROTECTED] To Sent by: Andreas Tapestry users Andreouusers@tapestry.apache.org [EMAIL PROTECTED]cc m Subject Re: Tap 4.0.2 to 4.1.2 migration loop 10/19/2007 05:32 / ognl issue PM Please respond to Tapestry users [EMAIL PROTECTED] ache.org But i 1would point out that this is a good opportunity to clean up your markup Jesse Kuhnert wrote: Sounds like it's just an OGNL bug. If you file it here I should be able to fix it fairly quickly as it looks like something that'll be easy to do: http://jira.opensymphony.com/browse/OGNL (the fix will come in the form of a new 2.7.2-SNAPSHOT build off of http://opencomponentry.com/repository/ ) On 10/19/07, Dom Couldwell [EMAIL PROTECTED] wrote: Hi, I'm migrating an existing project which uses 4.0.2 to use 4.1.2 and I'm having and ognl / loop related issue. Here's the snippet that works on 4.0.2 td jwcid=@For source=ognl:tab.searchCriteriaOptions value=ognl:currentFilterGroup index=ognl:currentFilterGroupIndex div jwcid=@If element=literal:td condition=ognl:tab.searchCriteria[currentFilterGroupIndex] != null class=ognl:'filter' + getFilterColumnStyle(currentFilterGroupIndex) select jwcid=@Select multiple=literal:false size=10 onchange= ognl:'searchSubmit(\''[EMAIL PROTECTED]@FILTER+'\', '+currentFilterGroupIndex+');' div jwcid=@For source=ognl:currentFilterGroup value=ognl:currentFilter index=ognl:currentFilterIndex option jwcid=@Option selected= ognl:tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] label=ognl:currentFilter /option /div /select /div /td But under 4.1.2 it's giving me the error: 2007-10-19 16:31:13,878, ERROR, [org.apache.tapestry.services.impl.HiveMindExpressionCompiler], line 179, Error generating OGNL getter for expression tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] with root [EMAIL PROTECTED]/$Search] and body: { return ($w) (((java.util.List)(($Search_91)$2).getTab().getSearchCriteriaSelections()).get((($Search_91)$2).getCurrentFilterGroupIndex())).get(((java.util.List)(($Search_91)$2).getCurrentFilterIndex()));} org.apache.hivemind.ApplicationRuntimeException: Unable to add method java.lang.Object get(ognl.OgnlContext, java.lang.Object) to class $ASTChain_115b9f4b263: [source error] get(java.util.List) not found in java.lang.Object at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278) ... Caused by: javassist.CannotCompileException: [source error] get(java.util.List) not found in java.lang.Object at javassist.CtBehavior.setBody(CtBehavior.java:347) at javassist.CtBehavior.setBody(CtBehavior.java:316) at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:272) ... 161 more Caused by: compile error: get(java.util.List) not found in java.lang.Object ... Should we be using different ognl syntax for the new version of Tapestry? I've tried updating the problem line to selected= ognl:getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex) which works when the page serves but does not write the values back to the page: 2007
Re: Tap 4.0.2 to 4.1.2 migration loop / ognl issue
I should point out that the underlying implementation is a List of Lists not an actual 2D Array, don't know if that makes any difference. Dom Couldwell Global Markets Research +1(212)250-7082 Jesse Kuhnert [EMAIL PROTECTED] mTo Tapestry users 10/22/2007 08:53 users@tapestry.apache.org AMcc Subject Please respond to Re: Tap 4.0.2 to 4.1.2 migration loop Tapestry users / ognl issue [EMAIL PROTECTED] ache.org Yes, I think it's probably the 2d array causing my problems. Should be a fix for it later today. (evening EST ) On 10/22/07, Dom Couldwell [EMAIL PROTECTED] wrote: Anything in particular that you would suggest? Some of the underlying code is dictating some of this (e.g. the use of the 2D array of booleans). Dom Couldwell Global Markets Research +1(212)250-7082 andyhot [EMAIL PROTECTED] To Sent by: Andreas Tapestry users Andreouusers@tapestry.apache.org [EMAIL PROTECTED] cc m Subject Re: Tap 4.0.2 to 4.1.2 migration loop 10/19/2007 05:32 / ognl issue PM Please respond to Tapestry users [EMAIL PROTECTED] ache.org But i 1would point out that this is a good opportunity to clean up your markup Jesse Kuhnert wrote: Sounds like it's just an OGNL bug. If you file it here I should be able to fix it fairly quickly as it looks like something that'll be easy to do: http://jira.opensymphony.com/browse/OGNL (the fix will come in the form of a new 2.7.2-SNAPSHOT build off of http://opencomponentry.com/repository/ ) On 10/19/07, Dom Couldwell [EMAIL PROTECTED] wrote: Hi, I'm migrating an existing project which uses 4.0.2 to use 4.1.2 and I'm having and ognl / loop related issue. Here's the snippet that works on 4.0.2 td jwcid=@For source=ognl:tab.searchCriteriaOptions value=ognl:currentFilterGroup index=ognl:currentFilterGroupIndex div jwcid=@If element=literal:td condition=ognl:tab.searchCriteria[currentFilterGroupIndex] != null class=ognl:'filter' + getFilterColumnStyle(currentFilterGroupIndex) select jwcid=@Select multiple=literal:false size=10 onchange= ognl:'searchSubmit(\''[EMAIL PROTECTED]@FILTER+'\', '+currentFilterGroupIndex+');' div jwcid=@For source=ognl:currentFilterGroup value=ognl:currentFilter index=ognl:currentFilterIndex option jwcid=@Option selected= ognl:tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] label=ognl:currentFilter /option /div /select /div /td But under 4.1.2 it's giving me the error: 2007-10-19 16:31:13,878, ERROR, [org.apache.tapestry.services.impl.HiveMindExpressionCompiler], line 179, Error generating OGNL getter for expression tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] with root [EMAIL PROTECTED]/$Search] and body: { return ($w) (((java.util.List)(($Search_91)$2).getTab().getSearchCriteriaSelections()).get((($Search_91)$2).getCurrentFilterGroupIndex())).get(((java.util.List)(($Search_91)$2).getCurrentFilterIndex()));} org.apache.hivemind.ApplicationRuntimeException: Unable to add method java.lang.Object get(ognl.OgnlContext, java.lang.Object) to class $ASTChain_115b9f4b263: [source error] get(java.util.List) not found in java.lang.Object at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278
Re: Tap 4.0.2 to 4.1.2 migration loop / ognl issue
OK, I've updated the JIRA with more info on the underlying implementation. Yell if you need more detail. Thanks, Dom Couldwell Global Markets Research Jesse Kuhnert [EMAIL PROTECTED] mTo Tapestry users 10/22/2007 09:19 users@tapestry.apache.org AMcc Subject Please respond to Re: Tap 4.0.2 to 4.1.2 migration loop Tapestry users / ognl issue [EMAIL PROTECTED] ache.org Yes, it would make a big difference. I'll need to create a unit test to re-produce the runtime behavior so anything you know about the object structure will help a great deal. (in the form of jira ticket knowledge) On 10/22/07, Dom Couldwell [EMAIL PROTECTED] wrote: I should point out that the underlying implementation is a List of Lists not an actual 2D Array, don't know if that makes any difference. Dom Couldwell Global Markets Research +1(212)250-7082 Jesse Kuhnert [EMAIL PROTECTED] m To Tapestry users 10/22/2007 08:53 users@tapestry.apache.org AM cc Subject Please respond to Re: Tap 4.0.2 to 4.1.2 migration loop Tapestry users / ognl issue [EMAIL PROTECTED] ache.org Yes, I think it's probably the 2d array causing my problems. Should be a fix for it later today. (evening EST ) On 10/22/07, Dom Couldwell [EMAIL PROTECTED] wrote: Anything in particular that you would suggest? Some of the underlying code is dictating some of this (e.g. the use of the 2D array of booleans). Dom Couldwell Global Markets Research +1(212)250-7082 andyhot [EMAIL PROTECTED] To Sent by: Andreas Tapestry users Andreouusers@tapestry.apache.org [EMAIL PROTECTED] cc m Subject Re: Tap 4.0.2 to 4.1.2 migration loop 10/19/2007 05:32 / ognl issue PM Please respond to Tapestry users [EMAIL PROTECTED] ache.org But i 1would point out that this is a good opportunity to clean up your markup Jesse Kuhnert wrote: Sounds like it's just an OGNL bug. If you file it here I should be able to fix it fairly quickly as it looks like something that'll be easy to do: http://jira.opensymphony.com/browse/OGNL (the fix will come in the form of a new 2.7.2-SNAPSHOT build off of http://opencomponentry.com/repository/ ) On 10/19/07, Dom Couldwell [EMAIL PROTECTED] wrote: Hi, I'm migrating an existing project which uses 4.0.2 to use 4.1.2 and I'm having and ognl / loop related issue. Here's the snippet that works on 4.0.2 td jwcid=@For source=ognl:tab.searchCriteriaOptions value=ognl:currentFilterGroup index=ognl:currentFilterGroupIndex div jwcid=@If element=literal:td condition=ognl:tab.searchCriteria[currentFilterGroupIndex] != null class=ognl:'filter' + getFilterColumnStyle(currentFilterGroupIndex) select jwcid=@Select multiple=literal:false size=10 onchange= ognl:'searchSubmit(\''[EMAIL PROTECTED]@FILTER+'\', '+currentFilterGroupIndex+');' div jwcid=@For source=ognl:currentFilterGroup value=ognl:currentFilter index=ognl:currentFilterIndex option jwcid=@Option selected= ognl:tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] label
Tap 4.0.2 to 4.1.2 migration loop / ognl issue
Hi, I'm migrating an existing project which uses 4.0.2 to use 4.1.2 and I'm having and ognl / loop related issue. Here's the snippet that works on 4.0.2 td jwcid=@For source=ognl:tab.searchCriteriaOptions value=ognl:currentFilterGroup index=ognl:currentFilterGroupIndex div jwcid=@If element=literal:td condition=ognl:tab.searchCriteria[currentFilterGroupIndex] != null class=ognl:'filter' + getFilterColumnStyle(currentFilterGroupIndex) select jwcid=@Select multiple=literal:false size=10 onchange= ognl:'searchSubmit(\''[EMAIL PROTECTED]@FILTER+'\', '+currentFilterGroupIndex+');' div jwcid=@For source=ognl:currentFilterGroup value=ognl:currentFilter index=ognl:currentFilterIndex option jwcid=@Option selected= ognl:tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] label=ognl:currentFilter /option /div /select /div /td But under 4.1.2 it's giving me the error: 2007-10-19 16:31:13,878, ERROR, [org.apache.tapestry.services.impl.HiveMindExpressionCompiler], line 179, Error generating OGNL getter for expression tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] with root [EMAIL PROTECTED]/$Search] and body: { return ($w) (((java.util.List)(($Search_91)$2).getTab().getSearchCriteriaSelections()).get((($Search_91)$2).getCurrentFilterGroupIndex())).get(((java.util.List)(($Search_91)$2).getCurrentFilterIndex()));} org.apache.hivemind.ApplicationRuntimeException: Unable to add method java.lang.Object get(ognl.OgnlContext, java.lang.Object) to class $ASTChain_115b9f4b263: [source error] get(java.util.List) not found in java.lang.Object at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278) ... Caused by: javassist.CannotCompileException: [source error] get(java.util.List) not found in java.lang.Object at javassist.CtBehavior.setBody(CtBehavior.java:347) at javassist.CtBehavior.setBody(CtBehavior.java:316) at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:272) ... 161 more Caused by: compile error: get(java.util.List) not found in java.lang.Object ... Should we be using different ognl syntax for the new version of Tapestry? I've tried updating the problem line to selected= ognl:getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex) which works when the page serves but does not write the values back to the page: 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to true: Inappropriate OGNL expression: get(currentFilterIndex) 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, binding|ExpressionBinding[Home/$Search getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex)] location|context:/WEB-INF/Search.html, line 106 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.hivemind.ApplicationRuntimeException 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to true: Inappropriate OGNL expression: get(currentFilterIndex) 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32, 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44, component|[EMAIL PROTECTED]/$Search] location|context:/WEB-INF/Home.html, line 51 2007-10-19 17:01:08,287, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, ognl.InappropriateExpressionException Any ideas? Thanks, Dom Couldwell Global Markets Research --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tap 4.0.2 to 4.1.2 migration loop / ognl issue
Done http://jira.opensymphony.com/browse/OGNL-130 Thanks, Dom Dom Couldwell Global Markets Research +1(212)250-7082 Jesse Kuhnert [EMAIL PROTECTED] mTo Tapestry users 10/19/2007 05:23 users@tapestry.apache.org PMcc Subject Please respond to Re: Tap 4.0.2 to 4.1.2 migration loop Tapestry users / ognl issue [EMAIL PROTECTED] ache.org Sounds like it's just an OGNL bug. If you file it here I should be able to fix it fairly quickly as it looks like something that'll be easy to do: http://jira.opensymphony.com/browse/OGNL (the fix will come in the form of a new 2.7.2-SNAPSHOT build off of http://opencomponentry.com/repository/ ) On 10/19/07, Dom Couldwell [EMAIL PROTECTED] wrote: Hi, I'm migrating an existing project which uses 4.0.2 to use 4.1.2 and I'm having and ognl / loop related issue. Here's the snippet that works on 4.0.2 td jwcid=@For source=ognl:tab.searchCriteriaOptions value=ognl:currentFilterGroup index=ognl:currentFilterGroupIndex div jwcid=@If element=literal:td condition=ognl:tab.searchCriteria[currentFilterGroupIndex] != null class=ognl:'filter' + getFilterColumnStyle(currentFilterGroupIndex) select jwcid=@Select multiple=literal:false size=10 onchange= ognl:'searchSubmit(\''[EMAIL PROTECTED]@FILTER+'\', '+currentFilterGroupIndex+');' div jwcid=@For source=ognl:currentFilterGroup value=ognl:currentFilter index=ognl:currentFilterIndex option jwcid=@Option selected= ognl:tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] label=ognl:currentFilter /option /div /select /div /td But under 4.1.2 it's giving me the error: 2007-10-19 16:31:13,878, ERROR, [org.apache.tapestry.services.impl.HiveMindExpressionCompiler], line 179, Error generating OGNL getter for expression tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex] with root [EMAIL PROTECTED]/$Search] and body: { return ($w) (((java.util.List)(($Search_91)$2).getTab().getSearchCriteriaSelections()).get((($Search_91)$2).getCurrentFilterGroupIndex())).get(((java.util.List)(($Search_91)$2).getCurrentFilterIndex()));} org.apache.hivemind.ApplicationRuntimeException: Unable to add method java.lang.Object get(ognl.OgnlContext, java.lang.Object) to class $ASTChain_115b9f4b263: [source error] get(java.util.List) not found in java.lang.Object at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278) ... Caused by: javassist.CannotCompileException: [source error] get(java.util.List) not found in java.lang.Object at javassist.CtBehavior.setBody(CtBehavior.java:347) at javassist.CtBehavior.setBody(CtBehavior.java:316) at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:272) ... 161 more Caused by: compile error: get(java.util.List) not found in java.lang.Object ... Should we be using different ognl syntax for the new version of Tapestry? I've tried updating the problem line to selected= ognl:getTab().getSearchCriteriaSelections().get(currentFilterGroupIndex).get(currentFilterIndex) which works when the page serves but does not write the values back to the page: 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException 2007-10-19 17:01:08,272, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression 'parsed OGNL expression' of [EMAIL PROTECTED]/$Search] to true: Inappropriate OGNL expression: get(currentFilterIndex) 2007-10-19 17:01:08,272, ERROR
Re: Complex Bindings with Contrib Table
I did something recently that might be of use, it was not pretty though... Basically the underlying page returned a list of MarketData objects (POJOs) that each have a method called getMarketData(String key) on them that pulled data from a map i.e. each Market Data object held a number of pieces of data keyed by Strings. For the Contrib table definition the definition was: component id=resultsTable type=Contrib:TableView binding name=source value=ognl:results/ binding name=columns value=ognl:tableColumns/ binding name=pageSize value=ognl:pageSize/ /component Where the getTableColumns() method on the underlying page returned something like: data0:displayName1:getMarketDate('key1'),data1:displayName2:getMarketDate('key2'),data2:displayName3:getMarketDate('key3') e.g. data0:Mid Price:getMarketDate('Mid_Price'),data1:Mid Yield:getMarketDate('Mid_Yield'),data2:Ask Price:getMarketDate('Ask Price') And the getResults() method returned a list of the MarketData objects in the .html I then had something like: td jwcid=[EMAIL PROTECTED] span jwcid=@Insert value=ognl:components.rows.tableRow.getMarketData(keys[0])/span /td td jwcid=[EMAIL PROTECTED] span jwcid=@Insert value=ognl:components.rows.tableRow.getMarketData(keys[1])/span /td td jwcid=[EMAIL PROTECTED] span jwcid=@Insert value=ognl:components.rows.tableRow.getMarketData(keys[2])/span /td This is a simplified version as the original had a lot more junk... the getKeys method returns a list of Strings that corresponds to the keys used to build up the original tableColumns list You can have as many of the above Block definitions as you like to cater for up to the maximum number of columns of data you want to show but they will only be rendered for the number of columns that you declare in your table columns. As I said it's not pretty but it did work... I did try to get it to render the above blocks in a For loop but could not work out how to generate them dynamically. I should also point out that I'm relatively new to Tapestry so there may be others with far better solutions. In the end I also binned the Contrib table and did it myself which made for much neater code. Dom Daniel Jue [EMAIL PROTECTED]
Re: beware new 4.1.1 snapshot builds
Hmm, seem to be getting the following debug when I redeploy our site after pulling down the latest 4.1.1 snapshot DEBUG: failed loading http://dbnycws72331.dbg.ads.db.com:8080/RDQ/app?service=assetpath=%2Fdojo%2F../tapestry/namespace.js with error: [TypeError: dojo.registerModulePath is not a function, file: http://dbnycws72331.dbg.ads.db.com:8080/RDQ/app?service=assetpath=%2Fdojo%2Fdojo.js, line: 203] Was not getting this error before I pulled down the latest snapshot. Any ideas as to what has changed in the snapshot that's causing this error to appear? It's not causing any functional problems as far as I can see just bringing up this debug but I want to be sure there's not something under the hood broken. This line appears in the header and does not appear to have been there prior to pulling down the latest snapshot: dojo.require(tapestry.namespace) I did a clean maven build of the project before redeploying so I'm assuming I should have pulled down everything we require.. Dom Couldwell Josh Long [EMAIL PROTECTED] 10/01/2006 05:57 PM
Re: beware new 4.1.1 snapshot builds
yes, sorry should have tried that. Dom Couldwell Global Markets Research +1(212)250-7082 Jesse Kuhnert [EMAIL PROTECTED] 10/03/2006 03:46 PM To Tapestry users users@tapestry.apache.org
Refreshing popup links
Hi, I'm having a problem with asynchronous refreshes of table data not refreshing the associated popup link javascript. Basically I've got a set of tabs, under each tab there's a table and I switch between tabs using a DirectLink which asynchronously refreshes the contents of the display table Each display table contains a set of values which are also ExternalLinks to a popup page. The popup links are generated using the popupRenderer renderer on top of and ExternalLink. The problem comes when you switch between panes. The table data refreshes OK but the popup link javascript is not refreshed so the popup_window_7 javascript function is still pointing to what used to be item 7 in the previously displayed table, not item 7 in the newly updated table. I could work around this by not making the tab switching asynchronous but that's just ugly. Is there any way I can get the javascript re-rendered at the same time as the content table is refreshed? Can I somehow add another component to the updateComponents list of the async DirectLink? Thanks, Dom -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Shell renderBaseTag flag
OK, this may just be down to the fact that it's the end of a very long day but... does the renderBaseTag parameter of the Shell component actually work? see http://tapestry.apache.org/tapestry4.1/components/Shell.html I've tried setting it to false but it still keeps on rendering the html element at the top of the document. I really don't want it as I'm trying to produce XML for an RSS feed. Dom -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Shell renderBaseTag flag
update the docs to more clearly state that renderBaseTag relates to the BASE tag found inside of HEAD If you don't want HTML written, do not use the @Shell Dom Couldwell wrote: OK, this may just be down to the fact that it's the end of a very long day but... does the renderBaseTag parameter of the Shell component actually work? see http://tapestry.apache.org/tapestry4.1/components/Shell.html I've tried setting it to false but it still keeps on rendering the html element at the top of the document. I really don't want it as I'm trying to produce XML for an RSS feed. Dom -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / J2EE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
EventListener follow up event
Hi, I'm trying to implement a pretty simple menu structure that supposed to update the menu tree when a given link is clicked and also update the content of the page. I've got it working but only for the first click... First time I click on one of the given links the tree expands to show the sub menu and the content div (main_content) updates to display the name of the link that the user has selected. Problem is when I then click on another link nothing happens. If I refresh the page then I can click on another link again. Any ideas as to what I'm doing wrong? Also for the EventListeners is there a neater way of working out which link has been clicked rather than adding in all the elements to the EventListener annotation? It's not really a sustainable solution once the menu structure gets bigger. Ideally I'd want to pass through a parameter link you do with a regular listener (e.g. the parameters definition on a DirectLink) but I can't see where I could define this. Relevant parts of html, page and java files are attached. I'm using the 4.1.1 snapshot on Tomcat 5.0.1.9 with Firefox. Thanks, Dom Home.html div jwcid=[EMAIL PROTECTED] element=literal:div ul jwcid=menuItems li a jwcid=@Any id=ognl:currentMenuItem.id element=literal:a span jwcid=@Insert value=ognl:currentMenuItem.name/ /a span jwcid=@If condition=ognl:currentMenuItem.expanded ul jwcid=subMenuItems li a jwcid=@Any id=ognl:currentSubMenuItem.id element=literal:a span jwcid=@Insert value=ognl:currentSubMenuItem.name/ /a /li /ul /span /li /ul /div div jwcid=[EMAIL PROTECTED] element=literal:div div jwcid=@Insert value=ognl:selectedPage/div /div Home.page property name=currentMenuItem/ component id=menuItems type=For binding name=source value=menuItems/ binding name=element value=literal:ul/ binding name=value value=currentMenuItem/ /component property name=currentSubMenuItem/ component id=subMenuItems type=For binding name=source value=currentMenuItem.subMenus/ binding name=element value=literal:ul/ binding name=value value=currentSubMenuItem/ /component Home.java @Persist(session) public abstract ListMenuItem getMenuItems(); public abstract void setMenuItems(ListMenuItem items); @Persist(session) public abstract String getSelectedPage(); public abstract void setSelectedPage(String page); @EventListener(events=onclick, elements={introduction, research, biographies}, async=true) public void menuSelect(BrowserEvent event){ String menu = (String)event.getTarget().get(id); setSelectedPage(menu); ListMenuItem items = getMenuItems(); for (Iterator iter = items.iterator(); iter.hasNext();) { MenuItem element = (MenuItem) iter.next(); if(element.getId().equals(menu)){ element.setExpanded(true); } else { element.setExpanded(false); } } getRequestCycle().getResponseBuilder().updateComponent(main_menu); getRequestCycle().getResponseBuilder().updateComponent(main_content); } @EventListener(events=onclick, targets = article_1, article_2, article_3, async=true) public void subMenuSelect(BrowserEvent event){ setSelectedPage((String)event.getTarget().get(id)); getRequestCycle().getResponseBuilder().updateComponent(main_content); } -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapestry 4.1 + Dojo Tabs
Hi, I'm trying to use Tapestry 4.1 to create a set of dynamic tabs using custom components. I've got some if it to work using the components that I've written but I can't seem to get the tabs themselves to be created, just the content pane. The main html looks like this: span jwcid=[EMAIL PROTECTED] span jwcid=tabs a jwcid=@LinkPane id=ognl:currentLink label=ognl:currentLink span jwcid=@Insert value=ognl:currentLink/span /a /span /span Where the tabs component is just a For element. The TabContainer component I've written seems to work ok and is rendered as I'd expect but the LinkPane doesn't seem to render the TabLabels correctly. Here's the html that's produced according to Firebug: div wairole=tabpanel class=dojoTabContainer dojoLayoutContainer id=mainTabContainer role=wairole:tabpanel style= div dojoattachpoint=dojoTabLabels class=dojoTabLabels-top dojoAlignTop style=left: 0px; top: 0px; bottom: auto; right: auto; width: 500px; / div dojoattachpoint=containerNode class=dojoTabPaneWrapper dojoAlignClient style=left: 0px; top: -1px; bottom: auto; right: auto; width: 498px; height: 299px; div class=dojoLinkPane style=..contents of first pane.../div /div /div As you can see the dojoTabLabels attach point doesn't contain anything, this should contain a list of the tabs. Here's the widget definitions produced in the html from the components script files: tapestry.widget.synchronizeWidgetState(Treasuries, LinkPane, {refreshOnShow:true,href:url to contents of first pane,label:Treasuries,widgetId:Treasuries}); tapestry.widget.synchronizeWidgetState(mainTabContainer, TabContainer, {selectedTab:Treasuries,widgetId:mainTabContainer}); Any ideas as to what I'm missing? Thanks, Dom -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry 4.1 + Dojo Tabs
OK, that seems to work now when I add in explicit calls to addChild in the .script associated with the TabContainer component. Next question is about dynamically adding tabs. I can get a simple version of the Event Listener in Tapestry 4.1 working ok where one form element can have a given event listened to e.g. onchange for a select element. e.g. @EventListener(events = onchange, elements = tabSelect, submitForm = myForm) public void tabSelected(){ log.info(Hi); } span jwcid=[EMAIL PROTECTED] span jwcid=[EMAIL PROTECTED] value=ognl:selectedTab model=ognl:tabs/ span jwcid=[EMAIL PROTECTED] label=literal:Add a tab/ /span But...I can't see how I can update the definition of the element to allow me to use the EventListener with a method that includes a BrowserEvent or a RequestCycle in the definition. When I just update the method I get an error telling me it can't find a version of the method with no parameters I need to capture the browser event in order to know what the user has selected so I can add the correct tab. e.g. @EventListener(events = onchange, elements = tabSelect, submitForm = myForm) public void tabSelected(Browser event){ log.info(Hi); } Exception: no listener method named 'tabSelected' suitable for no parameters found in ... Am I missing something obvious? I've tried looking through all the on-line docs but I can't find anything covering this. Thanks, Dom Dom Couldwell Global Markets Research +1(212)250-7082 Dom Couldwell [EMAIL PROTECTED] 08/09/2006 10:33 AM
Re: Tapestry 4.1 + Dojo Tabs
All I've done is add in the BrowserEvent parameter into the method in the java class. This results in the error I described. Please let me know if there is anything else I need to do or if this is a bug. Thanks, Dom Dom Couldwell Global Markets Research +1(212)250-7082 Jesse Kuhnert [EMAIL PROTECTED] 08/09/2006 03:23 PM To Tapestry users users@tapestry.apache.org
Re: Tapestry 4.1 + Dojo Tabs
sounds reasonable to me. I've been able to add BrowserEvent (not Browser that you listed in your example) to the page here: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java?view=markup If you can't make it work can you file a JIRA issue so I can work on this later tonight? On 8/9/06, Dom Couldwell [EMAIL PROTECTED] wrote: All I've done is add in the BrowserEvent parameter into the method in the java class. This results in the error I described. Please let me know if there is anything else I need to do or if this is a bug. Thanks, Dom Dom Couldwell Global Markets Research +1(212)250-7082 Jesse Kuhnert [EMAIL PROTECTED] 08/09/2006 03:23 PM To Tapestry users users@tapestry.apache.org cc Please respond to Tapestry users users@tapestry.apache.org Subject Re: Tapestry 4.1 + Dojo Tabs You shouldn't have to do anything other than define a BrowserEvent parameter. It's possible I have a bug wrt having BrowserEvent and other parameters set in the same method? If this is the case I will fix it asap. On 8/9/06, Dom Couldwell [EMAIL PROTECTED] wrote: OK, that seems to work now when I add in explicit calls to addChild in the .script associated with the TabContainer component. Next question is about dynamically adding tabs. I can get a simple version of the Event Listener in Tapestry 4.1 working ok where one form element can have a given event listened to e.g. onchange for a select element. e.g. @EventListener(events = onchange, elements = tabSelect, submitForm = myForm) public void tabSelected(){ log.info(Hi); } span jwcid=[EMAIL PROTECTED] span jwcid=[EMAIL PROTECTED] value=ognl:selectedTab model=ognl:tabs/ span jwcid=[EMAIL PROTECTED] label=literal:Add a tab/ /span But...I can't see how I can update the definition of the element to allow me to use the EventListener with a method that includes a BrowserEvent or a RequestCycle in the definition. When I just update the method I get an error telling me it can't find a version of the method with no parameters I need to capture the browser event in order to know what the user has selected so I can add the correct tab. e.g. @EventListener(events = onchange, elements = tabSelect, submitForm = myForm) public void tabSelected(Browser event){ log.info(Hi); } Exception: no listener method named 'tabSelected' suitable for no parameters found in ... Am I missing something obvious? I've tried looking through