pageBeginRender and submit

2007-04-03 Thread paolo

Hi, I'm quiet new of tapestry.
I have a problem in calling a page.
My form in MyPage.html is

form jwcid=[EMAIL PROTECTED] listener=ognl:listeners.submitMainForm
delegate=ognl:beans.delegate input type=submit jwcid=[EMAIL 
PROTECTED]
value=Salva selected=ognl:mainSubmitType
 tag=saveDay /
/form

In MyPage.java I have a method submitMainForm(IRequestCycle cycle) and the
pageBeginRender method.
When I press submit button, I see that is called:
pageBeginRender method, 
submitMainForm 
pageBeginRender again.
When is there a listener on form Is pageBeginRender method called before
listener method?
Which is the problem?

Thanks a lot in advance



-- 
View this message in context: 
http://www.nabble.com/pageBeginRender-and-submit-tf3510853.html#a9806821
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: pageBeginRender and submit

2007-04-03 Thread Martino Piccinato

You can look here:

http://tapestry.apache.org/tapestry4.1/faq.html#submit-lifecycle

on form submit pageBeginRender is called before the form submit listener
discarding output in order to set page and page components in the proper
status before your listener is called.
As your next question might be what if I don't want to execute some code in
my pageBeginRenderr during first call?


The answer is check for cycle.isRewinding()

use

if(cycle.isRewinding()) { // This is the first rewind no output
pageBeginRenderer call code
/// Code
} else { // This is the second real output pageBeginRenderer call code
// Code
}


:-)

On 4/3/07, paolo [EMAIL PROTECTED] wrote:



Hi, I'm quiet new of tapestry.
I have a problem in calling a page.
My form in MyPage.html is

form jwcid=[EMAIL PROTECTED] listener=ognl:listeners.submitMainForm
delegate=ognl:beans.delegate input type=submit jwcid=
[EMAIL PROTECTED]
value=Salva selected=ognl:mainSubmitType
 tag=saveDay /
/form

In MyPage.java I have a method submitMainForm(IRequestCycle cycle) and the
pageBeginRender method.
When I press submit button, I see that is called:
pageBeginRender method,
submitMainForm
pageBeginRender again.
When is there a listener on form Is pageBeginRender method called before
listener method?
Which is the problem?

Thanks a lot in advance



--
View this message in context:
http://www.nabble.com/pageBeginRender-and-submit-tf3510853.html#a9806821
Sent from the Tapestry - User mailing list archive at Nabble.com.


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




Create Shoutcast service in Tapestry.

2007-04-03 Thread Hans Drexler
We try to create a Tapestry-service that generates a Shoutcast stream. The
problem is that the shoutcast response must have a status line that reads:

ICY 200 OK

Instead, the status line we get is always:

HTTP/1.1 200 OK

Many mediaplayers (WinAmp, Xmms, iTunes) accept the header with HTTP status
line, but some do not. The ICY header is incorrect according to RFC 2616 and I
have been unable to generate a response with this status line.

Does somebody have a clue on how we could spit out a response with the ICY
like status line in it? Any help is appreciated.



The code we use now is basically like this:

private WebResponse _response;

[...]

private OutputStream initOutputStream(boolean metadata) throws 
IOException {
OutputStream out = _response.getOutputStream(new 
ContentType(audio/mpeg));

//Spit out Shoutcast-headers.
_response.setHeader(icy-notice1,BRThis stream requires a
href=\http://www.winamp.com/\;Winamp/aBR);
_response.setHeader(icy-notice1,MusiController
SHOUTcast-implementationBR);
_response.setHeader(icy-name,MusiController);
_response.setHeader(icy-genre,All sorts);

_response.setHeader(icy-url,http://musicontroller.sourceforge.net;);
_response.setHeader(icy-pub,1);
_response.setHeader(icy-br,192);
if (metadata) _response.setIntHeader(icy-metaint,BUFFER_SIZE);

log.debug(Outputstream initialized);

return out;
}
[...]

public void setResponse(WebResponse response) {
_response = response;
}   



Hans Drexler


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



Re: HandyTapestry 1.0, Intellij Idea Tapestry plugin

2007-04-03 Thread Borut Bolčina




Any plans for 4.1.x support?

Cheers,
Borut

On 2.4.2007 13:34, Alexei Orishchenko wrote:

  HandyTapestry 1.0 released

If you develop a  http://tapestry.apache.org/ Tapestry  web application
using  http://www.jetbrains.com/idea IntelliJ Idea 
then try  http://handyedit.com/handytapestry.html HandyTapestry  plugin!

The HandyTapestry plugin for IntelliJ Idea helps you to develop Tapestry web
applications faster.
The plugin adds helpful completions and navigations in the HTML template.
The Create Tapestry component dialog helps to create components.
The plugin supports Tapestry 4.0
http://handyedit.com/handytapestry.html Read more... 

- page specification support
- navigate / complete properties from component specification
- navigate / complete jwcid attribute value (component reference)
- delete component UI enhancements
- settings enhancement

- fix: autocomplete close tag
- fix: completion in the src attribute of the img tag
- highlighting fixes

  


-- 





Re: Cant get Ajax @EventListener to work :( [+1]

2007-04-03 Thread Wojtek Ciesielski

Hi all,

I cant get dojo EventListener to work. 


The same happens with me :( Are there any preparatory steps to perform 
to use EventListener? I have a template :


MyTemplate:
span jwcid=@Shell title=.:: Title ::.
  doctype='HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN'
  ajaxEnabled=true
  browserLogLevel=DEBUG
  debugEnabled=true
  body jwcid=@Body onunload=purge(document)
   div jwcid=dp2scripts /
   div id=someId href=#click here.../div
   ...
  /body
/span

Within MyTemplate.java:
public abstract class MyTemplate extends BaseComponent {
  private final static Logger log = Logger.getLogger(DP2Template.class);
  @EventListener(elements = someId, events = onmouseover)
  public void testEvent(PageEvent pe) {
log.info(Caught click!);
  }
}

And it DOES NOT WORK :( Nothing appears on Tomcat's console...

Any advice would be greatly appreciated...
Wojtek

--
On wie jak zyskać, a nie stracić.
Wideofelietony Tadeusza Mosza. Zobacz  http://link.interia.pl/f1a3c


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



Re: HandyTapestry 1.0, Intellij Idea Tapestry plugin

2007-04-03 Thread Jesse Kuhnert

I use it to develop / use 4.1 - so I guess it has pretty good support there.
I don't know if it has any specific 4.1 feature support though. (nor could I
think of any specific feature in 4.1 that it would need to handle in an ide
)

On 4/3/07, Borut Bolčina [EMAIL PROTECTED] wrote:


 Any plans for 4.1.x support?

Cheers,
Borut

On 2.4.2007 13:34, Alexei Orishchenko wrote:

HandyTapestry 1.0 released

If you develop a  http://tapestry.apache.org/ Tapestry  web application
using  http://www.jetbrains.com/idea IntelliJ Idea
then try  http://handyedit.com/handytapestry.html HandyTapestry  plugin!

The HandyTapestry plugin for IntelliJ Idea helps you to develop Tapestry web
applications faster.
The plugin adds helpful completions and navigations in the HTML template.
The Create Tapestry component dialog helps to create components.
The plugin supports Tapestry 4.0
http://handyedit.com/handytapestry.html Read more...

- page specification support
- navigate / complete properties from component specification
- navigate / complete jwcid attribute value (component reference)
- delete component UI enhancements
- settings enhancement

- fix: autocomplete close tag
- fix: completion in the src attribute of the img tag
- highlighting fixes


--
[image: bbLOG] http://borutb.tuditi.delo.si/





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: Cant get Ajax @EventListener to work :( [+1]

2007-04-03 Thread Wojtek Ciesielski

Jesse Kuhnert wrote:

Offhand I'd say the PageEvent object looks suspicious. It supports a
BrowserEvent object but might just pass your method by if it sees a
parameter it doesn't know about.


My experiments with a method with no arguments are also failing...

@EventListener(elements = someId, events=onClick, async=true)
  public void testEvent() {
log.info(Caught click!);
System.out.println(Brute force msg...);
  }

:(



On 4/3/07, Wojtek Ciesielski [EMAIL PROTECTED] wrote:

Hi all,

 I cant get dojo EventListener to work.

The same happens with me :( Are there any preparatory steps to perform
to use EventListener? I have a template :

MyTemplate:
span jwcid=@Shell title=.:: Title ::.
   doctype='HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN'
   ajaxEnabled=true
   browserLogLevel=DEBUG
   debugEnabled=true
   body jwcid=@Body onunload=purge(document)
div jwcid=dp2scripts /
div id=someId href=#click here.../div
...
   /body
/span

Within MyTemplate.java:
public abstract class MyTemplate extends BaseComponent {
   private final static Logger log = Logger.getLogger(DP2Template.class);
   @EventListener(elements = someId, events = onmouseover)
   public void testEvent(PageEvent pe) {
 log.info(Caught click!);
   }
}

And it DOES NOT WORK :( Nothing appears on Tomcat's console...

Any advice would be greatly appreciated...
Wojtek

--
On wie jak zyskać, a nie stracić.
Wideofelietony Tadeusza Mosza. Zobacz  http://link.interia.pl/f1a3c


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








--
Wideofelietony Tadeusza Mosza.
O biznesie dla wszystkich. Oglądaj  http://link.interia.pl/f1a3c


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



Re: Cant get Ajax @EventListener to work :( [+1]

2007-04-03 Thread Wojtek Ciesielski

Jesse Kuhnert wrote:

Offhand I'd say the PageEvent object looks suspicious. It supports a
BrowserEvent object but might just pass your method by if it sees a
parameter it doesn't know about.



What effects in the rendered page source should such annotation cause? 
Currently I'm not seeing anything special added to my page source...


!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
!-- Application: null --
!-- Page: CompaniesTab --
!-- Generated: Tue Apr 03 14:33:47 CEST 2007 --
html
head
meta name=generator content=Tapestry Application Framework, version 
4.1.1 /

meta http-equiv=Content-Type content=text/html;charset=UTF-8 /
title.:: MyApp 2.0 ::./title
script type=text/javascriptdjConfig = 
{isDebug:true,debugContainerId:debug,baseRelativePath:/dp2/app?service=assetpath=%2Fdojo%2F,preventBackButtonFix:false,parseWidgets:false,locale:en-us} 
/script


 script type=text/javascript 
src=/dp2/app?service=assetpath=%2Fdojo%2Fdojo.js/script


script type=text/javascript
dojo.registerModulePath(tapestry, 
/dp2/app?service=assetpath=%2Ftapestry%2F);

/script
script type=text/javascript 
src=/dp2/app?service=assetpath=%2Ftapestry%2Fcore.js/script

script type=text/javascript
dojo.require(dojo.logging.Logger);
dojo.log.setLevel(dojo.log.getLevel(DEBUG));
dojo.require(tapestry.namespace);
/script
link rel=stylesheet type=text/css href=/dp2/css/MyApp2.css /
/head

body onunload=purge(document) id=Body
script type=text/javascript!--
function toggleOk(divEl) {
  var button = divEl.getElementsByTagName(a).item(0);
  button.className = button.className == 'okOff' ? 'okOn' : 'okOff';
}
function purge(d) {
  var a = d.attributes, i, l, n;
  if (a) {
l = a.length;
for (i = 0; i  l; i += 1) {
n = a[i].name;
if (typeof d[n] === 'function') {
d[n] = null;
}
}
  }
  a = d.childNodes;
  if (a) {
l = a.length;
for (i = 0; i  l; i += 1) {
purge(d.childNodes[i]);
}
  }
}
// --/script

   div id=someId href=#click here.../div


/body/html

--
Plan to połowa sukcesu.
Sprawdz na  http://link.interia.pl/f1a41


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



Re: Cant get Ajax @EventListener to work :( [+1]

2007-04-03 Thread Jesse Kuhnert

Yeah you should see something along the lines of :

dojo.event.connect(dojo.byId(someId), ... .

towards the bottom of your page.

You might also try using Tapestry 4.1.2 instead of 4.1.1. They should
both work equally well but I can't remember if 4.1.1 had any issues in
this area or not.

On 4/3/07, Wojtek Ciesielski [EMAIL PROTECTED] wrote:

Jesse Kuhnert wrote:
 Offhand I'd say the PageEvent object looks suspicious. It supports a
 BrowserEvent object but might just pass your method by if it sees a
 parameter it doesn't know about.


What effects in the rendered page source should such annotation cause?
Currently I'm not seeing anything special added to my page source...

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
!-- Application: null --
!-- Page: CompaniesTab --
!-- Generated: Tue Apr 03 14:33:47 CEST 2007 --
html
head
meta name=generator content=Tapestry Application Framework, version
4.1.1 /
meta http-equiv=Content-Type content=text/html;charset=UTF-8 /
title.:: MyApp 2.0 ::./title
script type=text/javascriptdjConfig =
{isDebug:true,debugContainerId:debug,baseRelativePath:/dp2/app?service=assetpath=%2Fdojo%2F,preventBackButtonFix:false,parseWidgets:false,locale:en-us}
/script

  script type=text/javascript
src=/dp2/app?service=assetpath=%2Fdojo%2Fdojo.js/script

script type=text/javascript
dojo.registerModulePath(tapestry,
/dp2/app?service=assetpath=%2Ftapestry%2F);
/script
script type=text/javascript
src=/dp2/app?service=assetpath=%2Ftapestry%2Fcore.js/script
script type=text/javascript
dojo.require(dojo.logging.Logger);
dojo.log.setLevel(dojo.log.getLevel(DEBUG));
dojo.require(tapestry.namespace);
/script
link rel=stylesheet type=text/css href=/dp2/css/MyApp2.css /
/head

body onunload=purge(document) id=Body
script type=text/javascript!--
function toggleOk(divEl) {
   var button = divEl.getElementsByTagName(a).item(0);
   button.className = button.className == 'okOff' ? 'okOn' : 'okOff';
 }
 function purge(d) {
   var a = d.attributes, i, l, n;
   if (a) {
 l = a.length;
 for (i = 0; i  l; i += 1) {
 n = a[i].name;
 if (typeof d[n] === 'function') {
 d[n] = null;
 }
 }
   }
   a = d.childNodes;
   if (a) {
 l = a.length;
 for (i = 0; i  l; i += 1) {
 purge(d.childNodes[i]);
 }
   }
 }
// --/script

div id=someId href=#click here.../div


/body/html

--
Plan to połowa sukcesu.
Sprawdz na  http://link.interia.pl/f1a41


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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: Cant get Ajax @EventListener to work :( [+1]

2007-04-03 Thread Jesse Kuhnert

I don't think onClick will be a valid js event name to listen to. In
this instance it has to be onclick .

On 4/3/07, Wojtek Ciesielski [EMAIL PROTECTED] wrote:

I've made it ultra-simple...:

SimplePage.java: ===

public abstract class SimplePage extends BasePage {
   private static final Logger log = Logger.getLogger(SimplePage.class);
   @EventListener(elements = someId, events=onClick, async=true)
   public void testEvent() {
 log.info(Caught click!);
 System.out.println(Brute force msg...);
   }
}

SimplePage.page: ===

?xml version=1.0?
!DOCTYPE page-specification PUBLIC
-//Apache Software Foundation//Tapestry Specification 4.1//EN
http://jakarta.apache.org/tapestry/dtd/Tapestry_4_1.dtd;
page-specification class=com.garlik.datapatrol2.pages.SimplePage
/page-specification


And MyApp.application: 

?xml version=1.0?
!DOCTYPE application PUBLIC
-//Apache Software Foundation//Tapestry Specification 4.1//EN
http://jakarta.apache.org/tapestry/dtd/Tapestry_4_1.dtd;
application
   meta key=org.apache.tapestry.page-class-packages
value=com.garlik.datapatarol2.pages/
   page specification-path=pages/SimplePage.page name=SimplePage/
/application

And it's NOT workin :( (Some DOJO features are running 'cause I'm
getting msg about lack of BACK support when opening page in Opera).

Wojtek

--
Najlepiej wytresowany pies swiata 
Zobacz  http://link.interia.pl/f1a34


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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Re: Create Shoutcast service in Tapestry.

2007-04-03 Thread Richard Kirby

Hi Hans,

The status line is output by the servlet engine - not Tapestry, since it 
is a core part of the HTTP spec.


What you may be able to do, is create a javax.servlet.Filter which reads 
the response from Tapestry into a stream, hopefully including the status 
line - and then just re-output but with your new status line. Don't know 
if that will work though.


Richard.

Hans Drexler wrote:

We try to create a Tapestry-service that generates a Shoutcast stream. The
problem is that the shoutcast response must have a status line that reads:

ICY 200 OK

Instead, the status line we get is always:

HTTP/1.1 200 OK

Many mediaplayers (WinAmp, Xmms, iTunes) accept the header with HTTP status
line, but some do not. The ICY header is incorrect according to RFC 2616 and I
have been unable to generate a response with this status line.

Does somebody have a clue on how we could spit out a response with the ICY
like status line in it? Any help is appreciated.



The code we use now is basically like this:

private WebResponse _response;

[...]

private OutputStream initOutputStream(boolean metadata) throws 
IOException {
OutputStream out = _response.getOutputStream(new 
ContentType(audio/mpeg));

//Spit out Shoutcast-headers.
_response.setHeader(icy-notice1,BRThis stream requires a
href=\http://www.winamp.com/\;Winamp/aBR);
_response.setHeader(icy-notice1,MusiController
SHOUTcast-implementationBR);
_response.setHeader(icy-name,MusiController);
_response.setHeader(icy-genre,All sorts);

_response.setHeader(icy-url,http://musicontroller.sourceforge.net;);
_response.setHeader(icy-pub,1);
_response.setHeader(icy-br,192);
if (metadata) _response.setIntHeader(icy-metaint,BUFFER_SIZE);

log.debug(Outputstream initialized);

return out;
}
[...]

public void setResponse(WebResponse response) {
_response = response;
}   



Hans Drexler


-
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: Cant get Ajax @EventListener to work :( [+1]

2007-04-03 Thread Borut Bolčina

Hello,

event listeners aren't called in components, only in pages. I had the 
same problem and then moved the listener to enclosing page. See 
@EventListener in Border post.


-Borut

On 3.4.2007 13:55, Wojtek Ciesielski wrote:

Hi all,

I cant get dojo EventListener to work. 


The same happens with me :( Are there any preparatory steps to perform 
to use EventListener? I have a template :


MyTemplate:
span jwcid=@Shell title=.:: Title ::.
  doctype='HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN'
  ajaxEnabled=true
  browserLogLevel=DEBUG
  debugEnabled=true
  body jwcid=@Body onunload=purge(document)
   div jwcid=dp2scripts /
   div id=someId href=#click here.../div
   ...
  /body
/span

Within MyTemplate.java:
public abstract class MyTemplate extends BaseComponent {
  private final static Logger log = Logger.getLogger(DP2Template.class);
  @EventListener(elements = someId, events = onmouseover)
  public void testEvent(PageEvent pe) {
log.info(Caught click!);
  }
}

And it DOES NOT WORK :( Nothing appears on Tomcat's console...

Any advice would be greatly appreciated...
Wojtek

--
On wie jak zyskać, a nie stracić.
Wideofelietony Tadeusza Mosza. Zobacz  http://link.interia.pl/f1a3c


-
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: HandyTapestry 1.0, Intellij Idea Tapestry plugin

2007-04-03 Thread Borut Bolčina




Thanks for the reply Jesse.

P.S. Any progress on http://jira.opensymphony.com/browse/OGNL-16 which
is closed, but I still have problems?

On 3.4.2007 14:27, Jesse Kuhnert wrote:
I use it to develop / use 4.1 - so I guess it has pretty
good support there. I don't know if it has any specific 4.1 feature
support though. (nor could I think of any specific feature in 4.1 that
it would need to handle in an ide )
  
  
  On 4/3/07, Borut
Bolčina [EMAIL PROTECTED]
wrote:
  
Any plans for 4.1.x support?

Cheers,
Borut

On 2.4.2007 13:34, Alexei Orishchenko wrote:

  HandyTapestry 1.0 released

If you develop a  http://tapestry.apache.org/ Tapestry  web application

using  http://www.jetbrains.com/idea IntelliJ Idea 
then try  
http://handyedit.com/handytapestry.html HandyTapestry  plugin!

The HandyTapestry plugin for IntelliJ Idea helps you to develop Tapestry web
applications faster.
The plugin adds helpful completions and navigations in the HTML template.

The Create Tapestry component dialog helps to create components.
The plugin supports Tapestry 4.0

http://handyedit.com/handytapestry.html Read more... 

- page specification support
- navigate / complete properties from component specification
- navigate / complete jwcid attribute value (component reference)

- delete component UI enhancements
- settings enhancement

- fix: autocomplete close tag
- fix: completion in the src attribute of the img tag
- highlighting fixes

  


-- 



  
  
  
  
  
-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer
  
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. 
http://blog.opencomponentry.com


-- 





Tapestry 4.1.2

2007-04-03 Thread Gareth
Hi All,

Is there a likely approximate release date for tapestry 4.1.2 yet?

If so, could you please share it, I couldn't find it on the website anywhere.

Thanks

Gareth



___ 
What kind of emailer are you? Find out today - get a free analysis of your 
email personality. Take the quiz at the Yahoo! Mail Championship. 
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk 

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



Re: Cant get Ajax @EventListener to work :( [+1]

2007-04-03 Thread Jesse Kuhnert

Ah .It could be that element event listeners don't work in
components, but component event listeners will work.

Did anyone file a bug for that?

On 4/3/07, Borut Bolčina [EMAIL PROTECTED] wrote:

Hello,

event listeners aren't called in components, only in pages. I had the
same problem and then moved the listener to enclosing page. See
@EventListener in Border post.

-Borut

On 3.4.2007 13:55, Wojtek Ciesielski wrote:
 Hi all,

 I cant get dojo EventListener to work.

 The same happens with me :( Are there any preparatory steps to perform
 to use EventListener? I have a template :

 MyTemplate:
 span jwcid=@Shell title=.:: Title ::.
   doctype='HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN'
   ajaxEnabled=true
   browserLogLevel=DEBUG
   debugEnabled=true
   body jwcid=@Body onunload=purge(document)
div jwcid=dp2scripts /
div id=someId href=#click here.../div
...
   /body
 /span

 Within MyTemplate.java:
 public abstract class MyTemplate extends BaseComponent {
   private final static Logger log = Logger.getLogger(DP2Template.class);
   @EventListener(elements = someId, events = onmouseover)
   public void testEvent(PageEvent pe) {
 log.info(Caught click!);
   }
 }

 And it DOES NOT WORK :( Nothing appears on Tomcat's console...

 Any advice would be greatly appreciated...
 Wojtek

 --
 On wie jak zyskać, a nie stracić.
 Wideofelietony Tadeusza Mosza. Zobacz  http://link.interia.pl/f1a3c


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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: Tapestry 4.1.2

2007-04-03 Thread Jesse Kuhnert

Maybe another week or two. It is entirely dependent on seeing the ognl
features stabilize.

On 4/3/07, Gareth [EMAIL PROTECTED] wrote:

Hi All,

Is there a likely approximate release date for tapestry 4.1.2 yet?

If so, could you please share it, I couldn't find it on the website anywhere.

Thanks

Gareth



___
What kind of emailer are you? Find out today - get a free analysis of your 
email personality. Take the quiz at the Yahoo! Mail Championship.
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk

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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Re: Create Shoutcast service in Tapestry.

2007-04-03 Thread Hans Drexler
On Tue, 03 Apr 2007 14:11:03 +0100, Richard Kirby wrote
 Hi Hans,
 
 The status line is output by the servlet engine - not Tapestry,
  since it is a core part of the HTTP spec.
 
 What you may be able to do, is create a javax.servlet.Filter which 
 reads the response from Tapestry into a stream, hopefully including 
 the status line - and then just re-output but with your new status 
 line. Don't know if that will work though.
 
 Richard.
 

I already had a hunch that it would be something like this. Thanks for the
response. I will try to construct a filter. Never did that before, so it will
be a challenge :-)

 Hans Drexler wrote:
  We try to create a Tapestry-service that generates a Shoutcast stream. The
  problem is that the shoutcast response must have a status line that reads:
 
  ICY 200 OK
 
  Instead, the status line we get is always:
 
  HTTP/1.1 200 OK
 
  Many mediaplayers (WinAmp, Xmms, iTunes) accept the header with HTTP status
  line, but some do not. The ICY header is incorrect according to RFC 2616 
  and I
  have been unable to generate a response with this status line.
 
  Does somebody have a clue on how we could spit out a response with the ICY
  like status line in it? Any help is appreciated.
 
 
 
  The code we use now is basically like this:
 
  private WebResponse _response;
 
  [...]
 
  private OutputStream initOutputStream(boolean metadata) throws 
  IOException {
  OutputStream out = _response.getOutputStream(new 
  ContentType(audio/mpeg));
  
  //Spit out Shoutcast-headers.
  _response.setHeader(icy-notice1,BRThis stream requires a
  href=\http://www.winamp.com/\;Winamp/aBR);
  _response.setHeader(icy-notice1,MusiController
  SHOUTcast-implementationBR);
  _response.setHeader(icy-name,MusiController);
  _response.setHeader(icy-genre,All sorts);
  
  _response.setHeader(icy-url,http://musicontroller.sourceforge.net;);
  _response.setHeader(icy-pub,1);
  _response.setHeader(icy-br,192);
  if (metadata) _response.setIntHeader(icy-metaint,BUFFER_SIZE);
  
  log.debug(Outputstream initialized);
  
  return out;
  }
  [...]
 
  public void setResponse(WebResponse response) {
  _response = response;
  }   
 
 
  
  Hans Drexler
 
 
  -
  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]



Hans Drexler
GeoTax en WOZ-Support b.v.
e: [EMAIL PROTECTED]


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



It's working now - but HOW does it work? ;-)

2007-04-03 Thread Wojtek Ciesielski

Jesse Kuhnert wrote:

I don't think onClick will be a valid js event name to listen to. In
this instance it has to be onclick .


Thanks, it could be a reason (I was changing several things at once 
trying to fix it so I'm only 90% sure that that's it ;-)).


And I've noticed that even when @EventListener is added to one component 
of a page when it's clicked the whole rendering is taking place. By 
rendering I mean that pageBeginRender() method of the enclosing page is 
being called. As an effect - whole logic responsible for pulling data 
for whole page from underlying DB is being called...


So questions are:
1. Is there ANY place where behaviour of @EventListener (lifecycle of 
involved components) is described?
2. It seems like a bad optimization if logic for whole page and its 
component tree is being called, when I just want to update one widget on 
the page... How can I optimize it?


TIA,
Wojtek

--
Masz plan? Potrzebujesz motywacji ?
wejdz na  http://link.interia.pl/f1a40


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



Re: It's working now - but HOW does it work? ;-)

2007-04-03 Thread Jesse Kuhnert

You can call IRequestCycle.getResponseBuilder().isDynamic() to see if
it's a dynamic request and skip any heavy operations you don't need to
perform.

On 4/3/07, Wojtek Ciesielski [EMAIL PROTECTED] wrote:

Jesse Kuhnert wrote:
 I don't think onClick will be a valid js event name to listen to. In
 this instance it has to be onclick .

Thanks, it could be a reason (I was changing several things at once
trying to fix it so I'm only 90% sure that that's it ;-)).

And I've noticed that even when @EventListener is added to one component
of a page when it's clicked the whole rendering is taking place. By
rendering I mean that pageBeginRender() method of the enclosing page is
being called. As an effect - whole logic responsible for pulling data
for whole page from underlying DB is being called...

So questions are:
1. Is there ANY place where behaviour of @EventListener (lifecycle of
involved components) is described?
2. It seems like a bad optimization if logic for whole page and its
component tree is being called, when I just want to update one widget on
the page... How can I optimize it?

TIA,
Wojtek

--
Masz plan? Potrzebujesz motywacji ?
wejdz na  http://link.interia.pl/f1a40


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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Re: Tapestry 4.1.2

2007-04-03 Thread Gareth
Thanks Jesse.

- Original Message 
From: Jesse Kuhnert [EMAIL PROTECTED]
To: Tapestry users users@tapestry.apache.org
Sent: Tuesday, 3 April, 2007 2:34:52 PM
Subject: Re: Tapestry 4.1.2

Maybe another week or two. It is entirely dependent on seeing the ognl
features stabilize.

On 4/3/07, Gareth [EMAIL PROTECTED] wrote:
 Hi All,

 Is there a likely approximate release date for tapestry 4.1.2 yet?

 If so, could you please share it, I couldn't find it on the website anywhere.

 Thanks

 Gareth



 ___
 What kind of emailer are you? Find out today - get a free analysis of your 
 email personality. Take the quiz at the Yahoo! Mail Championship.
 http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk

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




-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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







___ 
All New Yahoo! Mail – Tired of unwanted email come-ons? Let our SpamGuard 
protect you. http://uk.docs.yahoo.com/nowyoucan.html

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



.jwc-file-free components for libraries (4.1.1)

2007-04-03 Thread Marcus.Schulte
We are trying to move a little library of ours to Java-5 with full usage
of annotations, without jwc-files. While a component itself is
recognised this way. Asset-resolution relative to the (non-existing)
specification doesn't work.
Did I overlook anything? Or would that be an improvement-issue in Jira?
 
regards,
Marcus


Re: .jwc-file-free components for libraries (4.1.1)

2007-04-03 Thread Jesse Kuhnert

I do remember being annoyed by this lately, if you file a jira issue
for it I'll fix it quickly.

On 4/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

We are trying to move a little library of ours to Java-5 with full usage
of annotations, without jwc-files. While a component itself is
recognised this way. Asset-resolution relative to the (non-existing)
specification doesn't work.
Did I overlook anything? Or would that be an improvement-issue in Jira?

regards,
Marcus




--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



T4.1.1: injecting service into page/component

2007-04-03 Thread Wojtek Ciesielski
Hi there - I need to obtain PageService within a method of my 
page/component (to get textual link to the injected page). How can I do 
this?


@InjectObject(service:tapestry.services.Page)
 public abstract PageService getPageService();

is not working...

Thanks in advance,
Wojtek


[T4.1] Question About @Shell and @Body

2007-04-03 Thread Chris Chiappone

I am wondering if the @Shell and @Body components are required in
order to get the ajax function to work with tapestry pages.  I already
have a header and footer defined using jsp's in a legacy application.
I am beginning to introduce Tapestry pages as we are moving forward.

Is there a way of manually defining what JS is included without using
either @Shell or @Body.


Thanks

--
~chris

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



Re: BeanEditForm

2007-04-03 Thread Howard Lewis Ship

I'm currently innundated ... working full time for a T4 customer, and
putting together a bunch of presentations for NFJS, OSCON and JavaOne.
Try checking around the T5 integration tests, I think there's a
useful example there.

On 4/3/07, Graham Ford [EMAIL PROTECTED] wrote:

Thanks Howard.

Is there any chance anyone could give a bit more info on this. I have
got the BeanModel and tried to add the fields of the child object to it,
but I am always getting an error. I am probably doing something dumb,
but if anyone could show me the way, I would be grateful.

Graham

Howard Lewis Ship wrote:
 It is possible, and involves obtaining the BeanModel and modifying it
 before passing it as the model parameter of the BeanEditForm
 component.

 I'm travelling now, so that's as specific as I have time to answer!

 On 3/29/07, Graham Ford [EMAIL PROTECTED] wrote:
 Hi,

 I'm loving Tapestry 5 so far but I have a question about the
 BeanEditForm. If I have an object, say Person, which has a property of
 another object, say Address, is there a way of getting the details from
 the Address object into the form as well as the person's details?

 Thanks,
 Graham

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





--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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



RE: T4.1.1: injecting service into page/component

2007-04-03 Thread Ben Dotte
This should do the trick

@InjectObject(engine-service:page)
public abstract IEngineService getPageService();

Ben

-Original Message-
From: Wojtek Ciesielski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 03, 2007 11:18 AM
To: Tapestry users
Subject: T4.1.1: injecting service into page/component

Hi there - I need to obtain PageService within a method of my 
page/component (to get textual link to the injected page). How can I do 
this?

 @InjectObject(service:tapestry.services.Page)
  public abstract PageService getPageService();

is not working...

Thanks in advance,
Wojtek

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



Creating ajax-based expandable tree-like structures

2007-04-03 Thread Wojtek Ciesielski

Hi all,

I am trying to figure out some elegant way to use Tapestry to build 
dynamic ajax-based tree-like UI widget. In general it's about showing 
some hierarchical data:


* Some data item
   * some sub property
   * some sub property
 * last level of props
   * some sub property

Each level of that tree is (at least I planned in this way) a separate 
component as on each of those levels different things are shown with 
different actions. So here comes the question: how to approach this 
problem in a way that could be implemented by someone, who knows basics 
of Tapestry?


I thought about creating separate page (let's call it 
AjaxComponentProvider) which would be called when user clicks an item. 
This page would have injected components for those levels and would 
render next level of components (by deleting rendering to 
sub-components) as an XML. This XML would be then inserted into the 
page. Thanks to such approach it would be easy to switch from AJAX-based 
display to 'classical' one.


One thing that I can't find is how to obtain a String with URL to a 
AjaxComponentProvider with some additional properties... My initial ACP 
looks like this:


public abstract class AjaxComponentProvider extends DatapatrolBasePage {
 public static final String pageName = AjaxComponentProvider;
 public enum Action {GET_OCCURRENCE_DETAILS}
 public abstract Action getAction();
 public abstract void setAction(Action a);
 @InjectComponent(OccurrenceInfo)
 public abstract OccurrenceInfo getOccurrenceInfoComponent();
 public DpOccurrence getShownOccurrence() {
   CollectionDpItem items = MockDataProvider.createSearchedItems();
   return (DpOccurrence) 
items.iterator().next().getDpOccurrences().toArray()[0];
 }
 /**
  * @see 
org.apache.tapestry.BaseComponent#renderComponent(org.apache.tapestry.IMarkupWriter,
 org.apache.tapestry.IRequestCycle)
  */
 @Override
 protected void renderComponent(IMarkupWriter arg0, IRequestCycle arg1) {
   OccurrenceInfo oic = getOccurrenceInfoComponent();
   oic.render(arg0,arg1);
   //super.renderComponent(arg0, arg1);
 }
}


And on a page that is supposed to use ACP to obtain some sub-level I 
wanted to put something like


@InjectPage(AjaxComponentProvider.pageName)
public abstract AjaxComponentProvider getAjaxComponentProvider();

public String getLink() {

   AjaxComponentProvider acp = getAjaxComponentProvider();
   acp.setAction(Action.GET_OCCURRENCE_DETAILS);
   String toRet = // here I need to get string with url to 
AjaxComponentProvider page with props set
   return toRet;
 }


this getLink() method would be used in composing javascript on the 
template to create ajax requests...


What are you thoughts about it? Am I missing some much easier and 
elegant way to do this?




--
Najlepiej wytresowany pies swiata 
Zobacz  http://link.interia.pl/f1a34


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



Re: Creating ajax-based expandable tree-like structures

2007-04-03 Thread Jesse Kuhnert

I think you want:

http://opencomponentry.com:8080/tacos/ajax/TreeExample.html

On 4/3/07, Wojtek Ciesielski [EMAIL PROTECTED] wrote:
snipped


--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Re: [T4.1] Question About @Shell and @Body

2007-04-03 Thread Jesse Kuhnert

I think you still have to use a @Body even without the @Shell but you
can use the @ScriptIncludes instead of the shell - which ~only~
includes js on the page:

http://tapestry.apache.org/tapestry4.1/components/general/scriptincludes.html

On 4/3/07, Chris Chiappone [EMAIL PROTECTED] wrote:

I am wondering if the @Shell and @Body components are required in
order to get the ajax function to work with tapestry pages.  I already
have a header and footer defined using jsp's in a legacy application.
I am beginning to introduce Tapestry pages as we are moving forward.

Is there a way of manually defining what JS is included without using
either @Shell or @Body.


Thanks

--
~chris

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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Re: Cant get Ajax @EventListener to work :( [+1]

2007-04-03 Thread Borut Bolčina

Filed under
https://issues.apache.org/jira/browse/TAPESTRY-1398


Jesse Kuhnert wrote:

Ah .It could be that element event listeners don't work in
components, but component event listeners will work.

Did anyone file a bug for that?

On 4/3/07, Borut Bolčina [EMAIL PROTECTED] wrote:

Hello,

event listeners aren't called in components, only in pages. I had the
same problem and then moved the listener to enclosing page. See
@EventListener in Border post.

-Borut

On 3.4.2007 13:55, Wojtek Ciesielski wrote:
 Hi all,

 I cant get dojo EventListener to work.

 The same happens with me :( Are there any preparatory steps to perform
 to use EventListener? I have a template :

 MyTemplate:
 span jwcid=@Shell title=.:: Title ::.
   doctype='HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN'
   ajaxEnabled=true
   browserLogLevel=DEBUG
   debugEnabled=true
   body jwcid=@Body onunload=purge(document)
div jwcid=dp2scripts /
div id=someId href=#click here.../div
...
   /body
 /span

 Within MyTemplate.java:
 public abstract class MyTemplate extends BaseComponent {
   private final static Logger log = 
Logger.getLogger(DP2Template.class);

   @EventListener(elements = someId, events = onmouseover)
   public void testEvent(PageEvent pe) {
 log.info(Caught click!);
   }
 }

 And it DOES NOT WORK :( Nothing appears on Tomcat's console...

 Any advice would be greatly appreciated...
 Wojtek

 --
 On wie jak zyskać, a nie stracić.
 Wideofelietony Tadeusza Mosza. Zobacz  http://link.interia.pl/f1a3c


 -
 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: Creating ajax-based expandable tree-like structures

2007-04-03 Thread Borut Bolčina

Have a look at this blog
http://andyhot.di.uoa.gr/blojsom/blog/default/java/2006/08/17/Tapestry-Building-Trees-with-Tacos-and-Annotations.html

It sure helped me.

Cheers,
Borut

Wojtek Ciesielski wrote:

Hi all,

I am trying to figure out some elegant way to use Tapestry to build 
dynamic ajax-based tree-like UI widget. In general it's about showing 
some hierarchical data:


* Some data item
   * some sub property
   * some sub property
 * last level of props
   * some sub property

Each level of that tree is (at least I planned in this way) a separate 
component as on each of those levels different things are shown with 
different actions. So here comes the question: how to approach this 
problem in a way that could be implemented by someone, who knows 
basics of Tapestry?


I thought about creating separate page (let's call it 
AjaxComponentProvider) which would be called when user clicks an item. 
This page would have injected components for those levels and would 
render next level of components (by deleting rendering to 
sub-components) as an XML. This XML would be then inserted into the 
page. Thanks to such approach it would be easy to switch from 
AJAX-based display to 'classical' one.


One thing that I can't find is how to obtain a String with URL to a 
AjaxComponentProvider with some additional properties... My initial 
ACP looks like this:


public abstract class AjaxComponentProvider extends DatapatrolBasePage {
 public static final String pageName = AjaxComponentProvider;
 public enum Action {GET_OCCURRENCE_DETAILS}
 public abstract Action getAction();
 public abstract void setAction(Action a);
 @InjectComponent(OccurrenceInfo)
 public abstract OccurrenceInfo getOccurrenceInfoComponent();
 public DpOccurrence getShownOccurrence() {
   CollectionDpItem items = MockDataProvider.createSearchedItems();
   return (DpOccurrence) 
items.iterator().next().getDpOccurrences().toArray()[0];

 }
 /**
  * @see 
org.apache.tapestry.BaseComponent#renderComponent(org.apache.tapestry.IMarkupWriter, 
org.apache.tapestry.IRequestCycle)

  */
 @Override
 protected void renderComponent(IMarkupWriter arg0, IRequestCycle arg1) {
   OccurrenceInfo oic = getOccurrenceInfoComponent();
   oic.render(arg0,arg1);
   //super.renderComponent(arg0, arg1);
 }
}


And on a page that is supposed to use ACP to obtain some sub-level I 
wanted to put something like


@InjectPage(AjaxComponentProvider.pageName)
public abstract AjaxComponentProvider getAjaxComponentProvider();

public String getLink() {

   AjaxComponentProvider acp = getAjaxComponentProvider();
   acp.setAction(Action.GET_OCCURRENCE_DETAILS);
   String toRet = // here I need to get string with url to 
AjaxComponentProvider page with props set

   return toRet;
 }


this getLink() method would be used in composing javascript on the 
template to create ajax requests...


What are you thoughts about it? Am I missing some much easier and 
elegant way to do this?




--
Najlepiej wytresowany pies swiata 
Zobacz  http://link.interia.pl/f1a34


-
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: It's working now - but HOW does it work? ;-)

2007-04-03 Thread Sam Gendler

I've run into this problem on some heavyweight pages using Tap 4.0 and
Tacos 4.0.  I basically had to modify all my pages so that models are
initialized only on access.  If I need a model to reinitialize after
the rewind cycle, I set it back to null during a listener method.  In
Tap4.0 + tacos, even that wasn't really enough to get me any
efficiency gains, since the whole page must still rewind, so all the
models were firing, anyway.  At best, I was sparing myself the
re-initialization of any models that were updated for the render
cycle.  I solved this by introducing some infrastructure to my pages
such that a model is able to check whether it is needed for render,
rewind, both, or neither during ajax (dynamic) updates. I just
initialize a dictionary in the .page file or via the InitialValue
annotation which specifies which models have which update modes.  The
advantage of this is that I can serve up empty models during the
render phase, even if I needed the correct model during rewind, so
that Tap doesn't waste a bunch of cycles spewing lots of options to a
null writer.

It was a pretty simple refactoring of my code, but it required lots of
typing, since I moved from using astract model getters and setters
with an initializer in pageBeginRender calling the set method, to
having fully specified getters and setters that check if the stored
value is null before creating a new model, but only if is not an ajax
update or the model is specified as being needed for the current
cycle.  Modifying existing pages was a pain in the neck, but working
with new pages is very simple.  It is yet another declarative thing
that isn't checked at compile time, though, although I'm sure if I
thought about it, I could concoct a way to fix that. Doesn't seem
worth the effort, though, since most of my models are now initialized
in a base page class, since any page which don't use a particular
model don't suffer the initalization hit, anyway.

--sam


On 4/3/07, Jesse Kuhnert [EMAIL PROTECTED] wrote:

You can call IRequestCycle.getResponseBuilder().isDynamic() to see if
it's a dynamic request and skip any heavy operations you don't need to
perform.

On 4/3/07, Wojtek Ciesielski [EMAIL PROTECTED] wrote:
 Jesse Kuhnert wrote:
  I don't think onClick will be a valid js event name to listen to. In
  this instance it has to be onclick .

 Thanks, it could be a reason (I was changing several things at once
 trying to fix it so I'm only 90% sure that that's it ;-)).

 And I've noticed that even when @EventListener is added to one component
 of a page when it's clicked the whole rendering is taking place. By
 rendering I mean that pageBeginRender() method of the enclosing page is
 being called. As an effect - whole logic responsible for pulling data
 for whole page from underlying DB is being called...

 So questions are:
 1. Is there ANY place where behaviour of @EventListener (lifecycle of
 involved components) is described?
 2. It seems like a bad optimization if logic for whole page and its
 component tree is being called, when I just want to update one widget on
 the page... How can I optimize it?

 TIA,
 Wojtek

 --
 Masz plan? Potrzebujesz motywacji ?
 wejdz na  http://link.interia.pl/f1a40


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




--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.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]



Trouble with the Tap 5 tutorial

2007-04-03 Thread Andy Zimmerman

While trying to follow along through the Tap 5 tutorial (I realize it isn't
finished), I ran into a problem.  The create archetype made an AppModule
class that has a couple of imports that do not resolve.  Specifically:

import org.apache.tapestry.ioc.annotations.Contribute;
import org.apache.tapestry.ioc.annotations.Id;

Neither of these annotations appear in the annotations jar that Maven
fetched, so I thought I'd check the 5.0.3 version from apache.org or the
tapestry-ioc distribution.  No dice.  They don't exist there either.

Any suggestions on the correct way to resolve this problem?

Thanks,
Andy Zimmerman


Re: Trouble with the Tap 5 tutorial

2007-04-03 Thread Massimo Lusetti

On 4/3/07, Andy Zimmerman [EMAIL PROTECTED] wrote:


Any suggestions on the correct way to resolve this problem?


Please have a look at ML archives. That annotations are gone since
T5-ioc has lost namespace capablities they are no more needed, now use
the correct naming convention.

--
Massimo
http://meridio.blogspot.com

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



Re: Cant get Ajax @EventListener to work :( [+1]

2007-04-03 Thread Jesse Kuhnert

Resolved as not valid. :)

Just so everyone else is clear, elements  component event listeners
work equally well in components as they do pages.

On 4/3/07, Borut Bolčina [EMAIL PROTECTED] wrote:

Filed under
https://issues.apache.org/jira/browse/TAPESTRY-1398


Jesse Kuhnert wrote:
 Ah .It could be that element event listeners don't work in
 components, but component event listeners will work.

 Did anyone file a bug for that?

 On 4/3/07, Borut Bolčina [EMAIL PROTECTED] wrote:
 Hello,

 event listeners aren't called in components, only in pages. I had the
 same problem and then moved the listener to enclosing page. See
 @EventListener in Border post.

 -Borut

 On 3.4.2007 13:55, Wojtek Ciesielski wrote:
  Hi all,
 
  I cant get dojo EventListener to work.
 
  The same happens with me :( Are there any preparatory steps to perform
  to use EventListener? I have a template :
 
  MyTemplate:
  span jwcid=@Shell title=.:: Title ::.
doctype='HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN'
ajaxEnabled=true
browserLogLevel=DEBUG
debugEnabled=true
body jwcid=@Body onunload=purge(document)
 div jwcid=dp2scripts /
 div id=someId href=#click here.../div
 ...
/body
  /span
 
  Within MyTemplate.java:
  public abstract class MyTemplate extends BaseComponent {
private final static Logger log =
 Logger.getLogger(DP2Template.class);
@EventListener(elements = someId, events = onmouseover)
public void testEvent(PageEvent pe) {
  log.info(Caught click!);
}
  }
 
  And it DOES NOT WORK :( Nothing appears on Tomcat's console...
 
  Any advice would be greatly appreciated...
  Wojtek
 
  --
  On wie jak zyskać, a nie stracić.
  Wideofelietony Tadeusza Mosza. Zobacz  http://link.interia.pl/f1a3c
 
 
  -
  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]





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: Creating ajax-based expandable tree-like structures

2007-04-03 Thread andyhot
Also, 2 very useful implementations of a KeyProvider and a 
TreeContentProvider where added in tacos-4.1


http://fisheye3.cenqua.com/browse/tacos/tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/model/impl/BeanPropertyKeyProvider.java?r=469
http://fisheye3.cenqua.com/browse/tacos/tacos-4.1/trunk/tacos-core/src/java/net/sf/tacos/model/impl/BeanWithChildrenTreeContentProvider.java?r=469


Borut Bolčina wrote:

Have a look at this blog
http://andyhot.di.uoa.gr/blojsom/blog/default/java/2006/08/17/Tapestry-Building-Trees-with-Tacos-and-Annotations.html 



It sure helped me.

Cheers,
Borut

Wojtek Ciesielski wrote:

Hi all,

I am trying to figure out some elegant way to use Tapestry to build 
dynamic ajax-based tree-like UI widget. In general it's about showing 
some hierarchical data:


* Some data item
   * some sub property
   * some sub property
 * last level of props
   * some sub property

Each level of that tree is (at least I planned in this way) a 
separate component as on each of those levels different things are 
shown with different actions. So here comes the question: how to 
approach this problem in a way that could be implemented by someone, 
who knows basics of Tapestry?


I thought about creating separate page (let's call it 
AjaxComponentProvider) which would be called when user clicks an 
item. This page would have injected components for those levels and 
would render next level of components (by deleting rendering to 
sub-components) as an XML. This XML would be then inserted into the 
page. Thanks to such approach it would be easy to switch from 
AJAX-based display to 'classical' one.


One thing that I can't find is how to obtain a String with URL to a 
AjaxComponentProvider with some additional properties... My initial 
ACP looks like this:


public abstract class AjaxComponentProvider extends DatapatrolBasePage {
 public static final String pageName = AjaxComponentProvider;
 public enum Action {GET_OCCURRENCE_DETAILS}
 public abstract Action getAction();
 public abstract void setAction(Action a);
 @InjectComponent(OccurrenceInfo)
 public abstract OccurrenceInfo getOccurrenceInfoComponent();
 public DpOccurrence getShownOccurrence() {
   CollectionDpItem items = MockDataProvider.createSearchedItems();
   return (DpOccurrence) 
items.iterator().next().getDpOccurrences().toArray()[0];

 }
 /**
  * @see 
org.apache.tapestry.BaseComponent#renderComponent(org.apache.tapestry.IMarkupWriter, 
org.apache.tapestry.IRequestCycle)

  */
 @Override
 protected void renderComponent(IMarkupWriter arg0, IRequestCycle 
arg1) {

   OccurrenceInfo oic = getOccurrenceInfoComponent();
   oic.render(arg0,arg1);
   //super.renderComponent(arg0, arg1);
 }
}


And on a page that is supposed to use ACP to obtain some sub-level I 
wanted to put something like


@InjectPage(AjaxComponentProvider.pageName)
public abstract AjaxComponentProvider getAjaxComponentProvider();

public String getLink() {

   AjaxComponentProvider acp = getAjaxComponentProvider();
   acp.setAction(Action.GET_OCCURRENCE_DETAILS);
   String toRet = // here I need to get string with url to 
AjaxComponentProvider page with props set

   return toRet;
 }


this getLink() method would be used in composing javascript on the 
template to create ajax requests...


What are you thoughts about it? Am I missing some much easier and 
elegant way to do this?




--
Najlepiej wytresowany pies swiata 
Zobacz  http://link.interia.pl/f1a34


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



T5 Hibernate long conversations (session-per-conversation)

2007-04-03 Thread Bill Holloway

Has anyone implemented session-per-conversation (my preferred way to
handle optimistic locking) in T5?  Right now, tapestry-hibernate
implements session-per-request.

I'm thinking an application state object is a good place to start here
with methods like startConversation() and endConversation() with
hibernate sessions managed by this service.

Any thoughts?

Bill

--
The future is here.  It's just not evenly distributed yet.

-- Traditional

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



Re: T5 Hibernate long conversations (session-per-conversation)

2007-04-03 Thread Howard Lewis Ship

My problem with session-per-conversation is that its totally
incompatible with clustering, since the objects in the detached
session are not propogated to other servers.

That being said; yes some kind of mechanism (as service, an ASO) to
hold onto the sessions between requests, to support detach and
reattach, etc.  The tiny bit of work I've done on tapestry-hibernate
(for T5) doesn't support this concept, but it can grow to encompass
it.

On 4/3/07, Bill Holloway [EMAIL PROTECTED] wrote:

Has anyone implemented session-per-conversation (my preferred way to
handle optimistic locking) in T5?  Right now, tapestry-hibernate
implements session-per-request.

I'm thinking an application state object is a good place to start here
with methods like startConversation() and endConversation() with
hibernate sessions managed by this service.

Any thoughts?

Bill

--
The future is here.  It's just not evenly distributed yet.

 -- Traditional

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





--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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



Re: Create Shoutcast service in Tapestry.

2007-04-03 Thread Jesse Kuhnert

You can still do HttpServletResponse.setStatus(int code, String message);

It's deprecated so there may be a better way but who knows..It
wouldn't make sense if they didn't let you do it.

On 4/3/07, Hans Drexler [EMAIL PROTECTED] wrote:

On Tue, 03 Apr 2007 14:11:03 +0100, Richard Kirby wrote
 Hi Hans,

 The status line is output by the servlet engine - not Tapestry,
  since it is a core part of the HTTP spec.

 What you may be able to do, is create a javax.servlet.Filter which
 reads the response from Tapestry into a stream, hopefully including
 the status line - and then just re-output but with your new status
 line. Don't know if that will work though.

 Richard.


I already had a hunch that it would be something like this. Thanks for the
response. I will try to construct a filter. Never did that before, so it will
be a challenge :-)

 Hans Drexler wrote:
  We try to create a Tapestry-service that generates a Shoutcast stream. The
  problem is that the shoutcast response must have a status line that reads:
 
  ICY 200 OK
 
  Instead, the status line we get is always:
 
  HTTP/1.1 200 OK
 
  Many mediaplayers (WinAmp, Xmms, iTunes) accept the header with HTTP status
  line, but some do not. The ICY header is incorrect according to RFC 2616 
and I
  have been unable to generate a response with this status line.
 
  Does somebody have a clue on how we could spit out a response with the ICY
  like status line in it? Any help is appreciated.
 
 
 
  The code we use now is basically like this:
 
  private WebResponse _response;
 
  [...]
 
  private OutputStream initOutputStream(boolean metadata) throws 
IOException {
  OutputStream out = _response.getOutputStream(new 
ContentType(audio/mpeg));
 
  //Spit out Shoutcast-headers.
  _response.setHeader(icy-notice1,BRThis stream requires a
  href=\http://www.winamp.com/\;Winamp/aBR);
  _response.setHeader(icy-notice1,MusiController
  SHOUTcast-implementationBR);
  _response.setHeader(icy-name,MusiController);
  _response.setHeader(icy-genre,All sorts);
  
_response.setHeader(icy-url,http://musicontroller.sourceforge.net;);
  _response.setHeader(icy-pub,1);
  _response.setHeader(icy-br,192);
  if (metadata) _response.setIntHeader(icy-metaint,BUFFER_SIZE);
 
  log.debug(Outputstream initialized);
 
  return out;
  }
  [...]
 
  public void setResponse(WebResponse response) {
  _response = response;
  }
 
 
  
  Hans Drexler
 
 
  -
  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]



Hans Drexler
GeoTax en WOZ-Support b.v.
e: [EMAIL PROTECTED]


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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Prerendering a field

2007-04-03 Thread Anton Nikitin
Hi all,

Is there a quick way to trigger prerendering of some field (for a standard
component, like @TextField) before another field, similar to @FieldLabel's
prerender attribute?

I'm trying to find a workaround for T's trick where if I want field A
rewound before field B, I have to change sequence of A and B on the page.
Most times that's OK, but sometimes the looks suffer, while there's no clear
workaround.

Thanks,
A


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



Re: Prerendering a field

2007-04-03 Thread Jesse Kuhnert

None that I know of. It's extremely hacky as it is with just
FieldLabel / TextField.

On 4/3/07, Anton Nikitin [EMAIL PROTECTED] wrote:

Hi all,

Is there a quick way to trigger prerendering of some field (for a standard
component, like @TextField) before another field, similar to @FieldLabel's
prerender attribute?

I'm trying to find a workaround for T's trick where if I want field A
rewound before field B, I have to change sequence of A and B on the page.
Most times that's OK, but sometimes the looks suffer, while there's no clear
workaround.

Thanks,
A


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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Re: Prerendering a field

2007-04-03 Thread Andreas Andreou

http://tapestryjava.blogspot.com/2004/12/back-from-shoppingcom-defer-component.html
could give some ideas though...

On 4/4/07, Jesse Kuhnert [EMAIL PROTECTED] wrote:


None that I know of. It's extremely hacky as it is with just
FieldLabel / TextField.

On 4/3/07, Anton Nikitin [EMAIL PROTECTED] wrote:
 Hi all,

 Is there a quick way to trigger prerendering of some field (for a
standard
 component, like @TextField) before another field, similar to
@FieldLabel's
 prerender attribute?

 I'm trying to find a workaround for T's trick where if I want field A
 rewound before field B, I have to change sequence of A and B on the
page.
 Most times that's OK, but sometimes the looks suffer, while there's no
clear
 workaround.

 Thanks,
 A


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




--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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





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


Page w/o specification [T4.1.1]

2007-04-03 Thread Anton Nikitin
This probably has been answered in the past, sorry if I'm repeating.

Creating a simple page without specification (just the .html file, without
the .page) always throws PageNotFoundException: Page 'page name' not
found in application namespace.

However, documentation mentions
(http://tapestry.apache.org/tapestry4.1/usersguide/template.html):

In addition, any HTML template in the web application context is
considered a page, even if there is no matching page specification. For
simple pages that don't need to have any page-specific logic or properties,
there's no need for a page specification. Such a page may still use the
special Tapestry attributes (described in the following sections).


Is this a bug, or am I misinterpreting what's meant by simple page?

Thanks,
A


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



Re: T5 Hibernate long conversations (session-per-conversation)

2007-04-03 Thread Bill Holloway

Well, we will probably head into clustering some day.  What pattern,
then, can we use to do optimistic locking without hibernate long
conversations?  I don't think session-per-request can do it.

bill

On 4/3/07, Howard Lewis Ship [EMAIL PROTECTED] wrote:

My problem with session-per-conversation is that its totally
incompatible with clustering, since the objects in the detached
session are not propogated to other servers.

That being said; yes some kind of mechanism (as service, an ASO) to
hold onto the sessions between requests, to support detach and
reattach, etc.  The tiny bit of work I've done on tapestry-hibernate
(for T5) doesn't support this concept, but it can grow to encompass
it.

On 4/3/07, Bill Holloway [EMAIL PROTECTED] wrote:
 Has anyone implemented session-per-conversation (my preferred way to
 handle optimistic locking) in T5?  Right now, tapestry-hibernate
 implements session-per-request.

 I'm thinking an application state object is a good place to start here
 with methods like startConversation() and endConversation() with
 hibernate sessions managed by this service.

 Any thoughts?

 Bill

 --
 The future is here.  It's just not evenly distributed yet.

  -- Traditional

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




--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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





--
The future is here.  It's just not evenly distributed yet.

-- Traditional

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



RE: Prerendering a field

2007-04-03 Thread Anton Nikitin
Neat, that looks like it could work - thx Andreas!

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas
Andreou
Sent: Tuesday, April 03, 2007 11:56 PM
To: Tapestry users
Subject: Re: Prerendering a field

http://tapestryjava.blogspot.com/2004/12/back-from-shoppingcom-defer-compone
nt.html
could give some ideas though...

On 4/4/07, Jesse Kuhnert [EMAIL PROTECTED] wrote:

 None that I know of. It's extremely hacky as it is with just
 FieldLabel / TextField.

 On 4/3/07, Anton Nikitin [EMAIL PROTECTED] wrote:
  Hi all,
 
  Is there a quick way to trigger prerendering of some field (for a
 standard
  component, like @TextField) before another field, similar to
 @FieldLabel's
  prerender attribute?
 
  I'm trying to find a workaround for T's trick where if I want field A
  rewound before field B, I have to change sequence of A and B on the
 page.
  Most times that's OK, but sometimes the looks suffer, while there's no
 clear
  workaround.
 
  Thanks,
  A
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 Jesse Kuhnert
 Tapestry/Dojo team member/developer

 Open source based consulting work centered around
 dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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




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


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