Re: T5 Component Info Passing

2007-08-01 Thread Francois Armand

Todd Orr wrote:

[...] This is where I
found Environment to be deficient. It seems that no matter what
combination of phases of rendering I use I cannot get the data back to
the tabnavigation before it is finished rendering and therefore cannot
alter it's display.
Not sure that it matches what you want to do, but you could make your 
tabpanel register themselves to an environment value init ialized in 
tabgoup and read this env value in tabnavigation. Something like that :

(Sorry for the long post, I put all the code)

==

The enclosing element, for my test its a page (your tabgroup)
8--
TestRegister.html
8-
?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml; 
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;

   head
   meta http-equiv=Content-Type content=text/html; 
charset=UTF-8 /

   titleRegister and print ids/title
   /head
   body

   t:printregistered/
   t:registerid t:id=foo/
   t:registerid t:id=bar/
   t:registerid/
   t:printregistered/
  
   /body

/html
8--
If you call contexturl/testregister, you see :
8--

No id registered in env

I'm foo and should be registered.

I'm bar and should be registered.

I'm registerid and should be registered.

Found these ids in env:

   * Found: foo
   * Found: bar
   * Found: registerid

8--

==
==
Now, the details :

TestRegister.java
8-
public class TestRegister {
   @Inject
   private Environment environment;
   private Register register;
   private String id;
  
   public String getId() {

   return this.id;
   }

   public void setId(String id) {
   this.id = id;
   }

   @SetupRender
   void initEnv() {
   register = new Register();
   environment.push(Register.class, register);
   }
  
@CleanupRender

   void cleanup() {
   environment.pop(Register.class);
   }
  
   public ListString getIds() {

   return this.register.getRegistered();
   }
  
}

8-

The register object is really just here as a data container:
8--
Register.jeva
8
public class Register {
   private ListString registered;
  
   public Register() {

   registered = new ArrayListString();
   }

   public void register(String id) {

   this.registered.add(id);
   }
  
   public ListString getRegistered() {

   return this.registered;
   }
}
8--


Component that need to register themselves (your tabpanels) :
8--
RegisterId.java :
8
public class RegisterId {
   @Environmental
   private Register register;

   @Inject
   private ComponentResources resources;
  
   @SetupRender

   void setup() {
   if(register != null) {
   this.register.register(resources.getId());
   }
   }
  
   public String getId() {

   return resources.getId();
   }
}
8
RegisterId.html
8-
p xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
   t:if test=id
   I'm ${id} and should be registered.
   t:parameter name=else
   I have no id and sould not be registered.
   /t:parameter
   /t:if
/p
8--

==

The component that need to read registered ids (your tabnavigation)
8--
PrintRegistered.java
8-
public class PrintRegistered {

   @Environmental
   private Register register;
  
   private String id;
  
   public ListString getIds() {

   return null == register ? null : register.getRegistered();
   }

   public String getId() {
   return this.id;
   }

   public void setId(String id) {
   this.id = id;
   }
}
8-
PrintRegistered.html
8-
div  xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
   t:if test=ids
   pFound these ids in env:/p
   ul
   t:loop source=ids value=id
   

[T5] The pattle doesn't work fine with IE!

2007-08-01 Thread Donyee
I use the pattle component in my pages, it works fine in the firefox,
but in the IE the
(select)buttons were disabled!
Does anyone meet this problem?


徐 依伟


RE: [T5] Grid totals

2007-08-01 Thread Joost Schouten
Daniel,

In our current solution we disregarded the paginator and always show the
total of all lines as showing page totals doesn't make sense in our
situation. But implementing this should not be a big problem as you can just
obtain the current page, the rows per page and thus generate your totals
from it.

Though my solution works, it feels like a hack and I will search for a more
elegant way after our initial launch ;-)

On my page/component implementing the Grid, I instantiate a new RowObject in
a @SetupRender method, loop though all (or just current page on paginator)
rows and sum the totals. Then in a @AfterRenderTemplate method I take the
DOM and add a TFOOT containing the totals to the TABEL element.

Below my (simplified) @AfterRenderTemplate method

There will most likely be very nice and elegant ways to inject into or
extend from the Grid component so everything can be done at the component
level and not the DOM. But I just needed something to work right now ;-)

Hope it helps,

Joost

---totals dom injection method--

@AfterRenderTemplate
void after(MarkupWriter writer){
//first find the table Element. T5 writes it in a div. Note that 
//multiple tables in one component/page might cause issues
Element thisEl = writer.getElement();
Element table = null;
for(Node child : thisEl.getChildren()){
if(child instanceof Element 
((Element)child).getName().equalsIgnoreCase(div)){
for(Node child1 : ((Element)child).getChildren()){
if(child1 instanceof Element 
((Element)child1).getName().equalsIgnoreCase(table)){
table = ((Element)child1);
break;
}
}
}
if(table!=null){
break;
}
}
if(table!=null){//is null when there is no data to display

Element footerRow = table.element(tfoot).element(tr);
int span = 1;
String cellContent = null;
String className = cssStyleClass;
if(this.rows != null){
for(Iterator itr =
yourBeanModel.getPropertyNames().iterator();itr.hasNext();){
String column = (String)itr.next();
if(column.equals(toTotalColumn1)){
//always first close the possibly
open cell
writeFooterCell(footerRow,
cellContent, span, className);
span=1;
className = totalsmessage;
cellContent =
yourTotalsRow.getTotal1();
}else if(column.equals(toTotalColumn2)){
writeFooterCell(footerRow,
cellContent, span, className);
span=1;
className = totalsvalue;
cellContent =
yourTotalsRow.getTotal2();
}else{//all other columns just add a span
and don't 
//have a totals column
span++;
}
}
//write and close the last footer cell
writeFooterCell(footerRow, cellContent, span,
className);
}
}//close block when table element is found
}

private void writeFooterCell(Element footerRow, String content, int span,
String className){
if(content!=null){//if null, no open cell needs to be written as it
is 
//the first call toopen a cell
Element footerCell = footerRow.element(td, colspan,
 Integer.toString(span), class,
className);
footerCell.text(content);
}
}

-Original Message-
From: Daniel Jue [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 31, 2007 4:53 PM
To: Tapestry users
Subject: Re: [T5] Grid totals

Joost, How did you add a row for the totals while keeping that row
from being sortable?
I don't want to add it outside of the grid's table structure, because
I want the columns to align.  I did this in T4 using code like this:

span jwcid=tableView
table class=reportdata

tr
span jwcid=@Contrib:TableColumns class=literal:title /
/tr
tr class=DataTotalsRow
span jwcid=[EMAIL PROTECTED] source = ognl:AggregateList
value = ognl:aggindex
td align=right jwcid=@Any title=ognl:aggindex.getToolTip() 
span  jwcid=@Insert
value=ognl:aggindex.getValue()value/span
/td
/span
/tr
tr 

Re: [T5] The pattle doesn't work fine with IE!

2007-08-01 Thread 小司
Yes, My pallete does not work ,Button is disabled.only submit button works well

2007/8/1, Donyee [EMAIL PROTECTED]:
 I use the pattle component in my pages, it works fine in the firefox,
 but in the IE the
 (select)buttons were disabled!
 Does anyone meet this problem?


 徐 依伟



-- 
得与失都是生活


a bit of history

2007-08-01 Thread ra

Where versions 3 and 4 were released ?
I found news from april 2004 but I belive I was reading about tapestry
earlier
-- 
View this message in context: 
http://www.nabble.com/a-bit-of-history-tf4198864.html#a11942088
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] preview mode

2007-08-01 Thread ra

What does it mean preview mode for pages. That I can open the page in the
browser couse it's xhtml complainant ?
It's one of the goal
-- 
View this message in context: 
http://www.nabble.com/-T5--preview-mode-tf4198934.html#a11942232
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: a bit of history

2007-08-01 Thread Nick Westgate

Not quite sure what you're asking, but if it's history you want ...

You might have first heard about it at OnJava. Earliest article is 2001:
http://www.onjava.com/pub/a/onjava/2001/11/21/tapestry.html

Tapestry 4  3 were released via Apache.

Tapestry 2 was released via SourceForge:
http://sourceforge.net/projects/tapestry/

Tapestry 1 was developed (I presume) in house by Howard at Primix.

Cheers,
Nick.


ra wrote:

Where versions 3 and 4 were released ?
I found news from april 2004 but I belive I was reading about tapestry
earlier


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



Re: T5 layout

2007-08-01 Thread Chris Lewis

Thanks Howard - its quite a nice feature. Godspeed with the rest of Tap5.

Chris

Howard Lewis Ship wrote:

It is not yet possible; it is a feature to be added. Not sure of the JIRA
number.

On 7/31/07, Chris Lewis [EMAIL PROTECTED] wrote:
  

Hello all,

I've seen several threads about T5 and layout components, but still none
that show how to duplicate the functionality of $content$ in Tap 4. My
layout works as long as the page templates include only their body (ie,
no html, head, body). I liked $content$ in 4 because I could have
normal-ish page templates and then tell Tap to pay attention to only
what fell within $content$. So now my layout is:

layouts/General.html:
html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
head
titletest layout/title
/head
body
t:body/
/body
/html

And a page:

Login.html:
div t:type=layouts/General xmlns:t=
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
form t:type=BeanEditForm object=authRequest
submitlabel=message:login.submit.label
login form here
/form
/div

I don't like that in Login.html I can't have html (etc) without having
those elements duplicated in the resulting page. Is there a way around
this?

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






  




Re: a bit of history

2007-08-01 Thread Daniel Jue
aside I remember some tidbit saying Tapestry development started
before Struts, not that it matters much beyond trivia. /aside

On 8/1/07, Nick Westgate [EMAIL PROTECTED] wrote:
 Not quite sure what you're asking, but if it's history you want ...

 You might have first heard about it at OnJava. Earliest article is 2001:
 http://www.onjava.com/pub/a/onjava/2001/11/21/tapestry.html

 Tapestry 4  3 were released via Apache.

 Tapestry 2 was released via SourceForge:
 http://sourceforge.net/projects/tapestry/

 Tapestry 1 was developed (I presume) in house by Howard at Primix.

 Cheers,
 Nick.


 ra wrote:
  Where versions 3 and 4 were released ?
  I found news from april 2004 but I belive I was reading about tapestry
  earlier

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



Conditional async?

2007-08-01 Thread Malin Ljungh
I've created a login component to add to my pages.

If validation fails I'd like to use async=true to display validation
messages - works fine!

But - if login succeeds, I'd like to refresh the whole page... how do I
perform this? In this case I'd like to have async=false or possibly use
some other updateComponents.

Thought of a round-trip page or a forced reload from the client using script
or something...

Any ideas?

Malin


[T5] Problem with special characters and forms

2007-08-01 Thread Marcelo lotif
Hi all,
when i submit a form with a special character i get a crazy character on the
java class (like Ã(c) for é and ç for ç). This is a problem or there
is something to solve this?

Thanks in advance!

-- 
Atenciosamente,
Marcelo Lotif


Re: Conditional async?

2007-08-01 Thread Andrea Chiumenti
if login succeeds just write a conditional js that refresh the page


On 8/1/07, Malin Ljungh [EMAIL PROTECTED] wrote:
 I've created a login component to add to my pages.

 If validation fails I'd like to use async=true to display validation
 messages - works fine!

 But - if login succeeds, I'd like to refresh the whole page... how do I
 perform this? In this case I'd like to have async=false or possibly use
 some other updateComponents.

 Thought of a round-trip page or a forced reload from the client using script
 or something...

 Any ideas?

 Malin


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



T5 Strategy for redirecting due to any error

2007-08-01 Thread Daniel Jue
Hi, this is more a question of technique than an actual problem.

Some use cases:
Lets say I have code that throws a NPE.  I'd get a Tapestry error page
that spills it's guts.  It must use some technique for redirecting to
another page at any point (might be too deep in the framework to
harness that power)

Lets say I have another page that requires a user session (ASO) -- the
OnActivate method would do the checking and redirect to a page from
there.  Anyone can do this from OnActivate--so long as you know
everything in the OnActivate() method, so it's not really interesting.

Now lets say I have a page or component that checks a value that we
could label as invalid, or we have a select component that can't be
filled because a DB is down.

Is there a way to redirect to another page at any point in the render
process of a component or page?

I think this would kind of fall along the lines of people who
questioned how to replace the Tapestry error page with something more
appropriate for the end user.  Except that I'd want to be able to
explicitly call/forward to an arbitrary page when my code comes across
something abnormal.

Does anyone have ideas or strategies about this?

Daniel Jue

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



Re: T5 Strategy for redirecting due to any error

2007-08-01 Thread Nick Westgate (Work)

Yes. Resurrect the idea of throwing a RedirectException. (Or a Link, page
class ... ?)

Cheers,
Nick.



Daniel Jue wrote:
 
 Is there a way to redirect to another page at any point in the render
 process of a component or page?
 

-- 
View this message in context: 
http://www.nabble.com/T5-Strategy-for-redirecting-due-to-any-error-tf4200570.html#a11948151
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] ValueEncoder = TypeCoercer?

2007-08-01 Thread Ognen Ivanovski

Hello again,

I'm trying to write a CheckboxGroup / Checkbox pair of components for  
my project based on the RadioGroup / Radio components in the corelib.


While doing so I stumbled upon the ValueEncoder / ValueEncoderSource  
and I keep wondering why are they introduced and why isn't the type  
coercion used instead (objectType - string, string - objectType)?


Also in this direction, it would be good if one can contribute more  
dynamic type coercion configuration. E.g. if one uses Hibernate, one  
could contribute just one coercion handler that can turn any @Entity  
into a string and back (using the entity's declared @Id properties).


This would greatly simplify Radio's, Checkboxes, Selects and the like.

Cheers,
Ognen

--
Ognen Ivanovski | [EMAIL PROTECTED]
phone +389 -2- 30 64 532 | fax +389 -2- 30 79 495
Netcetera | 1000 Skopje | Macedonia | http://netcetera.com.mk




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



Tap5 - integrate several templates

2007-08-01 Thread Anujith Amaratunga
Hi,

 

How do I integrate several templates into one page? i.e I have a header and
a footer which needs to go into all the pages, but I don't want to duplicate
code in all pages. I've looked at the body element and embedded components
but not sure if that's the way to go. Any help is much appreciated. I am a
newbie to tapestry 5.

 

Thx

 

Anu



T5 : bug : no way to throw runtime exceptions within service interfaces

2007-08-01 Thread Evan Rawson - Work
i have some utilites running in my application via a custom Util Interface 
certain classes call. I need some way to redirect the user to a custom error 
page which a pregenerate error id. Even a way to throw a runtime exception (T3: 
ApplicationRuntimeException / RedirectException).

This would be a snap if i could inject the error page into my util interface 
methods, but i get a type coercion error. I read though the APi and didn't see 
anything that would allow me to throw sometime of exception. 

PS: i wanted to use this error throwing for when i hash the user password, and 
need to stop the application if there was a problem.

my other question was, how (or better yet what service) do i use to logout a 
user (inessence reset the entire ASO, and direct user to the root of the 
application. Is this something in t5 you have to manually create a ASO method 
to handle?

~evan

Re: Tap5 - integrate several templates

2007-08-01 Thread Evan Rawson - Work

all pages and components are technically consider the same thing within t5.

all components/pages wrap there content (what is between the tags 
t:component/pagecontentt:component/page)


within the wrapping component template you specify a t:body/ component. 
This directs the template as to where to insert the body content.


ex:
border component
html
head.../head
body
   t:header/
   t:body/
   t:footer/
/body
/html

any page which you wanna use the border on
t:border
content
/t:border

note how the border component calls a header and footer component to insert 
at the top and bottom of the body.


~evan

- Original Message - 
From: Anujith Amaratunga [EMAIL PROTECTED]

To: users@tapestry.apache.org
Sent: Wednesday, August 01, 2007 12:18 PM
Subject: Tap5 - integrate several templates



Hi,



How do I integrate several templates into one page? i.e I have a header 
and
a footer which needs to go into all the pages, but I don't want to 
duplicate
code in all pages. I've looked at the body element and embedded 
components

but not sure if that's the way to go. Any help is much appreciated. I am a
newbie to tapestry 5.



Thx



Anu





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



Re: [T5] Problem with special characters and forms

2007-08-01 Thread Marcelo lotif
you misunderstood me... the Ulrich tip solve my problem, what i tried to say
was that i did not search so well on the mailing list before i ask.

sorry again...

2007/8/1, Nick Westgate (Work) [EMAIL PROTECTED]:


 Did you read the page Ulrich linked to?
 The Utf8Filter changes are still needed to decode form submissions.

 Cheers,
 Nick.



 Marcelo lotif wrote:
 
  sorry, but i search and did not seen nothing about forms and the UTF-8
  encoding...
  thank you for the response :)
 
  2007/8/1, Ulrich Stärk [EMAIL PROTECTED]:
 
  This has been discussed a dozen times before. Please search the list
  archives for UTF-8 related topics.
 
  Have a look at http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding.
 
  Uli
 
  Marcelo lotif schrieb:
   Hi all,
   when i submit a form with a special character i get a crazy character
  on
  the
   java class (like Ã(c) for é and ç for ç). This is a problem
 or
  there
   is something to solve this?
  
   Thanks in advance!
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  Atenciosamente,
  Marcelo Lotif
 
 

 --
 View this message in context:
 http://www.nabble.com/-T5--Problem-with-special-characters-and-forms-tf4200062.html#a11946992
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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




-- 
Atenciosamente,
Marcelo Lotif


[t5] how to read nested properties

2007-08-01 Thread ra

input type=text t:type=TextField value=customer.firstName/

It seems it's not possible to get customer.firstName. Of course there's
defined getter getCustomer in the page class. I read that ognl is not
supported. Is it final decision ?



-- 
View this message in context: 
http://www.nabble.com/-t5--how-to-read-nested-properties-tf4201615.html#a11950505
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] Any component Bis

2007-08-01 Thread David Avenante
Hi,

The Any component is gone and now

div t:type=any class=prop:someProperty.../div

is now just:

div class=${someProperty}.../div

but is it possible since it's gone to add a mixin to and element like

div t:mixins=myLayoutMy layout/div

When I try this case tapestry throw me this error :

You may not specify mixins for element div because it does not
represent a component (which requires either an id attribute or a type
attribute)

Ok so a :

div t:id=myId t:mixins=myLayoutMy layout/div

Embedded component 'subLayout' has no type. You should specify a type
in the component template, or define the component inside class 

Any solution ?

Thanks.


Re: [T5] Any component Bis

2007-08-01 Thread Evan Rawson - Work
after some more research it seems that mixins have to be applied to a 
specific component type of specific instance of a component type. i dont 
think you can mixin for generics. i think a component minus a template is 
more what your looking for.


~evan
- Original Message - 
From: David Avenante [EMAIL PROTECTED]

To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, August 01, 2007 3:31 PM
Subject: [T5] Any component Bis



Hi,

The Any component is gone and now

div t:type=any class=prop:someProperty.../div

is now just:

div class=${someProperty}.../div

but is it possible since it's gone to add a mixin to and element like

div t:mixins=myLayoutMy layout/div

When I try this case tapestry throw me this error :

You may not specify mixins for element div because it does not
represent a component (which requires either an id attribute or a type
attribute)

Ok so a :

div t:id=myId t:mixins=myLayoutMy layout/div

Embedded component 'subLayout' has no type. You should specify a type
in the component template, or define the component inside class 

Any solution ?

Thanks.




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



Re: Conditional async?

2007-08-01 Thread Malin Ljungh
Thanks Andrea - it works! ... well, almost anyway :)

If the page is reached through a post I will get the POSTDATA confirm
dialog... :'(

Malin


On 8/1/07, Andrea Chiumenti [EMAIL PROTECTED] wrote:

 if login succeeds just write a conditional js that refresh the page


 On 8/1/07, Malin Ljungh [EMAIL PROTECTED] wrote:
  I've created a login component to add to my pages.
 
  If validation fails I'd like to use async=true to display validation
  messages - works fine!
 
  But - if login succeeds, I'd like to refresh the whole page... how do I
  perform this? In this case I'd like to have async=false or possibly
 use
  some other updateComponents.
 
  Thought of a round-trip page or a forced reload from the client using
 script
  or something...
 
  Any ideas?
 
  Malin
 

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




Re: [T5] Any component Bis

2007-08-01 Thread David Avenante
Yes, after investigation you're right.
So I think I need to re-implement an Any component ;)

Thank you for your input.


T4.0.2: Is compatible Tacos(Dojo) with any Browser??

2007-08-01 Thread César Augusto Mateus
Hi, I need a guide about of compatibility of Tacos (or Dojo) with browsers.
I made a page that works in IE6 and IE7, but it does not in Firefox.

In particular, the page is a component tacos:Tree whose links throws a
tacos:Dialog  where things are edited and saved, finally go back to
refreshed tree.
In IE the tacos:Dialog works and is a good render, but in FireFox it does
not work and watching the resulting code of the generated render its bad.
In Firefox the attributes delayedLoad and loadElement of the tree work well,
but in IE no.

Tacos (or Dojo) has a configuration for each browser?

Perhaps this problem is resolved in version 4.1 of Tapestry, but i am not
safe of change to this version because version 4.1 is not stable.

For Any idea or aid many thanks.


Re: [T5] Any component Bis

2007-08-01 Thread Nick Westgate

May as well use the original. I've put it here:
http://wiki.apache.org/tapestry/Tapestry5AnyComponent

Please update or add examples of its use.
I think Any was prematurely deprecated.

Cheers,
Nick.


David Avenante wrote:

Yes, after investigation you're right.
So I think I need to re-implement an Any component ;)

Thank you for your input.



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



Re: T5 Strategy for redirecting due to any error

2007-08-01 Thread Daniel Jue
Ah!

CleanupRender is a place I had not thought of!   As long as the
errors wouldn't cause actual runtime exceptions (which I may not
catch because catching RTE is not enforced), I could just set this
flag and I can redirect/display something meaningful.

A couple questions:  Your generic page -- I just got back into
extending pages (the T4 way).  I am putting my abstract orbase pages
in the /base directory.  This seems like the proper place to put them,
right?

2nd:  With an ApplicationScoped bean, is that per session or one for
the whole application?  It seems like having one for the whole app
would cause issues with one person receiving another person's error
flag.  I guess I am confused a little--when say ASO, I think of it as
existing for a current user's session only.  (Another person using the
app would have no direct knowledge of the ASO)

On 8/1/07, Joost Schouten [EMAIL PROTECTED] wrote:
 Daniel,

 I just setup a system where I have an ApplicationScoped bean hold a String
 authenticationDeniedMessage (could obviously be any error message). On my
 GenericPage which all my pages extend, I check on the @CleanupRender if this
 String != null and if so, redirect to my AuthetnicationDenied page. This
 page renders the message in clears it on @CleanupRender so any subsequent
 request will work again. This setup allows me to deny access to a page at
 any point of my page lifecycle without Declerative or Runtime Exceptions.

 Cheers,
 Joost

 -Original Message-
 From: Daniel Jue [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 02, 2007 2:56 AM
 To: Tapestry users
 Subject: T5 Strategy for redirecting due to any error

 Hi, this is more a question of technique than an actual problem.

 Some use cases:
 Lets say I have code that throws a NPE.  I'd get a Tapestry error page
 that spills it's guts.  It must use some technique for redirecting to
 another page at any point (might be too deep in the framework to
 harness that power)

 Lets say I have another page that requires a user session (ASO) -- the
 OnActivate method would do the checking and redirect to a page from
 there.  Anyone can do this from OnActivate--so long as you know
 everything in the OnActivate() method, so it's not really interesting.

 Now lets say I have a page or component that checks a value that we
 could label as invalid, or we have a select component that can't be
 filled because a DB is down.

 Is there a way to redirect to another page at any point in the render
 process of a component or page?

 I think this would kind of fall along the lines of people who
 questioned how to replace the Tapestry error page with something more
 appropriate for the end user.  Except that I'd want to be able to
 explicitly call/forward to an arbitrary page when my code comes across
 something abnormal.

 Does anyone have ideas or strategies about this?

 Daniel Jue

 -
 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: T5 Strategy for redirecting due to any error

2007-08-01 Thread Joost Schouten
A couple questions:  Your generic page -- I just got back into
extending pages (the T4 way).  I am putting my abstract orbase pages
in the /base directory.  This seems like the proper place to put them,
right?

That's what I do as well

2nd:  With an ApplicationScoped bean, is that per session or one for
the whole application?  It seems like having one for the whole app
would cause issues with one person receiving another person's error
flag.  I guess I am confused a little--when say ASO, I think of it as
existing for a current user's session only.  (Another person using the
app would have no direct knowledge of the ASO)

I have often wondered why the annotation is @ApplicationState cuz it seems
to me it is just a session scoped bean. This is how we use it without any
problems. So your assumption seems correct to me. ASO is session scoped. If
I'm missing something here I would love to be corrected. 

Cheers,
Joost
-Original Message-
From: Daniel Jue [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 02, 2007 5:29 PM
To: Tapestry users
Subject: Re: T5 Strategy for redirecting due to any error

Ah!

CleanupRender is a place I had not thought of!   As long as the
errors wouldn't cause actual runtime exceptions (which I may not
catch because catching RTE is not enforced), I could just set this
flag and I can redirect/display something meaningful.

A couple questions:  Your generic page -- I just got back into
extending pages (the T4 way).  I am putting my abstract orbase pages
in the /base directory.  This seems like the proper place to put them,
right?

2nd:  With an ApplicationScoped bean, is that per session or one for
the whole application?  It seems like having one for the whole app
would cause issues with one person receiving another person's error
flag.  I guess I am confused a little--when say ASO, I think of it as
existing for a current user's session only.  (Another person using the
app would have no direct knowledge of the ASO)

On 8/1/07, Joost Schouten [EMAIL PROTECTED] wrote:
 Daniel,

 I just setup a system where I have an ApplicationScoped bean hold a String
 authenticationDeniedMessage (could obviously be any error message). On my
 GenericPage which all my pages extend, I check on the @CleanupRender if
this
 String != null and if so, redirect to my AuthetnicationDenied page. This
 page renders the message in clears it on @CleanupRender so any subsequent
 request will work again. This setup allows me to deny access to a page at
 any point of my page lifecycle without Declerative or Runtime Exceptions.

 Cheers,
 Joost

 -Original Message-
 From: Daniel Jue [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 02, 2007 2:56 AM
 To: Tapestry users
 Subject: T5 Strategy for redirecting due to any error

 Hi, this is more a question of technique than an actual problem.

 Some use cases:
 Lets say I have code that throws a NPE.  I'd get a Tapestry error page
 that spills it's guts.  It must use some technique for redirecting to
 another page at any point (might be too deep in the framework to
 harness that power)

 Lets say I have another page that requires a user session (ASO) -- the
 OnActivate method would do the checking and redirect to a page from
 there.  Anyone can do this from OnActivate--so long as you know
 everything in the OnActivate() method, so it's not really interesting.

 Now lets say I have a page or component that checks a value that we
 could label as invalid, or we have a select component that can't be
 filled because a DB is down.

 Is there a way to redirect to another page at any point in the render
 process of a component or page?

 I think this would kind of fall along the lines of people who
 questioned how to replace the Tapestry error page with something more
 appropriate for the end user.  Except that I'd want to be able to
 explicitly call/forward to an arbitrary page when my code comes across
 something abnormal.

 Does anyone have ideas or strategies about this?

 Daniel Jue

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




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