Re: Tapestry at my company

2008-03-18 Thread Lance Java
For trolls such as yourself... I'd suggest you adopt struts 1 to ensure
maximum pain.

On 18/03/2008, Rob Smeets <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> Tomorrow is our last day of debate at my work about which framework to
> choose for our upcoming huge project.
> Its seems Wicket is winning the race for it's innovativeness, finess and
> excellent support, they claim, unfortunately. Most on my team members are
> concerned about the radically incompatible versions Tapestry has. And many
> say Tapestry 5 is over engineerd and has already lost the webframework
> battle and are concerned of it's future, in terms of upgrade and support.
> Could someone here offer me some killer arguments to counterfight these
> FUDs
> of my team?
>
> Regards,
>
>
> Rob
>


Re: T5 regExp problem

2008-04-15 Thread Lance Java
Since your regex is defined in a property file, you don't need to escape
your backslashes as you do with a java string.

try \-*\d*\.*\d*

Cheers,
Lance.

On 15/04/2008, Filip S. Adamsen <[EMAIL PROTECTED]> wrote:
>
> That's odd, it works for me alright... Tapestry doesn't do anything
> special wrt. regular expressions, it just uses the java.util.regex stuff.
>
> -Filip
>
> Sige skrev:
>
> > It seems @Validate("regexp") only support fixed number
> > of matches such as \\d{4}, and doesnt support "one or
> > more" or "zero or more" matches(\\d* or \\d+).
> >
> > Sige
> >
> >
> > --- Sige <[EMAIL PROTECTED]> wrote:
> >
> >  Hi,
> > >
> > > I have tried to use a  @Validate("regexp") to
> > > validate
> > > a number field, the regexp used is:
> > > numField-regexp=\\-*\\d*\\.*\\d*
> > >
> > > However this doesnt work in T5 (5.0.9), the
> > > validation
> > > is simply ignored, i have tested the regular
> > > expression  in Java correct. I wonder if T5 supports
> > > all java.util.regex.Pattern, or what I have gone
> > > wrong?
> > >
> > > Thanks
> > >
> > > Sige
> > >
> > > Send instant messages to your online friends
> > > http://au.messenger.yahoo.com
> > >
> > >  -
> >
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > Send instant messages to your online friends
> > http://au.messenger.yahoo.com
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Tapestry users declined for the first time in 3 years, says this researh site ...

2008-05-02 Thread Lance Java
Does anyone on this list have the nouse to find out where Rob Smeets lives?
I want to go round to his house and rough this little troll up a bit.

2008/5/2 Rob Smeets <[EMAIL PROTECTED]>:

> Hi guys,
>
> I don't mean to cause any depression or controversy but I saw this
> research
> results and thought you might want to know. Because this makes me worry
> about the future of Tapestry.
> According to the research, Tapestry users declined drastically by 45% for
> the first time in 3 years. I was very surprised because of the hype and
> sound bytes from Howard and co. surrounding Tapestry 5. I understand users
> of Wicket grew by 55% whereas GWT grew by 85%. According to the source,
> Adobe Flex users grew by 91% and that seems huge to me but warrants it of
> course. Even Howard admits Flex is one of the best.
> I think I agree with this research just by looking at the traffic here on
> the Tapestry list as well as responses on Howard's blog site on all topics
> regarding Tapestry.
>
> What do you think?
>
> Yours friendly,
>
> Rob
>


Can struts 1 and tapestry 5 play together nicely?

2008-05-13 Thread Lance Java
We are about to add a new section to an existing struts1 application and I
was hoping that I could implement the new section using tapestry 5 with a
view to migrating some of the existing pages to tapestry 5 in the future.
The existing application has a couple of servlets for generating images
(graphs etc) and references jsp's, stylesheets and images etc from a war.

So... a couple of questions:
1. Is this going to be possible?
2. Will I need to tell tapestry to ignore the existing servlets? (*.do,
etc.)
3. Any issues with linking from struts pages to tapestry pages?
4. Any other issues you can think of with doing this?

Thanks,
Lance.


Re: T5: JSONArray + fillling

2008-05-14 Thread Lance Java
You want a JSONObject not a JSONArray
http://tapestry.formos.com/nightly/tapestry5/apidocs/index.html

Cheers,
Lance.

2008/5/14 Leon Derks <[EMAIL PROTECTED]>:

> Hello
>
> I found this example:
>
> new JSONArray("[['a', 'value a'], ['b', 'value b'], ['c', 'value c'], ['d',
> 'value d']]"));
>
> The JSONArray contains information for my select box, with a value - label
> pair.
>
> But in my case, I want to make a new JSONArray filled with properties from
> my List of Groups.
>
> So for example something like this:
>
> for(Group group : List groups) {
>   jsonArray.put(group.getId, group.getName());
> }
>
> The problem is that a put operation only allows put(Object value) and
> put(int index, Object value);
>
> How can I add the group.getId and group.getName() as a value-label pair to
> the JSONArray?
>
> Leon
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: T5: JSONArray + fillling

2008-05-14 Thread Lance Java
JSONArray options = new JSONArray();
for(Group group : List groups) {
   JSONObject obj = new JSONObject();
   obj.put(group.getId, group.getName());
   options.put(obj);
}

Cheers,
Lance.

2008/5/14 Leon Derks <[EMAIL PROTECTED]>:

> Can you give me an example of that?
>
> Leon
>
>
> Lance Java wrote:
>
>> You want a JSONObject not a JSONArray
>> http://tapestry.formos.com/nightly/tapestry5/apidocs/index.html
>>
>> Cheers,
>> Lance.
>>
>> 2008/5/14 Leon Derks <[EMAIL PROTECTED]>:
>>
>>
>>
>>> Hello
>>>
>>> I found this example:
>>>
>>> new JSONArray("[['a', 'value a'], ['b', 'value b'], ['c', 'value c'],
>>> ['d',
>>> 'value d']]"));
>>>
>>> The JSONArray contains information for my select box, with a value -
>>> label
>>> pair.
>>>
>>> But in my case, I want to make a new JSONArray filled with properties
>>> from
>>> my List of Groups.
>>>
>>> So for example something like this:
>>>
>>> for(Group group : List groups) {
>>>  jsonArray.put(group.getId, group.getName());
>>> }
>>>
>>> The problem is that a put operation only allows put(Object value) and
>>> put(int index, Object value);
>>>
>>> How can I add the group.getId and group.getName() as a value-label pair
>>> to
>>> the JSONArray?
>>>
>>> Leon
>>>
>>>
>>> -
>>> 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: Repost: T3: Stop back button view of a form

2008-06-02 Thread Lance Java
Not really possible I'm sorry, when a user hits the back button, the page
they are viewing is in their browser cache (ie not a serverside hit).
Probably the best solution is to set a flag (persistant property or in the
db) on first form submit then fail any subsequent submits by redirecting to
an error page.

Cheers,
Lance.

2008/6/2 James Sherwood <[EMAIL PROTECTED]>:

> Hello,
>
> I was told I posted this in the wrong spot so I am sending to the list
> again and hopefully it goes in the right spot..
>
> I am trying to stop users from submitting a form and then pressing the back
> button and seeing the form again.  I would like to either redirect them
> somehow or just show them a session expired.
>
> Any ideas?
>
> Thanks,
> --James


Re: Repost: T3: Stop back button view of a form

2008-06-02 Thread Lance Java
Ok, here's a solution... use an onload script to either
a) populate a zone with the form fields
b) populate the zone with an already submitted message
This way the form will not be in the browser's cache.

If you want to redirect you'll need to use javascript since it'll be an ajax
request.

Cheers,
Lance.

2008/6/2 Lance Java <[EMAIL PROTECTED]>:

> Not really possible I'm sorry, when a user hits the back button, the page
> they are viewing is in their browser cache (ie not a serverside hit).
> Probably the best solution is to set a flag (persistant property or in the
> db) on first form submit then fail any subsequent submits by redirecting to
> an error page.
>
> Cheers,
> Lance.
>
> 2008/6/2 James Sherwood <[EMAIL PROTECTED]>:
>
> Hello,
>>
>> I was told I posted this in the wrong spot so I am sending to the list
>> again and hopefully it goes in the right spot..
>>
>> I am trying to stop users from submitting a form and then pressing the
>> back button and seeing the form again.  I would like to either redirect them
>> somehow or just show them a session expired.
>>
>> Any ideas?
>>
>> Thanks,
>> --James
>
>
>


Re: T5 ajax zone changing

2008-06-06 Thread Lance Java
I've always thought it would be nice to return a Map with the
key being the zone id so I can specify the zone(s) to update.

On 05/06/2008, Janko Muzykant <[EMAIL PROTECTED]> wrote:
>
>
> Thiago H. de Paula Figueiredo wrote on 05 Jun 2008 15:26:58 MET:
>
> > On Thu, 05 Jun 2008 11:18:53 -0300, Janko Muzykant <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Hi Markus,
> > > thanks for links, but this unfortunately does not solve the
> > > problem. i will
> > > try to highlight my case. commiting the form currenlty we have no
> > > possibility to select destination zone other when that one assigned in
> > > "form" element (eg. ), right?
> >
> > Not quite. :) The t:zone parameter defines what zone will be
> > updated. The return value of the event handler method defines what
> > content (a Zone or  Block) will be used to update that zone.
> >
> yup, that is what i called 'destination zone' :)  its conent may be
> updated dynamically by returned Block or Zone but i
> would like to choose quite different destination (depending on clicked
> button). and that's my problem :)
>
> greetins,
> jm.
>
> --
> Signature missing...
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


T5: Using tapestry components in a JSP

2008-06-09 Thread Lance Java
Hi, I'm a tapestry newbie and want to use tapestry5 for a new set of pages.
There is a requirement that some of the new components can be re-used on
some existing struts/JSP based pages. I was hoping that I could write a jsp
tag library which would initialize t5 components, include their javascript /
css and render the html inline.

Perhaps something like:

<%@ taglib uri="/WEB-INF/tapestry5" prefix="t5" %>

   
  
   
   
  
  
   

   
  
 
 
  

  
  

  
  
   

 Can someone let me know if i'm barking mad or not?
If this is possible, what classes etc I should be looking at and what
potential issues I might have.


Thanks,
Lance.


Re: T5: Using tapestry components in a JSP

2008-06-09 Thread Lance Java
Bummer... I thought this might be the case.
If this was possible it would be an easy peasy way for people to slowly
migrate to a superior platform.

Thanks for your response.

2008/6/9 Howard Lewis Ship <[EMAIL PROTECTED]>:

> This would be a daunting task.
>
> Tapestry 5 components live within a specialized, managed
> infrastructure.  It was never the intent to allow them to be used as
> JSP tags.  I've thought about going the other direction (mapping a JSP
> tag as a Tapestry component automagically).  Tapestry components
> expect to live inside a Tapestry page.  All of these things are linked
> together, which is why a T5 app can execute with almost no
> configuration.
>
> Tapestry components often cooperate with each other, for example, the
> relationship between a Form component and an enclosed TextField
> component. This form of communication is very dynamic and also hard to
> map to the JSP space.
>
> Finally, the code you provide for a component or page is actually only
> a very, very, very small part of the Tapestry application; not only is
> there a large amount of machinery behind the scenes, but the code you
> provide is instrumented heavily at runtime.
>
>
> On Mon, Jun 9, 2008 at 7:17 AM, Lance Java <[EMAIL PROTECTED]>
> wrote:
> > Hi, I'm a tapestry newbie and want to use tapestry5 for a new set of
> pages.
> > There is a requirement that some of the new components can be re-used on
> > some existing struts/JSP based pages. I was hoping that I could write a
> jsp
> > tag library which would initialize t5 components, include their
> javascript /
> > css and render the html inline.
> >
> > Perhaps something like:
> >
> > <%@ taglib uri="/WEB-INF/tapestry5" prefix="t5" %>
> > 
> >   
> >  
> >   
> >   
> >  
> >  
> >   
> >
> >   
> >  
> > 
> > 
> >  
> >
> >  
> >  
> >
> >  
> >  
> >   
> > 
> >  Can someone let me know if i'm barking mad or not?
> > If this is possible, what classes etc I should be looking at and what
> > potential issues I might have.
> >
> >
> > Thanks,
> > Lance.
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: T5: Using tapestry components in a JSP

2008-06-09 Thread Lance Java
I'm not sure how the struts action code would fit in with this model.

2008/6/9 Christian Edward Gruber <[EMAIL PROTECTED]>:

> Well Howard's other suggestion, with having jsps live within a T5 app might
> be a way to do it.  You build a shell around your current app, move some of
> your boilerplate inclusions (header/footer stuff) into a layout component,
> and then make a custom component to drive your jsps.  That would be a killer
> transition tool.
>
> Christian.
>
>
> On 9-Jun-08, at 15:30 , Lance Java wrote:
>
>  Bummer... I thought this might be the case.
>> If this was possible it would be an easy peasy way for people to slowly
>> migrate to a superior platform.
>>
>> Thanks for your response.
>>
>> 2008/6/9 Howard Lewis Ship <[EMAIL PROTECTED]>:
>>
>>  This would be a daunting task.
>>>
>>> Tapestry 5 components live within a specialized, managed
>>> infrastructure.  It was never the intent to allow them to be used as
>>> JSP tags.  I've thought about going the other direction (mapping a JSP
>>> tag as a Tapestry component automagically).  Tapestry components
>>> expect to live inside a Tapestry page.  All of these things are linked
>>> together, which is why a T5 app can execute with almost no
>>> configuration.
>>>
>>> Tapestry components often cooperate with each other, for example, the
>>> relationship between a Form component and an enclosed TextField
>>> component. This form of communication is very dynamic and also hard to
>>> map to the JSP space.
>>>
>>> Finally, the code you provide for a component or page is actually only
>>> a very, very, very small part of the Tapestry application; not only is
>>> there a large amount of machinery behind the scenes, but the code you
>>> provide is instrumented heavily at runtime.
>>>
>>>
>>> On Mon, Jun 9, 2008 at 7:17 AM, Lance Java <[EMAIL PROTECTED]>
>>> wrote:
>>>
>>>> Hi, I'm a tapestry newbie and want to use tapestry5 for a new set of
>>>>
>>> pages.
>>>
>>>> There is a requirement that some of the new components can be re-used on
>>>> some existing struts/JSP based pages. I was hoping that I could write a
>>>>
>>> jsp
>>>
>>>> tag library which would initialize t5 components, include their
>>>>
>>> javascript /
>>>
>>>> css and render the html inline.
>>>>
>>>> Perhaps something like:
>>>>
>>>> <%@ taglib uri="/WEB-INF/tapestry5" prefix="t5" %>
>>>> 
>>>>  
>>>>
>>>>  
>>>>  
>>>>
>>>>
>>>>  
>>>>
>>>>  
>>>>
>>>>   
>>>>   
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>  
>>>> 
>>>> Can someone let me know if i'm barking mad or not?
>>>> If this is possible, what classes etc I should be looking at and what
>>>> potential issues I might have.
>>>>
>>>>
>>>> Thanks,
>>>> Lance.
>>>>
>>>>
>>>
>>>
>>> --
>>> Howard M. Lewis Ship
>>>
>>> Creator Apache Tapestry and Apache HiveMind
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: T5: Using tapestry components in a JSP

2008-06-09 Thread Lance Java
I realise the differences... thanks marcus.
I was hoping for a hybrid where the struts action / jsp context acts as (or
delegates to) a tapestry page. Thus keeping my existing application as is
but adding new functionality as tapestry components.

2008/6/9 Marcus <[EMAIL PROTECTED]>:

> Hi lance,
>
> http://tapestry.apache.org/tapestry5/struts.html
>
> Marcus
>


Re: Urgent setting focus on @submit buttons

2008-06-10 Thread Lance Java
You oculd do it with javascript:

Event.observe(window, 'load',
function() { $('buttonId').focus(); }
);

2008/6/10 Kameswari <[EMAIL PROTECTED]>:

>
> I have a form with 2 @Submit buttons.
> By default while rendering the 1st button is set to focus.
> But i need the 2nd button to be in focus.
> I dont want to change the 1st button to be a @Button which fixes the
> problem
> Can anyone pls help..
> --
> View this message in context:
> http://www.nabble.com/Urgent-setting-focus-on-%40submit-buttons-tp17752598p17752598.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]
>
>


iGoogle style drag and drop components

2008-06-10 Thread Lance Java
Hi guys, has anyone written a set of components to support an iGoogle like
interface?
Where draggable components can be moved around the page and the surrounding
components re-order automatically.

Cheers,
Lance.


Re: Urgent setting focus on @submit buttons

2008-06-11 Thread Lance Java
I think this is the only way, there is no html attribute for a 
which will set the focus.
A cleaner solution might be to create a "focus" mixin which adds the
javascript I suggested.

Then you could do something like...


@see http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained

Cheers,
Lance.

2008/6/11 Kameswari <[EMAIL PROTECTED]>:

>
> Is there any othe solution?
>
> Lance Java wrote:
> >
> > You oculd do it with javascript:
> >
> > Event.observe(window, 'load',
> > function() { $('buttonId').focus(); }
> > );
> >
> > 2008/6/10 Kameswari <[EMAIL PROTECTED]>:
> >
> >>
> >> I have a form with 2 @Submit buttons.
> >> By default while rendering the 1st button is set to focus.
> >> But i need the 2nd button to be in focus.
> >> I dont want to change the 1st button to be a @Button which fixes the
> >> problem
> >> Can anyone pls help..
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Urgent-setting-focus-on-%40submit-buttons-tp17752598p17752598.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]
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Urgent-setting-focus-on-%40submit-buttons-tp17752598p17775567.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]
>
>


Creating a mixin on a component that is not a field

2008-06-12 Thread Lance Java
I'm trying to create a SortableTarget mixin on my own component but am not
having any luck as yet.
I have created a MixinAny component that implements ClientElement so I can
attach mixins to an Any style component and get the client id.

I have not been able to find any examples of attaching a mixin to a
component that does not extend field.

At the moment, when I attach my mixin to my MixinAny


My mixin parameters (@Parameter) are populated but the container
(@InjectContainer) is null in the afterRender method of my mixin.

Any suggestions as to what to do?

I have added the following to MixinAny

@Mixin @SuppressWarnings("unused")
private DiscardBody discardBody;

@Mixin @SuppressWarnings("unused")
private RenderInformals renderInformals;

Thanks,
Lance.








I have a mixin that uses @Parameter to get parameter and @InjectContainer to
inject the container
I include my mixin


Component is null in mixin

2008-06-13 Thread Lance Java
My last post did not get a response so perhaps including some code might
help.
I have a mixin which I attach to a custom component but the component is
null in the afterRender method of my mixin

It appears that @InjectContainer is not working... is there something I need
to add to my component? (MixinAny)

/**
 * This class is like the standard Any component except it supports
getClientId() for use in mixins
 */
@SupportsInformalParameters
public class MixinAny implements ClientElement {
@Inject
private ComponentResources resources;

@Inject
private PageRenderSupport support;

private String clientId;

@Mixin @SuppressWarnings("unused")
private DiscardBody discardBody; // I copied this from the Field
component looking at the autocomplete mixin

@Mixin @SuppressWarnings("unused")
private RenderInformals renderInformals;

@BeginRender
protected void beginRender(MarkupWriter writer)
{
clientId = support.allocateClientId(resources);
writer.element(resources.getElementName(null));
writer.attributes("id", getClientId());
resources.renderInformalParameters(writer);
}

@AfterRender
protected void afterRender(MarkupWriter writer)
{
writer.end(); // the element
}

/**
 */
public String getClientId() {
return clientId;
}
}


@IncludeJavaScriptLibrary({
"context:/layout/javascript/jquery.js",
"context:/layout/javascript/interface.js"
})
@MixinAfter
public class SortableTarget {
private static final Logger LOGGER =
Logger.getLogger(SortableTarget.class);

@Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
private String accept; // this is populated

@InjectContainer
private ClientElement container; //This should be my MixinAny component
but is null

@Inject
private PageRenderSupport renderSupport; // this is populated

@AfterRender
public void afterRender() {
 // container is null here
}
}

Cheers,
Lance.


Re: [T5] Using a Mixin on a Label component

2008-06-17 Thread Lance Java
If you read the next sentence:
"Alternately, you may prefix the name of the parameter with the *unqualified
* name of the Mixin class; this eliminates the ambiguity."

So you can use


I haven't tried this tho :)

On 17/06/2008, SergeEby <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I am trying to use a mixin to decorate the label component based on the
> embedded Field component.
> Since that field is not accessible, I thought I could use a parameter (like
> in the Label component) after reading the following:
> "If the component and a mixin both define a parameter with the same name,
> then the component wins: the component's parameter will be bound, and the
> mixin's parameter will be unbound."
> from the docs:
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/mixins.html
>
> How can I access the bound parameter from the mixin in that scenario?
>
> Thanks,
>
> /Serge
> --
> View this message in context:
> http://www.nabble.com/-T5--Using-a-Mixin-on-a-Label-component-tp17916465p17916465.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]
>
>


Re: Putting templates together with the java

2008-06-19 Thread Lance Java
Are you using eclipse? ctrl + shift + R is great (use * as wildcard)
Or you can use this plugin http://code.google.com/p/loom-t5/
Otherwise you can bundle your source anyhow you like, as long as your build
makes the war correctly at the end of the day. The maven folder structure is
only a (good, tried and trusted) recommendation.

On 19/06/2008, Geoff Callender <[EMAIL PROTECTED]> wrote:
>
> Perhaps I've lost my mind, but I'm struggling to find a good reason why we
> keep our templates and properties separate from our java source.  I find it
> causes nothing but pain having to incessantly jump between these
> disconnected parts of the source tree.  Is it purely to appease some Maven
> convention?
>
> What makes it even stranger is that the java classes end up together with
> the templates and properties anyway - my build process puts classes,
> templates and properties all together in WEB-INF/classes/ regardless of
> where they come from.  Live class reloading loves it that way and it keeps
> them secure from prying hackers.
>
> So why not mix the source together into the following structure
>
> src/
>   main/
>  java/<-- or perhaps some other name like "t5/"
> myproject/
>   base/
>   components/
>   css/
>   images/
>   META-INF/
>   mixins/
>   pages/
>   services/
>   WEB-INF/
>
> and let the build coax it into the WAR file correctly?
>
> Cheers,
>
> Geoff
>
>


t5: No ClassLoaders found for: org.apache.tapestry5.internal.services.ClientBehaviorSupport

2008-06-24 Thread Lance Java
I am a tapestry newbie, I and I'm playing around with tapestry 5.0.13.
When I have a page that contains only my components, tapestry is working as
expected.

When I put a core tapestry component (actionlink, zone, etc.) on the page I
get an exception

Page:

package mytapestrybasepackage.pages;

public class DeleteMe {
}

DeleteMe.tml

http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
 edit
 blah


When I remove the actionlink, blah is printed to the screen when I hit
http://:/deleteme

For some background info, I was using a previous version but have now
upgraded. I upgraded the javassist version and the tapestry jars and removed
the old ones and am 99% sure that the old version is gone. I am using
jboss-4.2.2.GA and java 1.5.0_06

Stack trace:

org.apache.tapestry5.internal.services.RenderQueueException: Render queue
error in BeginRender[DeleteMe:edit]: No ClassLoaders found for:
org.apache.tapestry5.internal.services.ClientBehaviorSupport [at
classpath:com/bglobal/isharesnet/tapestry/pages/DeleteMe.tml, line 2, column
56]
 at
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:80)
 at
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:108)
 at $PageRenderQueue_11aba59cc58.render($PageRenderQueue_11aba59cc58.java)
 at $PageRenderQueue_11aba59cc56.render($PageRenderQueue_11aba59cc56.java)
 at
org.apache.tapestry5.services.TapestryModule$14.renderMarkup(TapestryModule.java:1128)
 at
org.apache.tapestry5.services.TapestryModule$23.renderMarkup(TapestryModule.java:1472)
 at
$MarkupRenderer_11aba59cc5c.renderMarkup($MarkupRenderer_11aba59cc5c.java)
 at
org.apache.tapestry5.services.TapestryModule$22.renderMarkup(TapestryModule.java:1453)
 at
$MarkupRenderer_11aba59cc5c.renderMarkup($MarkupRenderer_11aba59cc5c.java)
 at
org.apache.tapestry5.services.TapestryModule$21.renderMarkup(TapestryModule.java:1435)
 at
$MarkupRenderer_11aba59cc5c.renderMarkup($MarkupRenderer_11aba59cc5c.java)
 at
org.apache.tapestry5.services.TapestryModule$20.renderMarkup(TapestryModule.java:1415)
 at
$MarkupRenderer_11aba59cc5c.renderMarkup($MarkupRenderer_11aba59cc5c.java)
 at
$MarkupRenderer_11aba59cc55.renderMarkup($MarkupRenderer_11aba59cc55.java)
 at
org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:55)
 at
$PageMarkupRenderer_11aba59cc53.renderPageMarkup($PageMarkupRenderer_11aba59cc53.java)
 at
org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57)
 at
$PageResponseRenderer_11aba59cc2a.renderPageResponse($PageResponseRenderer_11aba59cc2a.java)
 at
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:59)
 at
org.apache.tapestry5.services.TapestryModule$28.handle(TapestryModule.java:1672)
 at
$PageRenderRequestHandler_11aba59cc2b.handle($PageRenderRequestHandler_11aba59cc2b.java)
 at
$PageRenderRequestHandler_11aba59cc1f.handle($PageRenderRequestHandler_11aba59cc1f.java)
 at
org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:97)
 at
org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:73)
 at $Dispatcher_11aba59cc26.dispatch($Dispatcher_11aba59cc26.java)
 at $Dispatcher_11aba59cc18.dispatch($Dispatcher_11aba59cc18.java)
 at
org.apache.tapestry5.services.TapestryModule$12.service(TapestryModule.java:938)
 at
org.apache.tapestry5.internal.services.LocalizationFilter.service(LocalizationFilter.java:42)
 at $RequestHandler_11aba59cc19.service($RequestHandler_11aba59cc19.java)
 at
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:586)
 at $RequestHandler_11aba59cc19.service($RequestHandler_11aba59cc19.java)
 at
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
 at $RequestHandler_11aba59cc19.service($RequestHandler_11aba59cc19.java)
 at
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79)
 at $RequestHandler_11aba59cc19.service($RequestHandler_11aba59cc19.java)
 at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93)
 at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84)
 at
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:75)
 at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106)
 at $RequestHandler_11aba59cc19.service($RequestHandler_11aba59cc19.java)
 at $RequestHandler_11aba59cc11.service($RequestHandler_11aba59cc11.java)
 at
org.apache.tapestry5.services.TapestryModule$11.service(TapestryModule.java:918)
 at
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
 at
$HttpServletRequestFilter_11aba59cc10.service($HttpServletRequestFilter_11aba59cc10.java)
 at
$HttpServletReq

Re: t5: No ClassLoaders found for: org.apache.tapestry5.internal.services.ClientBehaviorSupport

2008-06-24 Thread Lance Java
Ok, have solved the issue thanks to this blog http://blog.progs.be/?p=52

Desc.useContextClassLoader = true;

Cheers,
Lance.

2008/6/24 Lance Java <[EMAIL PROTECTED]>:

> I am a tapestry newbie, I and I'm playing around with tapestry 5.0.13.
> When I have a page that contains only my components, tapestry is working as
> expected.
>
> When I put a core tapestry component (actionlink, zone, etc.) on the page I
> get an exception
>
> Page:
>
> package mytapestrybasepackage.pages;
>
> public class DeleteMe {
> }
>
> DeleteMe.tml
>
> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>  edit
>  blah
> 
>
> When I remove the actionlink, blah is printed to the screen when I hit
> http://:/deleteme <http://%3Chost%3E%3A%3Cport%3E/deleteme>
>
> For some background info, I was using a previous version but have now
> upgraded. I upgraded the javassist version and the tapestry jars and removed
> the old ones and am 99% sure that the old version is gone. I am using
> jboss-4.2.2.GA and java 1.5.0_06
>
> Stack trace:
>
> org.apache.tapestry5.internal.services.RenderQueueException: Render queue
> error in BeginRender[DeleteMe:edit]: No ClassLoaders found for:
> org.apache.tapestry5.internal.services.ClientBehaviorSupport [at
> classpath:com/bglobal/isharesnet/tapestry/pages/DeleteMe.tml, line 2, column
> 56]
>  at
> org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:80)
>  at
> org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:108)
>  at $PageRenderQueue_11aba59cc58.render($PageRenderQueue_11aba59cc58.java)
>  at $PageRenderQueue_11aba59cc56.render($PageRenderQueue_11aba59cc56.java)
>  at
> org.apache.tapestry5.services.TapestryModule$14.renderMarkup(TapestryModule.java:1128)
>  at
> org.apache.tapestry5.services.TapestryModule$23.renderMarkup(TapestryModule.java:1472)
>  at
> $MarkupRenderer_11aba59cc5c.renderMarkup($MarkupRenderer_11aba59cc5c.java)
>  at
> org.apache.tapestry5.services.TapestryModule$22.renderMarkup(TapestryModule.java:1453)
>  at
> $MarkupRenderer_11aba59cc5c.renderMarkup($MarkupRenderer_11aba59cc5c.java)
>  at
> org.apache.tapestry5.services.TapestryModule$21.renderMarkup(TapestryModule.java:1435)
>  at
> $MarkupRenderer_11aba59cc5c.renderMarkup($MarkupRenderer_11aba59cc5c.java)
>  at
> org.apache.tapestry5.services.TapestryModule$20.renderMarkup(TapestryModule.java:1415)
>  at
> $MarkupRenderer_11aba59cc5c.renderMarkup($MarkupRenderer_11aba59cc5c.java)
>  at
> $MarkupRenderer_11aba59cc55.renderMarkup($MarkupRenderer_11aba59cc55.java)
>  at
> org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:55)
>  at
> $PageMarkupRenderer_11aba59cc53.renderPageMarkup($PageMarkupRenderer_11aba59cc53.java)
>  at
> org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57)
>  at
> $PageResponseRenderer_11aba59cc2a.renderPageResponse($PageResponseRenderer_11aba59cc2a.java)
>  at
> org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:59)
>  at
> org.apache.tapestry5.services.TapestryModule$28.handle(TapestryModule.java:1672)
>  at
> $PageRenderRequestHandler_11aba59cc2b.handle($PageRenderRequestHandler_11aba59cc2b.java)
>  at
> $PageRenderRequestHandler_11aba59cc1f.handle($PageRenderRequestHandler_11aba59cc1f.java)
>  at
> org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:97)
>  at
> org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:73)
>  at $Dispatcher_11aba59cc26.dispatch($Dispatcher_11aba59cc26.java)
>  at $Dispatcher_11aba59cc18.dispatch($Dispatcher_11aba59cc18.java)
>  at
> org.apache.tapestry5.services.TapestryModule$12.service(TapestryModule.java:938)
>  at
> org.apache.tapestry5.internal.services.LocalizationFilter.service(LocalizationFilter.java:42)
>  at $RequestHandler_11aba59cc19.service($RequestHandler_11aba59cc19.java)
>  at
> org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:586)
>  at $RequestHandler_11aba59cc19.service($RequestHandler_11aba59cc19.java)
>  at
> org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
>  at $RequestHandler_11aba59cc19.service($RequestHandler_11aba59cc19.java)
>  at
> org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79)
>  at $RequestHandler_11aba59cc19.service($RequestHandler_11aba59cc19.java)
>  at
> org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93)

t5: Returning block works in Firefox but not in IE

2008-06-24 Thread Lance Java
I have an actionlink that returns a block and populates a zone in my page

FundGraph.tml
   edit

   ...

   
   


FundGraph.java
@Inject
private Block editorBlock;

@OnEvent(value="action", component="edit")
protected Object onActionFromEdit() {
return editorBlock;
}

In Firefox, this works fine. In IE, I get the following error:
A component event handler method returned the value
[EMAIL PROTECTED] Return type
org.apache.tapestry5.internal.structure.BlockImpl can not be handled.
Configured return types are java.lang.Class, java.lang.String, java.net.URL,
org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse,
org.apache.tapestry5.runtime.Component.

I have looked at previous posts on this list and it seems that this is
because request.isXHR() is false. What can I do to fix this in IE? I thought
that XHR should be true in this case?

I am using tapestry 5.0.13 and IE 6.0

Full stack trace:
%d 192408 ERROR
[org.apache.tapestry5.services.TapestryModule.RequestExceptionHandler]
(http-127.0.0.1-8080-2:) Processing of request failed with uncaught
exception: A component event handler method returned the value
[EMAIL PROTECTED] Return type
org.apache.tapestry5.internal.structure.BlockImpl can not be
handled.  Configured return types are java.lang.Class, java.lang.String,
java.net.URL, org.apache.tapestry5.Link,
org.apache.tapestry5.StreamResponse, org.apache.tapestry5.runtime.Component.
org.apache.tapestry5.runtime.ComponentEventException: A component event
handler method returned the value
[EMAIL PROTECTED] Return type
org.apache.tapestry5.internal.structure.BlockImpl can not be
handled.  Configured return types are java.lang.Class, java.lang.String,
java.net.URL, org.apache.tapestry5.Link,
org.apache.tapestry5.StreamResponse, org.apache.tapestry5.runtime.Component.
[at classpath:com/bglobal/isharesnet/tapestry/components/fund/FundGraph.tml,
line 2, column 44]
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1042)
at
org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:67)
at
org.apache.tapestry5.internal.services.ImmediateActionRenderResponseFilter.handle(ImmediateActionRenderResponseFilter.java:42)
at
$ComponentEventRequestHandler_11abad25fdc.handle($ComponentEventRequestHandler_11abad25fdc.java)
at
org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
at
$ComponentEventRequestHandler_11abad25fdc.handle($ComponentEventRequestHandler_11abad25fdc.java)
at
org.apache.tapestry5.services.TapestryModule$37.handle(TapestryModule.java:1987)
at
$ComponentEventRequestHandler_11abad25fdc.handle($ComponentEventRequestHandler_11abad25fdc.java)
at
$ComponentEventRequestHandler_11abad25f81.handle($ComponentEventRequestHandler_11abad25f81.java)
at
org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:135)
at $Dispatcher_11abad25f84.dispatch($Dispatcher_11abad25f84.java)
at $Dispatcher_11abad25f76.dispatch($Dispatcher_11abad25f76.java)
at
org.apache.tapestry5.services.TapestryModule$12.service(TapestryModule.java:938)
at
org.apache.tapestry5.internal.services.LocalizationFilter.service(LocalizationFilter.java:42)
at $RequestHandler_11abad25f77.service($RequestHandler_11abad25f77.java)
at
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:586)
at $RequestHandler_11abad25f77.service($RequestHandler_11abad25f77.java)
at
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
at $RequestHandler_11abad25f77.service($RequestHandler_11abad25f77.java)
at
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79)
at $RequestHandler_11abad25f77.service($RequestHandler_11abad25f77.java)
at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93)
at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84)
at
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:75)
at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106)
at $RequestHandler_11abad25f77.service($RequestHandler_11abad25f77.java)
at $RequestHandler_11abad25f6f.service($RequestHandler_11abad25f6f.java)
at
org.apache.tapestry5.services.TapestryModule$11.service(TapestryModule.java:918)
at
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
at
$HttpServletRequestFilter_11abad25f6e.service($HttpServletRequestFilter_11abad25f6e.java)
at
$HttpServletRequestHandler_11abad25f70.service($HttpServletRequestHandler_11abad25f70.java)
at
$HttpServletRequestHandler_11abad25f6d.service($HttpServletRequestHandler_11abad25f6d.java)
at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:168)
at
org.apache.catalina.core.ApplicationFilterChain.

Re: t5: Returning block works in Firefox but not in IE

2008-06-24 Thread Lance Java
I have solved the issue, I think I understand what was going wrong.
- Tapestry first draws action links as hrefs which cause a page reload for
graceful degredation
- Tapestry javascript magic then goes over all ajax action links and changes
them to javascript method calls
- I had a javascript error which stopped the tapestry javascript magic from
hapening, thus I was seeing the graceful degredation, thus no XHR's

Cheers,
Lance.

2008/6/24 Francisco Manzano <[EMAIL PROTECTED]>:

> Hi, I am inexperienced in Tapestry, but I had east problem recently:
> You have like result a valid xhtml page? You can look for if you have
> "scripts of tapestry" inserted at the end of the page.
> something  like this  :
> ...
>  type="text/javascript">
>  type="text/javascript">
>  type="text/javascript">
>  type="text/javascript">
> 
> <!--
> Tapestry.DEBUG_ENABLED = true;
> Tapestry.onDOMLoaded(function() {
>
> Tapestry.init({"zone":["zoneToUpdate"],"linkZone":[["theLink4","zoneToUpdate"],["theForm","zoneToUpdate"]]});
> });
> // -->
> 
> 
> 
>
> If these scripts are not, you can have this problem., and you can solve it
> obtaining a valid xhtml like result.
>
> I hope can help you
>
> &
> DiPegotDeis
>
>
>
>
> Lance Java wrote:
>
>> I have an actionlink that returns a block and populates a zone in my page
>>
>> FundGraph.tml
>>   edit
>>
>>   ...
>>
>>   
>>   
>>
>>
>> FundGraph.java
>>@Inject
>>private Block editorBlock;
>>
>>@OnEvent(value="action", component="edit")
>>protected Object onActionFromEdit() {
>>return editorBlock;
>>}
>>
>> In Firefox, this works fine. In IE, I get the following error:
>> A component event handler method returned the value
>> [EMAIL PROTECTED] Return type
>> org.apache.tapestry5.internal.structure.BlockImpl can not be handled.
>> Configured return types are java.lang.Class, java.lang.String,
>> java.net.URL,
>> org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse,
>> org.apache.tapestry5.runtime.Component.
>>
>> I have looked at previous posts on this list and it seems that this is
>> because request.isXHR() is false. What can I do to fix this in IE? I
>> thought
>> that XHR should be true in this case?
>>
>> I am using tapestry 5.0.13 and IE 6.0
>>
>> Full stack trace:
>> %d 192408 ERROR
>> [org.apache.tapestry5.services.TapestryModule.RequestExceptionHandler]
>> (http-127.0.0.1-8080-2:) Processing of request failed with uncaught
>> exception: A component event handler method returned the value
>> [EMAIL PROTECTED] Return type
>> org.apache.tapestry5.internal.structure.BlockImpl can not be
>> handled.  Configured return types are java.lang.Class, java.lang.String,
>> java.net.URL, org.apache.tapestry5.Link,
>> org.apache.tapestry5.StreamResponse,
>> org.apache.tapestry5.runtime.Component.
>> org.apache.tapestry5.runtime.ComponentEventException: A component event
>> handler method returned the value
>> [EMAIL PROTECTED] Return type
>> org.apache.tapestry5.internal.structure.BlockImpl can not be
>> handled.  Configured return types are java.lang.Class, java.lang.String,
>> java.net.URL, org.apache.tapestry5.Link,
>> org.apache.tapestry5.StreamResponse,
>> org.apache.tapestry5.runtime.Component.
>> [at
>> classpath:com/bglobal/isharesnet/tapestry/components/fund/FundGraph.tml,
>> line 2, column 44]
>> at
>>
>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1042)
>> at
>>
>> org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:67)
>> at
>>
>> org.apache.tapestry5.internal.services.ImmediateActionRenderResponseFilter.handle(ImmediateActionRenderResponseFilter.java:42)
>> at
>>
>> $ComponentEventRequestHandler_11abad25fdc.handle($ComponentEventRequestHandler_11abad25fdc.java)
>> at
>>
>> org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
>> at
>>
>> $ComponentEventRequestHandler_11abad25fdc.handle($ComponentEventRequestHandler_11abad25fdc.java)
>> at
>>
>> org.apache.tapestry5.services.TapestryModule$37.handle(TapestryModule.java:1987)
>> at
>>
>> $ComponentEventRequestHandler_11abad25fdc.handle($ComponentEventRequestHandler_11abad25fdc.java)

Re: [T5] How to use enums in .tml files

2008-06-24 Thread Lance Java
I'm a newbie but I notice tapestry has a StringToEnumCoercion.
What hapens if you do this?

...

onActionFromSomelink(EnumType enum) {
   // i'm expecting auto coercion to do it's job here
}

Where EnumType is the type of your enum.

Cheers,
Lance.

2008/6/24 9902468 <[EMAIL PROTECTED]>:

>
> Hi,
>
> There must be a way to use enum in actionlink context. How to do this?
>
> I mean like:
>
> Do not
> push.
>
>  - 99
> --
> View this message in context:
> http://www.nabble.com/-T5--How-to-use-enums-in-.tml-files-tp18090334p18090334.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]
>
>


Re: t5: Returning block works in Firefox but not in IE

2008-06-24 Thread Lance Java
Could returning null be built in as default behaviour? Since returning a
block from a non-xhr request is an error case, it would save putting checks
throughout the code and I can't see it breaking anything.

Cheers,
Lance.

2008/6/24 Howard Lewis Ship <[EMAIL PROTECTED]>:

> For full graceful degradation, you can inject the Request object can
> check its isXHR() method, then decide on an appropriate return value
> (typically, a Block or null).
>
> On Tue, Jun 24, 2008 at 9:24 AM, Lance Java <[EMAIL PROTECTED]>
> wrote:
> > I have solved the issue, I think I understand what was going wrong.
> > - Tapestry first draws action links as hrefs which cause a page reload
> for
> > graceful degredation
> > - Tapestry javascript magic then goes over all ajax action links and
> changes
> > them to javascript method calls
> > - I had a javascript error which stopped the tapestry javascript magic
> from
> > hapening, thus I was seeing the graceful degredation, thus no XHR's
> >
> > Cheers,
> > Lance.
> >
> > 2008/6/24 Francisco Manzano <[EMAIL PROTECTED]>:
> >
> >> Hi, I am inexperienced in Tapestry, but I had east problem recently:
> >> You have like result a valid xhtml page? You can look for if you have
> >> "scripts of tapestry" inserted at the end of the page.
> >> something  like this  :
> >> ...
> >>  >> type="text/javascript">
> >>  >> type="text/javascript">
> >>  >> type="text/javascript">
> >>  >> type="text/javascript">
> >> 
> >> <!--
> >> Tapestry.DEBUG_ENABLED = true;
> >> Tapestry.onDOMLoaded(function() {
> >>
> >>
> Tapestry.init({"zone":["zoneToUpdate"],"linkZone":[["theLink4","zoneToUpdate"],["theForm","zoneToUpdate"]]});
> >> });
> >> // -->
> >> 
> >> 
> >> 
> >>
> >> If these scripts are not, you can have this problem., and you can solve
> it
> >> obtaining a valid xhtml like result.
> >>
> >> I hope can help you
> >>
> >> &
> >> DiPegotDeis
> >>
> >>
> >>
> >>
> >> Lance Java wrote:
> >>
> >>> I have an actionlink that returns a block and populates a zone in my
> page
> >>>
> >>> FundGraph.tml
> >>>   edit
> >>>
> >>>   ...
> >>>
> >>>   
> >>>   
> >>>
> >>>
> >>> FundGraph.java
> >>>@Inject
> >>>private Block editorBlock;
> >>>
> >>>@OnEvent(value="action", component="edit")
> >>>protected Object onActionFromEdit() {
> >>>return editorBlock;
> >>>}
> >>>
> >>> In Firefox, this works fine. In IE, I get the following error:
> >>> A component event handler method returned the value
> >>> [EMAIL PROTECTED] Return type
> >>> org.apache.tapestry5.internal.structure.BlockImpl can not be handled.
> >>> Configured return types are java.lang.Class, java.lang.String,
> >>> java.net.URL,
> >>> org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse,
> >>> org.apache.tapestry5.runtime.Component.
> >>>
> >>> I have looked at previous posts on this list and it seems that this is
> >>> because request.isXHR() is false. What can I do to fix this in IE? I
> >>> thought
> >>> that XHR should be true in this case?
> >>>
> >>> I am using tapestry 5.0.13 and IE 6.0
> >>>
> >>> Full stack trace:
> >>> %d 192408 ERROR
> >>> [org.apache.tapestry5.services.TapestryModule.RequestExceptionHandler]
> >>> (http-127.0.0.1-8080-2:) Processing of request failed with uncaught
> >>> exception: A component event handler method returned the value
> >>> [EMAIL PROTECTED] Return type
> >>> org.apache.tapestry5.internal.structure.BlockImpl can not be
> >>> handled.  Configured return types are java.lang.Class,
> java.lang.String,
> >>> java.net.URL, org.apache.tapestry5.Link,
> >>> org.apache.tapestry5.StreamResponse,
> >>> org.apache.tapestry5.runtime.Component.
> >>> org.apache.tapestry5.runtime.ComponentEventException: A component event
> >>> handler method returned the val

Re: t5: Returning block works in Firefox but not in IE

2008-06-25 Thread Lance Java
Yep, that's what I meant

2008/6/25 9902468 <[EMAIL PROTECTED]>:

>
> Better yet:
>
> Tapestry could be so smart that it would return null even if the handler
> returns block if the request is not ajax.
>
> if(return_value == block && is_not_xhdr){
>block = null;
> }
>
> That wouldn't break anything?
>
>  -99
>
>
> Lance Java wrote:
> >
> > Could returning null be built in as default behaviour? Since returning a
> > block from a non-xhr request is an error case, it would save putting
> > checks
> > throughout the code and I can't see it breaking anything.
> >
> > Cheers,
> > Lance.
> >
> > 2008/6/24 Howard Lewis Ship <[EMAIL PROTECTED]>:
> >
> >> For full graceful degradation, you can inject the Request object can
> >> check its isXHR() method, then decide on an appropriate return value
> >> (typically, a Block or null).
> >>
> >> On Tue, Jun 24, 2008 at 9:24 AM, Lance Java <[EMAIL PROTECTED]>
> >> wrote:
> >> > I have solved the issue, I think I understand what was going wrong.
> >> > - Tapestry first draws action links as hrefs which cause a page reload
> >> for
> >> > graceful degredation
> >> > - Tapestry javascript magic then goes over all ajax action links and
> >> changes
> >> > them to javascript method calls
> >> > - I had a javascript error which stopped the tapestry javascript magic
> >> from
> >> > hapening, thus I was seeing the graceful degredation, thus no XHR's
> >> >
> >> > Cheers,
> >> > Lance.
> >> >
> >> > 2008/6/24 Francisco Manzano <[EMAIL PROTECTED]>:
> >> >
> >> >> Hi, I am inexperienced in Tapestry, but I had east problem recently:
> >> >> You have like result a valid xhtml page? You can look for if you have
> >> >> "scripts of tapestry" inserted at the end of the page.
> >> >> something  like this  :
> >> >> ...
> >> >>  >> >> type="text/javascript">
> >> >>  >> >> type="text/javascript">
> >> >>  >> >> type="text/javascript">
> >> >>  >> >> type="text/javascript">
> >> >> 
> >> >> <!--
> >> >> Tapestry.DEBUG_ENABLED = true;
> >> >> Tapestry.onDOMLoaded(function() {
> >> >>
> >> >>
> >>
> Tapestry.init({"zone":["zoneToUpdate"],"linkZone":[["theLink4","zoneToUpdate"],["theForm","zoneToUpdate"]]});
> >> >> });
> >> >> // -->
> >> >> 
> >> >> 
> >> >> 
> >> >>
> >> >> If these scripts are not, you can have this problem., and you can
> >> solve
> >> it
> >> >> obtaining a valid xhtml like result.
> >> >>
> >> >> I hope can help you
> >> >>
> >> >> &
> >> >> DiPegotDeis
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> Lance Java wrote:
> >> >>
> >> >>> I have an actionlink that returns a block and populates a zone in my
> >> page
> >> >>>
> >> >>> FundGraph.tml
> >> >>>   edit
> >> >>>
> >> >>>   ...
> >> >>>
> >> >>>   
> >> >>>   
> >> >>>
> >> >>>
> >> >>> FundGraph.java
> >> >>>@Inject
> >> >>>private Block editorBlock;
> >> >>>
> >> >>>@OnEvent(value="action", component="edit")
> >> >>>protected Object onActionFromEdit() {
> >> >>>return editorBlock;
> >> >>>}
> >> >>>
> >> >>> In Firefox, this works fine. In IE, I get the following error:
> >> >>> A component event handler method returned the value
> >> >>> [EMAIL PROTECTED] Return
> type
> >> >>> org.apache.tapestry5.internal.structure.BlockImpl can not be
> handled.
> >> >>> Configured return types are java.lang.Class, java.lang.String,
> >> >>> java.net.URL,
> >> >>> 

T5: Dynamic zone id

2008-06-26 Thread Lance Java
Consider the following example:

Page:
  
  
  
  
  



FundGraph:



 edit
 ...




 ...




I have a page with a few fund graphs and an editZone.
Each graph has an edit link which causes a form to appear in the editZone.
Each graph also has a viewZone which will be updated once it's form is
submitted.
Tapestry sees that I am including more than one "editZone" and magically
calls the zones "editZone", "editZone_1" etc
Therefore, when any form is submitted, the first graph is updated with the
reasult.

I would like to give the zone a dynamic id, something like "prop:viewZoneId"
which I calculate at runtime but tapestry is erroring stating:
"Component ids must be valid Java identifiers: start with a letter, and
consist of letters, numbers and underscores."

Any suggestions?

Cheers,
Lance.


Re: t5: Returning block works in Firefox but not in IE

2008-06-30 Thread Lance Java
With me, I had a javascript bug so tapestry's javascript did not execute.
I fixed my javascript bugs and everything started working.

2008/6/30 Weisu <[EMAIL PROTECTED]>:

>
> Hi Lance, I have the same error message. Could you kindly show the steps to
> make this work?
> Thanks in advance.
> Weisu.
>
> Lance Java wrote:
> >
> > Yep, that's what I meant
> >
> > 2008/6/25 9902468 <[EMAIL PROTECTED]>:
> >
> >>
> >> Better yet:
> >>
> >> Tapestry could be so smart that it would return null even if the handler
> >> returns block if the request is not ajax.
> >>
> >> if(return_value == block && is_not_xhdr){
> >>block = null;
> >> }
> >>
> >> That wouldn't break anything?
> >>
> >>  -99
> >>
> >>
> >> Lance Java wrote:
> >> >
> >> > Could returning null be built in as default behaviour? Since returning
> >> a
> >> > block from a non-xhr request is an error case, it would save putting
> >> > checks
> >> > throughout the code and I can't see it breaking anything.
> >> >
> >> > Cheers,
> >> > Lance.
> >> >
> >> > 2008/6/24 Howard Lewis Ship <[EMAIL PROTECTED]>:
> >> >
> >> >> For full graceful degradation, you can inject the Request object can
> >> >> check its isXHR() method, then decide on an appropriate return value
> >> >> (typically, a Block or null).
> >> >>
> >> >> On Tue, Jun 24, 2008 at 9:24 AM, Lance Java
> >> <[EMAIL PROTECTED]>
> >> >> wrote:
> >> >> > I have solved the issue, I think I understand what was going wrong.
> >> >> > - Tapestry first draws action links as hrefs which cause a page
> >> reload
> >> >> for
> >> >> > graceful degredation
> >> >> > - Tapestry javascript magic then goes over all ajax action links
> and
> >> >> changes
> >> >> > them to javascript method calls
> >> >> > - I had a javascript error which stopped the tapestry javascript
> >> magic
> >> >> from
> >> >> > hapening, thus I was seeing the graceful degredation, thus no XHR's
> >> >> >
> >> >> > Cheers,
> >> >> > Lance.
> >> >> >
> >> >> > 2008/6/24 Francisco Manzano <[EMAIL PROTECTED]>:
> >> >> >
> >> >> >> Hi, I am inexperienced in Tapestry, but I had east problem
> >> recently:
> >> >> >> You have like result a valid xhtml page? You can look for if you
> >> have
> >> >> >> "scripts of tapestry" inserted at the end of the page.
> >> >> >> something  like this  :
> >> >> >> ...
> >> >> >>  >> >> >> type="text/javascript">
> >> >> >>  >> >> >> type="text/javascript">
> >> >> >>  >> >> >> type="text/javascript">
> >> >> >>  >> >> >> type="text/javascript">
> >> >> >> 
> >> >> >> <!--
> >> >> >> Tapestry.DEBUG_ENABLED = true;
> >> >> >> Tapestry.onDOMLoaded(function() {
> >> >> >>
> >> >> >>
> >> >>
> >>
> Tapestry.init({"zone":["zoneToUpdate"],"linkZone":[["theLink4","zoneToUpdate"],["theForm","zoneToUpdate"]]});
> >> >> >> });
> >> >> >> // -->
> >> >> >> 
> >> >> >> 
> >> >> >> 
> >> >> >>
> >> >> >> If these scripts are not, you can have this problem., and you can
> >> >> solve
> >> >> it
> >> >> >> obtaining a valid xhtml like result.
> >> >> >>
> >> >> >> I hope can help you
> >> >> >>
> >> >> >> &
> >> >> >> DiPegotDeis
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> Lance Java wrote:
> >> >> >>
> >> >> >>> I have an 

Re: Creating new components on the fly in T5 using AJAX/JSON

2008-06-30 Thread Lance Java
I only know how how to populate zones with form submits or event links. I'm
sure you can take a look at the eventlink component and copy / paste.

Then all you need to do specify the zone to populate and return:
- A class object for your component
- The name (String) of the component
- A component instance (use @InjectComponent)
- A block (a set of components defined in your template)

Here's a block example with an actionlink:

template:

 







click me!

java
-
public class Test
{
   @Inject
   private Block myBlock;

   @OnEvent(component="myLink", value="action")
   private Block actionFromMyLink()
   {
   return myBlock;
   }

}

Cheers,
Lance.

2008/6/30 Denis McCarthy <[EMAIL PROTECTED]>:

> Hi,
> I'm working on a somewhat complex page at the moment. This page
> consists of several input boxes that users
> fill in. I've got various onblur AJAX mixins that fire on this page
> when fields are filled in by a user. Currently, based
> on the values that users put into these text boxes, other text boxes
> and drop down select lists are either shown
> or hidden (this is done by passing simple JSON back to the page in the
> AJAX response to these blur events)
>
> Ideally, I'd like not to have these optional fields just hidden, but
> instead for the optional field to be entirely absent
> from the html markup when it's not needed, and only present when data
> entered by the user in a different field
> mandates it. Is this possible in T5? I don't think it is (because I
> think that a field needs to be present in the tml
> at page load time for the component in question to be bound to the T5
> page class), but it would be great if
> it was, as it would make the page considerably lighter size wise for
> most of my users.
> Thanks
> Denis
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: T5: form zone parameter not taken into account

2008-07-03 Thread Lance Java
How are you returning the AccountManagement?
Do you use @InjectComponent or new AccountManagement() ?
The latter will not work.

2008/7/3 Stephane Decleire <[EMAIL PROTECTED]>:

> Thanks Josh,
>
> But i've tested my page with several navigators (IE 7.0, Firefox 2.0 & 3.0)
> with javascript enabled and i don't understand why my request is not
> submitted via AJAX.
> What i think is very strange is that Ajax seems to be used or not depending
> what content i have in my zone.
>
> Has anybody already encountered such a problem and found what content can
> prevent Ajax to be used ?
>
> Thanks in advance.
>
> Stephane
>
> Josh Canfield a écrit :
>
>  Your form is not being submitted via AJAX. You may have a javascript error
>> that is preventing the form from being properly updated for the zone.
>>
>> The request object has the isXHR method which you can use to determine if
>> it's a full or partial request. You can use this info to return something
>> other than the block/component for users that don't have javascript
>> enabled.
>>
>> On Wed, Jul 2, 2008 at 5:23 AM, Stephane Decleire <
>> [EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> I've got a form with a zone parameter but i still get the following
>>> warning
>>> and the whole page is refreshed when i submit the form. Any idea ?
>>>
>>> [WARN] ComponentInstanceResultProcessor Component Test:accountmanagement
>>> was returned from an event handler method, but is not a page component.
>>> The
>>> page containing the component will render the client response.
>>>
>>> Thanks in advance.
>>>
>>> Stephane
>>>
>>>
>>>
>>
>>
>>
>>
>>
>


Re: Displaying image on T5 page

2008-07-10 Thread Lance Java
This should help
http://wiki.apache.org/tapestry/Tapestry5HowToCreatePieChartsInAPage

2008/7/10 Yeeswara Nadapana (HCL Financial Services) <
[EMAIL PROTECTED]>:

>
> Hi,
>
>
>
> I am new to Tapestry. Using Tapestry 5.0.10 with my application. I need
> to display a chart image on my application using dynamic data. I am
> using JFreeChart for that. But, I couldn't get the way to display the
> image on my page.
>
>
>
> I have to display the image while rendering the page, not as an
> ActionLink. Can anyone help with this?
>
>
>
>
>
> Regards,
>
> Yeeswar
>
>
>
>
>
> DISCLAIMER:
>
> ---
> The contents of this e-mail and any attachment(s) are confidential and
> intended for the named recipient(s) only.
> It shall not attach any liability on the originator or HCL or its
> affiliates. Any views or opinions presented in
> this email are solely those of the author and may not necessarily reflect
> the opinions of HCL or its affiliates.
> Any form of reproduction, dissemination, copying, disclosure, modification,
> distribution and / or publication of
> this message without the prior written consent of the author of this e-mail
> is strictly prohibited. If you have
> received this email in error please delete it and notify the sender
> immediately. Before opening any mail and
> attachments please check them for viruses and defect.
>
> ---


Re: dynamically disable field

2008-07-29 Thread Lance Java
java:
class MyPage {
   @Property
   private String value;

   @Property
   private boolean disabled;
}

tml:


On 29/07/2008, Tan [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> hi all,
>
> i'm newbie in tapestry.  May i know is there any dynamically way to
> code it in java to control over tml  = false or true base
> on my coding?
> Thank you.
>
> Regards,
> Tan
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: help with self developed imagemap component

2008-08-08 Thread Lance Java
@see
http://wiki.apache.org/tapestry/Tapestry5HowToCreateASimpleGraphComponent

Where a link is created for the "chart" event and handeled by onChart()

On 08/08/2008, Gregor Burger <[EMAIL PROTECTED]> wrote:
>
> hi,
>
> I would like to develop a component which renders an imagemap
> produced by graphviz, so I can click on the graph elements.
> graphviz provides me the html map which i render using
> an raw Insert component. I've also developed a service which provides
> me the images from graphviz. This works fine, which is really cool.
>
> BUT:
>
> I need to specify the link targets in the graphviz script before the
> component gets rendered. So my question: How could I generate
> DirectLinks so i can embed the urls of the links in the graphviz script.
>
> I hope my explanations aren't to confusing and that somebody can
> help me.
>
> thanks in advance
>
> gregor
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: 答复: T5: Select component + onchange()

2008-08-15 Thread Lance Java
getBytes() will use the default encoding
[System.getProperty("file.encoding");]
if the default encoding is not UTF-8 in your example, you are trying to
construct a utf-8 string from a non utf-8 byte array.

Try this:
utfStr=new String("滕训华".getBytes("UTF-8"),"UTF-8");

Using chinese characters directly in you java code may be seen as bad
practice. You could instead store them in a property file or similar.
Alternatively you could use the unicode representation in your java code
"\u..."

Cheers,
Lance.

2008/8/14 滕训华 <[EMAIL PROTECTED]>

>
> Hi,Sven:
>I use your example code in my project,but when I return Chinese to
> javascript function and use alert to display it.it can not display
> normally,
> how can I slove this problem,thanks.
>
> My code:
>
>TextStreamResponse onChange(TblCustomerInfo changedCustomer){
>String utfStr="";
>try{
>utfStr=new String("滕训华".getBytes(),"UTF-8");
>}
>catch(UnsupportedEncodingException e){
>
>}
>return new  TextStreamResponse("text/html",utfStr);
>
>}
>
> My javascript code:
>
>function customerChangeEvent(response){
>
>alert(response);
>
>}
> -邮件原件-
> 发件人: Sven Homburg [mailto:[EMAIL PROTECTED]
> 发送时间: 2008年4月25日 2:54
> 收件人: Tapestry users
> 主题: Re: T5: Select component + onchange()
>
> here some sample code sequences
>
> your page class (simplified):
>
> @Component(parameters={"event=change"
> "onCompleteCallback=onSelect1Changed"})
> @Mixins("t5components/OnEvent")
> private Select _select1
>
> @Component
> private Select _select2
>
> @OnEvent(component = "select1", value = "change")
> JSONObject select1ElementChanged(String value)
> {
> JSONObject json = new JSONObject();
> json.put("result", new JSONArray("[['a', 'value a'], ['b', 'value b'],
> ['c',
> 'value c'], ['d', 'value d']]"));
> return json;
> }
>
>
> your page tml (simplified):
>
> 
> first value
> 
>
> 
> 
>
> 
> function onSelect1Changed(response)
> {
> var json = response.evalJSON();
> var array = $A(json.result)
>
> array.each(function(item){
>
> // create new option for select tag "select2" and fill value attribute with
> "item[0]"
> // and fill option.innerText with "item[1]"
>
> })
> }
> 
>
>
>
> 2008/4/24, Marcelo Lotif <[EMAIL PROTECTED]>:
> >
> > Yeah, i know this, but none of these responses suit to my needs (maybe a
> > Page response, but this will force a reload)... i tried to return a block
> > with the part of the code that i was trying to change, but i had no
> success
> >
> > And i don't have the enough knowledge of the JSON api and javascript...
> >
> > So i'm using the onchange='this.form.submit()'...
> >
> > =)
> >
> >
> > 2008/4/24 Sven Homburg <[EMAIL PROTECTED]>:
> >
> > > the JSONObject/JSONArray response too
> > >
> > > 2008/4/24, Sven Homburg <[EMAIL PROTECTED]>:
> > > >
> > > > the return type is not limited to StreamResponse.
> > > > all you can respond all that tapestry allowes here
> > > >
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
> > > > its up to you
> > > >
> > > > 2008/4/24, Marcelo Lotif <[EMAIL PROTECTED]>:
> > > >>
> > > >> I had the same issue as Leon some days ago (and this seems to be a
> > very
> > > >> common issue), and i tried your component. It's very good, with some
> > > ajax,
> > > >> but the return type is a little bit limited for what i was trying to
> > > >> achieve(update a combo with information from another combo, which
> has
> > > your
> > > >> mixin). The only way to do it was hardcoding the select in my
> java(or
> > > >> javascript, whatever), that was too creepy for me.
> > > >>
> > > >> My questions:
> > > >> 1 - Is there any way of change my page data with something more
> > > elaborate
> > > >> than TextStreamResponse?
> > > >> 1 - Is there any efforts on adding some similar behavior to future
> > > >> releases?
> > > >>
> > > >> Thank you!
> > > >>
> > > >> 2008/4/24 Sven Homburg <[EMAIL PROTECTED]>:
> > > >>
> > > >>
> > > >> > try this
> > > >> >
> > > >> >
> > > >>
> > >
> >
>
> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/
> commons/mixins/OnEvent.html
> > > >> >
> > > >> > 2008/4/24, Leon Derks <[EMAIL PROTECTED]>:
> > > >> > >
> > > >> > > Hello
> > > >> > >
> > > >> > > Is it possible to catch the onChange event from a select
> component
> > > in
> > > >> the
> > > >> > > java  page?
> > > >> > >
> > > >> > > I would expect something like: onChangeFromSelect(long id)
> {}
> > > >> > >
> > > >> > > Because I want to update information on my page, based on the
> > value
> > > >> that
> > > >> > is
> > > >> > > selected.
> > > >> > >
> > > >> > > How can I do that?
> > > >> > >
> > > >> > > Leon
> > > >> > >
> > > >> > >
> > > >> > >
> > > -
> > > >> > > To unsubsc

Re: Multiple file upload

2008-08-28 Thread Lance Java
The html file object only supports 1 file at a time, it's also locked down
by browser security so you can't set the value via javascript.
To upload multiple files you can either use multiple file objects with some
user friendly javascript or use an applet or a flash component.

I've seen some open source multi-upload applets floating about... have never
used one though.
Facebook for example uses an applet to upload multiple photos

2008/8/28 Massimo Lusetti <[EMAIL PROTECTED]>

> On Thu, Aug 28, 2008 at 5:08 PM, ProAdmin Dariusz Dwornikowski
> <[EMAIL PROTECTED]> wrote:
>
> > I think some major ajax has to be used.
>
> Look into Component Reference on Tapestry5 documentation site
>
>
> --
> Massimo
> http://meridio.blogspot.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: T5: Serverpush functionality?

2008-10-06 Thread Lance Java
Use dwr's reverse ajax... it's great!
http://directwebremoting.org/dwr/reverse-ajax

If you download the sample war it has examples including a chat application.

Dwr3.0 is soon to be released with a whole lot of reverse-ajax niceness.

2008/10/6 Thiago H. de Paula Figueiredo <[EMAIL PROTECTED]>

> Em Mon, 06 Oct 2008 09:19:57 -0300, Otho <[EMAIL PROTECTED]> escreveu:
>
>
>  Hi all!
>>
>> I am musing about a little project where there is for example a simple
>> chatserver in the background and a frontend built with tapestry where a
>> small portion of the page is used as chatwindow.
>>
>> I don't want to use Webstart or an applet but just plain T5.
>>
>> Has anyone already done serverpush with T5 and would like to share the
>> howto or could anyone direct me at some documents about how to do reverse
>> ajax
>> with Tapestry?
>>
>
> Take a look at Comet: http://cometdproject.dojotoolkit.org/. As far as I
> know, there is no ready-to-use implementation in T5, but I think it will be
> more related to Javascript than to T5.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> Consultor, desenvolvedor e instrutor em Java
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: [Spam Rating:3.40] Re: T5: Ajax components

2008-11-04 Thread Lance Java
I find this page useful http://wiki.apache.org/tapestry/Tapestry5HowTos

2008/11/4 James Sherwood <[EMAIL PROTECTED]>

> Hello,
>
> I am just in the process of learning T5 so the 'easy' part is not so 'easy'
> right now.
>
> Is there any good tutorials on how to make components like I listed by
> chance?
>
> --James
>
> -Original Message-
> From: devilabit [mailto:[EMAIL PROTECTED]
> Sent: October-31-08 5:55 PM
> To: users@tapestry.apache.org
> Subject: [Spam Rating:3.40] Re: T5: Ajax components
>
>
> It is easy to make custom components or create mixins in Tapestry and the
> t5components you mention do look promising.  You also have the option of
> using another javascript library like extjs if you need more advanced
> "sexy"
> looking widgets.
>
>
> James Sherwood wrote:
> >
> > Hello,
> >
> >
> >
> > I have been looking into some Ajax components to use in my upcoming T5
> > project.
> >
> >
> >
> > Tapestry itself does not seem to have much along these lines built in and
> > I
> > was wondering where people are getting there Ajax components from(besides
> > building them as this seems a bit above me right now)?
> >
> >
> >
> > The T5Components site seems to be the best and I am particularly
> > interested
> > in the in place editor:
> >
> >
> >
> > http://87.193.218.134:8080/t5c-demo/inplaceeditorpage
> >
> >
> >
> > and the tab set style of component:
> >
> >
> >
> > http://87.193.218.134:8080/t5c-demo/tabsetpage
> >
> >
> >
> > Are these the components I should be using or is there going to be built
> > in
> > ones at some point or am I missing something about using Ajax in T5 for
> > components such as these?
> >
> >
> >
> >
> >
> >
> >
> > Thanks,
> >
> > --James
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-Ajax-components-tp20246910p20273881.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]
>
>
> __ Information from ESET Smart Security, version of virus signature
> database 3536 (20081019) __
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
> __ Information from ESET Smart Security, version of virus signature
> database 3536 (20081019) __
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: T5: Using an annotation to define which is the page activation context / onActivate method ?

2008-11-11 Thread Lance Java
You could use pageAttached
http://tapestry.apache.org/tapestry5/tapestry-core/guide/lifecycle.html


2008/11/8 Joel Halbert <[EMAIL PROTECTED]>

> just realised that the order of invocation of onActivate methods is the
> other way around to that which i thought it was:
> http://markmail.org/message/7o52hrmcvli3jsje
>
> This does pose the question though: how can I invoke base functionality
> after subclasses have been initialised, but before PageRender?
>
> hmmm (being Saturday I've very likely missed something here)
>
> On Sat, 2008-11-08 at 14:40 +, Joel Halbert wrote:
> > Hi,
> >
> > Is it possible to use an annotation to define which method should be
> > used to set the page activation context?
> > i.e. I would like to define an onActivate() method, but have it called
> > something else, e.g. onActivateX().
> >
> > A reason for wanting to do so is to ensure that i may have a single
> > onActivate method in a base class which is always called regardless of
> > wether there are onActivate methods in subclasses (that might otherwise
> > override it and not call super.onActivate()).
> >
> > Thx
> > Joel
> >
> >
>
>
> --
> SU3 Analytics Ltd
> The Print House
> 18 Ashwin Street
> E8 3DL
> London
>
> Tel: +44 (0) 20 3051 8637
> Fax: +44 (0) 20 8196 2215
> Mob: +44 (0) 79 7431 0685
> www.su3analytics.com
>
> SU3 Analytics Ltd is a company registered in England and Wales under
> company number 06639473 at registered address 61b Oxford Gardens, London
> W10 5UJ, United Kingdom.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


[OT] Hot deploy with JBoss

2009-01-06 Thread Lance Java
Hi guys, this is slightly off topic but I know this problem has been solved
with tapestry so I'm sure there's some expertise in this forum.

I am attempting to add hot deploy functionality to an application which is
deployed to JBoss and uses spring mvc (sorry). I was hoping to be able to
hot deploy my spring controllers and back end services without re-starting
the server. I have attempted to do this in the past by updating an exploded
ear on jboss and touching the deployment descriptor but get out of memory
errors.

Basically my questions are:
1. Do I need to add classloader dropping wrappers to hot deploy my services
/ controllers?
2. Has anyone had success with JBoss's hot deploy
3. Am I better off to develop in Jetty because it's hot deploy is better
4. Can maven help me with this.

Sorry to ask this off topic question but I feel that these headaches have
been addressed by tapestry developers.

Cheers,
Lance.


Re: Push event using AJAX from server to client

2009-01-06 Thread Lance Java
DWR provides reverse ajax which will do what you want. See the reverse ajax
clock or chat examples in the war which can be downloaded from
http://directwebremoting.org/dwr/download

Cheers,
Lance.

2009/1/5 Peter Stavrinides 

> Hi everyone, Happy New Year!
>
> Has anyone played with AJAX push events? I would like to send a simple
> notification message (generated on the server via clicking a button) to
> client browsers... I am not even sure how to begin or if Tapestry can
> facilitate it.
>
> Thanks for your help,
> Peter
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Not working example for BeanDisplay

2009-08-19 Thread Lance Java


${bean.lastname.toUpperCase()}



Should read



${user.lastname.toUpperCase()}




2009/8/19 Andrey Larionov 

> Example from of parametrizing BeanDisplay component
> (
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/BeanDisplay.html
> )
> dosnt work
>
> 
>   ${bean.link.toUpperCase()}
> 
>
> this block produces exception somthing like
>
> Class components.FeedEntryElement does not contain a property named
> 'bean' (within property expression 'bean.link'). Available properties:
> class, componentResources, entry, entryEntry.
>
> Wrong example or i doing something wrong?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: [T5.1] Serialization and IoC?

2009-08-21 Thread Lance Java
You might need to split your cart into two classes... Cart (serializable)
which contains the items in a cart and CartService (not-serializable) which
encapsulates the functions to perform on Cart instances.

2009/8/21 xfile80303 

>
> Hi Christian,
>
> Well, it's kind of complex, but let me give you a contrived example and see
> if that helps clarify:
>
> Let's say we have an (Session State Object) SSO for a shopping cart.  That
> cart object needs to be persisted via Serialization so the cart will be
> available for longer than the session (say the user comes back a month
> later, etc.).  Normally, Tapestry will instantiate an instance of the Cart
> object via normal SSO IoC mechanisms, and will "give" the cart instances of
> services it needs.  How, using the java.io.Serialization mechanism can I
> initialize the cart with these service instances, since they should not/can
> not be serialized?
>
> Levi
>
>
> Christian Gruber wrote:
> >
> > Why would they be manifested by the IoC?  Are they value/domain
> > objects?  They probably shouldn't be managed by the IoC, but by a
> > service which is itself injected.  That service should then be able to
> > provide these objects and, if given them in serialized form and re-
> > constitute them appropriately.  Maybe you can give an example, so we
> > can better understand what you're trying to do?
> >
> > Christian.
> >
> > On Aug 20, 2009, at 6:32 PM, xfile80303 wrote:
> >
> >>
> >> Hi all,
> >>
> >> I have some Objects which I need to Serialize (java.io.Serailizable)
> >> and
> >> these objects are normally instantiated and initialized by
> >> Tapestry's IoC
> >> mechanism, such that services are injected into the constructor,
> >> etc.  The
> >> services themselves are not Serialzable (and would not make sense if
> >> they
> >> were declared so), so I'm wondering how I will get references to these
> >> services when the object is recreated via the Serialization
> >> mechanism.  Will
> >> Tapestry IoC somehow perform initialization?  I think not...?
> >>
> >> Thanks,
> >>
> >> Levi
> >> --
> >> View this message in context:
> >> http://n2.nabble.com/T5-1-Serialization-and-IoC-tp3482190p3482190.html
> >> Sent from the Tapestry Users mailing list archive at Nabble.com.
> >>
> >> -
> >> 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
> >
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/T5-1-Serialization-and-IoC-tp3482190p3482468.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Boolean Property Expression

2009-10-13 Thread Lance Java
The java beans spec only states that "is" can be used for boolean, it does
not mention java.lang.Boolean.

https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/viewproductdetail-start?productref=7224-javabeans-1.01-fr-spec-oth-js...@cds-cds_developer
2009/10/13 Benny Law 

> Hi all,
>
> I just came across something that seems odd to me: I have a User object
> which has a Boolean property with isMobileUser() and setMobileUser(Boolean)
> as getter and setter. When I used ${user.mobileUser} in my template (user
> is
> a page property), Tapestry complained about the expression being
> write-only.
> Apparently, it did not recognize the getter with the "is" prefix. Changing
> the expression to ${user.isMobileUser()} fixed the problem.
>
> Can somebody confirm whether Tapestry recognizes the "is" getter prefix for
> Boolean (not boolean) properties?
>
> Thanks,
>
> Benny Law
>


Re: Geronimo+Tomcat = Parameter namespacePrefix was null

2009-10-14 Thread Lance Java
> Wouldn't the JAR in my lib supercede the one provided by the container?
The default classloader implementation (ie java.lang.Classloader) is to
attempt to resolve the class in the parent classloader before trying the
current classloader. Different containers provide different configuration
options for this. I'm not sure of Geronimo's implementation.

2009/10/14 Michael Gentry 

> It looks like Geronimo has an older version of Woodstox:
>
> ./repository/woodstox/wstx-asl/3.2.1/wstx-asl-3.2.1.jar
>
> Versus what my application packaged:
>
>
> ./repository/default/PWR/1255532550665/PWR-1255532550665.war/WEB-INF/lib/woodstox-core-asl-4.0.3.jar
>
>
> I'm not sure if that is the real reason, but the ticket was seeming to
> indicate it could be a Woodstox problem.  Wouldn't the JAR in my lib
> supercede the one provided by the container?
>
> Thanks,
>
> mrg
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Ajax fileupload

2009-10-19 Thread Lance Java
As mentioned on previous threads, you can use dwr to upload files in an ajax
style fashion which uses a hidden iframe. There is an example of using
fileupload in the demo war file
http://directwebremoting.org/dwr/download.html

2009/10/18 Argo Vilberg 

> hi
> Is in tapestry such component like GMAIL fileupload. Choose file and after
> that, uploading started automatically?
>
>
> Argo
>


Re: Blackbird getting in the way of troubleshooting javascript errors in ChenilleKit components

2009-11-03 Thread Lance Java
You can proxy through to the following functions to populate the firebug
log:
console.log(), console.debug(), console.info(), console.warn(),
console.error(), console.trace()

Obviously these functions should test:
if(console)

2009/11/3 Dave Greggory 

> I'm trying to upgrade to 5.1, and everything is complete except for
> chenillekit components (Window and FCKEditor). I'm getting a lot of
> javascript errors from them, but unfortunately the Blackbird console is
> getting in the way of debugging them. When a javascript error occurs, I
> would like it to actually throw the exception instead of logging it... it's
> much easier to track down the source from FireBug when that happens. But
> with the adaption of Blackbird, this is no longer the case and I have no
> clue where the error occurs (it happens when I click on a link that is
> supposed to open a Chenille Kit Window component).
>
> How do I disable Blackbird completely, so I can actually navigate through
> the thrown exceptions/errors in Firebug like in 5.0.18? Blackbird website
> says to do the following but that will only hide the errors, it won't give
> me the original behavior.
>
>
> var log = {
>  toggle: function() {},
>  move: function() {},
>  resize: function() {},
>  clear: function() {},
>  debug: function() {},
>  info: function() {},
>  warn: function() {},
>  error: function() {},
>  profile: function() {}
> };
> Thanks,
> Dave
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Help with using DWR with Tapestry

2009-12-22 Thread Lance Java
You might like to take this discussion onto the dwr user's list. I think it
might involve writing a TapestryCreator which is able to look up services
from the tapestry registry. Please download the dwr source and have a look
at the SpringCreator for inspiration.

Cheers,
Lance.

2009/12/21 Ashwanth Kumar 

> Hello,
>
> In my project, i would like to use DWR along with Tapestry! But i've a
> probelm. Its like i need to access the DB, i use Hibernate with Tapestry.
> In
> my class i've:
>
> @Inject
> private Session _session;
>
> when i access this class from DWR, Tapestry doesn't interfere at all. But,
> i'm getting a null pointer exception where i first start using the Session.
> How and what should be done for this?
>
>  - Ashwanth Kumar
>


Re: Help with using DWR with Tapestry

2009-12-22 Thread Lance Java
For a bit more info your dwr.xml might look like this:


  

  
  

  

  


Perhaps some of the tapestry gurus can help out a bit more here. For
normal DWR usage in tapestry, you disable the tapestry filter for /dwr/*. It
seems that you might want a bit of the tapestry filter's functionality but
not all. For example injecting the request / response / session and creating
a hibernate session.

If you come up with a working solution, please post it back to the DWR
user's list and we'll include it in the project.

Cheers,
Lance.

2009/12/22 Lance Java 

> You might like to take this discussion onto the dwr user's list. I think it
> might involve writing a TapestryCreator which is able to look up services
> from the tapestry registry. Please download the dwr source and have a look
> at the SpringCreator for inspiration.
>
> Cheers,
> Lance.
>
> 2009/12/21 Ashwanth Kumar 
>
> Hello,
>>
>> In my project, i would like to use DWR along with Tapestry! But i've a
>> probelm. Its like i need to access the DB, i use Hibernate with Tapestry.
>> In
>> my class i've:
>>
>> @Inject
>> private Session _session;
>>
>> when i access this class from DWR, Tapestry doesn't interfere at all. But,
>> i'm getting a null pointer exception where i first start using the
>> Session.
>> How and what should be done for this?
>>
>>  - Ashwanth Kumar
>>
>
>


Re: Help with using DWR with Tapestry

2009-12-22 Thread Lance Java
One more thing to note is that DWR supports ajax filters which are basically
interceptors on DWR services. You may want to duplicate some of the
TapestryFilter's functionality in an AjaxFilter.

http://directwebremoting.org/dwr/server/dwrxml/filters.html
2009/12/22 Lance Java 

> For a bit more info your dwr.xml might look like this:
>
> 
>   
> 
>   
>   
> 
>   
> 
>   
> 
>
> Perhaps some of the tapestry gurus can help out a bit more here. For
> normal DWR usage in tapestry, you disable the tapestry filter for /dwr/*. It
> seems that you might want a bit of the tapestry filter's functionality but
> not all. For example injecting the request / response / session and creating
> a hibernate session.
>
> If you come up with a working solution, please post it back to the DWR
> user's list and we'll include it in the project.
>
> Cheers,
> Lance.
>
> 2009/12/22 Lance Java 
>
>  You might like to take this discussion onto the dwr user's list. I think
>> it might involve writing a TapestryCreator which is able to look up services
>> from the tapestry registry. Please download the dwr source and have a look
>> at the SpringCreator for inspiration.
>>
>> Cheers,
>> Lance.
>>
>> 2009/12/21 Ashwanth Kumar 
>>
>> Hello,
>>>
>>> In my project, i would like to use DWR along with Tapestry! But i've a
>>> probelm. Its like i need to access the DB, i use Hibernate with Tapestry.
>>> In
>>> my class i've:
>>>
>>> @Inject
>>> private Session _session;
>>>
>>> when i access this class from DWR, Tapestry doesn't interfere at all.
>>> But,
>>> i'm getting a null pointer exception where i first start using the
>>> Session.
>>> How and what should be done for this?
>>>
>>>  - Ashwanth Kumar
>>>
>>
>>
>


Re: Help with using DWR with Tapestry

2009-12-22 Thread Lance Java
Ah... great.

The TapestryCreator can access the servlet context using:
org.directwebremoting.WebContextFactory.get().getServletContext();

http://directwebremoting.org/dwr/server/javaapi.html

2009/12/22 Thiago H. de Paula Figueiredo 

> Em Tue, 22 Dec 2009 09:27:26 -0200, Lance Java 
> escreveu:
>
>
> One more thing to note is that DWR supports ajax filters which are
>> basically interceptors on DWR services. You may want to duplicate some of
>> the
>> TapestryFilter's functionality in an AjaxFilter.
>>
>
> There's no need to do that. TapestryFilter puts the Registry in the servlet
> context under the org.apache.tapestry5.application-registry attribute. Then
> you can get the HibernateSessionManager and get a Session through its
> getSession() method. I haven't tested it, but that's what I would try.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Help with using DWR with Tapestry

2009-12-22 Thread Lance Java
The tapestry creator will look something like...

public class TapestryCreator extends AbstractCreator {
private String beanName;

public String getBeanName() {
return beanName;
}

// set by config in dwr.xml (see my prev email)
public void setBeanName(String beanName) {
this.beanName = beanName;
}

   public Object getInstance() {
  // Use this instead of WebContextFactory (suggested in my prev email)
  ServletContext servletContext =
org.directwebremoting.ServerContextFactory.get().getServletContext();
  Object bean = getTapestryBean(servletContext, getbeanName);
   }

   protected Object getTapestryBean(ServletContext servletContext, String
beanName) {
  // look up the bean from the tapestry registry
   }

   public Class getType() {
  return getInstance().getClass();
   }
}

You will then use a dwr config similar to my previous email to define the
TapestryCreator and map it to a named service in the tapestry registry. As I
said, please download the DWR source and take a look at the SpringCreator
for inspiration.

2009/12/22 Ashwanth Kumar 

> Can u provide an example! I dont find any good example on the site!
>
>  - Ashwanth Kumar
>
> On Tue, Dec 22, 2009 at 5:10 PM, Lance Java  >wrote:
>
> > Ah... great.
> >
> > The TapestryCreator can access the servlet context using:
> > org.directwebremoting.WebContextFactory.get().getServletContext();
> >
> > http://directwebremoting.org/dwr/server/javaapi.html
> >
> > 2009/12/22 Thiago H. de Paula Figueiredo 
> >
> > > Em Tue, 22 Dec 2009 09:27:26 -0200, Lance Java <
> > lance.j...@googlemail.com>
> > > escreveu:
> > >
> > >
> > > One more thing to note is that DWR supports ajax filters which are
> > >> basically interceptors on DWR services. You may want to duplicate some
> > of
> > >> the
> > >> TapestryFilter's functionality in an AjaxFilter.
> > >>
> > >
> > > There's no need to do that. TapestryFilter puts the Registry in the
> > servlet
> > > context under the org.apache.tapestry5.application-registry attribute.
> > Then
> > > you can get the HibernateSessionManager and get a Session through its
> > > getSession() method. I haven't tested it, but that's what I would try.
> > >
> > > --
> > > Thiago H. de Paula Figueiredo
> > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> developer,
> > > and instructor
> > > Owner, software architect and developer, Ars Machina Tecnologia da
> > > Informação Ltda.
> > > http://www.arsmachina.com.br
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> >
>


Re: Help with using DWR with Tapestry

2009-12-22 Thread Lance Java
No probs. To verify that the TapestryFilter is doing it's job, try to
@Inject RequestGlobals into your bean.

Cheers,
Lance.

2009/12/22 Ashwanth Kumar 

> Sure,
>
> Thanks a lot! I'll post my code, once i get it working!
>
>  - Ashwanth Kumar
>
> On Tue, Dec 22, 2009 at 5:32 PM, Lance Java  >wrote:
>
> > The tapestry creator will look something like...
> >
> > public class TapestryCreator extends AbstractCreator {
> >private String beanName;
> >
> >public String getBeanName() {
> >return beanName;
> >}
> >
> >// set by config in dwr.xml (see my prev email)
> >public void setBeanName(String beanName) {
> >this.beanName = beanName;
> >}
> >
> >   public Object getInstance() {
> >  // Use this instead of WebContextFactory (suggested in my prev
> email)
> >  ServletContext servletContext =
> > org.directwebremoting.ServerContextFactory.get().getServletContext();
> >  Object bean = getTapestryBean(servletContext, getbeanName);
> >   }
> >
> >   protected Object getTapestryBean(ServletContext servletContext, String
> > beanName) {
> >  // look up the bean from the tapestry registry
> >   }
> >
> >   public Class getType() {
> >  return getInstance().getClass();
> >   }
> > }
> >
> > You will then use a dwr config similar to my previous email to define the
> > TapestryCreator and map it to a named service in the tapestry registry.
> As
> > I
> > said, please download the DWR source and take a look at the SpringCreator
> > for inspiration.
> >
> > 2009/12/22 Ashwanth Kumar 
> >
> > > Can u provide an example! I dont find any good example on the site!
> > >
> > >  - Ashwanth Kumar
> > >
> > > On Tue, Dec 22, 2009 at 5:10 PM, Lance Java  > > >wrote:
> > >
> > > > Ah... great.
> > > >
> > > > The TapestryCreator can access the servlet context using:
> > > > org.directwebremoting.WebContextFactory.get().getServletContext();
> > > >
> > > > http://directwebremoting.org/dwr/server/javaapi.html
> > > >
> > > > 2009/12/22 Thiago H. de Paula Figueiredo 
> > > >
> > > > > Em Tue, 22 Dec 2009 09:27:26 -0200, Lance Java <
> > > > lance.j...@googlemail.com>
> > > > > escreveu:
> > > > >
> > > > >
> > > > > One more thing to note is that DWR supports ajax filters which are
> > > > >> basically interceptors on DWR services. You may want to duplicate
> > some
> > > > of
> > > > >> the
> > > > >> TapestryFilter's functionality in an AjaxFilter.
> > > > >>
> > > > >
> > > > > There's no need to do that. TapestryFilter puts the Registry in the
> > > > servlet
> > > > > context under the org.apache.tapestry5.application-registry
> > attribute.
> > > > Then
> > > > > you can get the HibernateSessionManager and get a Session through
> its
> > > > > getSession() method. I haven't tested it, but that's what I would
> > try.
> > > > >
> > > > > --
> > > > > Thiago H. de Paula Figueiredo
> > > > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> > > developer,
> > > > > and instructor
> > > > > Owner, software architect and developer, Ars Machina Tecnologia da
> > > > > Informação Ltda.
> > > > > http://www.arsmachina.com.br
> > > > >
> > > > >
> > > > >
> -
> > > > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > > > >
> > > > >
> > > >
> > >
> >
>


Re: New Tapestry Website - http://www.seesaw.com/

2010-01-29 Thread Lance Java
Hi... just to give you a heads up... the css is not working as expected in
IE6 (screenshot attached)
Your response to this may well be "get a better browser" which I totally
understand.

Cheers,
Lance.
On 29 January 2010 10:18, Ben Gidley  wrote:

> Hi,
>
> We have just launched http://www.seesaw.com/ into beta this is a Tapestry
> 5
> powered website providing a video on demand site (like iPlayer or Hulu) in
> the UK market.
>
> It is still in beta but if you sign up there is a good chance of being
> invited soon.
>
> To help share this as a good Tapestry case study I will be producing some
> blog articles on key bits and doing a talk at Skillsmatter in London on the
> 23rd March -
> http://skillsmatter.com/event/java-jee/tapestry-5-in-action/zx-486 sharing
> our experiences with Tapestry.
>
> Thanks
>
> Ben Gidley
>
> www.gidley.co.uk
> b...@gidley.co.uk
>

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

Re: Get the referring page

2009-01-23 Thread Lance Java
1 more suggestion:
A hidden "returnPage" field on each of referring pages and the referring
pages POST to the multiple entry page.

2009/1/23 Peter Stavrinides 

> Hi everyone,
>
> I have a page with multiple entry points, when a user is done editing I
> want to return them to their previous page, there are a couple of ways of
> doing this I guess:
> - JavaScript (not so keen on this, I prefer a server side redirect)
> - Using the HTTP referer header of the Request service (I am thinking of
> using this, not sure what the drawbacks could be?)
> - ASO (hmmm not sure about the multiple window thing)
> - onActivate (don't want the callback URL to appear in the address bar)
> - Set a property on the page before calling onActivate (this could also
> work, of course it limits me to internal URL's over the referer approach...
> but thats probably also okay though)
>
> I would like to know if there is any possibility that the referer might not
> be set correctly under any circumstances etc... or if there is a better way
> to call back a previous page/URL.
>
> Thanks,
> Peter
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: How to get a page's html to send it as an email?

2009-03-16 Thread Lance Java
DWR does this by forwarding to the URL passing a response object that writes
to a local stringbuffer.
See the attached files, the method is DefaultWebContext.forwardToString();

Cheers,
Lance.

2009/3/16 Andreas Pardeike 

> Hi,
>
> I build it so my users can customize their tapestry pages. Now I
> want to add that they can send html emails by using the output of
> a specific page. How do I grab the outcome of a page for further
> processing?
>
> Regards,
> Andreas Pardeike
>
> -
> 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

Re: How to get a page's html to send it as an email?

2009-03-17 Thread Lance Java
Sorry... forgot to mention that this is a very general approach and there is
probably a tapestry way to do it.

2009/3/17 Andreas Pardeike 

> On 16 mar 2009, at 16.34, Lance Java wrote:
>
>  DWR does this by forwarding to the URL passing a response object that
>> writes to a local stringbuffer.
>> See the attached files, the method is DefaultWebContext.forwardToString();
>>
>
> Thanks for sharing the code with me. However, I wonder if there is a more
> build-in way of getting
> a T5 page to render into a string without simulating an external http
> request. Something that would
> even work with a component.
>
> Anyone?
>
> Andreas Pardeike
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: T5: tapestry-upload, allowing user to remove filename from textfield

2009-03-19 Thread Lance Java
The file object is pretty locked down by the browser and is impossible to
manipulate using javascript because of potential hacking implications. You
may have to settle for a x button next to it which creates a new file object
and drops the original.

2009/3/19 leechj 

>
> I feel foolish for not being able to figure this out, but I'm trying to
> make
> it so the user can remove the file name from the field in case they decide
> they don't actually want to upload a file as a part of their form. But when
> I click on the field, it just brings up a browsing box and I can't actually
> remove the file from the field.
> Any idea what I can do to allow a user to get rid of that file path/name?
>
> Thanks!
> --
> View this message in context:
> http://www.nabble.com/T5%3A-tapestry-upload%2C-allowing-user-to-remove-filename-from-textfield-tp22601002p22601002.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Using JSP taglibs in T5?

2009-06-10 Thread Lance Java
I have seen this sort of functionality used in DWR. The response is wrapped
in a class that writes to a local buffer instead of the response output
stream.

2009/6/10 Andreas Andreou 

> I think i remember a Tapestry component in the wiki (not sure if it
> was T4 or T5) that would include a jsp
> in the current (tapestry) page -
> it basically did
> context.getRequestDispatcher( jspPath ).include(request, response)
>
> I'm not really sure if this still works + it would mean you'd use the
> taglib in that jsp
> which you then include through the component... also, if the taglib
> generates links,
> they'll probably not work
>
> On Wed, Jun 10, 2009 at 1:21 PM, Alfie
> Kirkpatrick wrote:
> > Do people think this is possible and worth doing, or a complete
> > non-starter? We occasionally want to use products/libraries that come
> > with taglibs as their primary way of integrating functionality into
> > pages. For example, it might be a CMS product with taglibs to render
> > content + formatting into the page.
> >
> >
> >
> > Freemarker manages to do this but not looked at how. I wondered if
> > anyone else has tried this or thought more about it...
> >
> >
> >
> > Thanks!
> >
> > Alfie.
> >
> >
>
>
>
> --
> Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: [T5] JPF-Plugins (or any other plugin-framework) to add page content?

2009-07-27 Thread Lance Java
Tapestry OSGI may help you
http://groups.google.com/group/tapestry-osgi/

2009/7/27 Tobias Wehrum 

> Hello everyone,
>
> I need to write an application where multiple page contents should be added
> in later via plugins - for example different ways to output things, other
> payment modi, or statistics.
>
> Currently I am reading into http://jpf.sourceforge.net/index.html, but it
> is not necessairly a JPF problem:
> How can I add Tapestry pages and classes later in "per hand"? Or can you
> think of any other way plugin support could be made possible?
>
> Can anyone can make sense out of what I am trying to do? I would love some
> ideas, hints and solutions, because I'm stuck.
>
> Cheers!
> Tobias
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: [T4]. multiple file upload. Help.

2009-08-04 Thread Lance Java
This is not exactly true... you can use a hidden form. This may require a
bit of javascript to move the file objects to the hidden form, post the the
form then move them back to their visible location. DWR uses this trick.
Browser security is such that you can not set the value of a file object
with javascript, the user must do this.

2009/8/4 Juan E. Maya 

> Ajax doesn't allow to use multipart forms, therefore u can't upload
> files using ajax. If u check carefully google is using a flash control
> for this. U could also try to mess around with iframes but it's a big
> mess..
>
> This flash controller could be useful for u: http://swfupload.org/ if
> u decide to go for a flash based control
>
> On Tue, Aug 4, 2009 at 2:11 PM, kk4Nabble wrote:
> >
> > Hi all.
> >
> > Am using  Tapestry 4.1.5.
> > Can anybody help me with uploading multiple files. Just like Gmail does.
> >
> > Right now i can upload single file ,But how to upload multiple files via
> > AJAX.
> > Is there any way to do it.
> >
> > is there anyway to do through the dojo which is integrated with tapestry
> 4?
> > Please suggest..
> >
> > Thank u  all.
> >
> >
> > --
> > View this message in context:
> http://www.nabble.com/-T4-.-multiple-file-upload.-Help.-tp24807257p24807257.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > -
> > 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
>
>


Re: [T4]. multiple file upload. Help.

2009-08-04 Thread Lance Java
Yes.. your correct... you can't do it with XHR... you need a form and an
iframe. It gives you an AJAX-like effect.

2009/8/4 Juan E. Maya 

> I would really like to see how is possible to upload documents via ajax.
> As long as i have seen DWR uses an IFrame.  what do u mean by a hidden
> form? Do u have any examples?
>
> On Tue, Aug 4, 2009 at 3:01 PM, Lance Java
> wrote:
> > This is not exactly true... you can use a hidden form. This may require a
> > bit of javascript to move the file objects to the hidden form, post the
> the
> > form then move them back to their visible location. DWR uses this trick.
> > Browser security is such that you can not set the value of a file object
> > with javascript, the user must do this.
> >
> > 2009/8/4 Juan E. Maya 
> >
> >> Ajax doesn't allow to use multipart forms, therefore u can't upload
> >> files using ajax. If u check carefully google is using a flash control
> >> for this. U could also try to mess around with iframes but it's a big
> >> mess..
> >>
> >> This flash controller could be useful for u: http://swfupload.org/ if
> >> u decide to go for a flash based control
> >>
> >> On Tue, Aug 4, 2009 at 2:11 PM, kk4Nabble wrote:
> >> >
> >> > Hi all.
> >> >
> >> > Am using  Tapestry 4.1.5.
> >> > Can anybody help me with uploading multiple files. Just like Gmail
> does.
> >> >
> >> > Right now i can upload single file ,But how to upload multiple files
> via
> >> > AJAX.
> >> > Is there any way to do it.
> >> >
> >> > is there anyway to do through the dojo which is integrated with
> tapestry
> >> 4?
> >> > Please suggest..
> >> >
> >> > Thank u  all.
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://www.nabble.com/-T4-.-multiple-file-upload.-Help.-tp24807257p24807257.html
> >> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >> >
> >> >
> >> > -
> >> > 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
> >>
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: [T4]. multiple file upload. Help.

2009-08-04 Thread Lance Java
No probs... I wrote most of the DWR file upload code :)

2009/8/4 Juan E. Maya 

> But  DWR does make it pretty easy! Thanks a lot for the tip :)  I just
> read found this article:
> http://fisheye5.cenqua.com/browse/~raw,r=1.2/dwr/web/fileupload/index.html
>
> I had a similar problem last month and this may helped me improve the
> messy js i have for my the iframe handling.
>
> Thanks again!
>
> On Tue, Aug 4, 2009 at 3:20 PM, Lance Java
> wrote:
> > Yes.. your correct... you can't do it with XHR... you need a form and an
> > iframe. It gives you an AJAX-like effect.
> >
> > 2009/8/4 Juan E. Maya 
> >
> >> I would really like to see how is possible to upload documents via ajax.
> >> As long as i have seen DWR uses an IFrame.  what do u mean by a hidden
> >> form? Do u have any examples?
> >>
> >> On Tue, Aug 4, 2009 at 3:01 PM, Lance Java
> >> wrote:
> >> > This is not exactly true... you can use a hidden form. This may
> require a
> >> > bit of javascript to move the file objects to the hidden form, post
> the
> >> the
> >> > form then move them back to their visible location. DWR uses this
> trick.
> >> > Browser security is such that you can not set the value of a file
> object
> >> > with javascript, the user must do this.
> >> >
> >> > 2009/8/4 Juan E. Maya 
> >> >
> >> >> Ajax doesn't allow to use multipart forms, therefore u can't upload
> >> >> files using ajax. If u check carefully google is using a flash
> control
> >> >> for this. U could also try to mess around with iframes but it's a big
> >> >> mess..
> >> >>
> >> >> This flash controller could be useful for u: http://swfupload.org/if
> >> >> u decide to go for a flash based control
> >> >>
> >> >> On Tue, Aug 4, 2009 at 2:11 PM, kk4Nabble
> wrote:
> >> >> >
> >> >> > Hi all.
> >> >> >
> >> >> > Am using  Tapestry 4.1.5.
> >> >> > Can anybody help me with uploading multiple files. Just like Gmail
> >> does.
> >> >> >
> >> >> > Right now i can upload single file ,But how to upload multiple
> files
> >> via
> >> >> > AJAX.
> >> >> > Is there any way to do it.
> >> >> >
> >> >> > is there anyway to do through the dojo which is integrated with
> >> tapestry
> >> >> 4?
> >> >> > Please suggest..
> >> >> >
> >> >> > Thank u  all.
> >> >> >
> >> >> >
> >> >> > --
> >> >> > View this message in context:
> >> >>
> >>
> http://www.nabble.com/-T4-.-multiple-file-upload.-Help.-tp24807257p24807257.html
> >> >> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >> >> >
> >> >> >
> >> >> >
> -
> >> >> > 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
> >> >>
> >> >>
> >> >
> >>
> >> -
> >> 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
>
>


Re: T5.1 Parsing Errors

2009-08-10 Thread Lance Java
 should work

2009/8/10 Michael Gentry 

> Thanks Thiago.  I was trying to do something quick and dirty, but I
> guess I'll do it the right way.  :-)
>
> mrg
>
>
> On Mon, Aug 10, 2009 at 11:39 AM, Thiago H. de Paula
> Figueiredo wrote:
> > Em Mon, 10 Aug 2009 12:23:24 -0300, Michael Gentry <
> mgen...@masslight.net>
> > escreveu:
> >
> >> In my .tml file I have a line:
> >> Individual ID
> >> Tapestry fails to parse this:
> >> Unexpected character '>' (code 62) expected '=' at [row,col
> >> {unknown-source}]: [17,17]
> >> I think it is expecting nowrap="something" ... is this to be expected?
> >
> > Yes. Tapestry's templates must be valid XML, even when generating HTML.
> >
> >> Also, if I try to use a non-breakable space:
> >> Individual ID
> >> I get a different parsing error:
> >> Undeclared general entity "nbsp" at [row,col {unknown-source}]: [17,26]
> >> Thoughts?  (I know ... use CSS ...)
> >
> > Use CSS! :)
> > Again, templates must be valid XML, so you need to add
> > xmlns="http://www.w3.org/1999/xhtml"; to the root tag in your template.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java consultant, developer, and instructor
> > http://www.arsmachina.com.br/thiago
> >
> > -
> > 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
>
>


Re: DynamicTemplate issue

2013-10-26 Thread Lance Java
Have you seen the code I provided on the "jack of all trades page" thread?
I've pretty much solved the problem there. Tapestry uses bindings to read
and write values during rendering. Eg the prop: binding.


Re: Trying to create a custom mixin which will update zone.

2013-10-31 Thread Lance Java
Take a look at the onEvent mixin in tapestry-stitch
http://tapestry-stitch.uklance.cloudbees.net/oneventdemo



On 31 October 2013 19:44, George Christman  wrote:

> I was semi able to get it to work using the following code, but it looks as
> if the onDocument method doesn't have a blur event handler?
>
>
> (function() {
> define(["t5/core/events", "t5/core/dom", "t5/core/zone", "./jquery"],
> function(events, dom, zone, $) {
> int = function(spec) {
> var $field = $("#" + spec.id);
>
> $field.attr("data-update-zone", spec.zone);
> $field.attr("data-update-url", spec.url);
>
> return dom.onDocument('click', 'input[data-update-zone]',
> function() {
> var containingZone;
>
> containingZone = zone.findZone(this);
> return containingZone &&
> containingZone.trigger(events.zone.refresh, {
> url: this.attribute("data-update-url"),
> parameters: {
> "t:fieldvalue": $field.val()
> }
> });
> });
> };
> return int;
> });
>
> }).call(this);
>
>
> On Thu, Oct 31, 2013 at 2:36 PM, George Christman
> wrote:
>
> > I'm trying to create a mixin that on blur will grab the field value and
> > pass it to an event handler followed by a zone refresh. I continue to
> get a
> > null pointer on the zone refresh, I'm not sure what I'm missing.
> >
> >
> > tml.
> >
> >  > t:mixins="fieldUpdate" t:zone="empIdZone" updateFieldId="empId"/>
> >
> > mixins
> >
> > @Events(
> > {EventConstants.VALIDATE, "fieldUpdated" + " when 'zone'
> parameter
> > is bound"})
> > public class FieldUpdate {
> >
> > static final String EVENT_NAME = "fieldupdate";
> > @Environmental
> > private JavaScriptSupport jsSupport;
> > @InjectContainer
> > private ClientElement element;
> > @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
> > private String updateFieldId;
> > @Inject
> > private ComponentResources resources;
> > @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
> > private String zone;
> >
> > public void afterRender() {
> > Link link = resources.createEventLink(EVENT_NAME);
> >
> > JSONObject param = new JSONObject();
> > param.put("id", element.getClientId());
> > param.put("updateFieldId", updateFieldId);
> > param.put("url", link.toString());
> > param.put("zone", zone);
> >
> > jsSupport.require("fieldupdate").with(param);
> > }
> >
> > Object onFieldUpdate(@RequestParameter(value = "t:fieldvalue",
> > allowBlank = true) final String fieldvalue) throws ValidationException {
> >
> > CaptureResultCallback callback = new
> > CaptureResultCallback<>();
> >
> > this.resources.triggerEvent("fieldUpdated", new
> > Object[]{fieldvalue}, callback);
> >
> > return callback.getResult();
> > }
> > }
> >
> >
> > .js
> >
> > (function() {
> > define(["t5/core/ajax", "./jquery"], function(ajax, $) {
> > int = function(spec) {
> > var $field = $("#" + spec.id);
> >
> > return $field.bind('blur', function() {
> > return ajax(spec.url, {
> > type: "POST",
> > data: {
> > "t:fieldvalue": $field.val()
> > },
> > contentType: "application/x-www-form-urlencoded",
> > success: function(response) {
> > return process(response);
> > }
> > });
> > });
> > };
> > return int;
> > });
> > }).call(this);
> >
> > .java
> >
> > @InjectComponenet
> > private Zone empIdZone;
> >
> > @Inject
> > private AjaxResponseRenderer ajaxResponseRenderer;
> >
> > void onFieldUpdated(String value) {
> > test = "test";
> > ajaxResponseRenderer.addRender(empIdZone);
> > }
> >
> >
> > exception
> >
> >
> > org.apache.tapestry5.ioc.internal.OperationException trace
> >
> >- Handling Ajax 'fieldupdate' component event request for
> >timerecords/AccrualBalance:employeename.
> >
> > java.lang.NullPointerException
> > Filter Frames?
> > Stack trace:
> >
> >- org.apache.tapestry5.json.JSONObject.printValue(JSONObject.java:929)
> >- org.apache.tapestry5.json.JSONArray.print(JSONArray.java:464)
> >- org.apache.tapestry5.json.JSONObject.printValue(JSONObject.java:901)
> >- org.apache.tapestry5.json.JSONArray.print(JSONArray.java:464)
> >- org.apache.tapestry5.json.JSONObject.printValue(JSONObject.java:901)
> >- org.apache.tapestry5.json.JSONObject.print(JSONObject.java:872)
> >- org.apache.tapestry5.json.JSONObject.printValue(JSONObject.java:895)
> >- org.apache.tapestry5.json.JSONObject.print(JSONObject.java:872)
> >-
> org.apache.tapestry5.json.JSONCollection.print(JSONCollection.java:95)
> >
> >-

Re: Trying to create a custom mixin which will update zone.

2013-11-02 Thread Lance Java
Nice, I'm not too familiar with 5.4 so the data attributes + dom stuff is
all new to me.

NB jquery has built in support for data attributes so
$field.attr("data-update-zone", spec.zone) can be written as
$field.data("update-zone", spec.zone)


Re: T5.3: per page context session storage?

2013-11-06 Thread Lance Java
Any time someone wants to use the session, I always ask why. I avoid
session usage wherever possible. If there's no real need for it, I suggest
you keep your app stateless and use the page activation context / event
context to pass parameters.


Re: Tree, jumpstart tree from database and zone demo

2013-11-06 Thread Lance Java
FYI you might be interested in this:
http://tapestry-stitch.uklance.cloudbees.net/databasetreedemo


Re: T5.3: per page context session storage?

2013-11-07 Thread Lance Java
Ah, then you need conversation scope as Dragan has suggested I was just
checking ;)
 On 7 Nov 2013 11:19, "Dmitriy Vsekhvalnov"  wrote:

> Well, if you don't save your object(s) in memory you should save in some
> other place, right?
>
> So, what are you doing if you have to edit object with several
> pages/screens before finally committing it?
>
>
> On Thu, Nov 7, 2013 at 2:03 AM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Wed, 06 Nov 2013 18:37:24 -0200, Lance Java <
> lance.j...@googlemail.com>
> > wrote:
> >
> >  Any time someone wants to use the session, I always ask why. I avoid
> >> session usage wherever possible. If there's no real need for it, I
> >> suggest you keep your app stateless and use the page activation context
> /
> >> event
> >> context to pass parameters.
> >>
> >
> > Agreed 100%. Besides the lower memory usage, it also avoids some
> problems.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Tapestry, Java and Hibernate consultant and developer
> > http://machina.com.br
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


Re: Grid Pagination and Performance

2013-11-13 Thread Lance Java
The grid needs the rowcount to know how many pages there are in total (eg
page 1 of N). HibernateGridDataSource and JpaGridDataSource execute 2 types
of queries. 1 to get the rowcount and another to get a single page at a
time. In my opinion this is a scalable approach.


Re: Grid Pagination and Performance

2013-11-13 Thread Lance Java
The Grid should only ever send a single page of data at a time.

Let's get things clear...  Are you using @Persist or java.util.List with
your large dataset? To maintain scalability you should never coerce
GridDataSource to List.

Perhaps it's just your choice of language (persist & list) that was
ambiguous or perhaps we've found your issue. I think some code might help
better explain what you're doing.


Render component markup to HTML string for use in javascript etc.

2013-11-16 Thread Lance Java
I've seen the following question asked countless times in this forum:
"How do I render the HTML for my component into a string for use in
javascript"

I've added a 'capture' component to tapestry stitch and a demo which
demonstrates capturing markup during page render and ajax update.

Demo here:
http://tapestry-stitch.uklance.cloudbees.net/capturedemo

Comments & feedback welcome


Cheers,
Lance.


Re: Pre select Tree with zone update

2013-11-17 Thread Lance Java
Jumpstart fires it's own custom "leafSelected" event when you select a
leaf. So you'll need to make sure you mimic this action. From what I can
see, that means you'll need to initialise selectedClassification with a
value.


Re: Web frameworks

2013-11-18 Thread Lance Java
I'm not sure why... but for some reason a random user comes on this
tapestry list about once a year spreading FUD with a message similar to
this one. I've never really understood why... Please ignore this thread.


On 18 November 2013 19:12, Emmanuel Sowah  wrote:

> Hi guys,
>
> There is a great report that compares web frameworks and can be found here:
>
> http://zeroturnaround.com/rebellabs/the-2014-decision-makers-guide-to-java-web-frameworks/
>
> To my surprise, Tapestry didn't make it to the list. This makes me very
> nervous to even consider Tapestry for our upcoming project. I'm scared
> Tapestry may be abandoned one day and leave us in the cold. It may be a
> nice framework, but Tapestry's popularity is extremely low within the
> developers' community. Why is that? Is it because of it's track record on
> releases and backward compatibility issues, which I read a lot about on
> google search? Or is it because it's a one man project?
>
> What do you think?
>
> Regards,
> Emmanuel
>


Re: The Rise and Fall of Tapestry

2013-11-22 Thread Lance Java
> 7. Why Howard finally embraced Wicket and started using it in his
clients' projects.

Drink a shot!

> 8. When Tapestry became Wicketstry

Drink a shot!

> or Tapwickstry.

... and another!


Re: 5.4 Bug with select nested inside form loop.

2013-11-22 Thread Lance Java
Probably best to see some code before calling it a bug. Perhaps you are
initializing a variable in its  declaration (instead of @SetupRender) or
possibly a @Persist issue?


Re: 5.4 Bug with select nested inside form loop.

2013-11-22 Thread Lance Java
Why is your encoder calling
person.getPhones().add(phone)???

That looks totally dodgy!


Re: 5.4 Bug with select nested inside form loop.

2013-11-22 Thread Lance Java
I didn't take the time to fully understand your code but a ValueEncoder's
role is solely to serialize between clientside string and serverside
object. Nothing more.


Re: 5.4 Bug with select nested inside form loop.

2013-11-22 Thread Lance Java
I'm assuming you know that the encoder is fired every time a conversion
between clientside id and serverside object is done. This includes your
delete action etc.


Re: 5.4 Bug with select nested inside form loop.

2013-11-22 Thread Lance Java
As I said... I haven't taken the time to fully understand the code.

That being said, I'd be willing to bet you a fiver that it's causing the
issue
:)


Re: 5.4 Bug with select nested inside form loop.

2013-11-23 Thread Lance Java
I'm still not convinced this is a bug in tapestry... it might be but
there's still some suspect areas in your code.

1. In hibernate, Phone has-a Person (@ManyToOne) and Person has Phones(s)
(@OneToMany) but you seem to be manipulating both:

@CommitAfter
void onRemoveRow(Phone phone) {
person.getPhones().remove(phone);
session.delete(phone);
}

I'm thinking you should manipulate one and get the other from hibernate.

2. This whole @Transient temp id -System.nanoTime() thingy. Why is this
required?
It looks like you've let your UI implementation creep into your model.
Always a bad idea ;)

3. PhoneTypes doesn't relate to Person... these look like globals.
I'd really advise against initializing them in your page.
Looks more like a @Startup job or at least a synchronized method on a
service.



On 22 November 2013 20:50, George Christman  wrote:

> Your on :) you can just paypal me haha.
>
> Well the value encoder doesn't appear to be the issue. :( I can completely
> remove the encoder parameter from the component and refresh the page and it
> will still hold on to the wrong result despite the correct select option
> being selected in the select menu. I tried clearing my browser cache as
> well, no change. Should I file a bug report with JIRA?
>
>
> On Fri, Nov 22, 2013 at 3:24 PM, Lance Java  >wrote:
>
> > As I said... I haven't taken the time to fully understand the code.
> >
> > That being said, I'd be willing to bet you a fiver that it's causing the
> > issue
> > :)
> >
>
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>


Re: 5.4 Bug with select nested inside form loop.

2013-11-24 Thread Lance Java
> I used very similar code in 5.3.7 without issue which is why I believe
this
is a bug.

Ah, ok... I agree that this does point in the direction of a 5.4 bug.


> I was hoping to manage the formloop through the use of my person
object rather than having to manage the form loop through the phone object
and then having to sync the two objects up on the backend. Like I said, no
issues in 3.7.

Can I see the related TML?

> The reason for the tempid is do to the fact I get this exception when I pass
a null id to the interface while trying to remove the row

Ah, I see what you're doing... you can do this without tempId.
Option 1: Save the empty Phone you've created in onAddRow() to the database
before returning so that it has an id and can be looked up later
Option 2: Your value encoder returns ***i-am-new*** in toClient() for a
phone who's id is null. It then returns new Phone() for ***i-am-new*** in
toValue()
Option 3: @Persist your phones in the session. Your ValueEncoder then
converts between object and string using the array index



On 23 November 2013 23:06, George Christman  wrote:

> On Sat, Nov 23, 2013 at 4:48 AM, Lance Java  >wrote:
>
> > I'm still not convinced this is a bug in tapestry... it might be but
> > there's still some suspect areas in your code.
> >
>
> I used very similar code in 5.3.7 without issue which is why I believe this
> is a bug. I was hoping to manage the formloop through the use of my person
> object rather than having to manage the form loop through the phone object
> and then having to sync the two objects up on the backend. Like I said, no
> issues in 3.7.
>
>
> >
> > 1. In hibernate, Phone has-a Person (@ManyToOne) and Person has Phones(s)
> > (@OneToMany) but you seem to be manipulating both:
> >
> > @CommitAfter
> > void onRemoveRow(Phone phone) {
> > person.getPhones().remove(phone);
> > session.delete(phone);
> > }
> >
> > I'm thinking you should manipulate one and get the other from hibernate.
> >
>
> Your correct, I do not need the person.getPhones().remove(phone); Not sure
> why I was thinking I needed it.  I now just delete the phone object, but
> still no change.
>
> In my real project the fields are already added from the database so I was
> able to test the component by removing the encoder from the ajaxformloop.
> When I delete, still same issue. Even if I refresh the page after deletion,
> still holds onto the wrong values.  I'd like to point out i'm using firefox
> too.
>
> >
> > 2. This whole @Transient temp id -System.nanoTime() thingy. Why is this
> > required?
> > It looks like you've let your UI implementation creep into your model.
> > Always a bad idea ;)
> >
>
> The reason for the tempid is do to the fact I get this exception when I
> pass a null id to the interface while trying to remove the row
>
> *The value for query parameter 't:rowvalue' was blank, but a non-blank
> value is needed.*
>
> >
> > 3. PhoneTypes doesn't relate to Person... these look like globals.
> > I'd really advise against initializing them in your page.
> > Looks more like a @Startup job or at least a synchronized method on a
> > service.
> >
> > This isn't production code, I just through some demo code together to
> illistrate the issue. I wrote the code enabling you guys to quickly be able
> to test the component and determine if what I found was a bug.
>
> I still believe it has something to do with how the form loop holds on to
> values. I notice serverside validation now works properly, so I wonder if
> the issue has something to do with that bug fix.
>
> >
> >
> > On 22 November 2013 20:50, George Christman 
> > wrote:
> >
> > > Your on :) you can just paypal me haha.
> > >
> > > Well the value encoder doesn't appear to be the issue. :( I can
> > completely
> > > remove the encoder parameter from the component and refresh the page
> and
> > it
> > > will still hold on to the wrong result despite the correct select
> option
> > > being selected in the select menu. I tried clearing my browser cache as
> > > well, no change. Should I file a bug report with JIRA?
> > >
> > >
> > > On Fri, Nov 22, 2013 at 3:24 PM, Lance Java  > > >wrote:
> > >
> > > > As I said... I haven't taken the time to fully understand the code.
> > > >
> > > > That being said, I'd be willing to bet you a fiver that it's causing
> > the
> > > > issue
> > > > :)
> > > >
> > >
> > >
> > >
> > > --
> > > George Christman
> > > www.CarDaddy.com
> > > P.O. Box 735
> > > Johnstown, New York
> > >
> >
>
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>


Re: grid is showing this column -> _persistence Should Refresh Fetch Group

2013-11-27 Thread Lance Java
I'm guessing some ejb class transformation has added a _persistence
property to your bean.

Try

 On 28 Nov 2013 02:53, "Chris Mylonas"  wrote:

> Hi Tapsters,
>
> Can anyone shed any light on the above?
> I usually use my own home grown hand rolled tables but chucked a grid into
> my template for a quick scratch project hack-look-see.
>
> AFAIK my project layout, packaging into .ear is my usual workflow.
>
> All row values for this column are "false".
>
> Env:
> Glassfish, @EJB annotation like jumpstart, eclipselink is the JPA provider
> in my EJB layer.
>
> I thought it was something to do with an @Temporal on my entity, changed it
> from
>
> @Column(name = "tstamp")
> @Temporal(TemporalType.TIMESTAMP)
> private Date tstamp;
>
> to
>
> @Column(name = "tstamp")
> @Temporal(TemporalType.DATE)
> private Date tstamp;
>
> I can always just go back to hand rolled tables and pretend it never
> happened, but would be nice to know where a column like this comes from.
>
> Thank you
> Chris
>


Re: grid is showing this column -> _persistence Should Refresh Fetch Group

2013-11-27 Thread Lance Java
Oops. I meant exclude not ignore.
 On 28 Nov 2013 07:17, "Lance Java"  wrote:

> I'm guessing some ejb class transformation has added a _persistence
> property to your bean.
>
> Try
> 
>  On 28 Nov 2013 02:53, "Chris Mylonas"  wrote:
>
>> Hi Tapsters,
>>
>> Can anyone shed any light on the above?
>> I usually use my own home grown hand rolled tables but chucked a grid into
>> my template for a quick scratch project hack-look-see.
>>
>> AFAIK my project layout, packaging into .ear is my usual workflow.
>>
>> All row values for this column are "false".
>>
>> Env:
>> Glassfish, @EJB annotation like jumpstart, eclipselink is the JPA provider
>> in my EJB layer.
>>
>> I thought it was something to do with an @Temporal on my entity, changed
>> it
>> from
>>
>> @Column(name = "tstamp")
>> @Temporal(TemporalType.TIMESTAMP)
>> private Date tstamp;
>>
>> to
>>
>> @Column(name = "tstamp")
>> @Temporal(TemporalType.DATE)
>> private Date tstamp;
>>
>> I can always just go back to hand rolled tables and pretend it never
>> happened, but would be nice to know where a column like this comes from.
>>
>> Thank you
>> Chris
>>
>


Re: grid is showing this column -> _persistence Should Refresh Fetch Group

2013-11-28 Thread Lance Java
If you want to handle this globally, you could override / decorate
BeanModelSource and call BeanModel.exclude(...) based on some logic.


Re: AW: switch Modal Box

2013-11-28 Thread Lance Java
Create a page for your pdf that can return a StreamResponse from
onActivate(...).  If the pdf can't be rendered, you show an error.

You can either pagelink to the pdf page or return an instance of the pdf
page in onSuccess() from a form on another page.

 On 27 Nov 2013 18:53, "Vasili Petrenko" 
wrote:

> I can not return a zone on submit event. To return a zone you need a ajax
> request. Or? (Maybe code example)
> By ajax submit you can not return a StreamResponse.
>
> And if it work how can i bring up the jquery modal box?
>
> -Ursprüngliche Nachricht-
> Von: Barry Books [mailto:trs...@gmail.com]
> Gesendet: Mittwoch, 27. November 2013 16:41
> An: Tapestry users
> Betreff: Re: switch Modal Box
>
> I would use an event link. From the event handler you should be able to
> return a StreamResponse (which could be the PDF) or a Zone which would
> bring
> up the Modal.
>
>
> On Wed, Nov 27, 2013 at 8:52 AM, Vasili Petrenko <
> vasili.petre...@devintime.de> wrote:
>
> > Scenario:
> >
> >
> > Someone clicks on the actionlink and want to download a PDF. But if
> > there is no data, I want show a Modal Box and offer a further
> > suggestion.
> >
> > If data exists then download the PDF file.
> >
> > How can I do that?
> > I am new on Tepastry.
> >
> >
> >
> >
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: grid is showing this column -> _persistence Should Refresh Fetch Group

2013-11-28 Thread Lance Java
I'm assuming this is also a problem in beaneditor / beandisplay.
 On 28 Nov 2013 12:07, "Dimitris Zenios"  wrote:

> I had the same thing.The property is added by eclipselink weaving.The way i
> did it was to create a mixin that excludes the column from the grid and
> apply it to all the grids through a worker.
>
>
> On Thu, Nov 28, 2013 at 10:56 AM, Lance Java  >wrote:
>
> > If you want to handle this globally, you could override / decorate
> > BeanModelSource and call BeanModel.exclude(...) based on some logic.
> >
>


Re: Strange behavior with JUnit and MVN test in Eclipse

2013-11-29 Thread Lance Java
Taking an educated stab in the dark here but maybe your using the m2e
plugin in eclipse and it's resolving one of your dependencies to another
project in eclipse

At the command line it's resolving the same dependency from your maven
repo.
 On 29 Nov 2013 17:52, "Alessio Gambi"  wrote:

> Hi list !
>
> I had a strange situation today that might deserve some more investigation
> (or at least a warning for those like me...).
>
> Here it goes:
>
> I created a plain service (List/Ordered contribs) via build* method
> I created a contribution method to that service (List/Ordered contribs)
> via contribute* method
>
> >> I forgot to add an ID to one of my contribution using addInstance
> method. Actually I used the empty string:
> userContribution.addInstance("", ...) <<
>
> I wrote a test to start the registry, get an instance of the service, use
> the service, and check the results.
> I run the test and "magically" it worked fine.
>
> The I tried to deploy my artifact via mvn clean ... deploy
> This triggered mvn test
> And this time I got an exception in building the very same service (see
> output snippet below).
>
>
> I am really curios to understand what's going on, and at the same time, I
> suggest the other "non-black-belts" like me to pay attention to this thing.
>
> Thanks
>
> -- Alessio
>
>
>
>
> ===
>  Error invoking service contribution method
> at.ac.tuwien.dsg.cloud.modules.CloudAppModule.contributeBashUserDataService(OrderedConfiguration):
> java.lang.AssertionError
> 2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry -
> Operations trace:
> 2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry - [
> 1] Instantiating service BashUserDataService implementation via
> at.ac.tuwien.dsg.cloud.modules.CloudAppModule.buildBashUserDataService(Logger,
> PipelineBuilder, File, List) (at CloudAppModule.java:164)
> 2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry - [
> 2] Creating plan to invoke public static
> at.ac.tuwien.dsg.cloud.services.UserDataService
> at.ac.tuwien.dsg.cloud.modules.CloudAppModule.buildBashUserDataService(org.slf4j.Logger,org.apache.tapestry5.ioc.services.PipelineBuilder,java.io.File,java.util.List)
> 2013-11-29 18:42:13,876 [main] ERROR org.apache.tapestry5.ioc.Registry - [
> 3] Determining injection value for parameter #4 (java.util.List)
> 2013-11-29 18:42:13,877 [main] ERROR org.apache.tapestry5.ioc.Registry - [
> 4] Collecting ordered configuration for service BashUserDataService
> 2013-11-29 18:42:13,877 [main] ERROR org.apache.tapestry5.ioc.Registry - [
> 5] Invoking
> at.ac.tuwien.dsg.cloud.modules.CloudAppModule.contributeBashUserDataService(OrderedConfiguration)
> (at CloudAppModule.java:217)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.993 sec
> <<< FAILURE!
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


[ANN] tapestry-graphael

2013-11-30 Thread Lance Java
I've just created a little component library for generating gRaphaël SVG
charts. Currently only pie charts and line charts are supported I'll
probably only add other chart types as I need them myself.

Demo: http://tapestry-graphael.uklance.cloudbees.net/
Source: https://github.com/uklance/tapestry-graphael
gRaphaël docs: http://g.raphaeljs.com/

I realise that there's already a tapestry-highcharts component library but
I prefer gRaphaël's MIT license.

Contributions / feedback welcome.

Cheers,
Lance.


Re: [ANN] tapestry-graphael

2013-11-30 Thread Lance Java
Hi François,

Sencha is not free, it's a commercial product which uses gRaphaël for
charting.


Re: How does Tapestry SelectModelFactory pick the id

2013-12-02 Thread Lance Java
If you provide an "encoder" to your loop, select will use that.

Otherwise it will ask the ValueEncoderFactory for a ValueEncoder for the
type.

Note that tapestry-hibernate will provide a ValueEncoder for each of your
entities.

Note also that ValueEncoderFactory will call the TypeCoercer as a last
resort to find a coercion between String and the required type.
 On 1 Dec 2013 21:40, "Boris Horvat"  wrote:

> Hi everyone,
>
> I am confused by the SelectModelFactory and how it picks an id. I have a
> code
>
>
> public SelectModel getModel() {
> return modelFactroy.create(listOfMyObjects, "name");
> }
>
> This class has the id filed that is used by the hibernate and the name
> which I use as a label in this case.
>
> When I run my code I see that toString method is being used to generate the
> value. However in some other cases that does not appear to be the case and
> my code works out of the box, so what is the difference?
>
> How should I use SelectmodelFactory class to generate correct SelectModel
> for my objects?
>
> --
> Sincerely
> *Boris Horvat*
>


Re: Passing blocks as component parameters

2013-12-02 Thread Lance Java
As Kristian has said, this can normally be managed with block & delegate.

Another way is to declare (or TypeCoerce) your block as a RenderCommand.
You can return a RenderCommand from any render phase method.

A RenderCommand can delegate to other RenderCommands. Note that rendering
mimics tail recursion and can be hard to get your head around :)

 On 2 Dec 2013 06:25, "Kristian Marinkovic" 
wrote:

> Yes it is possible. Usually you use a Delegate component to render a Block.
>
> Cheers
> Kris
> Am 01.12.2013 23:53 schrieb "Boris Horvat" :
>
> > Is there any way to pass a block as a parameter and then to render it?
> >
> > I have checked a tree component and I have seen it renders it manually.
> Is
> > there any way to achieve this by simply passing few parameters around?
> >
> > Cheers
> >
> > --
> > Sincerely
> > *Boris Horvat*
> >
>


Re: component paramter frustrations

2013-12-02 Thread Lance Java
I avoid session usage at all costs (with the exception to the rule being
the logged in userId)

Why not pass the parameter values in your events so the app is stateless?

Also, remember that page. onActivate(...) is called for page render and
ajax events so sometimes it's better to initialise here instead of
@SetupRender.


Re: component paramter frustrations

2013-12-02 Thread Lance Java
As I said, you just pass the parameters in the event context of you events.


Loving the eclipse-tapestry5-plugin

2013-12-02 Thread Lance Java
I've just started using the new(ish) eclipse-tapestry5-plugin and I must
say it's great!!

The killer feature for me is the '+' button to create a .tml, .css, .js
file from a java class in a maven friendly location pre-filled with useful
templates.

Kudos to Dmitry Gusev for a great plugin.

If you haven't tried it yet... go get it!!

https://github.com/anjlab/eclipse-tapestry5-plugin


Re: Passing blocks as component parameters

2013-12-02 Thread Lance Java
Yup... 


On 2 December 2013 19:36, Boris Horvat  wrote:

> Let me try to be a bit more specific
>
> I want to have a component that I will initialize like this
>
> 
>
> asdasd
>
> and then in the MyComponent.tml I have something like
>
> ---
>
> 
>
> sometext
>
> 
>
> 
>
> ---
>
> So if I add
>
> @Parameter
> Block myblock
>
> into a MyComponent.java how can I render it?
>
> Is this that you were thinking by delegate? I just pass this parameter to
> the delegate? (I will try this hope it works :))
>
>
> On Mon, Dec 2, 2013 at 9:50 AM, Lance Java  >wrote:
>
> > As Kristian has said, this can normally be managed with block & delegate.
> >
> > Another way is to declare (or TypeCoerce) your block as a RenderCommand.
> > You can return a RenderCommand from any render phase method.
> >
> > A RenderCommand can delegate to other RenderCommands. Note that rendering
> > mimics tail recursion and can be hard to get your head around :)
> >
> >  On 2 Dec 2013 06:25, "Kristian Marinkovic" <
> kristian.marinko...@gmail.com
> > >
> > wrote:
> >
> > > Yes it is possible. Usually you use a Delegate component to render a
> > Block.
> > >
> > > Cheers
> > > Kris
> > > Am 01.12.2013 23:53 schrieb "Boris Horvat" :
> > >
> > > > Is there any way to pass a block as a parameter and then to render
> it?
> > > >
> > > > I have checked a tree component and I have seen it renders it
> manually.
> > > Is
> > > > there any way to achieve this by simply passing few parameters
> around?
> > > >
> > > > Cheers
> > > >
> > > > --
> > > > Sincerely
> > > > *Boris Horvat*
> > > >
> > >
> >
>
>
>
> --
> Sincerely
> *Boris Horvat*
>


Re: How does Tapestry SelectModelFactory pick the id

2013-12-02 Thread Lance Java
Hmm... not sure why I said loop.

If you provide an "encoder" to your loop, select will use that
Should be
If you provide an "encoder" to your select, it will use that.


If company is in the basepackage.entities package, then tapestry-hibernate
will auto-register a ValueEncoder for it.


On 2 December 2013 19:31, Boris Horvat  wrote:

> Hi to both of you :)
>
> I don't have a loop, I just a have a simple Select component that I want to
> use so I was expecting that tapestry-hibernate will provide one for me.
> However to my suprise this didnt work :(
>
> (Thiago) I know that SelectModel doesnt deal with id's that is why I said
> SelectModelFactory. What I am thinking is that the factory will create a
> model that will use the id of the entity as a value for the selection
> option, however for some reason it is using output of toString.
>
> I guess I could provide SelectModel of my own and populate correct values,
> however I would like to use out-of-the-box options that work for other
> classes of mine
>
> here is my code
>
>  t:model="model" />
>
> public SelectModel getModel() {
> return modelFactroy.create(listOfCompanies), "name");
> }
>
> listOfValues contain objects that have
>
> @Entity
> @XmlRootElement
> public class Company implements Serializable{
>
> @Id
> @GeneratedValue
> private Long id;
> @Column(name = "Name")
> private String name;
>
> 
>
>
> On Mon, Dec 2, 2013 at 11:57 AM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Sun, 01 Dec 2013 19:39:24 -0200, Boris Horvat <
> horvat.z.bo...@gmail.com>
> > wrote:
> >
> >  Hi everyone,
> >>
> >
> > Hi!
> >
> >
> >  I am confused by the SelectModelFactory and how it picks an id. I have a
> >> code
> >>
> >
> > SelectModel doesn't deal with ids at all. It deals with what the options
> > are and what their labels are. Ids are handled by ValueEncoder, passed
> > explicitly through the 'encoder' parameter of components like Select and
> > Palette or automatically by contributing to the ValueEncoderFactory
> service.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Tapestry, Java and Hibernate consultant and developer
> > http://machina.com.br
> > Help me spend a whole month working on Tapestry bug fixes and
> > improvements: http://igg.me/at/t5month
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
> --
> Sincerely
> *Boris Horvat*
>


Re: Can you get URL context values within a component.

2013-12-04 Thread Lance Java
Components should have knowledge of page activation context. Pass the
selected tab as a component parameter. The parameter can be mapped to the
page activation context in the page.

See the demo here http://tapestry-stitch.uklance.cloudbees.net/tabgroupdemo


Re: Can you get URL context values within a component.

2013-12-04 Thread Lance Java
Oops, smartphone typing. I meant to say

Components should never have knowledge of page activation context.
 On 4 Dec 2013 23:07, "Lance Java"  wrote:

> Components should have knowledge of page activation context. Pass the
> selected tab as a component parameter. The parameter can be mapped to the
> page activation context in the page.
>
> See the demo here
> http://tapestry-stitch.uklance.cloudbees.net/tabgroupdemo
>


  1   2   3   4   5   6   7   8   9   10   >