Re: Wrong visual behaviors using chenillekit window component

2009-01-19 Thread James Hillyerd
The first thing I would try is setting the z-index for the validation
popups:

http://www.w3schools.com/Css/pr_pos_z-index.asp

-james

On Mon, Jan 19, 2009 at 10:16 AM, Hugo Palma  wrote:

> I'm getting erratic visual behaviors when using chenillekit window
> component
> and i was wondering if anyone else has experienced the same or has any
> suggestions.
> I have a form rendered in the window with client validation turned on, and
> it seems that some elements that are showed by triggering events on the
> form
> are rendered in the background page and not on the window, therefore
> getting
> hidden.
>
> For example, the balloon that indicates a validation error, or the date
> picker from the DateTimeField component (the default DateField component
> works fine).
> The location seems ok, it's just the depth that's wrong.
>
> Any ideas ?
> Thanks.
>
> PS - I have already created an issue for this (
> http://code.google.com/p/chenillekit/issues/detail?id=27) but maybe
> someone
> here already has some kind of workaround for this.
>



-- 
James A. Hillyerd 


t:if test considers Float < 1.0 as false?

2009-01-18 Thread James Hillyerd
It seems that t:if considers 0.1, 0.99 as false, but 1.0 as true.
 Should I file a bug?  This is 5.0.18
-james

-- 
James A. Hillyerd 


Re: [T5] improve documentation

2009-01-16 Thread James Hillyerd
I quite like the existing tutorial, I was just disappointed it ended so
abruptly.  :)

I think whatever docs come around in the future, they need to cover more on
Encoders/Translators/Coercers - as that was one of the most difficult things
for me to learn.  Honestly, I still barely understand when to use which.

-james

On Tue, Jan 13, 2009 at 10:15 AM, Howard Lewis Ship wrote:

> I've been coming to the same conclusion.
>
> I'm clearing time with my boss to pursue this, along with several
> online articles.
>
> I have an idea for an application that can demonstrate every bit of
> Tapestry and be useful to boot.
>
> So the "guide" is the reference, what I have planned is the "tour".
> It would replace the tutorial.
>
>
>

-- 
James A. Hillyerd 


Google and t:grid

2009-01-08 Thread James Hillyerd
Google is indexing the different sorted versions of my grid components.  ie:
http://simobjects.net/manufacturer/view.grid.columns:sort/aircraftType?t:ac=5

This makes it look like I have a bunch of pages with identical content,
which google doesn't like.  It also makes the site more brittle, because in
some places I have renamed the grid, so the link returns an error. (The
above link is an example of that)

It seems like adding rel="nofollow" to the sort links would be a good idea?

-james

-- 
James A. Hillyerd 


tapestry:parameter namespace

2008-12-17 Thread James Hillyerd
I've tried using the xmlns:p="tapestry:parameter" namespace a couple
times, but it doesn't seem to work.  Also, the manual says t:parameter
is deprecated, but then says that the new namespace was introduced in
Tapestry 5.1 - which I don't think exists yet?
Any ideas?

>From the manual:

Parameter Namespace

Parameter namespaces are a new feature introduced in Tapestry 5.1.
They are a more concise way of passing parameter blocks to components.

You must define a special namespace, usually given the prefix "p":

http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";
xmlns:p="tapestry:parameter">


-james

--
James A. Hillyerd 

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Which annotation to be used in page class?

2008-12-15 Thread James Hillyerd
Gotta say, it's really confusing that @InjectService doesn't work with
components, but @Inject @Service does.

-james

On Mon, Dec 15, 2008 at 3:20 AM, Martijn Brinkers wrote:

> It seems that @Id an only be used for injecting a Block.
>
> >From javadoc: "Currently, this is used when injecting a {...@link Block}."
>
> Martijn
>
> On Sun, 2008-12-14 at 21:06 +0800, d0ng wrote:
> > Hi,
> > I want to inject a service in a page with service id,when I use
> > @Inject
> > @Id("serviceid")
> >
> > It seems that does not inject the service with "serviceid".
> >
> > Instead of use
> >
> > @Inject
> > @Servcie("serviceid")
> >
> > It works well.
> >
> > Does the @Id annotation can't be used in a page class?
> >
> > Thanks.
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
James A. Hillyerd 


Re: What's the easiest way to implement two dependent select lists ?

2008-12-09 Thread James Hillyerd
Hugo,

That's a great example.  I think this belongs on the Wiki!

Is the JSON stuff built into Tapestry, or do I need a third party library
for that?

-james

On Tue, Dec 9, 2008 at 10:17 AM, Hugo Palma <[EMAIL PROTECTED]> wrote:

> Here's how i'm doing this now:
>
> On the source select i'm using the OnEvent mixin to fire the change event:
>
>  t:event="change" t:onCompleteCallback="onCompleteOperatorChange" .../>
>
> The event listener method is then responsible for querying the database for
> the value to be set in the destination select:
>
> @OnEvent(component = "operator", value = "change")
>public JSONArray onChangeOperatorEvent(String value) {
>JSONArray jsonArray = new JSONArray();
>
>for (Plaza plaza : getDestinationSelectValues(value)) {
>JSONObject jsonObject = new JSONObject();
>jsonObject.put("value", plaza.getId());
>jsonObject.put("label", plaza.getDescription());
>
>jsonArray.put(jsonObject);
>}
>
>return jsonArray;
>}
>
> Finally, the onCompleteOperatorChange javascript function has to parse the
> return JSON and update the select input options:
>
> function onCompleteOperatorChange(response) {
>selectElement = $("entryPlaza");
>responseJSON = response.evalJSON();
>
>while (selectElement .options.length > 0) {
>selectElement .options[0] = null;
>}
>
>for (index = 0; index < responseJSON .length; index++) {
>selectElement.options[index] = new Option(responseJSON
> [index].label, responseJSON [index].value);
>}
>
>Tapestry.ElementEffect.highlight($("entryPlaza"));
>}
>
> It would make things a little easier if the selects weren't inside a form
> because then my event listener method could return the component instance
> itself and then on the client i would just have to replace the current
> element with the new rendered one.
>
> On Sun, Dec 7, 2008 at 10:46 PM, Hugo Palma <[EMAIL PROTECTED]>
> wrote:
>
> >  I'm already using the OnEvent component. Still, because the model of the
> > select list i want to update is calculated server-side i need to pass it
> in
> > json to the client, parse it again in javascript and then update the
> select
> > input. This does work but i feel that there should be a simpler way of
> doing
> > this, maybe using zones.
> >
> > thermus wrote:
> >
> > I'm a Tapestry novice, but you may want to have a look at
> http://code.google.com/p/tapestry5-components/ t5components .  It allows
> you
> > to add a mixin to components to respond to an OnChange event with AJAX
> (see: http://87.193.218.134:8080/t5c-demo/oneventpage this  and
> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html
> > this  for details).  You could then change the data model for the other
> > select component with a tiny bit of JavaScript in the onCompleteCallback
> > function.
> >
> > I'm curious how a Tapestry expert would handle it.
> >
> >
> > HugoPalma wrote:
> >
> >
> >  I have a very usual use where in a form i have two selects, and when the
> > user selects a value on one the values on the second should be filtered
> > accordingly.
> > As the Select component doesn't support ajax out-of.the-box i see myself
> > forced to implement a lot of plumbing and javascript stuff.
> >
> > Still, i feel that this kind of use case should be much easier to
> > implement.
> > Maybe i'm missing something.
> > I'd like to hear some ideas about how u would handle this.
> >
> > Thanks.
> >
> >
> >
> >
> >
>



-- 
James A. Hillyerd <[EMAIL PROTECTED]>


Re: passivate/activate

2008-12-08 Thread James Hillyerd
(I'm still learning to anyone feel free to correct me!)

Think of it this way: onPassivate() is used to generate links to your a
page.  Anytime you to t:pagelink, t:actionlink, or t:form - they all create
an instance of your page (even if you don't specify a context), then call
onPassivate on it.   I *think* each link/form etc will create it's own
instance of the page (actually more likely fetching it from the cache) and
call onPassivate.  So you could see this many times for a single .tml
render.
onActivate() doesn't necessarily need to be called first.  You could @Inject
a page, call a setter on it, and then return it from an event handler.  I
think Tapestry would then call onPassivate and use that to generate the
redirect URL for the browser.  Then when your browser requests that URL,
Tapestry will call the pages onActivate method to attempt restore the state
you wanted.

Does that make sense?  I know the labeling seems backwards, that's what made
it hard for me to grasp - seems weird to passivate something that was never
activated!

-james

On Mon, Dec 8, 2008 at 7:19 PM, Luther Baker <[EMAIL PROTECTED]> wrote:

> Question about the flow.
>
> I GET ViewProject.tml with an activation context of "1" which invokes:
>ViewProject.onActivate(Integer projectId)
>
> I echo the projectId to the screen as a context for a CreateIssue pagelink.
> I visit or GET CreateIssue.tml which invokes:
>CreateIssue.onActivate(Integer projectId)
>Createissue.onPassivate()
>
>
> *Q1*: ?? Why does onPassivate get called here - but not when I visited
> ViewProject ??
>
>
> I complete two fields on the CreateIssue.tml form and submit the form to
> CreateIssue.java which invokes
>CreateIssue.onActivate(Integer projectId)
>CreateIssue.onSuccess()
>
>
> *Q2*: ?? Why isn't CreateIssue.onPassivate called ??
>
>
> I return CreateIssue.onSuccess returns "ViewProject.class" which invokes:
>ViewProject.onPassivate()
>ViewProject.onActivate(Integer projectId)
>
>
> *Q3*: ?? Whoa? How'd that happen? I'm going TO ViewProject.tml --- and yet,
> onPassivate is invoked first. obviously, ViewProject has NO IDEA what
> projectId to return since, it was invoked without an ACTIVATION context. Is
> that why onPassivate is called? to find an activation context? I know the
> docs say that if no activation context is passed - Tapestry will ask the
> page for one. Is this how? If so - one need be a bit careful about how
> onPassivate is implemented?
>
> Is there an HttpSession free way to forward to have CreateIssue.onSuccess
> >>
> ViewProject.onActivate(Integer projectId) ?
>
> So - I'm not sure how I can forward to another page and pass an activation
> context along with the forward ... Is there a way? After taking a look
> here,
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html, I
> decided to try to @InjectPage so that
>
> CreateIssue.onSuccess()
> {
>   nextPage.setProject(project);
>   return nextPage;
> }
>
> and changed ViewProject.onPassivate() to return project.getId() ... which,
> is naturally used by ViewProject.Activate(Integer projectId) which is
> called
> next.
>
> Does that seem like the right way to do this? I don't need to @Persist as
> the example has done - since with this method, I can cause onPassivate to
> return what onActivate needs ... and I really don't need to save this info
> after the request is handled... But, is it safe to assume that the instance
> of the page returned by CreateIssue will be the instance that handles the
> request ... ie: do I have a pooling concern when I'm directly assigning
> page
> properties?
>
> Man ... this is cool.
>
> -Luther
>



-- 
James A. Hillyerd <[EMAIL PROTECTED]>


Re: Page present, still get onLoad FAIL: ClassNotFound error

2008-12-05 Thread James Hillyerd
You will probably want to scroll down further in the stack trace.  If
Tapestry IoC can't resolve everything it needs to inject into a particular
Page, Component or Service then you will see ClassNotFoundException.  It's
likely the JVM was able to load the class fine.

-james

On Fri, Dec 5, 2008 at 10:08 AM, Tom Pfotzer <[EMAIL PROTECTED]>wrote:

>
> I'm new to Tapestry. Installed Serge Eby's AppFuse kick-start package, uses
> Tapestry 5.0.17.
> Install went OK. Can start app, but once navigate off main page, get
> classNotFound errors accessing some (not all) pages.
>
> Using Eclipse IDE. Generating exploded WAR. Context root is
> wtpwebapps\engine\WEB-INF.
> Page classes and related .tml files are stored in
> \WEB-INF\classes\...\pages
> Components and related .tml files are stored in
> \WEB-INF\classes\...\components
>
> Debug is turned on for org.apache.tapestry. Upon server-start, get these
> diagnostics, among others:
>
> [engine] INFO [main] ComponentClassResolver.showChanges(275) | Available
> pages:
>   PropertyEditBlocks: org.apache.tapestry5.corelib.pages.PropertyEditBlocks
>ServiceStatus: org.apache.tapestry5.corelib.pages.ServiceStatus
>   Signup: org.testorg.app.webapp.pages.Signup
> UserEdit: org.testorg.app.webapp.pages.UserEdit
>admin/ActiveUsers: org.testorg.app.webapp.pages.admin.ActiveUsers
>   admin/ClickStreams: org.testorg.app.webapp.pages.admin.ClickStreams
>
> Server startup succeeds.
>
> When I navigate to the UserEdit page, I get a run-time exception,
> classNotFound error, thus:
>
> [engine] ERROR [http-8080-Processor24]
> RequestExceptionHandler.handleRequestException(170) | Unexpected runtime
> exception: java.lang.ClassNotFoundException: caught an exception while
> obtaining a class file for org.testorg.app.webapp.pages.UserEdit
> org.apache.tapestry5.runtime.ComponentEventException:
> java.lang.ClassNotFoundException: caught an exception while obtaining a
> class file for org.testorg.app.webapp.pages.UserEdit [at
> classpath:org/testorg/app/webapp/pages/MainMenu.tml, line 14, column 51]
>
> Can anyone suggest some possible reasons for this runtime exception? I'm
> not
> seeing any errors/bugs outstanding on Serge's AppFuse-for-Tapestry5 wiki,
> and Serge has recently updated the code base there (Aug 30th 2008).  I have
> taken care to eliminate all T4 jars and to install all T5 jars.
>
> Thanks in advance.
>
> Tom
> --
> View this message in context:
> http://www.nabble.com/Page-present%2C-still-get-onLoad-FAIL%3A-ClassNotFound-error-tp20859516p20859516.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
James A. Hillyerd <[EMAIL PROTECTED]>


Re: architectural question

2008-12-05 Thread James Hillyerd
Look at the bottom of this page:

http://tapestry.apache.org/tapestry5/tapestry-hibernate/userguide.html

It explains how to get @CommitAfter working with DAOs.

-james

On Fri, Dec 5, 2008 at 10:20 AM, Luther Baker <[EMAIL PROTECTED]> wrote:

> If I inject a Hibernate session into my DAO and have my Tapestry Controller
> invoke that, is there a Tapestry way that I can tell hibernate to start and
> commit a transaction via annotations or configuration?
>
> IE:
>
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/BeanEditForm.html
>
> public class CreateUser
> {
>@Inject
>private UserDAO userDAO;
>
> ...
>Object onSuccess()
>{
>userDAO.add(user);
>
>return UserAdmin.class;
>}
> }
>
> public class UserDAO
> {
>@Inject
>private Session session;
>
>void add(User user)
>{
>session.persist(user);
>}
> }
>
>
> I tried to use @CommitAfter in my DAO but that didn't work. I essentially
> want to simulate:
>
>void add(User user)
>{
>session.beginTransaction();
>session.persist(user);
>sessino.getTransaction().commit();
>}
>
> but I don't want to explicitly code this in my DAO for fear that I may have
> some instances where the the transactional boundaries must be larger.
>
> Maybe this isn't a Tapestry specific thing - but I'm not sure how to inject
> the Hibernate Session into my DAO but have my Tapestry Controller define
> the
> transactional boundaries ... was hoping some Tapestry annotations might
> help
> me out.
>
> -Luther
>



-- 
James A. Hillyerd <[EMAIL PROTECTED]>


Advantages of various .tml storage locations?

2008-12-04 Thread James Hillyerd
What are the pros/cons of keeping page .tml in:

1. src/main/java

  vs

2. src/main/resources

  vs

3. src/main/webapp

?


I see JumpStart uses #1, and the tutorial uses #3.  Seems like it would
easier to use #1 or #2 so at least the components and pages .tml are in the
same directory tree.

Thanks.

-james

-- 
James A. Hillyerd <[EMAIL PROTECTED]>


Re: [T5] Palette NPE

2008-12-03 Thread James Hillyerd
Probably not related to your problem, but I was seeing an NPE from the exact
same line of code when passing the palette a Set (instead of a List).

-james

On Wed, Dec 3, 2008 at 11:27 AM, zack1403 <[EMAIL PROTECTED]> wrote:

>
> Ive overridden both equals and hashCode (neither were overridden before)
> and
> have been waiting for the issue to reproduce.  It is very intermittent and
> a
> simple f5 makes it go away which is frustrating.  I also am trying using
> GenericSelectModel as the encoder and model which might make the issue go
> away.  Ill follow up if that fixes it.  Thanks!
>
> Zack
>
>
> Nicolas Charles wrote:
> >
> > I just had this issue; it was because the object overrided the "equals"
> > method, but not "hashCode", hence the selected object couldn't be found
> > in the selected set.
> >
> > Nick
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-T5--Palette-NPE-tp20652729p20819782.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
James A. Hillyerd <[EMAIL PROTECTED]>