[T5] Palette OptionGroup

2008-10-24 Thread Christoph Jäger

Hi,

I recently tried out the palette with option groups. The available  
list should look like:


Austria
  Linz
  Salzburg
  Vienna
Germany
  Berlin
  Frankfurt
  München
USA
  Illinois
  Kansas City
  New York

This renders ok. But here support for option groups ends. What would  
be nice:


- if you move one city from the available to the selected list (or  
back): add the option group the city belongs to (if not already existig)
- if you move the last city of an option group, remove the option  
group (both directions)


Should I log an enhancement request to JIRA, or is this already  
implemented, but I didn't find how to switch it on?


Best Regards,

Christoph


Christoph Jäger
[EMAIL PROTECTED]






Re: Tutorial on Tapestry 5 scriptaculous usage

2008-10-24 Thread Peter Stavrinides

Not exactly what you are asking, but there is a wiki article that explains most 
of the concepts required:
http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained

- Original Message -
From: wesley [EMAIL PROTECTED]
To: users@tapestry.apache.org
Sent: Thursday, 23 October, 2008 11:54:14 PM GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul
Subject: Tutorial on Tapestry 5 scriptaculous usage


hi all,

so far i haven't seen any detail tutorial on the usage of ajax with
scriptaculous within Tapestry 5, anyone has pointer or links to it? please
advise

regards,
wesley
-- 
View this message in context: 
http://n2.nabble.com/Tutorial-on-Tapestry-5-scriptaculous-usage-tp1369700p1369700.html
Sent from the Tapestry Users 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]



Re: [T5] editing a looped list of objects' properties in a form

2008-10-24 Thread tapestryphoto

Quoting Andy Pahne [EMAIL PROTECTED]:



That were our web designers. But it worked that way in many other form
components. So I did not think about it any further.

Anyway, I tried input type=submit. There's no difference in the
behaviour, regardless of which type of Submit is used.




I think you might find (as I did - see my 2nd original posting on this  
issue) that the objects being updated in the loop are different  
instances to the ones that are specified. It seems to be a  
serialization problem (but that's a guess on my part - I don't know  
what the Tapestry code does).


I think a bug should be raised for this issue.


p.






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



Re: layout template doesn't work

2008-10-24 Thread Michal Hlavac
On Thursday 23 October 2008 20:08:18 Howard Lewis Ship wrote:
 Your Layout.tml is likely in the wrong location.

thanks,

you were right... I had template files in weapp folder instead of resoures.

thanks, m.

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



tapestry-core transitive dependencies in maven repository

2008-10-24 Thread Michal Hlavac
Hello,

do we need slf4j-log4j12 transitive dependency in tapestry-core library?
As I see tapestry really needs only slf4j-api.

m.

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



tapestry-spring-security: how to get the exception that made the login fail

2008-10-24 Thread Ulrich Stärk
When I throw an UsernameNotFoundException inside my UserDetailsService, 
the client is redirected to the page denoted by the 
spring-security.failure.url symbol. But I'm giving a detailed 
description, why the login failed, that I'd like to be displayed on that 
page. How do I do this?


Uli

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



Re: [T5] editing a looped list of objects' properties in a form

2008-10-24 Thread Joachim Van der Auwera

Hi,

From my experience, there is a problem for components which cause 
events which are enclosed in a loop.
Tapestry will use the dom nesting for the component event url, and thus, 
it is always the last (at least in my case) of the components which is 
triggered by the event.
The solution is to pass a context to each event and assure this context 
is different for each iteration of the loop.


Kind regards,
Joachim

tapestryphoto wrote:
This looks similar to my problem (see both of my posts from a day or 
so ago). It appears Loops in a Form do not update the properties.


Perhaps this is broken in Tapestry.  I guess it must be a bug. 
Unfortunately I'm not knowledgeable enough about Tapestry to provide 
an answer and I await someone who is.


p.


Quoting Andy Pahne [EMAIL PROTECTED]:



I am trying to edit the properties of objects contained in a list by
using a loop in a form component. But it does not work, because the
objects in the list are not updated.



The list of passengers:

@Property @Persist
private ListPassenger passengers;


This list is initialized like this:

@BeforeRenderTemplate
public void initialize() {
int passengersTotal = getQuery().getPassengersTotal();
if(passengers == null) {
passengers = new ArrayListPassenger(passengersTotal);
for (int i = 0; i  passengersTotal; i++) {
passengers.add(new Passenger());
}
}
}



I try to buid a form in order to edit the passengers like this:


form t:type=Form
  t:id=search_accommodation
  t:clientValidation=false
  t:autofocus=false
 t:loop source=passengers value=passenger
 fieldset class=column first
legend${message:firstName-label}/legend
input type=text
   t:type=TextField
   t:value=passenger.firstName
   t:validate=required,minLength=2
   t:id=firstName/
/fieldset
 /t:loop
/form




Unfortunatly, after a successful submit, the firstName property is not
set for any of the passengers contained in that list. I veryify that by
the following logging statements:


public void onSuccess() {
int passengersTotal = getSearchOptions().getPassengersTotal();
for (int i = 0; i  passengersTotal; i++) {
System.out.println(Passenger '+i+' + :  +
passengers.get(i).getFirstName());
}
}


which always produces the output:

   Passenger '0': null
   Passenger '1': null


I thought that this would be the way to go, but I must be wrong
somehow. Could anybody tell me what's the correct pattern to use here?


Thank you,
Andy









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





--
Joachim Van der Auwera
PROGS bvba, progs.be


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



Re: [T5] editing a looped list of objects' properties in a form

2008-10-24 Thread Andy Pahne

Jonathan Barker schrieb:

Well, that was fun.  Sort of.

I did get it working by setting volatile=true for the loop.  It did leave
me scratching my head wondering about the interactions of Persist and
volatile.

Odd.




I like your approach. Works for me.

By the way: found another thread, where another solution might be included:

http://markmail.org/message/cwr4pi2ipyehohkb?q=tapestry+loop+list+form+list:org.apache.tapestry.userspage=1#query:tapestry%20loop%20list%20form%20list%3Aorg.apache.tapestry.users+page:1+mid:7wo6jz3sbka5dgmf+state:results


Thanks.


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



Re: [T5] editing a looped list of objects' properties in a form

2008-10-24 Thread Andy Pahne

tapestryphoto schrieb:
I think you might find (as I did - see my 2nd original posting on this 
issue) that the objects being updated in the loop are different 
instances to the ones that are specified. It seems to be a serialization 
problem (but that's a guess on my part - I don't know what the Tapestry 
code does).


I think a bug should be raised for this issue.



I don't know if I understand enough about how it works or why the 
solution works that Jonathan posted. So I don't know if that's a bug or 
a feature.


But the documentation could be enhanced. Maybe a JIRA for that?




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



Re: T5 : Jira TAP5-290 not entirely resolved

2008-10-24 Thread Hugo Palma
Actually it is.
By declaring you style like:

div.msg {
}

Your saying that this style will be applied to every div tags with the class
msg. So if the tag isn't a div this style won't be applied.
Still, i think Howard's fix shouldn't change the rendered tag. This can
cause problems like yours and one will have to change the css declarations
because of this, it shouldn't have to be done.
Maybe the issue should be reopened ?


On Thu, Oct 23, 2008 at 6:11 PM, Stephane Decleire 
[EMAIL PROTECTED] wrote:

 ok
 so my css is not hooked to the tag, it's hooked to the class.

 FYI
 p.msg, div.msg, td.msg {
   background-color : #ff;
   color : #707070;
   font-family : verdana,arial;
   font-size : 11px;
   border : 1px solid #cc;
   padding: 6px 6px 6px 6px;
   margin : 4px 0px 4px 0px;

 }

 Stephane

 Hugo Palma a écrit :

 I mean defining in your css something like this:

 div {
 
 }

 That style is applied to all div tags and in that case after the partial
 update it wouldn't be applied anymore.

 Stephane Decleire wrote:

 What do you mean by hooked to the tag ?

 Stephane

 Hugo Palma a écrit :

 Are you sure your css isn't hooked to the tag instead of the class ?

 I still haven't tried this fix, but it seems weird that the msg class
 isn't
 applied when it's declared in the class attribute of the tag.

 On Thu, Oct 23, 2008 at 1:14 PM, Stephane Decleire 
 [EMAIL PROTECTED] wrote:



 The correction linked to Jira TAP5-290 defines the namespaces as needed
 but
 the tag generated is not the same in a full and in a partial render :

 In my sample, the div tag printed during a full page rendering :

 div class=msg
  div.../div
 /div

 becomes an ns0 tag :

 ns0:div class=msg xmlns:ns0=http://www.w3.org/1999/xhtml;
 xmlns:ns1=
  div.../div
 /ns0:div

 and my class=msg css information is no more applied.

 Stephane








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




Re: T5 : Jira TAP5-290 not entirely resolved

2008-10-24 Thread Hugo Palma
Just a note, i took the liberty of reopening the issue with comments
regarding this situation.

On Thu, Oct 23, 2008 at 6:11 PM, Stephane Decleire 
[EMAIL PROTECTED] wrote:

 ok
 so my css is not hooked to the tag, it's hooked to the class.

 FYI
 p.msg, div.msg, td.msg {
   background-color : #ff;
   color : #707070;
   font-family : verdana,arial;
   font-size : 11px;
   border : 1px solid #cc;
   padding: 6px 6px 6px 6px;
   margin : 4px 0px 4px 0px;

 }

 Stephane

 Hugo Palma a écrit :

 I mean defining in your css something like this:

 div {
 
 }

 That style is applied to all div tags and in that case after the partial
 update it wouldn't be applied anymore.

 Stephane Decleire wrote:

 What do you mean by hooked to the tag ?

 Stephane

 Hugo Palma a écrit :

 Are you sure your css isn't hooked to the tag instead of the class ?

 I still haven't tried this fix, but it seems weird that the msg class
 isn't
 applied when it's declared in the class attribute of the tag.

 On Thu, Oct 23, 2008 at 1:14 PM, Stephane Decleire 
 [EMAIL PROTECTED] wrote:



 The correction linked to Jira TAP5-290 defines the namespaces as needed
 but
 the tag generated is not the same in a full and in a partial render :

 In my sample, the div tag printed during a full page rendering :

 div class=msg
  div.../div
 /div

 becomes an ns0 tag :

 ns0:div class=msg xmlns:ns0=http://www.w3.org/1999/xhtml;
 xmlns:ns1=
  div.../div
 /ns0:div

 and my class=msg css information is no more applied.

 Stephane








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




Re: [T5] editing a looped list of objects' properties in a form

2008-10-24 Thread tapestryphoto

Quoting Andy Pahne [EMAIL PROTECTED]:


tapestryphoto schrieb:
I think you might find (as I did - see my 2nd original posting on   
this issue) that the objects being updated in the loop are   
different instances to the ones that are specified. It seems to be   
a serialization problem (but that's a guess on my part - I don't   
know what the Tapestry code does).


I think a bug should be raised for this issue.



I don't know if I understand enough about how it works or why the
solution works that Jonathan posted. So I don't know if that's a bug or
a feature.

But the documentation could be enhanced. Maybe a JIRA for that?




Yes, more information on volatile (and how it interacts with @Persist)  
would be nice.


For the moment I have moved away from Loop and am using Grid... not  
that Grid is without its own set of problems :-)


p.




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



Re: Conditional Validation in t5

2008-10-24 Thread Daniel Alonso Sanchez

For god's shake, thanks a lot for your response,Hugo! I was trying something
different for activate validations in both sides, but, due to the
restrictions I think I'm gonna follow your idea.

Thanks a lot again for your time :D
-- 
View this message in context: 
http://www.nabble.com/Conditional-Validation-in-t5-tp20126760p20147177.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: Grid bug - Grid is not collection type aware

2008-10-24 Thread tapestryphoto


If the source for a grid is a collection which has a generic type of  
an abstract class and the list contains concrete classes which are not  
all of the same subclass then it throws:


Render queue error in BeginRender[SearchByTag:grid_0.rows.gridcell]:  
ConcreteB cannot be cast to ConcreteA



Is this a bug?  It certainly seems that way to me; at the very least  
it seems a deficiency.


Suggestions for a workaround?  (my guess is to create another class  
which will hold all the values I want to display, then copy everything  
from my list of abstract-derived classes into a list of this new class  
- how incredibly ugly. Surely there must be a better way?)


Template fragment:

t:grid t:source=conList
/t:grid


Code fragments:

@Property
@Persist
private ListAbstractClass conList;

 // this doesn't work:
conList = new ArrayListAbstractClass();
conList.add(new ConcreteA());
conList.add(new ConcreteA());
conList.add(new ConcreteB());

 // this does work:
conList = new ArrayListAbstractClass();
conList.add(new ConcreteA());
conList.add(new ConcreteA());
conList.add(new ConcreteA());



public class ConcreteA extends AbstractClass
{
}

public class ConcreteB extends AbstractClass
{
}

public abstract class AbstractClass
{
private String a;
private String b;


public String getA()
{
return I am A;
}
public void setA(String a)
{
this.a = a;
}
public String getB()
{
return I am B;
}
public void setB(String b)
{
this.b = b;
}


}



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



T5: prevent browser caching

2008-10-24 Thread mailinglist
We encountered a strange problem with yes, again :-) the browser back button. 
Seems that FF3 aggressively uses page caching where Safari does not. I tried to 
use the @Meta(value={pragma=no-cache, cache-control=no-cache, expires=0}) 
but without effect. What is the best or at least working solution to get the 
META info included in the T5 rendered pages to prevent browser caching at all? 
Do I need to modify the response, too? 

Thanks in advance for any hint

Jens

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



Rendering messages in template

2008-10-24 Thread Ivan Dubrov
Is there a way instead of writing

Page.tml:
Step title: ${stepTitle}

Page.java:
public String getStepTitle() {
return messages.get(step.getStepName() + -step);
}

write something like (does not work):
${messages:${step.stepName}-step}

?

-- 
WBR,
Ivan S. Dubrov



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



T5: Grid component removing a field

2008-10-24 Thread James Sherwood
Hello,

 

Let's say I have a grid component running off a source with objects such as:

 

Id

Fname

Lname

 

How do I remove Id from the grid?

 

Remove=Id in the html of t:grid does not work.

 

Thanks,

--James



Re: T5: Grid bug - Grid is not collection type aware

2008-10-24 Thread tapestryphoto


Ok, after some experimentation I can see that I can do this by  
providing a BeanModel.


p.

Quoting tapestryphoto [EMAIL PROTECTED]:



If the source for a grid is a collection which has a generic type of
an abstract class and the list contains concrete classes which are not
all of the same subclass then it throws:

Render queue error in BeginRender[SearchByTag:grid_0.rows.gridcell]:
ConcreteB cannot be cast to ConcreteA


Is this a bug?  It certainly seems that way to me; at the very least
it seems a deficiency.

Suggestions for a workaround?  (my guess is to create another class
which will hold all the values I want to display, then copy everything
from my list of abstract-derived classes into a list of this new class
- how incredibly ugly. Surely there must be a better way?)

Template fragment:

t:grid t:source=conList
/t:grid


Code fragments:

@Property
@Persist
private ListAbstractClass conList;

 // this doesn't work:
conList = new ArrayListAbstractClass();
conList.add(new ConcreteA());
conList.add(new ConcreteA());
conList.add(new ConcreteB());

 // this does work:
conList = new ArrayListAbstractClass();
conList.add(new ConcreteA());
conList.add(new ConcreteA());
conList.add(new ConcreteA());



public class ConcreteA extends AbstractClass
{
}

public class ConcreteB extends AbstractClass
{
}

public abstract class AbstractClass
{
private String a;
private String b;


public String getA()
{
return I am A;
}
public void setA(String a)
{
this.a = a;
}
public String getB()
{
return I am B;
}
public void setB(String b)
{
this.b = b;
}


}



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



Re: T5: Grid component removing a field

2008-10-24 Thread Andy Pahne




James Sherwood schrieb:

Hello,

Let's say I have a grid component running off a source with objects such as:

Id
Fname
Lname

 
How do I remove Id from the grid?


 


Remove=Id in the html of t:grid does not work.




I think that remove has been renamed to exclude. Try for example:

   t:exclude=id



 


Thanks,

--James




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



T5: BeanEditForm and Date

2008-10-24 Thread James Sherwood
Hello,

 

It seems that beaneditform does not like have a date as a field in the
object.

 

Is there a way around this?

 

--James



Re: [T5]t5component Chart interfere with TabSet problem

2008-10-24 Thread olip

Dear Sven,

Thank you so much for your help, I really appreciate it!

You helped me a lot.

Thanks again

Oliver

Sven Homburg wrote:
 
 hi oliver,
 
 i checked it, and you are right,
 its impossible to insert a chart into a hidden (display:none) element.
 in this case the flotr library cant calculate the dimension of the chart
 
 i have change the flotr code a bit, so if element is hidden, the dimension
 is getting from style tag if set.
 please get the latest trunk from t5components
 
 2008/10/23 olip [EMAIL PROTECTED]
 

 have somebody had a look over it??
 Thank you
 Oliver

 olip wrote:
 
  I have got problems with the t5component chart when using in
 conjunction
  with the t5 component tabset.
 
  As an example I use the code from the t5components site and make a test
  site
  with three tabs. the middle tab should contain a chart (also from the
  examples on t5components)
 
  When running this code I get three empty tabs and I cannot switch
 between
  them, it seems like the site hangs. When I start the same code
 without
  displaying the chart component in the middle tab it works just fine.
 
  The sample code works when using only the tabset or the chart.
 
  I am using tapestry 5
 
  Maybe those components interfere each other?
 
  Thanks for your help
  Oliver
 
  ===
  MyPage.java
 
  import org.apache.tapestry.commons.utils.XYDataItem;
  import org.apache.tapestry.commons.components.Chart;
  import org.apache.tapestry5.annotations.Component;
  import org.apache.tapestry5.annotations.Cached;
  import org.apache.tapestry5.annotations.Persist;
  import org.apache.tapestry5.annotations.OnEvent;
  import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
  import org.apache.tapestry.commons.components.TabSet;
 
  import java.util.List;
 
 
  public class MyPage {
  private ListListXYDataItem _testData;
 
  /**
   * simple chart
   */
  @Component(parameters = {dataItems=testData})
  private Chart _chart1;
 
  /**
   * subclassed bar chart component
   */
  @Component
  private Chart _chart2;
 
  /**
   * subclassed line chart component
   */
  @Component(parameters = {dataItems=testData})
  private Chart _chart3;
 
  @Persist
  private String _activePanel;
 
  /**
   * generating some data arrays
   */
  @Cached
  public List getTestData() {
  ListListXYDataItem dataList = CollectionFactory.newList();
  ListXYDataItem list1 = CollectionFactory.newList();
  ListXYDataItem list2 = CollectionFactory.newList();
 
  list1.add(new XYDataItem(0, 0.5));
  list1.add(new XYDataItem(1, 0.6));
  list1.add(new XYDataItem(2, 1.8));
  list1.add(new XYDataItem(3, 0.9));
  list1.add(new XYDataItem(4, 2));
 
  list2.add(new XYDataItem(0, 1.5));
  list2.add(new XYDataItem(1, 2));
  list2.add(new XYDataItem(2, 4.5));
  list2.add(new XYDataItem(3, 3.5));
  list2.add(new XYDataItem(4, 5.5));
 
  dataList.add(list1);
  dataList.add(list2);
 
  return dataList;
  }
 
  public String getActivePanel() {
  return _activePanel;
  }
 
  public void setActivePanel(String activePanel) {
  _activePanel = activePanel;
  }
 
  @OnEvent(component = tabset, value = action)
  public void onChange(String choosenPanelId) {
  _activePanel = choosenPanelId;
  }
 
 
  }
 
 
  ===
  MyPage.tml
 
  html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
  body
 
  div t:type=t5components/TabSet
  panelIds=list:'stuff1','stuff2','stuff3' activePanelId=activePanel
 
  div id=stuff1 style=display:none;
  h1Hello Guys and Dolls/h1
  /div
 
  div id=stuff2 style=display:none;
 div t:id=chart1 style=width: 350px; height:
 150px;/
  br/
  div t:id=chart2 style=width: 350px; height:
 150px;/
  br/
  div t:id=chart3 style=width: 350px; height:
 150px;/
  /div
 
  div id=stuff3 style=display:none;
  h1Hello World!/h1
  /div
 
  /div
  /body
  /html
 
  ===
  MyPage.properties
 
 
  label-stuff1 = introduction
  label-stuff2 = chart
  label-stuff3 = greetings
 
  ===
 
 
 

 --
 View this message in context:
 http://n2.nabble.com/-T5-t5component-Chart-interfere-with-TabSet-problem-tp1344812p1367160.html
 Sent from the Tapestry Users mailing list archive at Nabble.com.


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


 
 
 -- 
 with regards
 Sven Homburg
 

T4.1 AJAX Indicators

2008-10-24 Thread Norman Franke
I've searched the documentation, and I can't find how one implements a  
loading... indicator when an AJAX request is sent off. My app will  
be doing a series of database queries which can take 10 seconds or so,  
and it really needs something to tell the user they need to wait a  
bit. Showing/Hiding a div would be great.


Norman Franke
Answering Service for Directors, Inc.
www.myasd.com



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



Re: Rendering messages in template

2008-10-24 Thread Szemere Szemere
I don't think so, at least not in ordinary Tapestry. For your example, I'm
not sure that even OGNL would help out.


Re: so much useless logging

2008-10-24 Thread Szemere Szemere
+1 for t5.enhanced
I read that as category
com.company.webapp.Page
--
t5.enhanced.com.company.webapp.Page

Szemere


Re: T5: BeanEditForm and Date

2008-10-24 Thread Howard Lewis Ship
http://www.catb.org/~esr/faqs/smart-questions.html

On Fri, Oct 24, 2008 at 8:02 AM, James Sherwood
[EMAIL PROTECTED] wrote:
 Hello,



 It seems that beaneditform does not like have a date as a field in the
 object.



 Is there a way around this?



 --James





-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



Re: T5 : Jira TAP5-290 not entirely resolved

2008-10-24 Thread Howard Lewis Ship
I noticed the blank string namespaces, and fixed it last night.

On Thu, Oct 23, 2008 at 5:14 AM, Stephane Decleire
[EMAIL PROTECTED] wrote:
 The correction linked to Jira TAP5-290 defines the namespaces as needed but
 the tag generated is not the same in a full and in a partial render :

 In my sample, the div tag printed during a full page rendering :

 div class=msg
   div.../div
 /div

 becomes an ns0 tag :

 ns0:div class=msg xmlns:ns0=http://www.w3.org/1999/xhtml; xmlns:ns1=
   div.../div
 /ns0:div

 and my class=msg css information is no more applied.

 Stephane




-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



The URL encoding issue

2008-10-24 Thread Howard Lewis Ship
BTW,

I'm actively working on the issue with URL encoding/decoding.  Because
of the differences between Jetty and Tomcat, I'm abandoning standard
URL encoding (i.e., %2f and all that) and using my own scheme.

As a side effect, we can now properly support null and blank string
values in page activation and event contexts (they will appear in URLs
as $N and $B, respectively).

-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



[T5] Decorating Spring-defined services

2008-10-24 Thread Thiago H. de Paula Figueiredo

Hi!

I've just tried many ways to decorate my UserController service, which is  
defined via Spring. In other words: my decorate* method is never called  
and therefore my service remains undecorated. Are non-Tapestry-IoC-defined  
services not decoratable? Looking at the variables in the Eclipse  
debugger, the injected UserController instance is a Spring proxy (I'm  
using spring-tx), not like any Tapestry-IoC-defined service.


By the way, AspectDecorator is unbelievably awesome. :)

My attempts:

public static T T decorateUserController(UserController service,  
AspectDecorator aspectDecorator) {

... // never executed
// If I change UserController for any Tapestry-IoC-defined service,
// this method is called.
}

public static T T decorateUserController(ClassT serviceInterface, T  
service,

String serviceId, AspectDecorator aspectDecorator) {
... // never executed
}


@Match(User*)
public static T T decorateSomething(ClassT serviceInterface, T service,
String serviceId, AspectDecorator aspectDecorator) {
... // never executed
}

@Match(*)
public static T T decorateSomething(ClassT serviceInterface, T service,
String serviceId, AspectDecorator aspectDecorator) {
}

Throws this exception:
java.lang.IllegalStateException: Construction of service  
'AssetObjectProvider' has failed due to recursion: the service depends on  
itself in some way. Please check  
org.apache.tapestry5.internal.services.AssetObjectProvider(AssetSource,  
TypeCoercer, SymbolSource) (at AssetObjectProvider.java:45) via  
org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at  
TapestryModule.java:155) for references to another service that is itself  
dependent on service 'AssetObjectProvider'.
	at  
org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:52)
	at  
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:65)



--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: T5 : Jira TAP5-290 not entirely resolved

2008-10-24 Thread Hugo Palma
Cool, i hadn't noticed it.

Still the bigger problem remains with the tag name.

On Fri, Oct 24, 2008 at 5:46 PM, Howard Lewis Ship [EMAIL PROTECTED] wrote:

 I noticed the blank string namespaces, and fixed it last night.

 On Thu, Oct 23, 2008 at 5:14 AM, Stephane Decleire
 [EMAIL PROTECTED] wrote:
  The correction linked to Jira TAP5-290 defines the namespaces as needed
 but
  the tag generated is not the same in a full and in a partial render :
 
  In my sample, the div tag printed during a full page rendering :
 
  div class=msg
div.../div
  /div
 
  becomes an ns0 tag :
 
  ns0:div class=msg xmlns:ns0=http://www.w3.org/1999/xhtml;
 xmlns:ns1=
div.../div
  /ns0:div
 
  and my class=msg css information is no more applied.
 
  Stephane
 



 --
 Howard M. Lewis Ship

 Creator Apache Tapestry and Apache HiveMind

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




tapestry5-acegi version to work with Tapestry 5.0.15

2008-10-24 Thread Mahen Perera
Hi all,

 

I am trying to get hold of the tapestry5-acegi version which works with
the latest release of tapestry, i.e. 5.0.15.

 

Assuming the required tapestry5-acegi version is 1.1.1, I don't seem to
find it in the following maven repository.

 

repository 

idlocalhost.nu/id 



urlhttp://www.localhost.nu/java/mvn/url 

  /repository

 

Can someone give me any pointers as to where to find it.

 

Thanks in advance.

 

 

 

The information contained in this email is strictly confidential and for the 
use of 

the addressee only, unless otherwise indicated. If you are not the intended 
recipient, please do not read, copy, use or 

disclose to others this message or any attachment. Please also notify the 
sender by replying to this email or by 

telephone (+44 (0)20 7896 0011) and then delete the email and any copies of it. 
Opinions, conclusions (etc.) that do 

not relate to the official business of this company shall be understood as 
neither given nor endorsed by it. IG Index 

plc is a company registered in England and Wales under number 01190902. VAT 
registration number 761 2978 07. Registered 

Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and 
regulated by the Financial Services 

Authority. FSA Register number 114059.


On Fri, Oct 24, 2008 at 6:01 PM, Howard Lewis Ship hls...@gmail.com wrote: BTW, I'm actively working on the issue with URL encoding/decoding. Because of the differences between Jetty and Tom

2008-10-24 Thread Denis McCarthy
Hi,
I'm trying to implement version-specific paths for my javascript files
(so I can have the expires header for these files in the far future).
Looking at Tapestry's code, the appropriate way to do this is to use
the contributeClasspathAssetAliasManager method in AppModule to give a
version-specific alias for the javascript file in question (as long as
the file is on the classpath, which ours is). Unfortunately for the
life of me I can't get this to work. The code seems fairly simple: In
AppModule.java:

public static void
contributeFactoryDefaults(MappedConfigurationString, String
configuration) {
configuration.add(my.version, 1.0.3);
configuration.add(my.js, classpath:${my.js.path});
configuration.add(my.js.path, /com/myco/myapp);
}


public static void
contributeClasspathAssetAliasManager(MappedConfigurationString,
String configuration,

@Symbol(my.version) String myJsVersion,

@Symbol(my.js.path) String myJsPath) {
configuration.add(myJsVersion + /myjs, myJsPath);
}

Then in my DefaultLayout class, I have
@IncludeJavaScriptLibrary(${my.js}/javascripts.js)

Now, in my case, when this is rendered the javascript path is the
assets/com/myco/myapp/javascripts.js, with not a version in sight in
the path. I must be missing something simple here, although I've gone
through the TapestryModule code from tapestry svn and I nothing jumps
out at me. Any pointers would be greatly appreciated.
Thanks
Denis

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



Trapping the user is on a new page event and calling ComponentResources.discardPersistentFieldChanges() on new page?

2008-10-24 Thread Joel Halbert

Hi,

Is there a hook you can leverage to trap an event when the user 
navigates to a new page? Specifically I want to be able to call 
ComponentResources.discardPersistentFieldChanges() on the previous page 
when this happens...


Cheers,
Joel

--
SU3 Analytics Ltd
61b Oxford Gardens
W10 5UJ
London

Tel: +44 20 8960 2634
Mob: +44 75 2501 0825
www.su3analytics.com

SU3 Analytics Ltd is a company registered in England and Wales under company 
number 06639473 at registered address 61b Oxford Gardens, London W10 5UJ, 
United Kingdom.



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



contributeClasspathAssetAliasManager not contributing

2008-10-24 Thread Denis McCarthy
Oops. just sent this but managed to bork the subject line! Sorry...
Hi,
I'm trying to implement version-specific paths for my javascript files
(so I can have the expires header for these files in the far future).
Looking at Tapestry's code, the appropriate way to do this is to use
the contributeClasspathAssetAliasManager method in AppModule to give a
version-specific alias for the javascript file in question (as long as
the file is on the classpath, which ours is). Unfortunately for the
life of me I can't get this to work. The code seems fairly simple: In
AppModule.java:

   public static void
contributeFactoryDefaults(MappedConfigurationString, String
configuration) {
   configuration.add(my.version, 1.0.3);
   configuration.add(my.js, classpath:${my.js.path});
   configuration.add(my.js.path, /com/myco/myapp);
   }


   public static void
contributeClasspathAssetAliasManager(MappedConfigurationString,
String configuration,

@Symbol(my.version) String myJsVersion,

@Symbol(my.js.path) String myJsPath) {
   configuration.add(myJsVersion + /myjs, myJsPath);
   }

Then in my DefaultLayout class, I have
@IncludeJavaScriptLibrary(${my.js}/javascripts.js)

Now, in my case, when this is rendered the javascript path is the
assets/com/myco/myapp/javascripts.js, with not a version in sight in
the path. I must be missing something simple here, although I've gone
through the TapestryModule code from tapestry svn and I nothing jumps
out at me. Any pointers would be greatly appreciated.
Thanks
Denis

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



Re: Trapping the user is on a new page event and calling ComponentResources.discardPersistentFieldChanges() on new page?

2008-10-24 Thread Thiago H. de Paula Figueiredo
Em Fri, 24 Oct 2008 14:21:05 -0300, Joel Halbert [EMAIL PROTECTED]  
escreveu:



Hi,

Is there a hook you can leverage to trap an event when the user  
navigates to a new page?


I didn't understand how different this situation would be from simply  
catching the end of the rendering of a page. This would be the  
@CleanupRender event or, maybe better, the @PageDetached event. All the  
component events are described here:  
http://tapestry.apache.org/tapestry5/guide/rendering.html and the page  
events here:

http://tapestry.apache.org/tapestry5/guide/lifecycle.html.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: Trapping the user is on a new page event and calling ComponentResources.discardPersistentFieldChanges() on new page?

2008-10-24 Thread Joel Halbert
The difference is needing to know when the user has requested a new 
page, not when the current page has finished rendering.
Logically speaking, T5 would need to keep a track of the last requested 
page, and notify me whenever this changed.



Thiago H. de Paula Figueiredo wrote:
Em Fri, 24 Oct 2008 14:21:05 -0300, Joel Halbert 
[EMAIL PROTECTED] escreveu:



Hi,

Is there a hook you can leverage to trap an event when the user 
navigates to a new page?


I didn't understand how different this situation would be from simply 
catching the end of the rendering of a page. This would be the 
@CleanupRender event or, maybe better, the @PageDetached event. All 
the component events are described here: 
http://tapestry.apache.org/tapestry5/guide/rendering.html and the page 
events here:

http://tapestry.apache.org/tapestry5/guide/lifecycle.html.



--
SU3 Analytics Ltd
61b Oxford Gardens
W10 5UJ
London

Tel: +44 20 8960 2634
Mob: +44 75 2501 0825
www.su3analytics.com

SU3 Analytics Ltd is a company registered in England and Wales under company 
number 06639473 at registered address 61b Oxford Gardens, London W10 5UJ, 
United Kingdom.



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



RE: Trapping the user is on a new page event and calling ComponentResources.discardPersistentFieldChanges() on new page?

2008-10-24 Thread Jonathan Barker
Thiago,

PageDetached fires when the instance of the page used to service the request
gets returned to the page pool.  It doesn't have anything to do with the
user navigating away from a page.

The problem is, with Forward and Back buttons, navigating away from a page
is a browser-side event.  Different frameworks have tried various ways to
stop the back-button from breaking applications.  It's one of the big
reasons that T5 moved to the redirect-after-post pattern.

Jonathan

 -Original Message-
 From: Thiago H. de Paula Figueiredo [mailto:[EMAIL PROTECTED]
 Sent: Friday, October 24, 2008 14:29
 To: Tapestry users
 Subject: Re: Trapping the user is on a new page event and calling
 ComponentResources.discardPersistentFieldChanges() on new page?
 
 Em Fri, 24 Oct 2008 14:21:05 -0300, Joel Halbert [EMAIL PROTECTED]
 escreveu:
 
  Hi,
 
  Is there a hook you can leverage to trap an event when the user
  navigates to a new page?
 
 I didn't understand how different this situation would be from simply
 catching the end of the rendering of a page. This would be the
 @CleanupRender event or, maybe better, the @PageDetached event. All the
 component events are described here:
 http://tapestry.apache.org/tapestry5/guide/rendering.html and the page
 events here:
 http://tapestry.apache.org/tapestry5/guide/lifecycle.html.
 
 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago
 
 -
 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]



Re: Trapping the user is on a new page event and calling ComponentResources.discardPersistentFieldChanges() on new page?

2008-10-24 Thread Thiago H. de Paula Figueiredo
Em Fri, 24 Oct 2008 14:31:44 -0300, Joel Halbert [EMAIL PROTECTED]  
escreveu:


The difference is needing to know when the user has requested a new  
page, not when the current page has finished rendering.
Logically speaking, T5 would need to keep a track of the last requested  
page, and notify me whenever this changed.


Now I got it. :) One possible solution would be the use of a RequestFilter  
to do that, as AFAIK, Tapestry has no event for that.


PS: SU3 Analytics address in Kensington just makes me wonder when I'll  
have the chance to visit London again . . . I just fell in love with this  
city . . .


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: Trapping the user is on a new page event and calling ComponentResources.discardPersistentFieldChanges() on new page?

2008-10-24 Thread Thiago H. de Paula Figueiredo
Em Fri, 24 Oct 2008 14:42:49 -0300, Jonathan Barker  
[EMAIL PROTECTED] escreveu:



Thiago,


Hi, Jonathan!

PageDetached fires when the instance of the page used to service the  
request

gets returned to the page pool.  It doesn't have anything to do with the
user navigating away from a page.


That's what I thought about Joel's request until he clarified in another  
message.


The problem is, with Forward and Back buttons, navigating away from a  
page is a browser-side event.  Different frameworks have tried various  
ways to

stop the back-button from breaking applications.  It's one of the big
reasons that T5 moved to the redirect-after-post pattern.


Embedding redirect-after-post and flash persistence transparently in T5  
was a really very smart move from Howard. :)


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: Trapping the user is on a new page event and calling ComponentResources.discardPersistentFieldChanges() on new page?

2008-10-24 Thread Joel Halbert
I'm less interested in the back button event and more interested when 
when a new page is requested i.e. the user deliberately navigates away 
from the current page. Logically speaking T5 would just need to store he 
current page ref in memory, and notify the user when this changed.
I'm guessing that it should be should be do-able, if it's not possible 
already?


Jonathan Barker wrote:

Thiago,

PageDetached fires when the instance of the page used to service the request
gets returned to the page pool.  It doesn't have anything to do with the
user navigating away from a page.

The problem is, with Forward and Back buttons, navigating away from a page
is a browser-side event.  Different frameworks have tried various ways to
stop the back-button from breaking applications.  It's one of the big
reasons that T5 moved to the redirect-after-post pattern.

Jonathan

  

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2008 14:29
To: Tapestry users
Subject: Re: Trapping the user is on a new page event and calling
ComponentResources.discardPersistentFieldChanges() on new page?

Em Fri, 24 Oct 2008 14:21:05 -0300, Joel Halbert [EMAIL PROTECTED]
escreveu:



Hi,

Is there a hook you can leverage to trap an event when the user
navigates to a new page?
  

I didn't understand how different this situation would be from simply
catching the end of the rendering of a page. This would be the
@CleanupRender event or, maybe better, the @PageDetached event. All the
component events are described here:
http://tapestry.apache.org/tapestry5/guide/rendering.html and the page
events here:
http://tapestry.apache.org/tapestry5/guide/lifecycle.html.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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

  


--
SU3 Analytics Ltd
61b Oxford Gardens
W10 5UJ
London

Tel: +44 20 8960 2634
Mob: +44 75 2501 0825
www.su3analytics.com

SU3 Analytics Ltd is a company registered in England and Wales under company 
number 06639473 at registered address 61b Oxford Gardens, London W10 5UJ, 
United Kingdom.



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



Re: tapestry5-acegi version to work with Tapestry 5.0.15

2008-10-24 Thread Robin Helgelin
On Fri, Oct 24, 2008 at 7:18 PM, Mahen Perera
[EMAIL PROTECTED] wrote:
 Assuming the required tapestry5-acegi version is 1.1.1, I don't seem to
 find it in the following maven repository.

That version should work fine.

http://www.localhost.nu/java/mvn/nu/localhost/tapestry/tapestry5-acegi/1.1.1/

-- 
regards,
Robin

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



Re: Trapping the user is on a new page event and calling ComponentResources.discardPersistentFieldChanges() on new page?

2008-10-24 Thread Wendell Ruotsi
Arriving at a new page doesn't always mean they've left the first page - 
they could have done an Open link in new tab/window. Or they could 
have just opened a new window and typed in a different url on the same 
site. In both cases, the first page is still open in their browser.


-Wendell

Joel Halbert wrote:
I'm less interested in the back button event and more interested when 
when a new page is requested i.e. the user deliberately navigates away 
from the current page. Logically speaking T5 would just need to store 
he current page ref in memory, and notify the user when this changed.
I'm guessing that it should be should be do-able, if it's not possible 
already?


Jonathan Barker wrote:

Thiago,

PageDetached fires when the instance of the page used to service the 
request

gets returned to the page pool.  It doesn't have anything to do with the
user navigating away from a page.

The problem is, with Forward and Back buttons, navigating away from a 
page
is a browser-side event.  Different frameworks have tried various 
ways to

stop the back-button from breaking applications.  It's one of the big
reasons that T5 moved to the redirect-after-post pattern.

Jonathan

 

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2008 14:29
To: Tapestry users
Subject: Re: Trapping the user is on a new page event and calling
ComponentResources.discardPersistentFieldChanges() on new page?

Em Fri, 24 Oct 2008 14:21:05 -0300, Joel Halbert 
[EMAIL PROTECTED]

escreveu:

   

Hi,

Is there a hook you can leverage to trap an event when the user
navigates to a new page?
  

I didn't understand how different this situation would be from simply
catching the end of the rendering of a page. This would be the
@CleanupRender event or, maybe better, the @PageDetached event. All the
component events are described here:
http://tapestry.apache.org/tapestry5/guide/rendering.html and the page
events here:
http://tapestry.apache.org/tapestry5/guide/lifecycle.html.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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

  




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



Re: Trapping the user is on a new page event and calling ComponentResources.discardPersistentFieldChanges() on new page?

2008-10-24 Thread Joel Halbert

that's generally ok in my case.

Wendell Ruotsi wrote:
Arriving at a new page doesn't always mean they've left the first page 
- they could have done an Open link in new tab/window. Or they could 
have just opened a new window and typed in a different url on the same 
site. In both cases, the first page is still open in their browser.


-Wendell

Joel Halbert wrote:
I'm less interested in the back button event and more interested when 
when a new page is requested i.e. the user deliberately navigates 
away from the current page. Logically speaking T5 would just need to 
store he current page ref in memory, and notify the user when this 
changed.
I'm guessing that it should be should be do-able, if it's not 
possible already?


Jonathan Barker wrote:

Thiago,

PageDetached fires when the instance of the page used to service the 
request
gets returned to the page pool.  It doesn't have anything to do with 
the

user navigating away from a page.

The problem is, with Forward and Back buttons, navigating away from 
a page
is a browser-side event.  Different frameworks have tried various 
ways to

stop the back-button from breaking applications.  It's one of the big
reasons that T5 moved to the redirect-after-post pattern.

Jonathan

 

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2008 14:29
To: Tapestry users
Subject: Re: Trapping the user is on a new page event and calling
ComponentResources.discardPersistentFieldChanges() on new page?

Em Fri, 24 Oct 2008 14:21:05 -0300, Joel Halbert 
[EMAIL PROTECTED]

escreveu:

  

Hi,

Is there a hook you can leverage to trap an event when the user
navigates to a new page?
  

I didn't understand how different this situation would be from simply
catching the end of the rendering of a page. This would be the
@CleanupRender event or, maybe better, the @PageDetached event. All 
the

component events are described here:
http://tapestry.apache.org/tapestry5/guide/rendering.html and the page
events here:
http://tapestry.apache.org/tapestry5/guide/lifecycle.html.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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

  




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



--
SU3 Analytics Ltd
61b Oxford Gardens
W10 5UJ
London

Tel: +44 20 8960 2634
Mob: +44 75 2501 0825
www.su3analytics.com

SU3 Analytics Ltd is a company registered in England and Wales under company 
number 06639473 at registered address 61b Oxford Gardens, London W10 5UJ, 
United Kingdom.



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



Re: Deep linking to tapestry pages from jps. Conversion

2008-10-24 Thread Howard Lewis Ship
For deep linking purposes, could you pass the information as normal
query parameters?

You could then @Inject the Request object to retrieve those values.
You can also use the ContextValueEncoder service to decode them to
appropriate types.
This work would be done in the page's activate event handler method.

This is a more servlet-style of development, which may be the right
approach for a transitional application.

On Thu, Oct 23, 2008 at 8:33 AM, Ian Petzer [EMAIL PROTECTED] wrote:
 Hi,

 We are busy converting our Struts/Tiles based application to Tapestry. Until
 this is complete I have am required to generate links to the new Tapestry
 pages correctly from the jsp pages.

 Normally this isn't a problem as I used the url pattern of:
 HOST/PAGE/PARAM1/PARAM2/PARAM3

 Now, please consider the situation where my params have following values:

 PARAM1 = Hello
 PARAM2 = relative/url
 PARAM3 = colon:seperated

 So if I follow my previous url pattern i would get

 HOST/PAGE/Hello/relative/url/colon:seperated

 This of course doesn't work as that url is interpreted as having four
 params: [Hello, relative, url, colon:seperated] instead of the three that I
 define.

 When I use a pageLink object on Tapestry pages this isn't a problem as
 param2 is double url encoded, so that relative/url -- relative%252Furl

 However the colon in param3 isn't double url encoded.

 I would really appreciate it if someone could indicate the rules which are
 used when forming these urls or if someone could suggest an approach to
 generate these urls. Possibly a reverse @Inject of the relevant Tapestry
 object into my Spring service where I could call a method to convert the
 context values.

 Thanks,
 Ian




-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



Re: T4.1 AJAX Indicators

2008-10-24 Thread Norman Franke
I sort of have it working by doing an onclick and relying on the  
entire form to update, which resets my div.


But that brings up another point. I want to AJAX fetch a list of  
elements with a checkbox. Is there a better way to do this than by  
setting the entire form as one of the updateComponents? It pretty much  
forces an update of the entire page. If I don't, I can't get the  
values of the checkbox since tapestry serializes the state of the @For  
and checkboxes in fields.


What's the best way to handle this?

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 12:10 PM, Norman Franke wrote:

I've searched the documentation, and I can't find how one implements  
a loading... indicator when an AJAX request is sent off. My app  
will be doing a series of database queries which can take 10 seconds  
or so, and it really needs something to tell the user they need to  
wait a bit. Showing/Hiding a div would be great.


Norman Franke
Answering Service for Directors, Inc.
www.myasd.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]



Re: T5 - new clien side validator, again

2008-10-24 Thread Mohammad Shamsi
no idea ?

i don't know how add my javascript validator in Tapestry validators list.

any expeirence ?

thanks all

On Wed, Oct 22, 2008 at 11:27 PM, Mohammad Shamsi [EMAIL PROTECTED]wrote:

 hi,

 im trying to add new validator to my project. but i have problem to add
 javascript for clienside validation.

 any idea ?

 --
 sincerely yours
 M. H. Shamsi




-- 
sincerely yours
M. H. Shamsi


Re: T4.1 AJAX Indicators

2008-10-24 Thread Andreas Andreou
To answer your initial question, just use contrib:ajaxStatus from
http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/ajaxstatus.html

For the second, why not update only the part in question?

On Fri, Oct 24, 2008 at 9:22 PM, Norman Franke [EMAIL PROTECTED] wrote:
 I sort of have it working by doing an onclick and relying on the entire
 form to update, which resets my div.

 But that brings up another point. I want to AJAX fetch a list of elements
 with a checkbox. Is there a better way to do this than by setting the entire
 form as one of the updateComponents? It pretty much forces an update of the
 entire page. If I don't, I can't get the values of the checkbox since
 tapestry serializes the state of the @For and checkboxes in fields.

 What's the best way to handle this?

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com

 On Oct 24, 2008, at 12:10 PM, Norman Franke wrote:

 I've searched the documentation, and I can't find how one implements a
 loading... indicator when an AJAX request is sent off. My app will be
 doing a series of database queries which can take 10 seconds or so, and it
 really needs something to tell the user they need to wait a bit.
 Showing/Hiding a div would be great.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.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]





-- 
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



Re: T4.1 AJAX Indicators

2008-10-24 Thread Norman Franke

Thanks. I apparently forgot to look at contrib.

As for the second question, I'd love to, but how can I update the  
formhidden section of the form such that my controls (that were  
created via AJAX) will be sent on the next AJAX action? If I don't  
update the entire form, I never get the values of the controls, it  
seems. Changing it from @Persist(client) to @Persist(session)  
seems to have solved it, however.


Lastly, how can I get an ajax submit to abort? I want to have an  
onclick on a the submit that will put up confirm('Are you sure?')  
but no matter what, it submits anyway.


Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 2:36 PM, Andreas Andreou wrote:


To answer your initial question, just use contrib:ajaxStatus from
http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/ajaxstatus.html

For the second, why not update only the part in question?

On Fri, Oct 24, 2008 at 9:22 PM, Norman Franke [EMAIL PROTECTED]  
wrote:
I sort of have it working by doing an onclick and relying on the  
entire

form to update, which resets my div.

But that brings up another point. I want to AJAX fetch a list of  
elements
with a checkbox. Is there a better way to do this than by setting  
the entire
form as one of the updateComponents? It pretty much forces an  
update of the

entire page. If I don't, I can't get the values of the checkbox since
tapestry serializes the state of the @For and checkboxes in fields.

What's the best way to handle this?

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 12:10 PM, Norman Franke wrote:

I've searched the documentation, and I can't find how one  
implements a
loading... indicator when an AJAX request is sent off. My app  
will be
doing a series of database queries which can take 10 seconds or  
so, and it

really needs something to tell the user they need to wait a bit.
Showing/Hiding a div would be great.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.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]






--
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



Re: T4.1 AJAX Indicators

2008-10-24 Thread Andreas Andreou
dojo.event.connect to it and in there do dojo.event.stopEvent (or
something like that) if you
dont want to go on with the submit

On Fri, Oct 24, 2008 at 10:22 PM, Norman Franke [EMAIL PROTECTED] wrote:
 Thanks. I apparently forgot to look at contrib.

 As for the second question, I'd love to, but how can I update the formhidden
 section of the form such that my controls (that were created via AJAX) will
 be sent on the next AJAX action? If I don't update the entire form, I never
 get the values of the controls, it seems. Changing it from
 @Persist(client) to @Persist(session) seems to have solved it, however.

 Lastly, how can I get an ajax submit to abort? I want to have an onclick on
 a the submit that will put up confirm('Are you sure?') but no matter what,
 it submits anyway.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com

 On Oct 24, 2008, at 2:36 PM, Andreas Andreou wrote:

 To answer your initial question, just use contrib:ajaxStatus from

 http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/ajaxstatus.html

 For the second, why not update only the part in question?

 On Fri, Oct 24, 2008 at 9:22 PM, Norman Franke [EMAIL PROTECTED] wrote:

 I sort of have it working by doing an onclick and relying on the entire
 form to update, which resets my div.

 But that brings up another point. I want to AJAX fetch a list of elements
 with a checkbox. Is there a better way to do this than by setting the
 entire
 form as one of the updateComponents? It pretty much forces an update of
 the
 entire page. If I don't, I can't get the values of the checkbox since
 tapestry serializes the state of the @For and checkboxes in fields.

 What's the best way to handle this?

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com

 On Oct 24, 2008, at 12:10 PM, Norman Franke wrote:

 I've searched the documentation, and I can't find how one implements a
 loading... indicator when an AJAX request is sent off. My app will be
 doing a series of database queries which can take 10 seconds or so, and
 it
 really needs something to tell the user they need to wait a bit.
 Showing/Hiding a div would be great.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.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]





 --
 Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
 Tapestry / Tacos developer
 Open Source / JEE Consulting

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





-- 
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



T5: Beaneditform and Date problem

2008-10-24 Thread James Sherwood
Hello,

 

I have an object Celebrity with the fields:

 

private long id;

private String firstName;

private String lastName;

private Date dateOfBirth;(java.util.Date)

 

When I use the tag:

 

t:beaneditform t:id=celebrity/

 

And access the page I get the console error:

 

No service implements the interface java.util.Date.

 

And a Tapestry error:

 

Render queue error in SetupRender[AddCelebrity:celebrity.editor]: Exception
instantiating instance of com.packtpub.celebrities.model.Celebrity (for
component 'AddCelebrity:celebrity.editor'): Error invoking constructor
com.packtpub.celebrities.model.Celebrity(String, String, Date, Occupation)
(at Celebrity.java:23) (for service 'BeanModelSource'): No service
implements the interface java.util.Date.

 

Any ideas what I am doing wrong?

 

Thanks,

--James



Re: T5: Beaneditform and Date problem

2008-10-24 Thread Thiago H. de Paula Figueiredo
One solution is to remove any constructor that takes arguments. Other is  
to write a method like


@OnEvent(component = celebrity, value = Form.PREPARE) {
yourEditedObject = new Celebrity(...);
}

Em Fri, 24 Oct 2008 16:32:37 -0300, James Sherwood  
[EMAIL PROTECTED] escreveu:



Hello,


I have an object Celebrity with the fields:


private long id;

private String firstName;

private String lastName;

private Date dateOfBirth;(java.util.Date)


When I use the tag:


t:beaneditform t:id=celebrity/


And access the page I get the console error:


No service implements the interface java.util.Date.


And a Tapestry error:


Render queue error in SetupRender[AddCelebrity:celebrity.editor]:  
Exception

instantiating instance of com.packtpub.celebrities.model.Celebrity (for
component 'AddCelebrity:celebrity.editor'): Error invoking constructor
com.packtpub.celebrities.model.Celebrity(String, String, Date,  
Occupation)

(at Celebrity.java:23) (for service 'BeanModelSource'): No service
implements the interface java.util.Date.


Any ideas what I am doing wrong?


Thanks,

--James





--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



Re: T4.1 AJAX Indicators

2008-10-24 Thread Kalle Korhonen
You can also just use @EventListener. Call a Javascript operation to display
the status and hook up your EventListener to an arbitrary Javascript call.

Kalle

On Fri, Oct 24, 2008 at 12:31 PM, Andreas Andreou [EMAIL PROTECTED]wrote:

 dojo.event.connect to it and in there do dojo.event.stopEvent (or
 something like that) if you
 dont want to go on with the submit

 On Fri, Oct 24, 2008 at 10:22 PM, Norman Franke [EMAIL PROTECTED] wrote:
  Thanks. I apparently forgot to look at contrib.
 
  As for the second question, I'd love to, but how can I update the
 formhidden
  section of the form such that my controls (that were created via AJAX)
 will
  be sent on the next AJAX action? If I don't update the entire form, I
 never
  get the values of the controls, it seems. Changing it from
  @Persist(client) to @Persist(session) seems to have solved it,
 however.
 
  Lastly, how can I get an ajax submit to abort? I want to have an onclick
 on
  a the submit that will put up confirm('Are you sure?') but no matter
 what,
  it submits anyway.
 
  Norman Franke
  Answering Service for Directors, Inc.
  www.myasd.com
 
  On Oct 24, 2008, at 2:36 PM, Andreas Andreou wrote:
 
  To answer your initial question, just use contrib:ajaxStatus from
 
 
 http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/ajaxstatus.html
 
  For the second, why not update only the part in question?
 
  On Fri, Oct 24, 2008 at 9:22 PM, Norman Franke [EMAIL PROTECTED]
 wrote:
 
  I sort of have it working by doing an onclick and relying on the
 entire
  form to update, which resets my div.
 
  But that brings up another point. I want to AJAX fetch a list of
 elements
  with a checkbox. Is there a better way to do this than by setting the
  entire
  form as one of the updateComponents? It pretty much forces an update of
  the
  entire page. If I don't, I can't get the values of the checkbox since
  tapestry serializes the state of the @For and checkboxes in fields.
 
  What's the best way to handle this?
 
  Norman Franke
  Answering Service for Directors, Inc.
  www.myasd.com
 
  On Oct 24, 2008, at 12:10 PM, Norman Franke wrote:
 
  I've searched the documentation, and I can't find how one implements a
  loading... indicator when an AJAX request is sent off. My app will
 be
  doing a series of database queries which can take 10 seconds or so,
 and
  it
  really needs something to tell the user they need to wait a bit.
  Showing/Hiding a div would be great.
 
  Norman Franke
  Answering Service for Directors, Inc.
  www.myasd.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]
 
 
 
 
 
  --
  Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
  Tapestry / Tacos developer
  Open Source / JEE Consulting
 
  -
  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]
 
 



 --
 Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
 Tapestry / Tacos developer
 Open Source / JEE Consulting

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




Re: T4.1 AJAX Indicators

2008-10-24 Thread Norman Franke
I'm using T4.1.5 which has dojo 0.4.x and no dojo. event.stopEvent. I  
tried dojo.event.browser.stopEvent but that didn't work. Nor did  
e.stopPropigation or e.preventDefault. In fact, I tried all three  
together (and separate) and it still fires.


Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 3:31 PM, Andreas Andreou wrote:


dojo.event.connect to it and in there do dojo.event.stopEvent (or
something like that) if you
dont want to go on with the submit

On Fri, Oct 24, 2008 at 10:22 PM, Norman Franke [EMAIL PROTECTED]  
wrote:

Thanks. I apparently forgot to look at contrib.

As for the second question, I'd love to, but how can I update the  
formhidden
section of the form such that my controls (that were created via  
AJAX) will
be sent on the next AJAX action? If I don't update the entire form,  
I never

get the values of the controls, it seems. Changing it from
@Persist(client) to @Persist(session) seems to have solved it,  
however.


Lastly, how can I get an ajax submit to abort? I want to have an  
onclick on
a the submit that will put up confirm('Are you sure?') but no  
matter what,

it submits anyway.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 2:36 PM, Andreas Andreou wrote:


To answer your initial question, just use contrib:ajaxStatus from

http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/ajaxstatus.html

For the second, why not update only the part in question?

On Fri, Oct 24, 2008 at 9:22 PM, Norman Franke [EMAIL PROTECTED]  
wrote:


I sort of have it working by doing an onclick and relying on  
the entire

form to update, which resets my div.

But that brings up another point. I want to AJAX fetch a list of  
elements
with a checkbox. Is there a better way to do this than by setting  
the

entire
form as one of the updateComponents? It pretty much forces an  
update of

the
entire page. If I don't, I can't get the values of the checkbox  
since

tapestry serializes the state of the @For and checkboxes in fields.

What's the best way to handle this?

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 12:10 PM, Norman Franke wrote:

I've searched the documentation, and I can't find how one  
implements a
loading... indicator when an AJAX request is sent off. My app  
will be
doing a series of database queries which can take 10 seconds or  
so, and

it
really needs something to tell the user they need to wait a bit.
Showing/Hiding a div would be great.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.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]






--
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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






--
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



Re: Deep linking to tapestry pages from jps. Conversion

2008-10-24 Thread Borut Bolčina
Hi,

it would be great if there was also a JSP transition guide. We have a large
JSP application at the moment and my intention is to replace it gradually
with Tapestry 5. Any advice on how to do it *the right way* would be more
than welcome!

Regards,
Borut

2008/10/24 Howard Lewis Ship [EMAIL PROTECTED]

 For deep linking purposes, could you pass the information as normal
 query parameters?

 You could then @Inject the Request object to retrieve those values.
 You can also use the ContextValueEncoder service to decode them to
 appropriate types.
 This work would be done in the page's activate event handler method.

 This is a more servlet-style of development, which may be the right
 approach for a transitional application.

 On Thu, Oct 23, 2008 at 8:33 AM, Ian Petzer [EMAIL PROTECTED] wrote:
  Hi,
 
  We are busy converting our Struts/Tiles based application to Tapestry.
 Until
  this is complete I have am required to generate links to the new Tapestry
  pages correctly from the jsp pages.
 
  Normally this isn't a problem as I used the url pattern of:
  HOST/PAGE/PARAM1/PARAM2/PARAM3
 
  Now, please consider the situation where my params have following values:
 
  PARAM1 = Hello
  PARAM2 = relative/url
  PARAM3 = colon:seperated
 
  So if I follow my previous url pattern i would get
 
  HOST/PAGE/Hello/relative/url/colon:seperated
 
  This of course doesn't work as that url is interpreted as having four
  params: [Hello, relative, url, colon:seperated] instead of the three that
 I
  define.
 
  When I use a pageLink object on Tapestry pages this isn't a problem as
  param2 is double url encoded, so that relative/url -- relative%252Furl
 
  However the colon in param3 isn't double url encoded.
 
  I would really appreciate it if someone could indicate the rules which
 are
  used when forming these urls or if someone could suggest an approach to
  generate these urls. Possibly a reverse @Inject of the relevant Tapestry
  object into my Spring service where I could call a method to convert the
  context values.
 
  Thanks,
  Ian
 



 --
 Howard M. Lewis Ship

 Creator Apache Tapestry and Apache HiveMind

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




[solution} Re: Trapping the user is on a new page event and calling ComponentResources.discardPersistentFieldChanges() on new page?

2008-10-24 Thread Thiago H. de Paula Figueiredo
Em Fri, 24 Oct 2008 14:21:05 -0300, Joel Halbert [EMAIL PROTECTED]  
escreveu:


Is there a hook you can leverage to trap an event when the user  
navigates to a new page? Specifically I want to be able to call  
ComponentResources.discardPersistentFieldChanges() on the previous page  
when this happens...


I've just implemented this solution as a RequestFilter. It could be  
improved in some points (getting the page name and the session page  
attribute clearing are a little hacky), but at least it works. :)



In AppModule or any other Tapestry-IoC module class:

/**
 * RequestFilter that clears all persistent fields of a page when the user
 * requests another page.
 *
 * @author Thiago H. de Paula Figueiredo (thiagohp at gmail dot com).
 */
public class ClearLastPageRequestFilter implements RequestFilter {

	final private static String ATTRIBUTE =  
ClearLastPageRequestFilter.class.getName();


private ComponentClassResolver componentClassResolver;

private HttpServletRequest httpServletRequest;

/**
 * @param pagePool
 * @param componentClassResolver
 * @param request
 */
	public ClearLastPageRequestFilter(ComponentClassResolver  
componentClassResolver,

HttpServletRequest request) {

this.componentClassResolver = componentClassResolver;
this.httpServletRequest = request;

}

/**
	 * @see  
org.apache.tapestry5.services.RequestFilter#service(org.apache.tapestry5.services.Request,
	 * org.apache.tapestry5.services.Response,  
org.apache.tapestry5.services.RequestHandler)

 */
	public boolean service(Request request, Response response, RequestHandler  
handler)

throws IOException {

final Session session = request.getSession(true);

String lastPage = (String) session.getAttribute(ATTRIBUTE);
String thisPage = getPageName();

		if (lastPage != null  thisPage != null   
lastPage.equalsIgnoreCase(thisPage) == false) {


final ListString attributeNames = 
session.getAttributeNames();

for (String attributeName : attributeNames) {

if (attributeName.toLowerCase().startsWith(state: +  
thisPage.toLowerCase())) {

session.setAttribute(attributeName, 
null);
}

}

}

if (thisPage != null) {
session.setAttribute(ATTRIBUTE, thisPage);
}

return handler.service(request, response);

}

private String getPageName() {
// copied from RequestImpl.getPath()

String path = httpServletRequest.getPathInfo();

if (path == null) {
path = httpServletRequest.getServletPath();
}

		// Websphere 6.1 is a bit wonky (see TAPESTRY-1713), and tends to return  
the empty string

// for the servlet path, and return the true path in pathInfo.

path = path.length() == 0 ? / : path;
path = path.trim();

if (path.equals(/)) {
return Index;
}
else {

String extendedName = path.length() == 0 ? path : 
path.substring(1);

// Copied and adapted from Tapestry's 
PageRenderDispatcher

// Ignore trailing slashes in the path.
while (extendedName.endsWith(/)) {
extendedName = extendedName.substring(0, 
extendedName.length() - 1);
}

int slashx = extendedName.length();
boolean atEnd = true;

while (slashx  0) {

String pageName = extendedName.substring(0, 
slashx);

if 
(componentClassResolver.isPageName(pageName)) {
return pageName;
}

// Work backwards, splitting at the next slash.
slashx = extendedName.lastIndexOf('/', slashx - 
1);

atEnd = false;

}

}

// this isn't a page.
return null;

}

}


public static void  
contributeRequestHandler(OrderedConfigurationRequestFilter configuration,

ComponentClassResolver componentClassResolver,
HttpServletRequest request) {

ClearLastPageRequestFilter filter = new ClearLastPageRequestFilter(
componentClassResolver, request);

configuration.add(clearlastpage, filter, before:*);

}


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, 

Re: T4.1 AJAX Indicators

2008-10-24 Thread Andreas Andreou
sorry - dojo.event.connectBefore is what you need :)

On Fri, Oct 24, 2008 at 11:00 PM, Norman Franke [EMAIL PROTECTED] wrote:
 I'm using T4.1.5 which has dojo 0.4.x and no dojo. event.stopEvent. I tried
 dojo.event.browser.stopEvent but that didn't work. Nor did e.stopPropigation
 or e.preventDefault. In fact, I tried all three together (and separate) and
 it still fires.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com

 On Oct 24, 2008, at 3:31 PM, Andreas Andreou wrote:

 dojo.event.connect to it and in there do dojo.event.stopEvent (or
 something like that) if you
 dont want to go on with the submit

 On Fri, Oct 24, 2008 at 10:22 PM, Norman Franke [EMAIL PROTECTED] wrote:

 Thanks. I apparently forgot to look at contrib.

 As for the second question, I'd love to, but how can I update the
 formhidden
 section of the form such that my controls (that were created via AJAX)
 will
 be sent on the next AJAX action? If I don't update the entire form, I
 never
 get the values of the controls, it seems. Changing it from
 @Persist(client) to @Persist(session) seems to have solved it,
 however.

 Lastly, how can I get an ajax submit to abort? I want to have an onclick
 on
 a the submit that will put up confirm('Are you sure?') but no matter
 what,
 it submits anyway.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com

 On Oct 24, 2008, at 2:36 PM, Andreas Andreou wrote:

 To answer your initial question, just use contrib:ajaxStatus from


 http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/ajaxstatus.html

 For the second, why not update only the part in question?

 On Fri, Oct 24, 2008 at 9:22 PM, Norman Franke [EMAIL PROTECTED] wrote:

 I sort of have it working by doing an onclick and relying on the
 entire
 form to update, which resets my div.

 But that brings up another point. I want to AJAX fetch a list of
 elements
 with a checkbox. Is there a better way to do this than by setting the
 entire
 form as one of the updateComponents? It pretty much forces an update of
 the
 entire page. If I don't, I can't get the values of the checkbox since
 tapestry serializes the state of the @For and checkboxes in fields.

 What's the best way to handle this?

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com

 On Oct 24, 2008, at 12:10 PM, Norman Franke wrote:

 I've searched the documentation, and I can't find how one implements a
 loading... indicator when an AJAX request is sent off. My app will
 be
 doing a series of database queries which can take 10 seconds or so,
 and
 it
 really needs something to tell the user they need to wait a bit.
 Showing/Hiding a div would be great.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.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]





 --
 Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
 Tapestry / Tacos developer
 Open Source / JEE Consulting

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





 --
 Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
 Tapestry / Tacos developer
 Open Source / JEE Consulting

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





-- 
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



Re: T4.1 AJAX Indicators

2008-10-24 Thread Norman Franke
According to the documentation, before is the default. Either way, it  
still doesn't work. The ajax submit is still called. If I call a non- 
function, then it doesn't work, e.g. foobar(). It generates an error  
in the console, but does stop.


Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 4:10 PM, Andreas Andreou wrote:


sorry - dojo.event.connectBefore is what you need :)

On Fri, Oct 24, 2008 at 11:00 PM, Norman Franke [EMAIL PROTECTED]  
wrote:
I'm using T4.1.5 which has dojo 0.4.x and no dojo. event.stopEvent.  
I tried
dojo.event.browser.stopEvent but that didn't work. Nor did  
e.stopPropigation
or e.preventDefault. In fact, I tried all three together (and  
separate) and

it still fires.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 3:31 PM, Andreas Andreou wrote:


dojo.event.connect to it and in there do dojo.event.stopEvent (or
something like that) if you
dont want to go on with the submit

On Fri, Oct 24, 2008 at 10:22 PM, Norman Franke [EMAIL PROTECTED]  
wrote:


Thanks. I apparently forgot to look at contrib.

As for the second question, I'd love to, but how can I update the
formhidden
section of the form such that my controls (that were created via  
AJAX)

will
be sent on the next AJAX action? If I don't update the entire  
form, I

never
get the values of the controls, it seems. Changing it from
@Persist(client) to @Persist(session) seems to have solved it,
however.

Lastly, how can I get an ajax submit to abort? I want to have an  
onclick

on
a the submit that will put up confirm('Are you sure?') but no  
matter

what,
it submits anyway.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 2:36 PM, Andreas Andreou wrote:


To answer your initial question, just use contrib:ajaxStatus from


http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/ajaxstatus.html

For the second, why not update only the part in question?

On Fri, Oct 24, 2008 at 9:22 PM, Norman Franke  
[EMAIL PROTECTED] wrote:


I sort of have it working by doing an onclick and relying on  
the

entire
form to update, which resets my div.

But that brings up another point. I want to AJAX fetch a list of
elements
with a checkbox. Is there a better way to do this than by  
setting the

entire
form as one of the updateComponents? It pretty much forces an  
update of

the
entire page. If I don't, I can't get the values of the checkbox  
since
tapestry serializes the state of the @For and checkboxes in  
fields.


What's the best way to handle this?

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 12:10 PM, Norman Franke wrote:

I've searched the documentation, and I can't find how one  
implements a
loading... indicator when an AJAX request is sent off. My  
app will

be
doing a series of database queries which can take 10 seconds  
or so,

and
it
really needs something to tell the user they need to wait a bit.
Showing/Hiding a div would be great.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.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]






--
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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






--
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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






--
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



Re: T5: Beaneditform and Date problem

2008-10-24 Thread Andy Pahne


You can also annotate the zero argument constructor with @Inject.



Thiago H. de Paula Figueiredo wrote:
One solution is to remove any constructor that takes arguments. Other 
is to write a method like


@OnEvent(component = celebrity, value = Form.PREPARE) {
yourEditedObject = new Celebrity(...);
}

Em Fri, 24 Oct 2008 16:32:37 -0300, James Sherwood 
[EMAIL PROTECTED] escreveu:



Hello,


I have an object Celebrity with the fields:


private long id;

private String firstName;

private String lastName;

private Date dateOfBirth;(java.util.Date)


When I use the tag:


t:beaneditform t:id=celebrity/


And access the page I get the console error:


No service implements the interface java.util.Date.


And a Tapestry error:


Render queue error in SetupRender[AddCelebrity:celebrity.editor]: 
Exception

instantiating instance of com.packtpub.celebrities.model.Celebrity (for
component 'AddCelebrity:celebrity.editor'): Error invoking constructor
com.packtpub.celebrities.model.Celebrity(String, String, Date, 
Occupation)

(at Celebrity.java:23) (for service 'BeanModelSource'): No service
implements the interface java.util.Date.


Any ideas what I am doing wrong?


Thanks,

--James








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



Re: T4.1 AJAX Indicators

2008-10-24 Thread Andreas Andreou
just tried something like
dojo.event.connect(dojo.byId('fepSubm'),'onclick',
function(e){dojo.event.browser.stopEvent(e);});
and it prevented the submit

On Fri, Oct 24, 2008 at 11:29 PM, Norman Franke [EMAIL PROTECTED] wrote:
 According to the documentation, before is the default. Either way, it still
 doesn't work. The ajax submit is still called. If I call a non-function,
 then it doesn't work, e.g. foobar(). It generates an error in the console,
 but does stop.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com

 On Oct 24, 2008, at 4:10 PM, Andreas Andreou wrote:

 sorry - dojo.event.connectBefore is what you need :)

 On Fri, Oct 24, 2008 at 11:00 PM, Norman Franke [EMAIL PROTECTED] wrote:

 I'm using T4.1.5 which has dojo 0.4.x and no dojo. event.stopEvent. I
 tried
 dojo.event.browser.stopEvent but that didn't work. Nor did
 e.stopPropigation
 or e.preventDefault. In fact, I tried all three together (and separate)
 and
 it still fires.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com

 On Oct 24, 2008, at 3:31 PM, Andreas Andreou wrote:

 dojo.event.connect to it and in there do dojo.event.stopEvent (or
 something like that) if you
 dont want to go on with the submit

 On Fri, Oct 24, 2008 at 10:22 PM, Norman Franke [EMAIL PROTECTED]
 wrote:

 Thanks. I apparently forgot to look at contrib.

 As for the second question, I'd love to, but how can I update the
 formhidden
 section of the form such that my controls (that were created via AJAX)
 will
 be sent on the next AJAX action? If I don't update the entire form, I
 never
 get the values of the controls, it seems. Changing it from
 @Persist(client) to @Persist(session) seems to have solved it,
 however.

 Lastly, how can I get an ajax submit to abort? I want to have an
 onclick
 on
 a the submit that will put up confirm('Are you sure?') but no matter
 what,
 it submits anyway.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com

 On Oct 24, 2008, at 2:36 PM, Andreas Andreou wrote:

 To answer your initial question, just use contrib:ajaxStatus from



 http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/ajaxstatus.html

 For the second, why not update only the part in question?

 On Fri, Oct 24, 2008 at 9:22 PM, Norman Franke [EMAIL PROTECTED]
 wrote:

 I sort of have it working by doing an onclick and relying on the
 entire
 form to update, which resets my div.

 But that brings up another point. I want to AJAX fetch a list of
 elements
 with a checkbox. Is there a better way to do this than by setting the
 entire
 form as one of the updateComponents? It pretty much forces an update
 of
 the
 entire page. If I don't, I can't get the values of the checkbox since
 tapestry serializes the state of the @For and checkboxes in fields.

 What's the best way to handle this?

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com

 On Oct 24, 2008, at 12:10 PM, Norman Franke wrote:

 I've searched the documentation, and I can't find how one implements
 a
 loading... indicator when an AJAX request is sent off. My app will
 be
 doing a series of database queries which can take 10 seconds or so,
 and
 it
 really needs something to tell the user they need to wait a bit.
 Showing/Hiding a div would be great.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.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]





 --
 Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
 Tapestry / Tacos developer
 Open Source / JEE Consulting

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





 --
 Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
 Tapestry / Tacos developer
 Open Source / JEE Consulting

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





 --
 Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
 Tapestry / Tacos developer
 Open Source / JEE Consulting

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




 

Re: [T5] Decorating Spring-defined services

2008-10-24 Thread Howard Lewis Ship
Current this is not possible; the Spring context is instantiated
first, then the beans in it are imported as Tapestry IoC services.
We may see some improvements to this in 5.1.

Perhaps you could define an IoC version of a Spring bean whose
implementation is the Spring bean itself, you could then decorate the
IoC wrapper:

public SpringBeanInterface
buildSpringBeanWrapper(@InjectService(beanname) SpringBeanInterface
bean)
{
  return bean;
}

On Fri, Oct 24, 2008 at 11:18 AM, Thiago H. de Paula Figueiredo
[EMAIL PROTECTED] wrote:
 Hi!

 I've just tried many ways to decorate my UserController service, which is
 defined via Spring. In other words: my decorate* method is never called and
 therefore my service remains undecorated. Are non-Tapestry-IoC-defined
 services not decoratable? Looking at the variables in the Eclipse debugger,
 the injected UserController instance is a Spring proxy (I'm using
 spring-tx), not like any Tapestry-IoC-defined service.

 By the way, AspectDecorator is unbelievably awesome. :)

Thanks!  One of many hidden gems inside Tapestry!


 My attempts:

 public static T T decorateUserController(UserController service,
 AspectDecorator aspectDecorator) {
... // never executed
// If I change UserController for any Tapestry-IoC-defined service,
// this method is called.
 }

 public static T T decorateUserController(ClassT serviceInterface, T
 service,
String serviceId, AspectDecorator aspectDecorator) {
... // never executed
 }


 @Match(User*)
 public static T T decorateSomething(ClassT serviceInterface, T service,
String serviceId, AspectDecorator aspectDecorator) {
... // never executed
 }

 @Match(*)
 public static T T decorateSomething(ClassT serviceInterface, T service,
String serviceId, AspectDecorator aspectDecorator) {
 }

 Throws this exception:
 java.lang.IllegalStateException: Construction of service
 'AssetObjectProvider' has failed due to recursion: the service depends on
 itself in some way. Please check
 org.apache.tapestry5.internal.services.AssetObjectProvider(AssetSource,
 TypeCoercer, SymbolSource) (at AssetObjectProvider.java:45) via
 org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at
 TapestryModule.java:155) for references to another service that is itself
 dependent on service 'AssetObjectProvider'.
at
 org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:52)
at
 org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:65)


 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

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





-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



Re: [T5] Decorating Spring-defined services

2008-10-24 Thread Thiago H. de Paula Figueiredo
Em Fri, 24 Oct 2008 18:04:53 -0300, Howard Lewis Ship [EMAIL PROTECTED]  
escreveu:



Current this is not possible; the Spring context is instantiated
first, then the beans in it are imported as Tapestry IoC services.


More one reason to build a tapestry-transaction package . . . If only I  
had time to write it now . . . :(



We may see some improvements to this in 5.1.


Nice!


Perhaps you could define an IoC version of a Spring bean whose
implementation is the Spring bean itself, you could then decorate the
IoC wrapper:


But then I would need to inject a different service (same interface,  
different id). It is a good solution, but not a complete one.


-
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: [T5] Decorating Spring-defined services

2008-10-24 Thread Howard Lewis Ship
On Fri, Oct 24, 2008 at 3:16 PM, Thiago H. de Paula Figueiredo
[EMAIL PROTECTED] wrote:
 Em Fri, 24 Oct 2008 18:04:53 -0300, Howard Lewis Ship [EMAIL PROTECTED]
 escreveu:

 Current this is not possible; the Spring context is instantiated
 first, then the beans in it are imported as Tapestry IoC services.

 More one reason to build a tapestry-transaction package . . . If only I had
 time to write it now . . . :(

 We may see some improvements to this in 5.1.

 Nice!

 Perhaps you could define an IoC version of a Spring bean whose
 implementation is the Spring bean itself, you could then decorate the
 IoC wrapper:

 But then I would need to inject a different service (same interface,
 different id). It is a good solution, but not a complete one.

Yes, it is a stop-gap measure to address todays needs, but a full
version would bring T5 IoC and Spring into parity, allowing T5 to
decorate Spring beans, and injection of IoC services into Spring
beans.  Hopefully all that is possible.


 -
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

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





-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



Re: T4.1 AJAX Indicators

2008-10-24 Thread Norman Franke
I did that exact same thing and it did submit. Very strange! I'm using  
Firefox 3.0 and T4.1.5. Where did you put the connect? I tried at the  
end of the body and outsize the body, before the /html


Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 5:00 PM, Andreas Andreou wrote:


just tried something like
dojo.event.connect(dojo.byId('fepSubm'),'onclick',
function(e){dojo.event.browser.stopEvent(e);});
and it prevented the submit

On Fri, Oct 24, 2008 at 11:29 PM, Norman Franke [EMAIL PROTECTED]  
wrote:
According to the documentation, before is the default. Either way,  
it still
doesn't work. The ajax submit is still called. If I call a non- 
function,
then it doesn't work, e.g. foobar(). It generates an error in the  
console,

but does stop.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 4:10 PM, Andreas Andreou wrote:


sorry - dojo.event.connectBefore is what you need :)

On Fri, Oct 24, 2008 at 11:00 PM, Norman Franke [EMAIL PROTECTED]  
wrote:


I'm using T4.1.5 which has dojo 0.4.x and no dojo.  
event.stopEvent. I

tried
dojo.event.browser.stopEvent but that didn't work. Nor did
e.stopPropigation
or e.preventDefault. In fact, I tried all three together (and  
separate)

and
it still fires.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 3:31 PM, Andreas Andreou wrote:


dojo.event.connect to it and in there do dojo.event.stopEvent (or
something like that) if you
dont want to go on with the submit

On Fri, Oct 24, 2008 at 10:22 PM, Norman Franke [EMAIL PROTECTED]
wrote:


Thanks. I apparently forgot to look at contrib.

As for the second question, I'd love to, but how can I update the
formhidden
section of the form such that my controls (that were created  
via AJAX)

will
be sent on the next AJAX action? If I don't update the entire  
form, I

never
get the values of the controls, it seems. Changing it from
@Persist(client) to @Persist(session) seems to have solved  
it,

however.

Lastly, how can I get an ajax submit to abort? I want to have an
onclick
on
a the submit that will put up confirm('Are you sure?') but no  
matter

what,
it submits anyway.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 2:36 PM, Andreas Andreou wrote:

To answer your initial question, just use contrib:ajaxStatus  
from




http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/ajaxstatus.html

For the second, why not update only the part in question?

On Fri, Oct 24, 2008 at 9:22 PM, Norman Franke  
[EMAIL PROTECTED]

wrote:


I sort of have it working by doing an onclick and relying  
on the

entire
form to update, which resets my div.

But that brings up another point. I want to AJAX fetch a list  
of

elements
with a checkbox. Is there a better way to do this than by  
setting the

entire
form as one of the updateComponents? It pretty much forces an  
update

of
the
entire page. If I don't, I can't get the values of the  
checkbox since
tapestry serializes the state of the @For and checkboxes in  
fields.


What's the best way to handle this?

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Oct 24, 2008, at 12:10 PM, Norman Franke wrote:

I've searched the documentation, and I can't find how one  
implements

a
loading... indicator when an AJAX request is sent off. My  
app will

be
doing a series of database queries which can take 10 seconds  
or so,

and
it
really needs something to tell the user they need to wait a  
bit.

Showing/Hiding a div would be great.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com




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






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






--
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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






--
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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






--
Andreas Andreou - [EMAIL PROTECTED] - 

AppModule Setting the Locale

2008-10-24 Thread superoverdrive
How can the Locale be overwritten/set inside of AppModule?

Is there a list of services that can be overwritten/set/accessed inside of 
AppModule ?

Thanks!

Tobias

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



Re: AppModule Setting the Locale

2008-10-24 Thread superoverdrive
This code does not workunfortunately:

 public RequestFilter buildTimingFilter(final Logger log)
{
return new RequestFilter()
{
  
@Inject 
private PersistentLocale persistentLocale;

public boolean service(Request request, Response response, 
RequestHandler handler)
throws IOException
{



if (request.getServerName().equals(www.domain.co.uk)){
persistentLocale.set(Locale.ENGLISH);
}
else {
persistentLocale.set(Locale.GERMAN);

}


 Original-Nachricht 
 Datum: Fri, 24 Oct 2008 23:47:47 +0200
 Von: [EMAIL PROTECTED]
 An: users@tapestry.apache.org
 Betreff: AppModule  Setting the Locale

 How can the Locale be overwritten/set inside of AppModule?
 
 Is there a list of services that can be overwritten/set/accessed inside of
 AppModule ?
 
 Thanks!
 
 Tobias
 
 -
 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]



T5: tapestry actionlink ie6 problem

2008-10-24 Thread Argo Vilberg
hi,


I use tapestry actionlink with GRID.
Actionlink works fine with firefox, but do not with ie6.

What a bug?



t:if test=fileList
 t:form t:id=signform
  t:grid
   source=fileList rowsPerPage=7 pagerPosition=bottom

  include=choosen,failinimi,suurus,isikunimi,loodud,valitud,valitud2
   t:rowClass=prop:evenodd.next
   row=fail

   t:parameter name=choosenCell
t:parameter name=choosenCell
 t:checkbox value=fail.choosen/
/t:parameter
   /t:parameter
   t:parameter name=valitudCell
 a t:type=actionlink t:id=download t:context=${fail.id}
href=#button type=submit
class=submitbuttontableDownload/button/a

   /t:parameter
   t:parameter name=valitud2Cell
 a t:type=actionlink t:id=sign t:context=${fail.id}
href=#button type=submit class=submitbuttontableAnna
allkiri/button/a
   /t:parameter
  /t:grid
  t:submit class=submitbutton t:id=signfiles t:value=Anna
allkiri valitud failidele /
 /t:form
 t:parameter name=else
  br/br
  Ei leitud Ć¼htegi faili!
 /t:parameter
/t:if





 Object onActionFromDownload(String name) {
  System.out.println(onFormSubmit.donwload=true);
  Long failId = new Long(name);
  System.out.println(onSubmit.failId=+failId);
  if (failId!=null) {
   System.out.println(failId=+failId);
  DbFile dbFile =
ImageDB.INSTANCE.loadImage(failId.longValue(),getUser().getRole().getRoleId(),getUser().getIdcode());
   InputStream in = new ByteArrayInputStream(dbFile.getFileData());
  return new
AttachmentStreamResponse(in,dbFile.getFileName());
 } else {
  System.out.println(onFormSubmit return null);
  return null;
 }
 }


How to solve this problem?


Argo


[T5] Grid default sort column

2008-10-24 Thread Christoph Jäger

Hi,

I have got a problem with setting the default sort column for a grid  
after updating from 5.0.14 to 5.0.15.


This code, inspired by some comments on this list, works perfectly  
nice on 5.0.14, but breaks on 5.0.15:


@SetupRender
public void setDefaultSortOrder()
{
  if (grid.getSortModel().getSortConstraints().isEmpty())
  {
grid.getSortModel().updateSort(code);
  }
}

It works on 5.0.15 the first time a page is displayed. For the second  
time (just clicking the same link in my menu), I get a  
NullPointerException at org.apache.tapestry5.corelib.components.Grid 
$DefaultGridSortModel.getSortConstraints(Grid.java:372). Somehow the  
dataModel seems to be null in this second request.


Is there a better / preferred way to set the default sort order?  
Should I file a JIRA?


Thanks,

Christoph


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



Re: T5: tapestry actionlink ie6 problem

2008-10-24 Thread Argo Vilberg
If i use only textlink in actionLink property instead of button, all works
fine also in IE6.

Good luck M$ and ie6!


Argo

2008/10/24 Argo Vilberg [EMAIL PROTECTED]

 hi,


 I use tapestry actionlink with GRID.
 Actionlink works fine with firefox, but do not with ie6.

 What a bug?



 t:if test=fileList
  t:form t:id=signform
   t:grid
source=fileList rowsPerPage=7 pagerPosition=bottom

   include=choosen,failinimi,suurus,isikunimi,loodud,valitud,valitud2
t:rowClass=prop:evenodd.next
row=fail

t:parameter name=choosenCell
 t:parameter name=choosenCell
  t:checkbox value=fail.choosen/
 /t:parameter
/t:parameter
t:parameter name=valitudCell
  a t:type=actionlink t:id=download t:context=${fail.id}
 href=#button type=submit
 class=submitbuttontableDownload/button/a

/t:parameter
t:parameter name=valitud2Cell
  a t:type=actionlink t:id=sign t:context=${fail.id}
 href=#button type=submit class=submitbuttontableAnna
 allkiri/button/a
/t:parameter
   /t:grid
   t:submit class=submitbutton t:id=signfiles t:value=Anna
 allkiri valitud failidele /
  /t:form
  t:parameter name=else
   br/br
   Ei leitud Ć¼htegi faili!
  /t:parameter
 /t:if





  Object onActionFromDownload(String name) {
   System.out.println(onFormSubmit.donwload=true);
   Long failId = new Long(name);
   System.out.println(onSubmit.failId=+failId);
   if (failId!=null) {
System.out.println(failId=+failId);
   DbFile dbFile =
 ImageDB.INSTANCE.loadImage(failId.longValue(),getUser().getRole().getRoleId(),getUser().getIdcode());
InputStream in = new ByteArrayInputStream(dbFile.getFileData());
   return new
 AttachmentStreamResponse(in,dbFile.getFileName());
  } else {
   System.out.println(onFormSubmit return null);
   return null;
  }
  }


 How to solve this problem?


 Argo




[T5] Grid and checkbox behaviour

2008-10-24 Thread Argo Vilberg
hi,

If i want user grid with checkbox , then navigation between grid tabs lost
previously checked checkboxs.

If choose another tab to show in grid, then previous checked checkbox are
lost.

How can i use grid and checked rows over all grid tabs`?


Argo


T5: Extra Component Information

2008-10-24 Thread James Sherwood
Hello,

 

I have seen components such as the Fckeditor being used but cannot figure
out how to use them.

 

The component reference docs at
http://tapestry.apache.org/tapestry5/tapestry-core/ref/ does not list them.

 

This site: http://87.193.218.134:8080/t5c-demo/editorpage lists many nice
components that do not appear to be in the main component reference site but
I cannot figure out how to make them available.

 

I believe it has something to do with when I create the project with maven
or my pom and blocks of code such as this:

 

dependency

  groupIdorg.apache.tapestry/groupId

  artifactIdt5c-contrib/artifactId

  version0.5.13/version

  /dependency

 

I just cannot seem to put it all together.

 

Can someone help me bridge the gap I am missing?

 

If it helps I use the Eclipse/Tomcat Combination with maven creation.

 

Thanks,

 

--James



Re: What is the difference between a Translator and FieldTranslator

2008-10-24 Thread Christoph Jäger

Hi,

I just stumbled upon the same problem when updating from 5.0.14 to  
5.0.15. There must be a way that Tapestry automatically creates the  
FieldTranslator if a Translator is specified for a field. All the  
information should be there. As I see it, apart from the Translator,  
the FieldTranslator needs the Field, a MessageFormatter and a  
FormSupport instance to do its work. I can't believe we have to  
manually pick up all of these objects and create a FieldTranslator  
(a separate one for each field in a form). Looking at how Tapestry  
automatically creates / converts / coerces lots of other useful stuff,  
I am almost sure there are some magic configuration entries to enable  
automatic creation of FieldTranslators (given a Translator), we just  
need to find them.


Best Regards,

Christoph


On Oct 8, 2008, at 19:25 , Joachim Van der Auwera wrote:


Howard Lewis Ship wrote:

A FieldTranslator is a wrapper around a Translator that is configured
for a specific Field component.



Thanks.
Should these not be created automatically?

This has caused me major headaches for migrating to 5.0.15, I had to  
change all my translators, assure they also implement  
FieldTranslator and replace all translate=translate:string to a  
(custom) StringTranslator which implements both Translator and  
FieldTranslator.


Kind regards,
Joachim
On Wed, Oct 8, 2008 at 5:40 AM, Joachim Van der Auwera [EMAIL PROTECTED] 
 wrote:



And when should which be used?

I am getting coercing errors trying to convert between the two,  
but it is
unclear to me why there is a difference (the interfaces look very  
similar).


Joachim

--
Joachim Van der Auwera
PROGS bvba, progs.be


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











--
Joachim Van der Auwera
PROGS bvba, progs.be


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



Christoph Jäger
[EMAIL PROTECTED]





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