Re: Easy Way to create a select model?

2010-01-29 Thread Andrew Court

Hi Andy,

I find the easiest way to populate a select list is just to pass it a Map of
values. Something like the following:

public MapInteger,String getMonthsModel()
{   
MapInteger,String model = new LinkedHashMapInteger,String();

model.put(1, Jan);
model.put(2, Feb);
model.put(3, Mar);

return model;

}


select t:type=Select t:model=monthsModel /

Andrew





Andy Pahne-7 wrote:
 
 
 I feel a little dumb, because for years I have been using Tapestry.
 
 Is there an _easy_ way og creating a SelectModel like this one (not so 
 uncommon one):
 
 valuelabel
 -
   1 Jan
   2 Feb
   ...
 
 
 I had a look at the documentation. But I cannot believe I have to deal 
 with SelectModel, OptionModel, OptionGroupModel and whatelse for this 
 simple usecase.
 
 I also had a look at the Wiki. I found four pages about selects. I 
 cannot believe that I have to use such bloat for my usecase.
 
 I surely must be missing something, or not?
 
 Andy
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Easy-Way-to-create-a-select-model--tp27356514p27379053.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 Resources and Velocity Templates

2009-11-16 Thread Andrew Court

Look at setting the file.resource.loader.path property

http://static.springsource.org/spring/docs/2.5.6/reference/view.html#view-velocity-advancedconfig
http://static.springsource.org/spring/docs/2.5.6/reference/view.html#view-velocity-advancedconfig
 

Andrew



Jonhy Pear wrote:
 
 Hi!
 
 I have configured Spring Email to send emails to users.
 
 I want to use Velocity (not a requirement though, the only requirement is
 to
 have templating) to help me generate the body of the mail.
 
 I have a Tapestry service where I inject both VelocityEngine and
 MailSender
 services.
 
 Then, in the method sendRegistrationConfirmationEmail(User user)  {
 
 ...
 
 String body =
 VelocityEngineUtils.mergeTemplateIntoString(this.velocityEngine,
 UserRegistrationConfirm.vm, model);
 
 }
 
 I have my template UserRegistrationConfirm.vm in
 src/main/resources/ under the same package as my service from where I use
 velocity.
 
 However the template could not be found.
 
 I have in my applicationContext.xml the following configuration for
 Velocity:
 
 
 
 bean id=velocityEngine
 class=org.springframework.ui.velocity.VelocityEngineFactoryBean
 property name=velocityProperties
 props
 prop key=resource.loaderclass/prop
 prop key=class.resource.loader.class
 
 org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader/prop
 /props
 /property
 /bean
 
 Do you  have any hint on how to tell velocity to lookup in
 src/main/resources/... ?
 
 thank you,
 
 

-- 
View this message in context: 
http://old.nabble.com/Tapestry-Resources-and-Velocity-Templates-tp26364177p26385154.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: t5: how to use Blackbird?

2009-06-22 Thread Andrew Court

Blackbird use is in the documentation
http://tapestry.apache.org/tapestry5.1/guide/ajax.html under Client-side
Logging




Angelo Chen wrote:
 
 Hi,
 
 cool, this works, is there a way to turn this off in the production mode?
 otherwise we have to remove those Logging.info(you are impossible to see
 this), my users do see this:), anyway it's a nice feature, I like this
 logging thing.
 
 Angelo
 
 
 Ray Fortycoats wrote:
 
 To use the Blackbird logging in Tapestry, you need to use
 'Tapestry.Logging'
 instead of the 'log' prefix
 
 e.g  Tapestry.Logging.info('test');
 
 This is defined in the blackbird.js file in the core Tapestry package.
 
 
 
 On Thu, Jun 18, 2009 at 6:05 AM, Angelo Chen
 angelochen...@yahoo.com.hkwrote:
 

 i did:
 log.info('test')
 but Firebug says: log undefined.


 Thiago H. de Paula Figueiredo wrote:
 
  Em Wed, 17 Jun 2009 23:15:17 -0300, Angelo Chen
  angelochen...@yahoo.com.hk escreveu:
 
  after upgrading my app to T5.1.0.5, I see this blackbird.js in the
  browser,
  how to use this to log some info instead of alert? thanks,
 
  What about the Blackbrid documentation?
  http://www.gscottolson.com/blackbirdjs/
 
  --
  Thiago H. de Paula Figueiredo
  Independent Java consultant, developer, and instructor
  http://www.arsmachina.com.br/thiago
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

 --
 View this message in context:
 http://www.nabble.com/t5%3A-how-to-use-Blackbird--tp24085319p24086448.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


 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/t5%3A-how-to-use-Blackbird--tp24085319p24144015.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



Access unique clientId in AjaxFormLoop iteration

2009-04-29 Thread Andrew Court

Each new iteration of AjaxFormLoop generated by an addRowLink event appends a
unique identifier to the clientId of elements in the form of -120f481f67e

Is it possible to access this value directly in order to pass it as a
parameter in onclick events for example?

Something  like:

input t:type=checkbox t:value=rate.onMon t:clientId=weekday_0
onclick=javascript:doAllCheckboxToggle('${uniqueId}')/

such that after render we would have:

input type=checkbox id=weekday_0-120f481f67e
onclick=javascript:doAllCheckboxToggle('-120f481f67e')/


Any pointers gratefully received.

Thanks,
Andrew
-- 
View this message in context: 
http://www.nabble.com/Access-unique-clientId-in-AjaxFormLoop-iteration-tp23304122p23304122.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: problems when using FormFragment in a loop

2009-04-28 Thread Andrew Court


Did anyone find a resolution (or file a JIRA) for this issue? 

I'm encountering exactly the same problem with formFragments in a loop. Only
the final loop iteration is updated on form submit and all the rest ignored.

Seems like a really fundamental problem with the formFragment component and
has me stumped.

Any ideas?

Thanks,
Andrew





Joachim Van der Auwera wrote:
 
 After two days of hunting, I have discovered a bug (or maybe better) 
 limitation.
 If you try to use the FormFragment component inside a loop, then the 
 updates caused by the form elements in the formfragment will only be 
 applied to the last item in the loop.
 
 The form elements seem to be included at the end of the form instead of 
 inside the loop element, which causes the problem.
 
 Maybe at a minimum the documentation could be modified to indicate this 
 limitation.
 
 Kind regards,
 Joachim
 
 -- 
 Joachim Van der Auwera
 PROGS bvba, progs.be
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/problems-when-using-FormFragment-in-a-loop-tp21488113p23287963.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: [REQUEST] Live T5 web sites, quotes, marketting

2009-04-26 Thread Andrew Court


https://reservations.guestlogic.com/book?id=nz1

Although a work in progress, this site demonstrates the flexiblity of T5 to
integrate with other technologies. It's a hotel booking system that combines
T5, DWR, Spring and Velocity. With T5 it all just slots together. No fuss,
no bother.

Andrew Court




Howard Lewis Ship wrote:
 
 I'm putting together some new presentations about Tapestry and I could
 use the help of the Tapestry community.
 
 I need more pictures of live T5 sites.  Just send me a URL and I can
 do a screen grab.  This is all about answering the question: is it
 mature?
 
 I make a number of reasonable observations about Tapestry 5, but would
 love quotes to back it up:
 - Fast and easy to develop
 - Helps with big teams
 - Great performance
 - Great internationalization / localization
 - Live class reloading gives almost scripting language productivity
 
 
 so quotes along the lines of we were able to quickly put together
 xyz or we found qrstuv much easier than our last framework or
 would have been a failure without Tapestry.  Don't let me put words
 in your mouth, however!
 
 -- 
 Howard M. Lewis Ship
 
 Creator of Apache Tapestry
 Director of Open Source Technology at Formos
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-REQUEST--Live-T5-web-sites%2C-quotes%2C-marketting-tp23050433p23246652.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: Hidden field encoder problem

2009-04-07 Thread Andrew Court

Thanks for the reply. 

Okay, but either way, it's still just converting a string to a java.sql.Date
and back again.

It still doesn't explain why the encoder is not working for the Hidden
field. Just wondering if anyone else has encountered this problem, and
whether it's a bug, or just something i'm overlooking?

Andrew



Robert Zeigler wrote:
 
 There's a fundamental difference between text field and hidden field:  
 one is intended for direct user-input data, and the other is not.
 Hence, the use of translator vs. encoder.
 
 Robert
 
 
 On Apr 6, 2009, at 4/67:09 PM , Andrew Court wrote:
 

 I'm seeing an issue with the new Hidden field component in 5.1.0.2.

 I've written a ValueEncoder to translate between string and  
 java.sql.Date,
 but this throws a class cast exception when used as the encoder  
 parameter
 for the hidden field.

 If I use a regular TextField component and use a ValueTranslator,  
 then this
 works without problem.

 The question is, why does Hidden field use an encoder, when  
 TextField uses a
 translator?  Perhaps there should be some consistency here.

 -- 
 View this message in context:
 http://www.nabble.com/Hidden-field-encoder-problem-tp22919903p22919903.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
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Hidden-field-encoder-problem-tp22919903p22922658.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



Hidden field encoder problem

2009-04-06 Thread Andrew Court

I'm seeing an issue with the new Hidden field component in 5.1.0.2.

I've written a ValueEncoder to translate between string and java.sql.Date,
but this throws a class cast exception when used as the encoder parameter
for the hidden field.

If I use a regular TextField component and use a ValueTranslator, then this
works without problem.

The question is, why does Hidden field use an encoder, when TextField uses a
translator?  Perhaps there should be some consistency here.

-- 
View this message in context: 
http://www.nabble.com/Hidden-field-encoder-problem-tp22919903p22919903.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: Return page from ajax request

2008-08-24 Thread Andrew Court

Hi Markus,

Actually no. I couldn't find any way to make a conditional redirect from an
xhttp action method.

My work around was to do the redirect on the client side based on the return
value of the action method, but unfortunately this means two trips to the
server.

Let me know if you can find a solution.

Andrew




Markus Joschko wrote:
 
 Hi Andrew,
 have you found the solution? I try the same but using the normal page
 navigation patterns result into
 
  Caused by: java.lang.RuntimeException: A component event handler
 method returned the value profile/Profiles. Return type
 java.lang.String can not be handled.  Configured return types are
 org.apache.tapestry5.StreamResponse,
 org.apache.tapestry5.json.JSONObject,
 org.apache.tapestry5.runtime.Component,
 org.apache.tapestry5.runtime.RenderCommand.
   at
 org.apache.tapestry5.internal.services.ObjectComponentEventResultProcessor.processResultValue(ObjectComponentEventResultProcessor.java:39)
   at
 $ComponentEventResultProcessor_11bf1136128.processResultValue($ComponentEventResultProcessor_11bf1136128.java)
   at
 $ComponentEventResultProcessor_11bf1136126.processResultValue($ComponentEventResultProcessor_11bf1136126.java)
   at
 org.apache.tapestry5.internal.services.ComponentResultProcessorWrapper.handleResult(ComponentResultProcessorWrapper.java:42)
   at
 org.apache.tapestry5.internal.structure.ComponentPageElementImpl$15.handleResult(ComponentPageElementImpl.java:1008)
   at
 org.apache.tapestry5.internal.services.EventImpl.storeResult(EventImpl.java:67)
 
 
 Thanks,
  Markus
 
 
 
 On Sun, Apr 27, 2008 at 11:06 PM, Andrew Court [EMAIL PROTECTED]
 wrote:

 Hi all,

 In T5, from an Ajax request, is it possible to redirect to a different
 page?

 What I'm trying to do is something like below:

 Object onSomeAjaxRequest(){

  if(some condition){
  exit xhttp and jump to a different page
  }
  else{
  return xhttp response to same page
  }

 }

 But this doesn't seem to work.

 Thanks for any pointers,
 Andrew
 --
 View this message in context:
 http://www.nabble.com/Return-page-from-ajax-request-tp16927742p16927742.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Return-page-from-ajax-request-tp16927742p19129107.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Custom translator broken in 5.0.14

2008-08-12 Thread Andrew Court

Hi,

I've just upgraded to 5.0.14 and encountered an exception with a previously
working java.sql.Date translator bound to a textfield.

Exception reads:
 Could not convert 'sqlDateTranslator' into a component parameter binding:
Unknown translator type 'sqlDateTranslator'. Configured translators are
byte, double, float, integer, long, string.

This was working in 5.0.13. What do I need to change to get this working
again?

Thanks for any help,
Andrew
-- 
View this message in context: 
http://www.nabble.com/Custom-translator-broken-in-5.0.14-tp18951922p18951922.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Return page from ajax request

2008-04-27 Thread Andrew Court

Hi all,

In T5, from an Ajax request, is it possible to redirect to a different page?

What I'm trying to do is something like below:

Object onSomeAjaxRequest(){

 if(some condition){
  exit xhttp and jump to a different page
 }
 else{
  return xhttp response to same page
 }

}

But this doesn't seem to work.

Thanks for any pointers,
Andrew
-- 
View this message in context: 
http://www.nabble.com/Return-page-from-ajax-request-tp16927742p16927742.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: Return javascript in zone markup

2008-04-12 Thread Andrew Court

Hi all,

I don't know if this functionality has been built into the zone component
yet (using 5.0.11 release), but what I'm trying to do is return additional
javascript along with html markup in an ajax response. Is this possible, and
if so how would one go about doing it?

And while I'm here, I've noticed what seems to be an issue with the @Secure
forced redirect from http to https. Any querystring parameters appended to
the url are dropped. It seems to me that it would be useful if these could
be passed along too.

Thanks for any help,
Andrew
-- 
View this message in context: 
http://www.nabble.com/T5%3A-Return-javascript-in-zone-markup-tp16656452p16656452.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]