Tapestry 5 XML tag(s)

2007-07-04 Thread Ryan Cuprak

Hello,
 With Tapestry 5 - where can I find information on how the new xml  
tags work - like t:pagelink / etc? I have done quite a bit of work  
with 4 and am a little disoriented without the jwcids etc. Not sure  
what I can put instead of 'pagelink'. I interpret entries on the  
component reference as attributes on the 't' tag?


 Thanks,
 -Ryan

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



Multiple 'hidden' fields for the same for loop

2006-11-11 Thread Ryan Cuprak
Hello,
 Just was curious if the multiple entries for 'prompts' was a cause for 
concern? 'prompts' is the id of a For loop. I am puzzled why it would appear 
twice.
 I am using Tapestry 4.1 downloaded October 15th or so. 

 Thanks,
 -Ryan


   form method=post action=/survey/direct.svc id=form

div style=display:none; id=formhiddeninput type=hidden name=formids 
value=prompts,question,question_0/
input type=hidden name=component value=form/
input type=hidden name=page value=survey/
input type=hidden name=session value=T/
input type=hidden name=submitmode value=/
input type=hidden name=submitname value=/
input type=hidden name=prompts 
value=VZH4sIAFvzloG1uIhBJb8oXS85P780XS8LiHPzU1Jz9NyKUlPd8otyA0tTi0sy8/MkSqtXLJh8U5OJgaGiiEEGmxaY0ndXeLlULO12MzEw+TBwxhdChUsYhHyyEssS9XMS89L1g0uKMvPSrX0YuOEKPF1KGISRlHjmlaSmpxZZVxSUMKgF5KQmFqcqpKQWJxdlJqUqVOaXFimkpabmAE0pVsjPU3AqLc7QA/pGEGSAHsgAPagBQo8WLPne2G7BxMDoycBalphTmgr0ggBCnV9pblJqUduaqbLcUx50g3xYwMDAwAgAKt5FqB8BAAA=/
input type=hidden name=prompts 
value=VZH4sIAG2QP08CMRiHXw4wCpggbEYSBhMTh2PVYDRGJDlzmBgHR1KPN0fxuJ5tDw4HExaNccXBwcTBkW/gB3A3xjAaJxddHFztAf4ZGNrh16e/9nn77xAXHJYZt3WLMd/WG2o1WQ0dveI7knoObtUZtXDPRyEpc597/cFO+WigQcSE6ao1PBQS0maDtEjBl9QpmFTIYsBhYVLtT9HH02xicXX9XgPNhJnq8TiWkBk1OcS1C/uSU9cumpD8BYyShOw/xHAl2siLgafygzqRSyLfYT7P2+jWkG8ovbmQ1kNaH9OZ19u7r+75irIwIN4ijo/qv+k/btdvHiI/61/lkr2XSw0g8ABAU2XZIRR66puck04oG3Qfc9cP5CYa1sUEPcER3o6pPaEuzU+axGiw7YtUa3vt7VPNwVCaHIXHXIFGyYRUtYbC4tQLvY/hFKLD2oiEWIU4KMIoFb4jYaqMTRUF30y8K0nRAQAA/
/div

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



Tapestry 4.1.1 Dojo (startup question)

2006-10-14 Thread Ryan Cuprak

Hello,
 Quick question with tapestry 4.1.1 - is there a default border  
component or do I still have to write my own?



 Using my existing border component which worked with Tapestry 4.0.x  
and Dojo I now get:
 FATAL: Could not load 'dojo.logging.Logger'; last tried  
'__package__.js'
 FATAL: Could not load 'dojo.logging.Logger'; last tried  
'__package__.js


 Border.html:
html jwcid=shell
head jwcid=[EMAIL PROTECTED]
  script type=text/javascript
  djConfig = { isDebug: false,
   baseRelativePath: js/dojo,
   preventBackButtonFix: false,
   parseWidgets: false
 };
  /script
  script jwcid=@Any type=text/javascript src=ognl:baseURL + '/ 
js/dojo/dojo.js'/script

/head
body jwcid=@Body 
span jwcid=@RenderBody/
/body
/html

 What's the proper approach in 4.1.1 with the embedded dojo?

 Thanks!
 -Ryan

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



Instructions for building 4.1

2006-10-10 Thread Ryan Cuprak

Hello,
 Just curious if there are instructions for building Tapestry 4.1  
from source/version control?
 I did find http://tapestry.apache.org/tapestry4.1/download.html but  
I am not quiet sure what I need setup. I have begun looking into  
maven but it is a bit tangential to tapestry 4.1.


Thanks,
-Ryan

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



Quick Contrib:Table question

2006-08-16 Thread Ryan Cuprak
Hello, 
 I am working creating a table for which the number of columns is dynamic (user 
can control which columns they want displayed). What is the proper approach for 
implementing the behavior? 

  Thus far I created an implementation of ITableColumnModel which then returns 
the custom set of columns. I initially returned SimpleTableColumn instances but 
was getting a 'Unable to read OGNL expression 'parsed OGNL expression' of 
[EMAIL PROTECTED]/image/bands.tableColumns]: tableColumnRenderer' exception 
(src below). After getting this exception I thought my approach might be wrong. 
Looking over the code I was a little puzzled on how my column would extract the 
values from the model etc. Looking through the contrib:table source I chanced 
upon 'ExpressionTableColumn'. There are no java docs so I am not quiet sure how 
it is supposed to be used. From the title I 'think' this would take ognl 
expressions and retrieve the values from my data model? However, I am not quiet 
sure how to contruct an instance - where/what do I use for an 
ExpressionEvaluator? 

Page spec:
 component id=bands type=Contrib:Table
binding name=source value=tableModel/
binding name=columns value=ognl:tableColumnModel/
binding name=rowsClass value=beans.evenOdd.next/
binding name=columnsClass value=literal:title/
/component 

My TableColumnModel (only one field, was trying to get it working first..):
 public class BandSummaryColumnModel implements ITableColumnModel {

private static final Logger logger = 
Logger.getLogger(BandSummaryColumnModel.class);

private MapString, ITableColumn _columns;

public BandSummaryColumnModel() {
if(logger.isDebugEnabled()) logger.debug(Instantiating 
BandSummaryColumnModel);
_columns = new HashMapString,ITableColumn();
_columns.put(callPointH,new 
SimpleTableColumn(callPointH,callPointH,true));
}

public int getColumnCount() {
if(logger.isDebugEnabled()) logger.debug(Column count:  + 
_columns.size());
return _columns.size();
}

public ITableColumn getColumn(String string) {
if(logger.isDebugEnabled()) logger.debug(Column requested:  + string);
return _columns.get(string);
}

public Iterator getColumns() {
if(logger.isDebugEnabled()) logger.debug(Column iterator requested);
return _columns.entrySet().iterator();
}
}

 Thanks!
 Ryan



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



Re: Quick Contrib:Table question (how to get an ExpressionEvaluator?)

2006-08-16 Thread Ryan Cuprak

 Thanks,
 That is much simpler!
 For the ExpressionTableColumn I need a ExpressionEvaluator as the last 
parameter. I think it is a tapestry service (still digging through the binding 
files), thought this would work:
@InjectObject(infrastructure:tapestry.ognl.ExpressionEvaluator)
public abstract ExpressionEvaluator getExpressionEvaluator();
   (also tried engine-service)

 However I get a nice exception that it can't find the service etc.

 -Ryan 
 
On Wednesday, August 16, 2006, at 07:10AM, Robert Zeigler [EMAIL PROTECTED] 
wrote:

If you want, you don't even have to implement ITableColumnModel.
just do something like:
.html:
table jwcid=@contrib:Table source=ognl:theSource
columns=ognl:columnList/

.java:

public List getColumnList() {
List ret = new ArrayList();
String columnId=callPointH;
String columnHeader=Call Point H;
//not that the root of your ognl expression is the current row obj.
String ognlExpression = callPoinH;
boolean sortable=true;
ret.add(new
ExpressionTableColumn(columnId,columnHeeader,ognlExpression,sortable);
return ret;
}

Ryan Cuprak wrote:
 Hello, 
  I am working creating a table for which the number of columns is dynamic 
 (user can control which columns they want displayed). What is the proper 
 approach for implementing the behavior? 
 
   Thus far I created an implementation of ITableColumnModel which then 
 returns the custom set of columns. I initially returned SimpleTableColumn 
 instances but was getting a 'Unable to read OGNL expression 'parsed OGNL 
 expression' of [EMAIL PROTECTED]/image/bands.tableColumns]: 
 tableColumnRenderer' exception (src below). After getting this exception I 
 thought my approach might be wrong. Looking over the code I was a little 
 puzzled on how my column would extract the values from the model etc. 
 Looking through the contrib:table source I chanced upon 
 'ExpressionTableColumn'. There are no java docs so I am not quiet sure how 
 it is supposed to be used. From the title I 'think' this would take ognl 
 expressions and retrieve the values from my data model? However, I am not 
 quiet sure how to contruct an instance - where/what do I use for an 
 ExpressionEvaluator? 
 
 Page spec:
  component id=bands type=Contrib:Table
 binding name=source value=tableModel/
 binding name=columns value=ognl:tableColumnModel/
 binding name=rowsClass value=beans.evenOdd.next/
 binding name=columnsClass value=literal:title/
 /component 
 
 My TableColumnModel (only one field, was trying to get it working first..):
  public class BandSummaryColumnModel implements ITableColumnModel {
 
 private static final Logger logger = 
 Logger.getLogger(BandSummaryColumnModel.class);
 
 private MapString, ITableColumn _columns;
 
 public BandSummaryColumnModel() {
 if(logger.isDebugEnabled()) logger.debug(Instantiating 
 BandSummaryColumnModel);
 _columns = new HashMapString,ITableColumn();
 _columns.put(callPointH,new 
 SimpleTableColumn(callPointH,callPointH,true));
 }
 
 public int getColumnCount() {
 if(logger.isDebugEnabled()) logger.debug(Column count:  + 
 _columns.size());
 return _columns.size();
 }
 
 public ITableColumn getColumn(String string) {
 if(logger.isDebugEnabled()) logger.debug(Column requested:  + 
 string);
 return _columns.get(string);
 }
 
 public Iterator getColumns() {
 if(logger.isDebugEnabled()) logger.debug(Column iterator 
 requested);
 return _columns.entrySet().iterator();
 }
 }
 
  Thanks!
  Ryan
 
 
 
 -
 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: PermGen space - Caching is ON

2006-07-26 Thread Ryan Cuprak
 
Hello,
 I just ran into a problem related to this thread. I have a class with 30 unit 
tests which tests a HiveMind service used by my Tapestry pages. About midway 
through execution I get a : java.lang.OutOfMemoryError: Java heap space.
 
 I guess I am doing something wrong. I know just enough about HiveMind to be 
dangerous.

Regards,
-Ryan

On Monday, July 24, 2006, at 11:01AM, Martin Strand [EMAIL PROTECTED] wrote:

What I meant is that the redeploy ant task you mentioned likely causes the  
same error as Eclipse's hot redeploy - old unused classes are still left  
in permgen space. Restarting tomcat rather than redeploying would probably  
cure the problem.

Also, if you check google:
http://www.google.com/search?num=25hl=enlr=client=operarls=enq=redeploy+OutOfMemoryError+PermGenbtnG=Search

you end up with a recent article on the subject:
http://www.jroller.com/page/agileanswers?entry=preventing_java_s_java_lang

where the guy suggests jrockit instead, but you said you already tried  
that... :\
But someone else there says After upgrading to jdk1.5.0_07 my Perm Gen  
Space gets gc'ed like it should be - no increase of Perm Gen Space, no  
code changes. so perhaps you could give update 7 a try.

Martin

On Mon, 24 Jul 2006 18:56:48 +0200, [EMAIL PROTECTED] wrote:

 This is in a production environment.   There isn't any hot deploying  
 happening.  We just let the application run.

 Our production environment virtual machine args:
 -Xms128m -Xmx1024m -Dorg.apache.tapestry.disable-caching=false  
 -XX:MaxPermSize=128m

 I don't know how much larger the PermSize can be.

 Thanks for your help.


 -Original Message-
 From: Martin Strand [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 24, 2006 10:31 AM
 To: Tapestry users
 Subject: Re: PermGen space - Caching is ON

 Hot redeploy is when you edit your code in Eclipse and Eclipse  
 automatically adds the new classes to the running JVM and reloads the  
 context. That would leave the old classes in the classloader, eventually  
 leading to the OOM error you're seeing.

 I'm far from an expert on the subject, but redeploying probably doesn't  
 unload any classes so every redeploy would be the same as uncaching all  
 Tapestry pages/components. You're sort of running Tapestry with  
 org.apache.tapestry.disable-caching set to somewhere between true and  
 false. ;) If you don't ever redeploy your app, just deploy it once and  
 then let it run, do you still get that error?

 Martin

 On Mon, 24 Jul 2006 17:42:54 +0200, Henri Dupre [EMAIL PROTECTED]
 wrote:

 Yes I've seen the same issue on linux and windows with all JDKs using
 Tomcat or JBoss.
 I'd be curious to know if other containers such as Jetty, Weblogic or
 Websphere have better solutions...
 I'm not sure what do you refer as hot redeploy... We are using the
 tomcat ant tasks to redeploy into tomcat.

 Henri.


 On 7/24/06, Martin Strand [EMAIL PROTECTED] wrote:

 So you're seeing this in your production environment, not only when
 you hot redeploy from Eclipse?

 Martin

 On Mon, 24 Jul 2006 03:50:17 +0200, Harvey, David
 [EMAIL PROTECTED] wrote:

  Thanks for your comments, discussion.  However, this occurs when
 caching
  is turned on, i.e.
  -Dorg.apache.tapestry.disable-caching=false.
 
  I sure hope there's a fix, I don't know if MaxPermSize can be made
  any larger in production and it sounds from your discussion that
  making it larger will just delay the OOM condition anyway.
 
  Anybody else have any ideas?
 
  -Original Message-
  From: James Carman [mailto:[EMAIL PROTECTED]
  Sent: Sunday, July 23, 2006 6:03 AM
  To: Tapestry users
  Subject: Re: PermGen space
 
  Actually, Tapestry (and HiveMind as well) uses Javassist to
  generate classes at runtime, but all the rest is still true with
  Javassist as
 it
  is with CGLIB (hibernate uses CGLIB).  As Martin said, enabling
 caching
  should fix the problem.  Tapestry will only generate (and cache)
  the classes for each page/component one time with caching enabled.
  In a production environment, you really shouldn't run into this,
  since you would have caching enabled and you wouldn't be hot
  redeploying your application.
 
  James
 
  Hi all,
  This problem is very common with Tapestry applications. This is
  due
 to
  the fact that Tapestry uses cglib to generate classes at runtime.
  Java uses a separate Heap space called PermGenSpace to put
 meta-data
  about classes, which is never garbage collected (this is normal
  since normally, classes never change...) but with cglib, classes
  are generated, which add to the PermGenSpace. And the next time
  your application is deployed, new classes are generated which add
  to the PermGenSpace, etc... So it fills and become full.
  So this problem is common to Java+Tapestry/cglib+deployed webapps.
  I hope this explaination is clear. Else ask questions.
  -jec
 
  Harvey, David a écrit :
  Hello all,
 
  We've been having occasional problems with PermGen out of space
  errors 

Using an Application state object in a service

2006-07-20 Thread Ryan Cuprak

Hello,

I have defined a custom service to generate images on fly. I need to  
inject an application state object into my service. Normally I would  
use @InjectState(XXXList) in a page implementation. However this  
time I need to make a setter and use the set-object property=...  
or  set-configuration property=... element in hivemodule.xml.


Configuration:

contribution configuration-id=tapestry.state.ApplicationObjects
...
state-object name=gelCompareList scope=session
create-instance class=com.kodak.mis.web.GelCompareList/
/state-object
/contribution

 service-point id=GelCompareImageService  
interface=org.apache.tapestry.engine.IEngineService

 invoke-factory
 construct  
class=com.kodak.mis.web.engine.GelCompareImageService
 set-object property=linkFactory  
value=service:tapestry.url.LinkFactory/
 set??? property=gelCompareList  
value=state:gelCompareList/   -Here is where I  
want to inject the state object

 /construct
 /invoke-factory
 /service-point

Thanks,
 Ryan

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



Table component problem

2006-06-15 Thread Ryan Cuprak
Hello,
 I am having a extremely weird problem with the sort on contrib table. It 
worked perfectly fine (as far as I can tell) until I upgraded to Tapestry 4.0.2 
from 4.0.1. When I click on sort I get an exception:
 Either the tableModel parameter or both source and columns parameters must be 
specified by component pages/jobFunctionList/table.tableView
 # 
org.apache.tapestry.contrib.table.components.TableView.getTableModel(TableView.java:220)
# 
org.apache.tapestry.contrib.table.components.inserted.SimpleTableColumnComponent.columnSelected(SimpleTableColumnComponent.java:149)
# sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
# sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
# 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
# java.lang.reflect.Method.invoke(Method.java:585)
# 
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMethod(ListenerMethodInvokerImpl.java:214)
# 
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:155)
# 
org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke(ListenerMethodInvokerImpl.java:124)
# 
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:77)
# 
org.apache.tapestry.listener.SyntheticListener.actionTriggered(SyntheticListener.java:51)
 
 ... (more)

  The snippet from the page specification:
  component id=table type=Contrib:Table
binding name=source value=jobFunctions/
binding name=columns value=literal:!selected: 
:selected,name:Name:name,!description:Description:description/
binding name=rowsClass value=beans.evenOdd.next/
binding name=columnsClass value=literal:title/
/component

 Where is really gets weird is during debugging. I step from TableView.java 
line 249 into getSource() (abstract method) at which my debugger drops me into 
getBinding() of AbstractComponent.java line 311. It does find a binding for 
source which it returns. However, TableView gets a null which results in the 
exception above. 
 Any suggestions on troubleshooting? Are there any techniques for debugging 
that 'magical' layer - the dynamically generated object which calls 
getBinding(String name) on AbstractComponent as a result of a call on 
getSource(). I understand that getSource() gets converted to a string 
('source') which is passed in as the name to lookup in the binding object of 
AbstractComponent. AbstractComponent finds a 'source' in its 'binding' object 
but that layer returns null instead.

Thanks!
 -Ryan

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



Re: Table component problem

2006-06-15 Thread Ryan Cuprak


Hello,
 As is usually the case right after sending the email below I  
figured out my problem. I had spent over an hour digging and was  
quiet perplexed. I needed to add a 'Persist' annotation to the 'get'  
method used by the source. I did call the set method in the  
pageBeginRender - which does not appear to be called when resorting  
the table (don't quiet understand why yet...). However, any pointers  
on how-to step into the 'dynamically' generated code/proxy would be  
appreciated for future reference =)


 Regards,
 Ryan

On Jun 15, 2006, at 11:47 PM, Ryan Cuprak wrote:


Hello,
 I am having a extremely weird problem with the sort on contrib  
table. It worked perfectly fine (as far as I can tell) until I  
upgraded to Tapestry 4.0.2 from 4.0.1. When I click on sort I get  
an exception:
 Either the tableModel parameter or both source and columns  
parameters must be specified by component pages/jobFunctionList/ 
table.tableView
 #  
org.apache.tapestry.contrib.table.components.TableView.getTableModel 
(TableView.java:220)
#  
org.apache.tapestry.contrib.table.components.inserted.SimpleTableColum 
nComponent.columnSelected(SimpleTableColumnComponent.java:149)

# sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
# sun.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:39)
# sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)

# java.lang.reflect.Method.invoke(Method.java:585)
#  
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMet 
hod(ListenerMethodInvokerImpl.java:214)
#  
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerM 
ethod(ListenerMethodInvokerImpl.java:155)
#  
org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke 
(ListenerMethodInvokerImpl.java:124)
#  
org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerM 
ethod(ListenerMethodInvokerImpl.java:77)
# org.apache.tapestry.listener.SyntheticListener.actionTriggered 
(SyntheticListener.java:51)

 ... (more)

  The snippet from the page specification:
  component id=table type=Contrib:Table
binding name=source value=jobFunctions/
binding name=columns value=literal:! 
selected: :selected,name:Name:name,! 
description:Description:description/

binding name=rowsClass value=beans.evenOdd.next/
binding name=columnsClass value=literal:title/
/component

 Where is really gets weird is during debugging. I step from  
TableView.java line 249 into getSource() (abstract method) at which  
my debugger drops me into getBinding() of AbstractComponent.java  
line 311. It does find a binding for source which it returns.  
However, TableView gets a null which results in the exception above.
 Any suggestions on troubleshooting? Are there any techniques for  
debugging that 'magical' layer - the dynamically generated object  
which calls getBinding(String name) on AbstractComponent as a  
result of a call on getSource(). I understand that getSource() gets  
converted to a string ('source') which is passed in as the name to  
lookup in the binding object of AbstractComponent.  
AbstractComponent finds a 'source' in its 'binding' object but that  
layer returns null instead.


Thanks!
 -Ryan

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



Retrieving the HiveMind registry built by ApplicationServlet

2006-06-12 Thread Ryan Cuprak
Hello,
 How do I snag the HiveMind registry which is built by processing the 
hivemodule.xml in WEB-INF? I am trying to expose my Hivemind service as a 
webservice (JAXRPC). My Hivemind service is used in serveral pages presently. 
Looking over the code for the ApplicationServlet it looks like it stores it in 
the ServletContext which isn't visible to my webservice implementation. 
Hopefully this makes sense...
 Should I:
 1) reload the registry
 2) store the registry in a static variable
 3) is there another trick available?
 
 Thanks,
 Ryan

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



RE: Custom component validation - two fields

2006-06-03 Thread Ryan Cuprak
 
 I think I follow. So you only display the TextField if the checkbox was 
checked (via refresh submit)?
 I plowed ahead with trying to implement my own AbstractFormComponent that 
would use an html template and also render some of its own content. However, I 
am getting a stale link exception when I submit. Either I am setting something 
up incorrectly or missing the boat on the rewind. Not exactly sure how to parse 
the StaleLink page. Been diving through the list archives and source trying to 
get a better idea on how component ids are generated and the rewind is done.
 I can create a new form component re-using other form components - right?
 To read the template I yanked code out of the BaseComponent class. 

 In the end, I want my custom component to display a checkbox and a textfield 
(possibly a PropertySelection as well). When the form is submitted, if the 
checkbox is checked but no content is contained in the textfield I want to 
decorate it and add a message to the top. This component will be used at least 
a dozen time on the page for different search parameters. 
 
 Gradually learning!

 Thanks,
 Ryan


Exception:
---
You have clicked on a stale link.

Rewind of form test/testForm expected 1 more form elements, starting with id 
'selected'.

This is most likely the result of using your browser's back button, but can 
also be an application error.  

Component Java code:
---
public abstract class ComboTest extends AbstractFormComponent implements 
ITemplateComponent {

private static Logger logger = Logger.getLogger(ComboTest.class);

private static final int OUTER_INIT_SIZE = 5;
private IRender[] _outer;
private int _outerCount = 0;

public ComboTest() {

}

public abstract boolean isSelected();

public void readTemplate(IRequestCycle cycle, IPageLoader loader) {
loader.loadTemplateForComponent(cycle,this);
}

protected void  renderFormComponent(IMarkupWriter writer, IRequestCycle 
cycle) {
logger.debug(being combotest render);
// this was an attempt to solve it, thought maybe it was missing the id 
for this component (this didn't work.)
writer.begin(input);
writer.attribute(type,hidden);
writer.attribute(name,getName());
writer.attribute(id,getName());
writer.end();
for(int i =0; i  _outerCount; i++) {
_outer[i].render(writer,cycle);
}

logger.debug(end combotest render);
}

protected void rewindFormComponent(IMarkupWriter writer, IRequestCycle 
cycle) {
logger.debug(combotest choosen: choosen:  + 
cycle.getParameter(getName()));

}

public void finishLoad(IRequestCycle cycle , IPageLoader loader , 
IComponentSpecification specification) {
logger.debug(finishing load);
readTemplate(cycle,loader);
super.finishLoad(cycle,loader,specification);
}

public void addOuter(IRender element) {
logger.debug(outer being rendered);
if(_outer == null) {
_outer = new IRender[OUTER_INIT_SIZE];
_outer[0] = element;
_outerCount = 1;
return;
}
if (_outerCount == _outer.length) {
IRender[] newOuter;
newOuter = new IRender[_outer.length*2];
System.arraycopy(_outer,0,newOuter,0,_outerCount);
_outer = newOuter;
}
_outer[_outerCount++] = element;
}
}

HTML Template:
---
html
head 
titleTest/title
/head
body jwcid=$content$
input type=checkbox jwcid=selected/
/body
/html

Template:
---
component-specification class=com.kodak.mis.web.components.ComboTest
 allow-informal-parameters=yes
 allow-body=no
component id=selected type=Checkbox
binding name=value value=selected/
/component
/component-specification
 

On Friday, June 02, 2006, at 12:38PM, Mark Stang [EMAIL PROTECTED] wrote:

What we do is to wrap the checkbox in an AnySubmit.  And then when checked a 
submit happens and the field is then displayed with whatever mark-up is 
required.  If the user attempts to leave the screen standard edits tell them 
they need to provide a value.  If they uncheck the box, the field goes away.  
Basically, it is done via a Conditional or Choose Component.

hth,

Mark


-Original Message-
From: Ryan Cuprak [mailto:[EMAIL PROTECTED]
Sent: Fri 6/2/2006 12:38 PM
To: users@tapestry.apache.org
Subject: Custom component validation - two fields
 
Hello, 
 We are trying to implement a rather simple custom form component for a search 
 page and perform validation on it. The custom component has a checkbox and a 
 text field. If the checkbox is checked then a value must be provided in the 
 text field. If not, the field must be decorated and a message displayed at 
 the top of the form (tie in with the delegate etc). What is the recommended 
 approach for implementing such component validation? Must

Custom component validation - two fields

2006-06-02 Thread Ryan Cuprak
Hello, 
 We are trying to implement a rather simple custom form component for a search 
page and perform validation on it. The custom component has a checkbox and a 
text field. If the checkbox is checked then a value must be provided in the 
text field. If not, the field must be decorated and a message displayed at the 
top of the form (tie in with the delegate etc). What is the recommended 
approach for implementing such component validation? Must we extend 
AbstractFormComponent and implement the renderFormComponent or is there a 
simpler approach? Is there a hybrid AbstractFormComponent/BaseComponent we have 
missed somehow? 

 Thanks!
 Ryan

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



RE: Directly requesting a page

2006-05-31 Thread Ryan Cuprak
 
 Yup, I am using version 4. That returns the page unprocessed - jwcid and 
everything. 
 From the blog 
(http://howardlewisship.com/blog/2004/12/tapestry-urls-half-way-there.html) I 
added the following to my web.xml:
 servlet-mapping
  servlet-nameapp/servlet-name
  url-pattern*.html/url-pattern
 /servlet-mapping 

 However, I then get the login page for the application- servlet mapping is 
definitely doing something. Excluding some JAXRPC stuff, the other entries in 
my web.xml are:

servlet
servlet-nameKMI/servlet-name
servlet-classorg.apache.tapestry.ApplicationServlet/servlet-class
load-on-startup0/load-on-startup
/servlet

servlet-mapping
servlet-nameKMI/servlet-name
url-pattern/app/url-pattern
/servlet-mapping

servlet-mapping
servlet-nameKMI/servlet-name
url-pattern*.page/url-pattern
/servlet-mapping
 filter
filter-nameredirect/filter-name
filter-classorg.apache.tapestry.RedirectFilter/filter-class
/filter
filter-mapping
filter-nameredirect/filter-name
url-pattern//url-pattern
/filter-mapping

welcome-file-list
welcome-file/app/welcome-file
/welcome-file-list

Thanks,
 -Ryan

On Wednesday, May 31, 2006, at 11:36AM, James Carman [EMAIL PROTECTED] wrote:

Are you in tap4?  If so, enable Friendly URLs and you can invoke the page by
doing:

http://localhost:8080/test.html



-Original Message-
From: Ryan Cuprak [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 31, 2006 2:33 PM
To: users@tapestry.apache.org
Subject: Directly requesting a page

Hello,
 How do I directly invoke a page using the page service? I have a test page
at the root of the application which I want to invoke. From the Manning book
I thought the url would look like:
http://127.0.0.1:8080/app?service=page/test

 This is just a page for tinkering... was trying to test a new component and
thought I could throw it up on a test page (instead of logging into the app
and drilling through the menus).

 Thanks,
 Ryan

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