Re: tapestry 4 radio group
Richard is right. It would have to be more like this: span jwcid=activeServerRadioGroup span jwcid=activeServers input type=radio jwcid=activeServerRadio / /span /span Also if values assigned to radio components are 'activeServer.id', let's assume it's Long, then 'selected' parameter of your activeServerRadioGroup component should be of type Long as well, so maybe you need another property property name=selectedId/ and then use it like this: component id=activeServerRadioGroup type=RadioGroup binding name=selected value=selectedId/ /component I haven't tested this code though. Dariusz On Thu, Jan 20, 2011 at 2:33 PM, Richard Kirby r...@capdm.com wrote: Hi, Can you say a little more exactly what you are trying to do as your HTML doesn't appear to be correct. The RadioGroup needs to wrap around the Radio buttons at the very least. Richard On 19 Jan 2011, at 19:29, sunray 2003 wrote: Hi, I am unable to get the tapestry 4 radio group working. My HTML tdspan jwcid=activeServerRadioGroup/span/td tdinput type=radio jwcid=activeServerRadio //td My .page property name=activeServer/ component id=activeServerRadioGroup type=RadioGroup binding name=selected value=activeServer.selected/ /component component id=activeServers type=For binding name=source value=activeServers/ binding name=keyExpression value=literal:id/ binding name=value value=activeServer/ binding name=element value=literal:tr/ /component component id=activeServerRadio type=Radio binding name=value value=activeServer.id/ /component In my .java file I have a method getActiveServers() that returns a list of custom class with selected, id attributes. The above structure is not working. Can somebody help? Thanks. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: JIRA TAP5_103 provide access to component parameters from within mixins
Hi, You have to use @BindParameter annotation described here: http://tapestry.apache.org/tapestry5.2-dev/guide/mixins.html Regards, Darek On Thu, Aug 19, 2010 at 10:31 PM, Shing Hing Man mat...@yahoo.com wrote: JIRA TAP5_103 is marked as fixed in Tap 5.2.0. https://issues.apache.org/jira/browse/TAP5-103 Does anyone know where I can find an example on reading a component parameters from within a mixin ? Does it work by simply inject the component for which the mixin is attached, in the mixin Java class ? Eg @InjectContainer private Object container; Thanks in advance for any assistance ! Shing - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[T5] debugging in eclipse
Hi All, I'm having problems debugging my tapestry application. I'm using Eclipse 3.5.0 and tapestry 5.2-SNAPSHOT. I have a custom component with parameter @Parameter(value=120) private int maxWidth; which is then set during my component invocation inside page t:myComponent t:maxWidth=1200 / now I have a eventListener in my component let's say sth like this public StreamResponse onMyCustomEvent(){ if(300 maxWidth){ return new TextStreamResponse(responseRenderer.findContentType(this), 300 +maxWidth);// this is never executed } return new TextStreamResponse(responseRenderer.findContentType(this), everything is OK - +maxWidth);// } Now my problem is that when I debug onMyCustomEvent method I can't see the real value of maxWidth parameter. Debugger shows me this value as 0 but the response I get from my listener is everything is OK - 1200. I can see that my component object has a field created by tapestry _$maxWidth$conduit that corresponds to maxWidth and this object has a value field that contains my 1200 value. I'm writing because maybe someone had a similar problem or knows how to setup eclipse to show real value of maxWidth without looking inside _$maxWidth$conduit. The same thing happens to fields inside my pages. I can see their values only by inspecting the conduit but corresponding fields are null. Best regards, Dariusz
Re: @For how to check last element?
Hi, You just have to use 'index' parameter of @For component. jwcid=@For source=ognl:theList value=elem index=loopIndex jwcid=@If condition=ognl:loopIndex == (theList.size()-1) last element :] Cheers, Dariusz On Fri, Mar 19, 2010 at 5:09 AM, asianCoolz second_co...@yahoo.com wrote: when using td jwcid=@For source=ognl:theList how to check for whether the element is last element in the loop? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to create absolute URL?
Hi, Not sure that this is the best way, but I did it like this: @Inject private Request request; @Inject private RequestGlobals requestGlobals; public String getHostUrl(){ if(hostUrl == null){ hostUrl = getRequestGlobals().getHTTPServletRequest().getScheme()+://; hostUrl += getRequest().getServerName(); if(getRequestGlobals().getHTTPServletRequest().getServerPort() != 80){ hostUrl += :+getRequestGlobals().getHTTPServletRequest().getServerPort(); } } return hostUrl; } -- Cheers, Dariusz On Wed, Mar 17, 2010 at 7:35 PM, Algirdas algirda...@gmail.com wrote: For registration process, I need to send user an email with an absolute link to my site, which finalizes the registration, that is, full URL with protocol (may be https), site name, page parameters: http://www.somemysite.com/register/p=RTWE343434dsfdf3435353sfsdfsdfdsf Is there a way from Tapestry (5.1.0.5) to generate such URL? -- View this message in context: http://n2.nabble.com/How-to-create-absolute-URL-tp4752509p4752509.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: Render large page
Hi, Actually Dmitry is right that javascript variables are invalid. They cannot contain '-' character and error that is shown when they do is exactly SyntaxError: missing ; before statement. I've happend to have similiar issue. This is because tapestry adds '-' + random number to generated client ids during ajax request. You propably could still use RoundCornerContainer component you just have to change your code to remove '-' from client id's for example pageRenderSupport.addScript( var %s = new Ck.Rounded('%s', '%s', '%s', '%s', '%s');, getClientId().replace(-,), getClientId(), bgcolor, fgcolor, size, renderPart); Above should fix the problem. Kind Regards, Dariusz On Sat, Mar 6, 2010 at 7:38 AM, Henry Chen hc...@peacocknine.com wrote: The variables are valid. The problem is both Confirm and RoundCornerContainer components use prototype to manipulate the html. I ended up replacing those component with some simple js functions and problem solved. -- View this message in context: http://n2.nabble.com/Render-large-page-tp4677583p4685449.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: tapestry 5 - How to call peekUniqueId?
What I was trying to achieve is to have element to trigger formInjector above forminjector component. Finally I was able to do so by using logic similar to Label component. I wrote a new component: public class FormInjectorTrigger { @Parameter(required=true) private ClientElement target; @Environmental private Heartbeat heartbeat; private Element element; void beginRender(final MarkupWriter writer){ element = writer.element(a); writer.attributes(href,#); heartbeat.defer(new Runnable() { @Override public void run() { element.forceAttributes(onclick, $('+target.getClientId()+').trigger();); } }); } void afterRender(MarkupWriter writer) { writer.end(); // a } } and use example is: t:form t:id=testForm a t:type=FormInjectorTrigger t:id=injectorTrigger target=component:forminjectorClick me.../a div t:type=forminjector t:id=formInjector position=below/ t:block t:id=textBlock t:textfield value=stringValue/br/ /t:block /t:form inside java: @Inject private Block textBlock; public Object onActionFromFormInjector() { return textBlock; } I would really like someone to comment on this. Is there an easier approach? I have to admit I don't understand how heartbeat works. When I used writer.attributes(onclick, $('+target.getClientId()+').trigger();) instead of element.forceAttributes these attributes where added to a form tag. Cheers, Dariusz On Thu, Jan 7, 2010 at 12:22 AM, Howard Lewis Ship hls...@gmail.com wrote: Generally, you should wait until after a component has rendered, then invoke getClientId() on it. On Wed, Jan 6, 2010 at 4:00 PM, Dariusz Majewski dariuszmajew...@gmail.com wrote: Hi All, In tapestry4, IRequestCycle has a peekUniqueId method (link http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/IRequestCycle.html#peekUniqueId%28java.lang.String%29 ). How to achieve that in tapestry5 ? Thanks, Dariusz -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org