Re: tapestry 4 radio group

2011-01-21 Thread Dariusz Majewski
Richard is right.

It would have to be more like this:


  

  


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



and then use it like this:





I haven't tested this code though.

Dariusz

On Thu, Jan 20, 2011 at 2:33 PM, Richard Kirby  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
> >
> > 
> > 
> >
> > My .page
> >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >  
> > 
> >
> > 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

2010-08-19 Thread Dariusz Majewski
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  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

2010-05-25 Thread Dariusz Majewski
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


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?

2010-03-20 Thread Dariusz Majewski
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  wrote:

> when using   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?

2010-03-17 Thread Dariusz Majewski
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  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

2010-03-15 Thread Dariusz Majewski
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  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?

2010-01-07 Thread Dariusz Majewski
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:

Click me...







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  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
>  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
>
>


tapestry 5 - How to call peekUniqueId?

2010-01-06 Thread Dariusz Majewski
Hi All,

In tapestry4, IRequestCycle has a peekUniqueId method
(link).
How to achieve that in tapestry5 ?

Thanks,
Dariusz