PropertySelection

2006-06-01 Thread abuer
Hello, 
In a page that display a query form and query results together, 
I want to remember the property selected by the user for the last query.  I 
store this value in a page property, but I cannot get the PropertySelection to 
render using the previous value for the default value.  It reverts to the value 
of index 0.
My current solution below use LabeledPropertySelectionModel and results in 
duplicate option in the pull-down.
  
Any help appreciated,
Alex./

from Search.html
   tr

 tdstrongspan key=po-componentPO 
Component/span/strong/td

 tdselect jwcid=sg_po_component_filter

 option value=0Select Label /option

 /select/td

   /tr

from the Search.page
component id=sg_po_component_filter type=PropertySelection
binding name=model value=possibleComponents/
binding name=value value=poComponent/
/component

public abstract class SearchPage extends BasePage implements 
PageBeginRenderListener {

@Persist(session)
public abstract Component getPoComponent();
public abstract void  setPoComponent(Component poComponent);
public abstract IPropertySelectionModel getPossibleComponents();
public abstract void
setPossibleComponents(IPropertySelectionModel model);

public void pageBeginRender(PageEvent event) {
if (getPoComponent() != null)
setPossibleComponents(new 
LabeledPropertySelectionModel(getPossibleComponents(), 
getPoComponent().getName(), getPoComponent()));
   }
}

public class SelectionModelT extends Option implements 
IPropertySelectionModel, Serializable {
 private static final long serialVersionUID = 1L;
private ListT options;
this.options = new ArrayListT();
for (T obj: options) {
this.options.add(obj);
}
}

public int getOptionCount() {
return options.size()+1;
}

public Object getOption(int index) {
return getOptionObj(index);
}
public String getLabel(int index) {
return getOptionObj(index).getName();
}
public String getValue(int index) {
return getOptionObj(index).getCode();
}
public Object translateValue(String value) {
for (T obj : options) 
if (obj.getCode().equals(value))
return obj;
return null;
}
}

private Option getOptionObj(int index) {
return (Option) options.get(index);
}



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



@Persist documentation?

2006-06-01 Thread Jean-Eric Cuendet

Hi,
I'm unable to find @Persist annotation doc...
Could someone point me to some?
Thanks.
-jec

--
Best regards / Salutations.

Jean-Eric Cuendet
Senior developer / Technical support
Riskpro Technologies SA
Av. Louis-Ruchonnet 2
CH-1003 Lausanne
Switzerland

Direct: +41 21 637 0123
Principal : +41 21 637 0110
Fax   : +41 21 637 0111
Skype : jec.rptec
Web   : http://www.rptec.ch


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



Re: @Persist documentation?

2006-06-01 Thread Shing Hing Man
Have you  checked out the following?

http://jakarta.apache.org/tapestry/tapestry-annotations/index.html#Persist

Shing

--- Jean-Eric Cuendet [EMAIL PROTECTED] wrote:

 Hi,
 I'm unable to find @Persist annotation doc...
 Could someone point me to some?
 Thanks.
 -jec
 
 -- 
 Best regards / Salutations.
 
 Jean-Eric Cuendet
 Senior developer / Technical support
 Riskpro Technologies SA
 Av. Louis-Ruchonnet 2
 CH-1003 Lausanne
 Switzerland
 
 Direct: +41 21 637 0123
 Principal : +41 21 637 0110
 Fax   : +41 21 637 0111
 Skype : jec.rptec
 Web   : http://www.rptec.ch


 

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

Home page :
  http://uk.geocities.com/matmsh/index.html



___ 
Inbox full of spam? Get leading spam protection and 1GB storage with All New 
Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html

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



Re: @Persist documentation?

2006-06-01 Thread Jesse Kuhnert

http://jakarta.apache.org/tapestry/tapestry-annotations/index.html#Persist

On 6/1/06, Jean-Eric Cuendet [EMAIL PROTECTED] wrote:


Hi,
I'm unable to find @Persist annotation doc...
Could someone point me to some?
Thanks.
-jec

--
Best regards / Salutations.

Jean-Eric Cuendet
Senior developer / Technical support
Riskpro Technologies SA
Av. Louis-Ruchonnet 2
CH-1003 Lausanne
Switzerland

Direct: +41 21 637 0123
Principal : +41 21 637 0110
Fax   : +41 21 637 0111
Skype : jec.rptec
Web   : http://www.rptec.ch


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





--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.


Re: Visit object

2006-06-01 Thread Mário Lopes

On 6/1/06, Andreas Bulling [EMAIL PROTECTED] wrote:

On 01. Jun 2006 - 17:56:58, Mário Lopes wrote:
| Hi.
|
| I've been following Tapestry in Action to implement a Visit session
| object but I was unable to make it work. Declaring a getVisit(); as
| abstract and then calling it through Visit visit = (Visit) getVisit();
| seems to be deprecated.

Instead of using the deprecated Visit object as described in TiA
you should use an Application State Object (ASO) with session scope.
You should find examples in the list archives.


Following your advice, I've created my own class, called Visit
(original isn't it? :-) and added this to hivemind.xml

 contribution configuration-id=tapestry.state.ApplicationObjects
   state-object name=user-visit scope=session
 create-instance class=com.icom.crm_feup.Visit/
   /state-object
 /contribution

This is the code I've used to try accessing the Visit object:

@InjectState(user-visit)
public abstract Visit getVisit();

But it isn't work. It complains, on runtime, about the annotation
being done before.

Any ideas?

-- Mário



Hope this helps,
  Andreas

-
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: Visit object

2006-06-01 Thread Andreas Bulling
| Following your advice, I've created my own class, called Visit
| (original isn't it? :-) and added this to hivemind.xml
| 
|  contribution configuration-id=tapestry.state.ApplicationObjects
|state-object name=user-visit scope=session
|  create-instance class=com.icom.crm_feup.Visit/
|/state-object
|  /contribution
| 
| This is the code I've used to try accessing the Visit object:
| 
| @InjectState(user-visit)
| public abstract Visit getVisit();
| 
| But it isn't work. It complains, on runtime, about the annotation
| being done before.

Could you post the stack trace?

Andreas

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



Border question

2006-06-01 Thread Carl Pelletier
Hi, I'm looking for advise, tips or idea here. I'm beginning the development of a site in Tapestry 4.0 and I don't know how to implement all my levels of menu without creating many border page.What I'm trying to do is implementing component that will render my menu. The problem I have, is that all example I saw like the library example and others just have one level of menu.Us, we got 3. Each page include all the menu and should Highlight the corresponding one when you are in the good section, in the good subsection and in the good page.All menu are genereted server side so no need for _javascript_. The final sites will have many pages, like ~50 to 75 so we don't want to duplicate all the html code of each level menu to display the good menu.For now, The only way I saw I can
 do this is by making a border level3 wich include a border level2 wich include a border level1. The problem with that is that I need to have a border level 3 for each item in the level2 and so one...Don't forget that each item in the menu will be secure, so a logued user will see somes items of all menus but not necessary all items.this site is a admin site and will be bind with Hibernate. I don't use Spring, structs or anything like that...I joint a picture of the design for help.If you can give me some tips, some idea or best pratice on that, It's will be very appreciate. Sorry for bad english!Carl Pelletier-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Border question

2006-06-01 Thread Andreas Bulling
On 01. Jun 2006 - 14:06:48, Mark Stang wrote:
| The other option is to create your own menuing component.  Start with 
manually coding a couple of HTML pages to get the LF.  Then abstract it 
backwards into a component that creates the HTML on-the-fly. Then just add that 
component/components to each page.  Or put them all in a border page and change 
out the interior.

Is this the best practice for implementing for example a breadcrumb
or a multi-level menue?

The problem is caused by Tapestry's component-based approach:
You have to define the logical order (the tree-structure) of your pages 
manually
in a seperate file, directly in the pages or in a not portable component.
That's more difficult than in a actions/operations-based approach... :-(

Andreas

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



RE: Visit object

2006-06-01 Thread James Carman
Try renaming what you call the getter/setter.  See what that does.  There is
a deprecated getVisit() method on IPage.

-Original Message-
From: Mário Lopes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 01, 2006 4:35 PM
To: Tapestry users
Subject: Re: Visit object

This is the error reported

Error at context:/WEB-INF/Home.page, line 6, column 53: Method 'public
abstract com.icom.crm_feup.Visit com.icom.crm_feup.Home.getVisit()'
(declared in class com.icom.crm_feup.Home) has no implementation in
class com.icom.crm_feup.Home (or enhanced subclass $Home_0).

If I refresh the webpage it returns a different error:

Error: An error occured processing annotation
@org.apache.tapestry.annotations.InjectState(value=crm) of public
abstract com.icom.crm_feup.Visit com.icom.crm_feup.Home.getVisit():
Property visit has already been accounted for by the element at
Annotation @org.apache.tapestry.annotations.InjectState(value=crm) of
public abstract com.icom.crm_feup.Visit
com.icom.crm_feup.Home.getVisit().

I didn't include the Stack Trace since it was quite long.

Here's what I have in hivemodule.xml

  contribution configuration-id=tapestry.state.ApplicationObjects
state-object name=crm scope=session
  create-instance class=com.icom.crm_feup.Visit/
/state-object
  /contribution

And here's how my code looks like in the Home page

@InjectState(crm)
public abstract Visit getVisit();
public abstract void setVisit(Visit visit);
...
// coloca o operador na sessao
Visit visit = new Visit();
visit.setOperador(operador);

setVisit(visit);

Hope it helps.

-- Mário

On 6/1/06, Andreas Bulling [EMAIL PROTECTED] wrote:
 | Following your advice, I've created my own class, called Visit
 | (original isn't it? :-) and added this to hivemind.xml
 |
 |  contribution configuration-id=tapestry.state.ApplicationObjects
 |state-object name=user-visit scope=session
 |  create-instance class=com.icom.crm_feup.Visit/
 |/state-object
 |  /contribution
 |
 | This is the code I've used to try accessing the Visit object:
 |
 | @InjectState(user-visit)
 | public abstract Visit getVisit();
 |
 | But it isn't work. It complains, on runtime, about the annotation
 | being done before.

 Could you post the stack trace?

 Andreas

 -
 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: Border question

2006-06-01 Thread Mark Stang
There is another option to get around that restriction.  It is what Howard 
calls my mutant application.  I have one Frame.html/Frame.page/Frame.java.  
All of my other pages are popups.  There are about 5 or 6 of those.  In 
addition, I have 130 components.  None of my components have any border 
content, it is all in the Frame.  As part of the Frame I have Breadcrumbs and 
something we call Headcrumbs.  Headcrumbs are a higher level menu.  So, we can 
have a bunch of breadcrumbs within each headcrumb.  Headcrumbs are a group of 
breadcrumbs.  Breadcrumbs are reusable across multiple Headcrumbs.  Any one 
breadcrumb knows nothing about any of its fellow breadcrumbs in a headcrumb.

Basically, we have a wizard application with 130 screens.

The border component replaces pages, we have one page that replaces components. 
 There is an age-old Tapestry question about whether you create components or 
pages?  What is your level of re-use?  We chose re-use at the level of 
components.

regards,

Mark


-Original Message-
From: Andreas Bulling on behalf of Andreas Bulling
Sent: Thu 6/1/2006 2:29 PM
To: Tapestry users
Subject: Re: Border question
 
On 01. Jun 2006 - 14:06:48, Mark Stang wrote:
| The other option is to create your own menuing component.  Start with 
manually coding a couple of HTML pages to get the LF.  Then abstract it 
backwards into a component that creates the HTML on-the-fly. Then just add that 
component/components to each page.  Or put them all in a border page and change 
out the interior.

Is this the best practice for implementing for example a breadcrumb
or a multi-level menue?

The problem is caused by Tapestry's component-based approach:
You have to define the logical order (the tree-structure) of your pages 
manually
in a seperate file, directly in the pages or in a not portable component.
That's more difficult than in a actions/operations-based approach... :-(

Andreas

-
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: Border question

2006-06-01 Thread Andreas Bulling
Hi Mark,

sounds as a solution even if I don't understand what you were trying to 
explain...
Some sample code would help a lot, is there something you can show us/commit
to one of the widely known Tapestry repositories?

Cheers,
  Andreas

On 01. Jun 2006 - 14:51:00, Mark Stang wrote:
| There is another option to get around that restriction.  It is what Howard 
calls my mutant application.  I have one Frame.html/Frame.page/Frame.java.  
All of my other pages are popups.  There are about 5 or 6 of those.  In 
addition, I have 130 components.  None of my components have any border 
content, it is all in the Frame.  As part of the Frame I have Breadcrumbs and 
something we call Headcrumbs.  Headcrumbs are a higher level menu.  So, we can 
have a bunch of breadcrumbs within each headcrumb.  Headcrumbs are a group of 
breadcrumbs.  Breadcrumbs are reusable across multiple Headcrumbs.  Any one 
breadcrumb knows nothing about any of its fellow breadcrumbs in a headcrumb.
| 
| Basically, we have a wizard application with 130 screens.
| 
| The border component replaces pages, we have one page that replaces 
components.  There is an age-old Tapestry question about whether you create 
components or pages?  What is your level of re-use?  We chose re-use at the 
level of components.
| 
| regards,
| 
| Mark


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



Re: Issues with Label Components with Tapestry 4.0

2006-06-01 Thread Jesse Kuhnert

Sure, but at that point you are basically overriding the behaviour provided
by the ValidationDelegate when it does before/after field rendering (not
talking about FieldLabel).

The FieldLabel component already supports informal parameters.

I noticed in your first email you mentioned trying to do this with something
like

label jwcid=mycompid class=class1 class2  and only saw class1 output.

Try doing this instead (though I agree it sounds like a bug somehow):

label jwcid=mycompid class=ognl:'class class2' /

On 6/1/06, Matt Raible [EMAIL PROTECTED] wrote:


Is there an easy way to subclass FieldLabel and override the
renderComponent() method to move writeLabelPrefix and
writeLabelSuffix to be inside label?

Thanks,

Matt

On May 31, 2006, at 2:51 PM, Ryan Holmes wrote:

 Your problem getting the span tag where you want it is due to how
 the FieldLabel component renders itself. Here's the relevant part
 of FieldLabel.renderComponent():

delegate.writeLabelPrefix(field, writer, cycle);
writer.begin(label);
if (id != null)
writer.attribute(for, id);
delegate.writeLabelAttributes(writer, cycle, field);
renderInformalParameters(writer, cycle);
writer.print(displayName, getRaw());
writer.end();
delegate.writeLabelSuffix(field, writer, cycle);


 You could argue that writeLabelPrefix() and writeLabelSuffix()
 should both be inside the label tag (makes sense to me), but the
 current code is symmetrical and not necessarily wrong. Your best
 bet is probably to override the FieldLabel component with your own
 version that renders the delegate prefix and/or suffix inside the
 label tag. And I'm sure you won't hesitate to file a bug report if
 you  feel strongly about it ;)

 -Ryan


 Matt Raible wrote:

 Matt Raible wrote:

 Andreas Andreou wrote:

 try component.getBinding(class)
 if that's not null, do a getObject() on it



 Thanks.  This works, but it also prints out duplicate class
 attributes.

 class=text large error class=text large


 It'd be nice to have something like:

 writer.appendAttribute(class, values to append);

 Another question - it seems my full label and input is
 getting wrapped with

 font color=red

 Is there anyway to get rid of that?  It's problematic b/c the
 closing /font isn't getting rendered until right before /form.


 Fixed this by using:

public void writeLabelPrefix(IFormComponent component,
 IMarkupWriter writer,
 IRequestCycle cycle) {
// does nothing put prevent font color=red from getting
 written
}


 Thanks,

 Matt


 Matt Raible wrote:

 Hmmm, I'm guessing the answers to my questions below are no,
 this isn't possible. ;-)

 Here's another question - is it possible in my custom Validator
 to get the existing CSS classes on a component?  For example, I
 currently have:

public void writeLabelAttributes(IMarkupWriter writer,
 IRequestCycle cycle, IFormComponent component) {
if (isInError(component)) {
writer.attribute(class, error);
}
}

public void writeAttributes(IMarkupWriter writer,
 IRequestCycle cycle,
IFormComponent component,
 IValidator validator) {
if (isInError()) {
writer.attribute(class, error);
}
}

 But I'd prefer to have something like this:

public void writeLabelAttributes(IMarkupWriter writer,
 IRequestCycle cycle, IFormComponent component) {
if (isInError(component)) {
writer.attribute(class, error  +
 component.getAttribute(class));
}
}

public void writeAttributes(IMarkupWriter writer,
 IRequestCycle cycle,
IFormComponent component,
 IValidator validator) {
if (isInError()) {
writer.attribute(class, error  +
 component.getAttribute(class));
}
}

 In other words, is there a method on component that allows me
 to get the current CSS classes?

 Matt

 Matt Raible wrote:

 I have two different Label components I'm trying to create.
 Issue #1
 ---
 The first is a simple component (just a Label.jwc and
 Label.html file in WEB-INF) that writes a label.  I'd like
 to include the option to write a required indicator.
 However, I'm having a difficult time retrieving a parameter's
 value.  Here's what I have so far:

 Label.jwc
 component-specification allow-informal-parameters=yes
parameter name=key required=yes/
parameter name=class required=no/
component id=label type=Any inherit-informal-
 parameters=yes/
 /component-specification

 Label.html
 label jwcid=labelspan jwcid=@Insert
 value=ognl:getMessages().getMessage(key)/ div jwcid=@If
 condition=ognl:class == 'required'span class=req */
 span/label

 I'm pretty sure class won't work as a parameter name b/c
 I've seen a stacktrace using this already.  Regardless, let's
 pretend it does (I've tried using other names).  Here's the
 desired usage:

 

RE: Border question

2006-06-01 Thread Mark Stang
Andreas,

Here is an excerpt from Frame.html:

!--This is our headcrumbs and breadcrumbs, which we don't show if it is the 
portal page.--
span jwcid=@contrib:FormConditional condition=ognl:! 
page.visit.currentTasklet.isItPortal()
   span jwcid=@contrib:FormConditional condition=ognl:! 
page.visit.currentTasklet.isPostInstallWizard()
div class=headcrumbs NOWRAPspan jwcid=@HeadCrumbs//div
   /span
   div class=breadcrumbsspan jwcid=@BreadCrumbs//div
/span
!-- common errors for every page --
span jwcid=validationErrors/
!-- Notes for each page --
span jwcid=@contrib:FormConditional 
condition=ognl:page.visit.currentState.isShowNote()
   div class=messagetextimg src=images/notes_icon.gif width=12 
height=12 border=0nbsp;span jwcid=@Insert raw=true 
value=ognl:note/
   /div
/span
!-- the Tapestry compenent that swaps out components --
span jwcid=@TaskletView/

TaskletView.java:

This implementation of renderComponent(), gets a component from another page 
and calls render on it.  We use a single holder page that has instances of 
all 130 components.  In Tapestry you can get a component from another page and 
display it in the current page.  So, our page stays the same, but the one 
component in the middle swaps in and out.

import org.apache.tapestry.AbstractComponent;

public abstract class TaskletView
extends AbstractComponent
{
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
{
Tasklet tasklet = ((Visit)getPage().getVisit()).getCurrentTasklet();
TaskletState ts = (TaskletState)tasklet.getCurrentState();
String pageForCard = ts.getPageName();
IPage cardPage = cycle.getPage(pageForCard);
String cardName = tasklet.getCurrentState().getStateName();
BaseComponent component = 
(BaseComponent)cardPage.getComponent(cardName);
if (component instanceof PageRenderListener)
{
IPage page = component.getPage();
page.beginPageRender();
}
component.render(writer, cycle);
}
}

I have attached a sample screen (snapshot7).  The Headcrumbs start with Main.  
The Breadcrumbs have checkmarks besides them.  The note is in green.  
Everything between the green note and the buttons is component.

In snapshot8, the headcrumbs and breadcrumbs have changed because we are in a 
different part of the application.  Everything between the green note and the 
buttons is the component.  Each of these components are just standard Tapestry 
components.  The headcrumbs and breadcrumbs are each tapestry components that 
redraw themselves every time we change screens.

Cheers,

Mark

-Original Message-
From: Andreas Bulling on behalf of Andreas Bulling
Sent: Thu 6/1/2006 3:08 PM
To: Tapestry users
Subject: Re: Border question
 
Hi Mark,

sounds as a solution even if I don't understand what you were trying to 
explain...
Some sample code would help a lot, is there something you can show us/commit
to one of the widely known Tapestry repositories?

Cheers,
  Andreas

On 01. Jun 2006 - 14:51:00, Mark Stang wrote:
| There is another option to get around that restriction.  It is what Howard 
calls my mutant application.  I have one Frame.html/Frame.page/Frame.java.  
All of my other pages are popups.  There are about 5 or 6 of those.  In 
addition, I have 130 components.  None of my components have any border 
content, it is all in the Frame.  As part of the Frame I have Breadcrumbs and 
something we call Headcrumbs.  Headcrumbs are a higher level menu.  So, we can 
have a bunch of breadcrumbs within each headcrumb.  Headcrumbs are a group of 
breadcrumbs.  Breadcrumbs are reusable across multiple Headcrumbs.  Any one 
breadcrumb knows nothing about any of its fellow breadcrumbs in a headcrumb.
| 
| Basically, we have a wizard application with 130 screens.
| 
| The border component replaces pages, we have one page that replaces 
components.  There is an age-old Tapestry question about whether you create 
components or pages?  What is your level of re-use?  We chose re-use at the 
level of components.
| 
| regards,
| 
| Mark


-
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: Border question

2006-06-01 Thread Mark Stang
Sorry, forgot about the list filtering attachments:

http://www.markjstang.com/tapestry/

regards,

Mark


-Original Message-
From: Mark Stang
Sent: Thu 6/1/2006 3:57 PM
To: Tapestry users
Subject: RE: Border question
 
Andreas,

Here is an excerpt from Frame.html:

!--This is our headcrumbs and breadcrumbs, which we don't show if it is the 
portal page.--
span jwcid=@contrib:FormConditional condition=ognl:! 
page.visit.currentTasklet.isItPortal()
   span jwcid=@contrib:FormConditional condition=ognl:! 
page.visit.currentTasklet.isPostInstallWizard()
div class=headcrumbs NOWRAPspan jwcid=@HeadCrumbs//div
   /span
   div class=breadcrumbsspan jwcid=@BreadCrumbs//div
/span
!-- common errors for every page --
span jwcid=validationErrors/
!-- Notes for each page --
span jwcid=@contrib:FormConditional 
condition=ognl:page.visit.currentState.isShowNote()
   div class=messagetextimg src=images/notes_icon.gif width=12 
height=12 border=0nbsp;span jwcid=@Insert raw=true 
value=ognl:note/
   /div
/span
!-- the Tapestry compenent that swaps out components --
span jwcid=@TaskletView/

TaskletView.java:

This implementation of renderComponent(), gets a component from another page 
and calls render on it.  We use a single holder page that has instances of 
all 130 components.  In Tapestry you can get a component from another page and 
display it in the current page.  So, our page stays the same, but the one 
component in the middle swaps in and out.

import org.apache.tapestry.AbstractComponent;

public abstract class TaskletView
extends AbstractComponent
{
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
{
Tasklet tasklet = ((Visit)getPage().getVisit()).getCurrentTasklet();
TaskletState ts = (TaskletState)tasklet.getCurrentState();
String pageForCard = ts.getPageName();
IPage cardPage = cycle.getPage(pageForCard);
String cardName = tasklet.getCurrentState().getStateName();
BaseComponent component = 
(BaseComponent)cardPage.getComponent(cardName);
if (component instanceof PageRenderListener)
{
IPage page = component.getPage();
page.beginPageRender();
}
component.render(writer, cycle);
}
}

I have attached a sample screen (snapshot7).  The Headcrumbs start with Main.  
The Breadcrumbs have checkmarks besides them.  The note is in green.  
Everything between the green note and the buttons is component.

In snapshot8, the headcrumbs and breadcrumbs have changed because we are in a 
different part of the application.  Everything between the green note and the 
buttons is the component.  Each of these components are just standard Tapestry 
components.  The headcrumbs and breadcrumbs are each tapestry components that 
redraw themselves every time we change screens.

Cheers,

Mark

-Original Message-
From: Andreas Bulling on behalf of Andreas Bulling
Sent: Thu 6/1/2006 3:08 PM
To: Tapestry users
Subject: Re: Border question
 
Hi Mark,

sounds as a solution even if I don't understand what you were trying to 
explain...
Some sample code would help a lot, is there something you can show us/commit
to one of the widely known Tapestry repositories?

Cheers,
  Andreas

On 01. Jun 2006 - 14:51:00, Mark Stang wrote:
| There is another option to get around that restriction.  It is what Howard 
calls my mutant application.  I have one Frame.html/Frame.page/Frame.java.  
All of my other pages are popups.  There are about 5 or 6 of those.  In 
addition, I have 130 components.  None of my components have any border 
content, it is all in the Frame.  As part of the Frame I have Breadcrumbs and 
something we call Headcrumbs.  Headcrumbs are a higher level menu.  So, we can 
have a bunch of breadcrumbs within each headcrumb.  Headcrumbs are a group of 
breadcrumbs.  Breadcrumbs are reusable across multiple Headcrumbs.  Any one 
breadcrumb knows nothing about any of its fellow breadcrumbs in a headcrumb.
| 
| Basically, we have a wizard application with 130 screens.
| 
| The border component replaces pages, we have one page that replaces 
components.  There is an age-old Tapestry question about whether you create 
components or pages?  What is your level of re-use?  We chose re-use at the 
level of components.
| 
| regards,
| 
| Mark


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

XMLHTTPRequest within tapestry

2006-06-01 Thread Peter Dawn

hi all,
i am trying to implement XMLHTTPRequest within my web app. now for
starters i would like to display a log file (which is constantly
updating), within my web app. how should i display its contents
without refreshing the page manually (it should display information as
the log gets filled in).
this is my code for JavaScript within the html file so far, but i dont
think its working,

function createXMLHTTP() {
var arrSignatures = [MSXML2.XMLHTTP.5.0, MSXML2.XMLHTTP.4.0,
 MSXML2.XMLHTTP.3.0, 
MSXML2.XMLHTTP,
 Microsoft.XMLHTTP];
for (var i=0; i  arrSignatures.length; i++) {
try {
var oRequest = new ActiveXObject (arrSignatures[i]);
return oRequest;
}
catch (oError) {
}
}   
throw new Error (MSXML is not installed on your system);  
  
}

var oRequest = createXMLHTTP();
oRequest.open(get, c:\log.txt, true);
oRequest.send(null);
alert(status is  + oRequest.status + ( + oRequest.statusText + ) );
alert(Response is + oRequest.responseText);

can somebody help me out.

thanks.

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



Re: Border question

2006-06-01 Thread Omar Valerio

Hi Carl,

You should use some sort of JavaScript based menu generation solution. They
are plenty of them, most of them allow you to configure menu generation
based on some sort of configuration file, or you can even handle the JS been
written on the fly by your web engine. Personally I use:

FREESTYLE MENUS v1.0 RC (c) 2001-2005 Angus Turnbull,
http://www.twinhelix.com

It is generated via an HTML List,  like this:

span
ul class=menulist id=listMenuRoot
 lia href=# jwcid=@ActionLink listener=ognl: listeners.goHome
Home/a/li
 lia href=#Cataacute;logos/a
  ul
   lia href=# jwcid=@ActionLink listener=ognl:
listeners.goVistaRegionRegiones./a
   /li
   lia href=# jwcid=@ActionLink listener=ognl:
listeners.goVistaDistritoDistritos./a
   /li
   lia href=# jwcid=@ActionLink listener=ognl:
listeners.goVistaFuerzaFuerzas./a
   /li
  /ul   !-     !
  lia jwcid=@ServiceLink service=restart
href=void(0)Salir/a/li
/ul

script type=text/javascript
!-- Script menu starts here
var listMenu = new FSMenu('listMenu', true, 'visibility', 'visible',
'hidden');
listMenu.cssLitClass = 'highlighted';

var arrow = null;
if (document.createElement  document.documentElement) {
 arrow = document.createElement('span');
 arrow.appendChild(document.createTextNode(''));
 arrow.className = 'subind';
}

addEvent(window, 'load', new Function('listMenu.activateMenu(listMenuRoot,
arrow)'));
//Script menu ends here --
/script

   hr /

/span
Regards,
---
Omar V.M.

On 6/1/06, Andreas Bulling [EMAIL PROTECTED] wrote:


Hi Mark,

sounds as a solution even if I don't understand what you were trying to
explain...
Some sample code would help a lot, is there something you can show
us/commit
to one of the widely known Tapestry repositories?

Cheers,
Andreas

On 01. Jun 2006 - 14:51:00, Mark Stang wrote:
| There is another option to get around that restriction.  It is what
Howard calls my mutant application.  I have one 
Frame.html/Frame.page/Frame.java.  All
of my other pages are popups.  There are about 5 or 6 of those.  In
addition, I have 130 components.  None of my components have any border
content, it is all in the Frame.  As part of the Frame I have Breadcrumbs
and something we call Headcrumbs.  Headcrumbs are a higher level menu.  So,
we can have a bunch of breadcrumbs within each headcrumb.  Headcrumbs are
a group of breadcrumbs.  Breadcrumbs are reusable across multiple
Headcrumbs.  Any one breadcrumb knows nothing about any of its fellow
breadcrumbs in a headcrumb.
|
| Basically, we have a wizard application with 130 screens.
|
| The border component replaces pages, we have one page that replaces
components.  There is an age-old Tapestry question about whether you create
components or pages?  What is your level of re-use?  We chose re-use at the
level of components.
|
| regards,
|
| Mark


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




Re: Unable to read OGNL expression 'parsed OGNL expression'

2006-06-01 Thread Bryan Lewis
Hard to say without seeing the java code and page spec.  It looks like
the page class should have a property model that's returned by a
getModel() method.  (That's the object you're calling the bean?)  I'm
guessing you should have something like:

public abstract class MyPage ...  {
public abstract MyBean getModel();
}

and

public class MyBean ... {
public String getWord() { // this getter shouldn't be abstract
return word;
}
}

Is there more to the error message?

You  could put some log messages in the various getter methods to see if
they're being called, or whether there's some other problem after
they're called like a NPE.



Rui Pacheco wrote:

 Hi all

 I have a couple of webpages on my web application where this error
 occurrs
 and I cant find out whats causing. Apparently these pages are no
 different
 from the other pages that work correctly.

 When I call my page, it complains of the getter method of one of my form
 elements. I checked the class I use as a model and both the variable
 and the
 getter and setter are there. I checked the HTML tag and it seems to be
 ok.
 The bean that corresponds the template also has a getter and setter
 for that
 field, both public and abstract.

 This is the offending line. Could you give me a hand, please?

 tdtextarea jwcid=[EMAIL PROTECTED] value=ognl:model.word
 validators=validators:required,maxLength=150 cols=50 rows=15
 class=itemsarea/textarea/td



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



submit listener not getting invoked??

2006-06-01 Thread Aninder Makkar
Hi Guys, 
  Im using a submit button in the form ,
  
  input jwcid=[EMAIL PROTECTED] listener=ognl:listeners.submit 
disabled=ognl:disable id=ognl:submitId  /
  
  initially when the page renders ,disable=true and id = aaa
  this form displays a tree structure data and as the user gets to the  leaf 
node i call a javascript function which sets disabled=false and  id=bbb
  
  however when i submit the form the listener method is not getting invoked???
  
  why ? 
  
  any help will be appreciated
  Aninder
  
  


-
Feel free to call! Free PC-to-PC calls. Low rates on PC-to-Phone.  Get Yahoo! 
Messenger with Voice

Re: XMLHTTPRequest within tapestry

2006-06-01 Thread Ryan Holmes
Have you checked out DWR (http://getahead.ltd.uk/dwr/)? It might be a 
good fit for what you're trying to do and it's framework agnostic, so it 
will work fine with Tapestry 3. It's also pretty darn easy to use.


-Ryan

Peter Dawn wrote:


just tried to implement it now. the country list example runs fine.
but am not sure how should i go about with something simple like a
hello world or just displaying the contents of a dummy file. it might
sound a very simple thing, i guess i am trying to get the basics.

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



Running the Tapestry Tutorial

2006-06-01 Thread Murray Collingwood

Hi folks

Sorry, this is a real newby question - how do you run the Tapestry Tutorial
in Eclipse?

I have installed Eclipse 3.1 (C:\Eclipse) and downloaded the Tapestry
Tutorial zip.  I extracted the Tutorial files into a folder -
C:\TapestryTutorial

I found a file called INFO.txt and tried to follow the instructions here
but they didn't help me find anything to work with.

The contents of the Tapestry Tutorial zip look nothing like the directory
layouts described on the Tapestry Quickstart page.
http://jakarta.apache.org/tapestry/QuickStart/index.html#Pre-requisistes

I must be missing something basic - somebody please help.

Cheers
mc



--
Murray Collingwood
Focus Computing
p +61 415 24 26 24
http://www.focus-computing.com.au


Re: submit listener not getting invoked??

2006-06-01 Thread Jesse Kuhnert

I think tapestry expects the id to be synchronized with the id of a valid
listener that it knows about...Changing the submit button id on the fly like
that will likely get undesired results unless you also change some of the
hidden form input fields to reflect your change.

Why do you need to manually set the id of the button or change it at all?

On 6/1/06, Aninder Makkar [EMAIL PROTECTED] wrote:


Hi Guys,
  Im using a submit button in the form ,

  input jwcid=[EMAIL PROTECTED] listener=ognl:listeners.submit
disabled=ognl:disable id=ognl:submitId  /

  initially when the page renders ,disable=true and id = aaa
  this form displays a tree structure data and as the user gets to
the  leaf node i call a javascript function which sets disabled=false
and  id=bbb

  however when i submit the form the listener method is not getting
invoked???

  why ?

  any help will be appreciated
  Aninder




-
Feel free to call! Free PC-to-PC calls. Low rates on PC-to-Phone.  Get
Yahoo! Messenger with Voice





--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.


Re: Running the Tapestry Tutorial

2006-06-01 Thread Jesse Kuhnert

No idea what the tutorial stuff is showing, but I do know if you check out
either tacos (http://tacos.sourceforge.net ) or the current tapestry4 trunk
version (trunk from either project) you will find eclipse shared run
configurations for the tacos demo or the upcoming (unreleased / documented)
tapestry4.1 tutorial application.

On 6/2/06, Murray Collingwood [EMAIL PROTECTED] wrote:


Hi folks

Sorry, this is a real newby question - how do you run the Tapestry
Tutorial
in Eclipse?

I have installed Eclipse 3.1 (C:\Eclipse) and downloaded the Tapestry
Tutorial zip.  I extracted the Tutorial files into a folder -
C:\TapestryTutorial

I found a file called INFO.txt and tried to follow the instructions here
but they didn't help me find anything to work with.

The contents of the Tapestry Tutorial zip look nothing like the directory
layouts described on the Tapestry Quickstart page.
http://jakarta.apache.org/tapestry/QuickStart/index.html#Pre-requisistes

I must be missing something basic - somebody please help.

Cheers
mc



--
Murray Collingwood
Focus Computing
p +61 415 24 26 24
http://www.focus-computing.com.au





--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.


Re: Unable to read OGNL expression 'parsed OGNL expression'

2006-06-01 Thread Jesse Kuhnert

Perhaps a message sort of like source is null for expression blah blah?

On 6/1/06, Bryan Lewis [EMAIL PROTECTED] wrote:


Hard to say without seeing the java code and page spec.  It looks like
the page class should have a property model that's returned by a
getModel() method.  (That's the object you're calling the bean?)  I'm
guessing you should have something like:

public abstract class MyPage ...  {
public abstract MyBean getModel();
}

and

public class MyBean ... {
public String getWord() { // this getter shouldn't be abstract
return word;
}
}

Is there more to the error message?

You  could put some log messages in the various getter methods to see if
they're being called, or whether there's some other problem after
they're called like a NPE.



Rui Pacheco wrote:

 Hi all

 I have a couple of webpages on my web application where this error
 occurrs
 and I cant find out whats causing. Apparently these pages are no
 different
 from the other pages that work correctly.

 When I call my page, it complains of the getter method of one of my form
 elements. I checked the class I use as a model and both the variable
 and the
 getter and setter are there. I checked the HTML tag and it seems to be
 ok.
 The bean that corresponds the template also has a getter and setter
 for that
 field, both public and abstract.

 This is the offending line. Could you give me a hand, please?

 tdtextarea jwcid=[EMAIL PROTECTED] value=ognl:model.word
 validators=validators:required,maxLength=150 cols=50 rows=15
 class=itemsarea/textarea/td



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





--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.


Re: submit listener not getting invoked??

2006-06-01 Thread Jesse Kuhnert

Sounds good :)

Just as an fyi though, it's pretty easy to define images using css classes
instead of id based definitions..Ie

.myClassName {
 background-image:url(something.gif)
}

Then you just use different classes for different buttons.

On 6/2/06, Aninder Makkar [EMAIL PROTECTED] wrote:


id=aaa has a faded look image for the submit button and id=bbb has a
normal image for the submit button .

  even i suspect the same thing as you said , i checked out with my
front  ender and he thinks there is no way of referring 2 images from the
same  style sheet (so that the id remains the same)

  i guess i need a quick crash course in css

  but then i gotto finish this thing today

  so basically wot im trying to do is a disabled button(with a faded
look  image) which gets enabled using  javascript( which also has to  change
the image) and when clicked calls the listener method on the  java class.

  and when i was about to do a send on this mail @ImageButton appeared
on  my mind horizon , and i think this is exactly what Mr Howard orders
in  this situation,
  anyway thanks for your help :)

  Aninder

Jesse Kuhnert [EMAIL PROTECTED] wrote:  I think tapestry expects the id
to be synchronized with the id of a valid
listener that it knows about...Changing the submit button id on the fly
like
that will likely get undesired results unless you also change some of the
hidden form input fields to reflect your change.

Why do you need to manually set the id of the button or change it at all?

On 6/1/06, Aninder Makkar  wrote:

 Hi Guys,
   Im using a submit button in the form ,

[input]
 disabled=ognl:disable id=ognl:submitId  /

   initially when the page renders ,disable=true and id = aaa
   this form displays a tree structure data and as the user gets to
 the  leaf node i call a javascript function which sets disabled=false
 and  id=bbb

   however when i submit the form the listener method is not getting
 invoked???

   why ?

   any help will be appreciated
   Aninder




 -
 Feel free to call! Free PC-to-PC calls. Low rates on PC-to-Phone.  Get
 Yahoo! Messenger with Voice




--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com





--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.