Re: How to resolve the rendered component in a mixin

2012-07-08 Thread mem
@Muhammad:
No, not exactly.
I'd need a reference not necessarily to the component to which the mixin is
applied but rather to all it's rendering subcomponents. Like in the example
in my first post the myComponent could contain a zone which again contains
i.e. an anchor tag where the var is named edit. When applying my mixin i'd
like to specify it somehow like the following on one page:

...
@MixinClasses({SomeMixin.class})
@Component(parameters={"attrName=something", "attrValue=x", "pattern=edit"})
private MyComponent myComponent;

Where on another page i might have something like this:

@MixinClasses({SomeMixin.class})
@Component(parameters={"attrName=something", "attrValue=y"})
private LinkSubmit submit;

or this (MyParentComponent contains myComponent):

@MixinClasses({SomeMixin.class})
@Component(parameters={"attrName=something", "attrValue=z",
"pattern=myComponent.edit"})
private MyParentComponent myParentComponent;


So the pattern parameter should be optional and i'd like to use it in the
mixin in the begin/afterRender to check if the attribute should be applied
to the currently rendered component.


@Thiago:
I tried to inject the container already but i didn't find any method which
would assist me with the currently rendered subcomponent, the container
itself isn't what i need. I also tried and looked at ComponentResources and
JSSupport.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-resolve-the-rendered-component-in-a-mixin-tp5714315p5714348.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: Tapestry jodatime module (based on jumpstart) ?

2012-07-08 Thread Geoff Callender
The more contributions the merrier.

Please note that while I'm pretty confident my code is handling timezones 
properly, I haven't had the chance to confirm its correctness by running it in 
a production multiple timezone environment.

Cheers,
Geoff

On 06/07/2012, at 10:15 PM, Dimitris Zenios wrote:

> I dont have them in a separate module since in order for tapestry to
> have jodatime support is just two bean block sources and 2 coercers so
> i never though there was a need for creating a module.I always copy
> the files over to the new project.I can provide the source though.Will
> post it here tonight.
> 
> Cheers
> Dimitris Zeios
> 
> On Fri, Jul 6, 2012 at 2:55 PM, Alex Kotchnev  wrote:
>> Dimitris,
>>   I was thinking of starting w/ Geoff's Jumpstart code; however, if you
>> already have a separate module that you've used in an application , and you
>> are willing to contribute the code under the terms that Kalle described
>> (e.g. license and what not), that would be even a better start. Heck, if
>> you want to just contribute the module to Tynamo, talk to Kalle about
>> contributing it to Tynamo and becoming the maintainer for the module . I'd
>> be glad to see the source and maybe write some tests.
>> 
>>   In either case, whatever can get us quicker to a tynamo-jodatime module
>> is what I want to do.
>> 
>> Cheers,
>> 
>> Alex K
>> 
>> On Fri, Jul 6, 2012 at 7:01 AM, Dimitris Zenios
>> wrote:
>> 
>>> I can also be a part of tapestry-jodatime if needed.We have jodatime
>>> integration into our tapestry application.All we had to do is
>>> contribute beanblock source and some coercers.Let me know if you need
>>> the source code.
>>> 
>>> Regards
>>> Dimitris Zenios
>>> 
>>> On Fri, Jul 6, 2012 at 1:37 PM, Alex Kotchnev  wrote:
 Geoff,
   thanks for allowing this. Jumpstart is such an invaluable resource for
 good examples, I would be very happy to add a small contribution that
>>> other
 people could use.
 
 Kalle,
   sounds like I have a project for the weekend. I'll probably commit the
 code over the weekend; however, I will probably need to talk again
>>> sometime
 next week when it's time to go through the release process.
 
 Cheers,
 
 Alex K
 
 On Thu, Jul 5, 2012 at 9:41 PM, Geoff Callender <
 geoff.callender.jumpst...@gmail.com> wrote:
 
> On 6 July 2012 10:59, Kalle Korhonen 
>>> wrote:
> 
> 
>> On Thu, Jul 5, 2012 at 2:20 PM, Alex Kotchnev 
> wrote:
>>> I was looking at Geoff's examples in JumpStart on supporting
>>> JodaTime,
>> e.g.
>>> 
>> 
> 
>>> http://jumpstart.doublenegative.com.au/jumpstart/examples/lang/typecoercers
>>> and
>>> 
>> 
> 
>>> http://jumpstart.doublenegative.com.au/jumpstart/examples/jodatime/jodatime
>>> and
>>> 
>> 
> 
>>> http://jumpstart.doublenegative.com.au/jumpstart/examples/lang/propertyeditors
>>> It looks like a perfect candidate to break off as a separate module
>>> somewhere (e.g. on github or into an existing project like tynamo) -
> e.g.
>>> it has some interesting contributions, a component to explicitly
> display
>>> joda time - good stuff all around.
>>> Geoff - any objections if I break something off and pull some of
>>> your
>> code
>>> into a separate module ?
>>> If jumpstart doesn't have a good way of publishing this as a
>>> separate
>>> module - would any of the existing projects (that have some
>> infrastructure
>>> - e.g. tynamo, chenillekit) be interested in taking in an extra
>>> module
>> like
>>> this (so that I don't have to deal w/ setting up new projects,
> websites,
>>> etc) ?
>> 
>> Not that I want to necessarily accumulate any modules up for grabs but
>> it would fit into Tynamo's mission as long as somebody takes an oath
>> to become a maintainer of the new module. Alex, being the JDO module
>> maintainer, it'd be pretty simple for you to bring it about. Geoff,
>> how is your stuff licensed? Everything at Tynamo is Apache licensed.
>> What Tynamo has to offer is a code structure to support multiple
>> independent modules, a build system, a pretty well-tested release
>> process ready to go for publishing all the way to Maven central, as
>> well as the Confluence-backed website and a structure for documenting
>> the modules (you knew this Alex, but just explaining for everybody
>> else following the discussion).
>> 
>> Kalle
>> 
> 
> Alex, I have no objection whatsoever.
> 
> Kalle, I haven't specified a license (perhaps I should). I say on the
>>> site
> it's available for people to use as they wish. If you copy what you want
> and apply an Apache license to it that's fine with me. Is that enough to
> cover you?
> 
> Cheers,
> 
> Geoff
> 
>>> 
>>> -
>>>

Re: Problem with range operator

2012-07-08 Thread bhorvat
yea this works. Great

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Problem-with-range-operator-tp5714339p5714345.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: Problem with range operator

2012-07-08 Thread Dusko Jovanovski
I made an oversight, try this:


//html code


On Sun, Jul 8, 2012 at 11:54 AM, bhorvat  wrote:

> Hm...Well it says here that it should
> http://tapestry.apache.org/property-expressions.html
>
> "The rangeOp creates a range object that will iterate between the two
> values. The upper and lower bounds may be literal integers, or property
> expressions"
>
> Also the expression is evaluated properly as it returns the number, but the
> conversion is wrong. :S
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Problem-with-range-operator-tp5714339p5714343.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: Problem with range operator

2012-07-08 Thread bhorvat
Hm...Well it says here that it should
http://tapestry.apache.org/property-expressions.html

"The rangeOp creates a range object that will iterate between the two
values. The upper and lower bounds may be literal integers, or property
expressions"

Also the expression is evaluated properly as it returns the number, but the
conversion is wrong. :S

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Problem-with-range-operator-tp5714339p5714343.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: Problem with range operator

2012-07-08 Thread Dusko Jovanovski
I don't think you can use it like that, only with fixed values.

On Sun, Jul 8, 2012 at 11:35 AM, bhorvat  wrote:

> That is the option, but tapestry has this cool option so I would like to
> use
> it
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Problem-with-range-operator-tp5714339p5714341.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: Problem with range operator

2012-07-08 Thread bhorvat
That is the option, but tapestry has this cool option so I would like to use
it

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Problem-with-range-operator-tp5714339p5714341.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: Problem with range operator

2012-07-08 Thread Dusko Jovanovski
Why don't you just return an array from 1 to lastDayInMonth?

.tml
t:source="rangeOfDates"

.java
public List getRangeOfDates()
{
List list = new LinkedList();

for(Integer i=1; i <=lastDayInMonth; i++)
   list.add(i);

return list;
}


On Sun, Jul 8, 2012 at 10:55 AM, bhorvat  wrote:

> I have a strange problem with range operator, well it is eighter that or I
> dont know how to use it.
>
> I have tried the following
>
>  
> //html code
>  
>
> this works but my problem is that the number 31 needs to be dynamic so I
> have a property ${lastDayInMonth}
>
> However if I try
>
> 
> //html code
>  
>
> I get
>
> A JSONArray text must start with '[' at character 1 of 1..31
>
> and if I try
>
> 
> //html code
>  
>
> I get
>
> Caused by: java.lang.RuntimeException: Coercion of 1..31 to type
> java.lang.Integer (via String --> Long, Long --> Integer) failed: For input
> string: "1..31"
>
> So what am I dont wrong, ideas?
>
> cheers and tnx
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Problem-with-range-operator-tp5714339.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
>
>


Problem with range operator

2012-07-08 Thread bhorvat
I have a strange problem with range operator, well it is eighter that or I
dont know how to use it.

I have tried the following 

 
//html code
 

this works but my problem is that the number 31 needs to be dynamic so I
have a property ${lastDayInMonth}

However if I try 


//html code
 

I get

A JSONArray text must start with '[' at character 1 of 1..31

and if I try 


//html code
 

I get

Caused by: java.lang.RuntimeException: Coercion of 1..31 to type
java.lang.Integer (via String --> Long, Long --> Integer) failed: For input
string: "1..31"

So what am I dont wrong, ideas?

cheers and tnx

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Problem-with-range-operator-tp5714339.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