Re: Google Map Module and JavaScript-only PDF viewer component | GSOC2010

2010-04-09 Thread Ben Gidley
Do you mean you are planning on using
https://docs.google.com/viewer

This is googles embedable PDF viewer. It should be relatively simple to
write a tapestry control that uses it.
 
Ben Gidley

www.gidley.co.uk
b...@gidley.co.uk


On Sat, Apr 10, 2010 at 3:41 AM, Alex Kotchnev  wrote:

> Charith,
>   it seems to me that with the Javascript PDF viewer you might be biting
> more than you can chew. PDF is not a very pleasant format to deal with, and
> in order to view it only in Javascript/HTML you'll need to convert the PDF
> to images. I few years ago I was doing something similar, and it was
> neither
> pretty nor pleasant. Alternatively, there seem to be a few ways to convert
> a
> PDF file to flash, but then your component is not going to be "javascript
> only".
>
>   Anyway, maybe you could shed some light on how you plan to deal with
> this. It also seems like you're kinda new to Tapestry and there's a few
> things to learn there as well. Considering that you only have a few short
> months for this, it might be wise to pick something more realistic that
> doesn't require major inventions in just a couple of months.
>
> Regards,
>
> Alex K
>
> On Fri, Apr 9, 2010 at 10:26 PM, Charith Madusanka  >wrote:
>
> > Hi all,
> >
> > Project Reference Link...
> >
> > http://code.google.com/apis/ajax/
> > http://code.google.com/apis/maps/
> > http://wiki.apache.org/tapestry/FrontPage
> > http://en.wikipedia.org/wiki/JavaScript
> >
> > charith
> >
>


Re: Google Map Module and JavaScript-only PDF viewer component | GSOC2010

2010-04-09 Thread Alex Kotchnev
Charith,
   it seems to me that with the Javascript PDF viewer you might be biting
more than you can chew. PDF is not a very pleasant format to deal with, and
in order to view it only in Javascript/HTML you'll need to convert the PDF
to images. I few years ago I was doing something similar, and it was neither
pretty nor pleasant. Alternatively, there seem to be a few ways to convert a
PDF file to flash, but then your component is not going to be "javascript
only".

   Anyway, maybe you could shed some light on how you plan to deal with
this. It also seems like you're kinda new to Tapestry and there's a few
things to learn there as well. Considering that you only have a few short
months for this, it might be wise to pick something more realistic that
doesn't require major inventions in just a couple of months.

Regards,

Alex K

On Fri, Apr 9, 2010 at 10:26 PM, Charith Madusanka wrote:

> Hi all,
>
> Project Reference Link...
>
> http://code.google.com/apis/ajax/
> http://code.google.com/apis/maps/
> http://wiki.apache.org/tapestry/FrontPage
> http://en.wikipedia.org/wiki/JavaScript
>
> charith
>


Re: Google Map Module and JavaScript-only PDF viewer component | GSOC2010

2010-04-09 Thread Charith Madusanka
Hi all,

Project Reference Link...

http://code.google.com/apis/ajax/
http://code.google.com/apis/maps/
http://wiki.apache.org/tapestry/FrontPage
http://en.wikipedia.org/wiki/JavaScript

charith


Re: Google Map Module and JavaScript-only PDF viewer component | GSOC2010

2010-04-09 Thread Charith Madusanka
http://wiki.apache.org/general/CharithElvitigala


RE: Zone updating / caching

2010-04-09 Thread Jim O'Callaghan
Thiago,

That has done the trick.  Thanks for the suggestion.

Regards,
Jim.

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: 09 April 2010 02:15
To: Tapestry users
Subject: Re: Zone updating / caching

On Thu, 08 Apr 2010 21:19:45 -0300, Jim O'Callaghan  
 wrote:

> Surely somebody must have come up with something tidy for this scenario  
> :-)

Have you seen the ProgressiveDisplay component?

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


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



Re: Need anchor/link to the fields in Tapestry5 ValidationTracker

2010-04-09 Thread Josh Canfield
> I need to provide links to the individual fields in errors at the top.

It seems like a case for ValidationDecorator. You can add the  tags for fields with errors. Take a look at the
source for AutofocusValidationDecorator and this old email

http://old.nabble.com/Example-of-overriding-the-default-ValidationDecorator-td26906669s302.html#a26906669


I don't see a way to grab all the Fields in the form, or even just the
fields in error, so you may have to gather that info manually.

Josh

On Fri, Apr 9, 2010 at 2:28 PM, JayeshU  wrote:
>
> I need to provide links to the individual fields in errors at the top.
>
> Tapestry4 had -> IFieldTracking field =
> IValidationDelegate.getFieldTracking();
>
> I couldn't find any equivalent in tapestry5.
> Tapestry 5 validator returns List getErrors(); But then there is no
> way to link these error messages to the actual fields which are in error.
>
> I need to follow company's web standards which mandates to provide 
> links to errornous fields.
>
> Any help is appreciated.
> --
> View this message in context: 
> http://old.nabble.com/Need-anchor-link-to-the-fields-in-Tapestry5-ValidationTracker-tp28197743p28197743.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
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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



Re: simple case for checkboxes & T5

2010-04-09 Thread Josh Canfield
Hi.

Here is a solution using a patch of the standard checkbox component
that accepts any Object that can be ValueEncoder encoded. I created
stand-in objects and make the assumption that documentFieldDN is
unique and can be used in a set of all documentFieldDN.

You could persist the set as query parameters, or in the browser
cookie or whatever but I'm just sticking the set into the session.

Enjoy!

Josh



** Checkbox.java 


package com.joshcanfield.tapestry.common.components;

import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.ValidationTracker;
import org.apache.tapestry5.ValueEncoder;
import org.apache.tapestry5.annotations.*;
import org.apache.tapestry5.corelib.base.AbstractField;
import org.apache.tapestry5.corelib.mixins.RenderDisabled;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.ComponentDefaultProvider;
import org.apache.tapestry5.services.Request;

/**
 * A Checkbox component is simply a .
 *
 */
public class Checkbox extends AbstractField {
private static final String NULL_TOKEN = "::null::";

/**
 * The value to be read or updated. If not bound, the Checkbox
will attempt to edit a property of its container
 * whose name matches the component's id.
 */
@Parameter(required = true, autoconnect = true)
private Object value;

@Parameter(autoconnect = true)
private boolean checked;

/**
 * Value encoder for the value, usually determined automatically
from the type of the property bound to the value
 * parameter.
 */
@Parameter(required = true)
private ValueEncoder encoder;

@Inject
private Request request;

@SuppressWarnings("unused")
@Mixin
private RenderDisabled renderDisabled;

@Inject
private ComponentResources resources;

@Inject
private ComponentDefaultProvider defaultProvider;
@Environmental
private ValidationTracker tracker;

ValueEncoder defaultEncoder() {
return defaultProvider.defaultValueEncoder("value", resources);
}

@BeginRender
void begin(MarkupWriter writer) {
final boolean isBoolean = value != null && value instanceof Boolean;
// Available only when there is an error in the form
final String asSubmitted = tracker.getInput(this);

boolean isChecked = false;

if (asSubmitted != null) {
// This is true when there is a form error.
isChecked = isBoolean ? Boolean.parseBoolean(asSubmitted)
: !asSubmitted.equals(NULL_TOKEN);
} else if (resources.isBound("checked")) {
isChecked = checked;
} else if (isBoolean) {
isChecked = (Boolean) value;
}

writer.element("input", "type", "checkbox",
"name", getControlName(),
"id", getClientId(),
// For non-boolean values we always grab the value
from the bound parameter because
// we can't reconstitute it from a form post
"value", isBoolean ? null : encoder.toClient(value),
"checked", isChecked ? "checked" : null);

resources.renderInformalParameters(writer);

decorateInsideField();
}

@AfterRender
void after(MarkupWriter writer) {
writer.end(); // input
}

@Override
protected void processSubmission(String elementName) {
// if the value wasn't submitted then it will be null
final String postedValue = request.getParameter(elementName);

value = encoder.toValue(postedValue);

// Stick a null token in there so we know when there was an
error in the form and can skip other checks.
tracker.recordInput(this, postedValue == null ? NULL_TOKEN :
postedValue);
}
}


** CheckboxTest.java ***


package usr.joshcan.tapestry.pages;

import com.joshcanfield.tapestry.common.components.Checkbox;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.PageLoaded;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * User: joshcanfield
 * Date: Apr 9, 2010
 */
public class CheckboxTest {

private List _processTypes;


@Property
private ProcessType _processType;

@Property
private DocumentType _documentType;

@Property
private DocumentField _documentField;

@Component
private Checkbox _checkbox;

@Persist
private Set _checked;

/*
 * Page Life cycle methods
 */
@PageLoaded
void createObjects() {
// Runs once when the page
_processTypes 

Re: Obtaining the actual service instead of the interface/proxy

2010-04-09 Thread Thiago H. de Paula Figueiredo

On Fri, 09 Apr 2010 18:48:28 -0300, Martijn Kaag  wrote:


hi


Hi!

For unittest purposes i'd like to be able to obtain the actual service  
instatiation instead of the proxy/interface.

Any idea how to achieve this?


No. But your can instantiate the service implementation directly.

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



Obtaining the actual service instead of the interface/proxy

2010-04-09 Thread Martijn Kaag
hi

For unittest purposes i'd like to be able to obtain the actual service 
instatiation instead of the proxy/interface.

Any idea how to achieve this?

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



Re: Need anchor/link to the fields in Tapestry5 ValidationTracker

2010-04-09 Thread JayeshU

Thanks Thiago for quick response.

I will add to JIRA.

You mentioned to use ValidationTracker.get(Field) method to match the error.
That's looks like alternative I can use for now. But the followup question
is, how do I get list of *all* the fields in that form, so I can loop
through them ?

Thanks

-- 
View this message in context: 
http://old.nabble.com/Need-anchor-link-to-the-fields-in-Tapestry5-ValidationTracker-tp28197743p28197899.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: Need anchor/link to the fields in Tapestry5 ValidationTracker

2010-04-09 Thread Thiago H. de Paula Figueiredo

On Fri, 09 Apr 2010 18:28:32 -0300, JayeshU  wrote:


I couldn't find any equivalent in tapestry5.
Tapestry 5 validator returns List getErrors(); But then there is  
no way to link these error messages to the actual fields which are in  
error.


What about using String getError(Field field) in ValidationTracker? It's  
not elegant, but at least you can try to match fields to their error  
messages.


I need to follow company's web standards which mandates to provide  
 links to errornous fields.


This seems to be a nice feature to be added to Tapestry itself. Please  
file a JIRA about it.


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



Need anchor/link to the fields in Tapestry5 ValidationTracker

2010-04-09 Thread JayeshU

I need to provide links to the individual fields in errors at the top.

Tapestry4 had -> IFieldTracking field =
IValidationDelegate.getFieldTracking();

I couldn't find any equivalent in tapestry5.
Tapestry 5 validator returns List getErrors(); But then there is no
way to link these error messages to the actual fields which are in error.

I need to follow company's web standards which mandates to provide 
links to errornous fields.

Any help is appreciated.
-- 
View this message in context: 
http://old.nabble.com/Need-anchor-link-to-the-fields-in-Tapestry5-ValidationTracker-tp28197743p28197743.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: Tweaking an AjaxFormLoop

2010-04-09 Thread Robert Zeigler

Not that I'm aware of.
Feel free to search jira and create one. :)

Robert

On Apr 9, 2010, at 4/95:39 AM , Peter Stavrinides wrote:

Nice post! and came at just the right time for me too... so thanks  
for the tips!


+1 for feature addition, any Jira open?

cheers,
Peter

- Original Message -
From: "Juan Isern" 
To: users@tapestry.apache.org
Sent: Friday, 9 April, 2010 08:09:40 GMT +02:00 Athens, Beirut,  
Bucharest, Istanbul

Subject: Re: Tweaking an AjaxFormLoop


Robert, following your recomendation finally implemented a component  
that

does basically nothing but register itself as a trigger and has an id
assigned by tap as well.

On the client side, I have a global map and a
function triggerRowInjector(triggerId) so that I can inject rows
selectively.

As for the effect thing, you can see that they're hardcoded in the  
function

Tapestry.Initializer.formLoopRemoveLink so I overrode it making them
consistent.

I'm using tapestry 5.1.0.5, so I expect this "solution" to be broken  
by...

5.2, maybe? :P




Robert Zeigler wrote:


That just sounds like you're asking for trouble down the road,
though. ;)
You're effectively relying on implementation details of the  
component.

It'll break if:
  * AjaxFormLoop changes the id of the contained RowInjector  
component

  * You want more than one AjaxFormLoop on the page

I'll grant you that it works... for now. :) And it's the sort of
solution I might put in projects that I write for myself, but not a
solution I would put into a project I write for clients.

It's probably worth submitting a jira for a feature addition to make
this sort of functionality easier/more robust.

Robert

On Apr 8, 2010, at 4/89:20 PM , Brian Heston wrote:


I've done something similar without much hacking.  In my case I have
an autocomplete field in each row, and when a selection is made I
needed to add a new row automatically so the user can enter the next
item.  I found that the row injector always has the same name, so I
just call the trigger function defined in tapestry.js when I want to
add the new row.  The addRow parameter is empty so the link doesn't
render, but the trigger still does.


  
  
  
  ...
  


function itemSelected() {
  $("rowInjector").trigger();
}

You may notice that I'm using my own autocomplete mixin, which I had
to make to expose the afterUpdateElement event, but if you've got
some other logic that invokes the adding of a row the idea should be
the same.

Hope this helps,
Brian



From: Juan Isern [juanis...@gmail.com]
Sent: Thursday, April 08, 2010 6:43 PM
To: users@tapestry.apache.org
Subject: Re: Tweaking an AjaxFormLoop

Robert, I've got to say that you gave me the answer that I feared
most.

Hehe, REALLY thanks for your tips, I knew already that sooner or
later I had
to hack into tapestry.js

Cheers!


Robert Zeigler wrote:



On Apr 8, 2010, at 4/81:48 PM , Juan Isern wrote:

What I would like to do is to trigger an "addRow" event by  
executing

some
javascript (that will be invoked when an upload finishes). I  
thought

of
simulating a click event on an invisible "add row" link but I'm  
sure

there's
a prettier solution out there.



There are other ways to do it, although I'm not sure I would call
them
"prettier". :)
AjaxFormLoop places an "AjaxFormLoopContext" object into the
environment when it renders.
You can access this object and add a call to "addAddRowTrigger".
That
part is pretty. The main issue (for you) is that tapestry then
assumes
that the trigger is going to be invoked on the "click" action,  
which

isn't what you want in this case.
There's a way around it, and that's where things get uglier. You  
can

monkey patch tapestry.js to override
Tapestry.Initializer.ajaxFormLoop, and make it behave how you want.
This is typically how I've implemented custom "add row"
functionality.

It might be a nifty change to enable a second form of the
"addAddRowTrigger" that takes, say, a js callback name as a 2nd
argument.  Or perhaps some flag triggering whether the first  
argument

is an id or a callback.  In any event, the initializer could then
check for the appropriate condition, and if the condition is met,  
the
initializer would delegate the setup to the callback, passing in  
the

row injector, rather than assuming a click.  If there's enough
interest in something like this, I would be willing to do the  
work to

add it to the framework (the exact api would need to be worked out,
though).


The same question could apply to any client-side ajax behavior,  
like

refreshing zones. Is there any way to do it programmatically via
javascript?



The best answer here is to take a look for yourself through  
(mainly)

the tapestry.js file.
But, yes, you can refresh zones in non-default ways; the trick (as
with AjaxFormLoop above) is getting a handle to the runtime js
objects.

Another thing: the javascript effect displayed when a row is  
added/

removed
behaves in a somewhat weird fashi

Re: Exception with T5 & checkbox

2010-04-09 Thread Thiago H. de Paula Figueiredo
On Fri, 09 Apr 2010 04:57:13 -0300, jaques robert  
 wrote:



Another question is how to traduce :
value="${documentField.documentFieldDN}" checked="checked"/>


value="documentField.documentFieldDN"/>


documentField.documentFieldDN should be a boolean property

If documentField.documentFieldDN is true, the checkbox will be rendered  
checked.


--
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: Coercion from String to ArrayList in Loop

2010-04-09 Thread Mite

Thanks, it works now.
-- 
View this message in context: 
http://old.nabble.com/Coercion-from-String-to-ArrayList-in-Loop-tp28183967p28190833.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: Exception with T5 & checkbox

2010-04-09 Thread Thiago H. de Paula Figueiredo
On Fri, 09 Apr 2010 04:34:45 -0300, jaques robert  
 wrote:


I've already tried that but IE & FF when meeting checked="" or  
checked="checked" are considerating that the checkbox are checked :( ...


Please try again, but checked="" means not checked as per the HTML  
standard.


I'm using this html component because if I use the T5 component, I've  
got type coercion error (see my other posts inside this ML)


Please post the exception here again.

So the idea is to use a  to display checked or not. However the test  
to use can be of that sort :

 ?



Yes.

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



[Announce] RSS & Atom with Tapestry 5 Rome integration

2010-04-09 Thread Robin Komiwes
Another contribution from "Spread The Source" this week. This one is
about contributing Tapestry to allow action methods to return RSS and
Atom feeds produced with Rome library.

Checkout the complete announce at
http://spreadthesource.com/2010/04/atom-and-rss-feeds-for-tapestry5/
and the source code on Github
http://github.com/spreadthesource/tapestry5-rome/.

Robin Komiwes

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



[Announce] RSS & Atom with Tapestry 5 Rome integration

2010-04-09 Thread Robin Komiwes
Another contribution from "Spread The Source" this week. This one is
about contributing Tapestry to allow action methods to return RSS and
Atom feeds produced with Rome library.

Checkout the complete announce at
http://spreadthesource.com/2010/04/atom-and-rss-feeds-for-tapestry5/
and the source code on Github
http://github.com/spreadthesource/tapestry5-rome/.

Robin Komiwes

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



simple case for checkboxes & T5

2010-04-09 Thread jaques robert
Hello,


I've got some problemes with checkbox & T5 for a while. I'd just like to 
display a page which could contains some checkbox, then submit this page in 
order to treat the various item corresponding to the ticked checkbox then 
redirect to the same page with the same checkbox ticked. It is simple with JSP 
however seems complicated to me to realize with T5




    

        

                                    

                                            

                                        

                                  

        ...



Howard Lewis Ship advise to use the http request without using t5 component in 
this cas. That was I've done. However for the display when returning to this 
page after submission documentField.checked is always to false

Perhaps I'm missing something moreover I think I'm making a "usine à gaz".


On the onActivate() I've got :

        _exportNameForModifcation = exportNameForModification;

        System.out.println("_exportNameForModifcation : " +
_exportNameForModifcation);

        documentFieldAlreadyTicked =
getExportService().getDocumentFields(exportNameForModification);

        

        HttpServletRequest req = requestGlobals.getHTTPServletRequest();

        List selectedDocumentFields = new
LinkedList();

  

on the onSuccess() :

        HttpServletRequest req = requestGlobals.getHTTPServletRequest();

        String[] exportToCreate =
req.getParameterValues("selectedDocumentFields");

                

        System.out.println("exportToCreate : " + exportToCreate);   
    

        _formFieldsToCreate = Arrays.asList(exportToCreate);

        

        getExportService().modifyExportProfil(_profilName, _language,
_formFieldsToCreate);

        

        //return this;

        return null;


on the getDocumentField()



public ExportDocumentField getDocumentField() {

        System.out.println("_documentField : " + _documentField);

        if (documentFieldAlreadyTicked.contains(_documentField)) {

            _documentField.setChecked("true");

            System.out.println(documentFieldAlreadyTicked + " contains
" + _documentField);

        }

        else {

            System.out.println(documentFieldAlreadyTicked + " does not
contains " + _documentField);

            _documentField.setChecked(null);

        }

        

        return _documentField;

    }


It sux cause getDocumentField() is called much more times than the item 
displayed. Is it the good way to go ?


If I use a t:checkbox component I see that there isn't a selected property as 
in T3 for knowing which one is 
selected.http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Checkbox.html)


Can you help me resolve this case ?

Regards,
Mondes.



  

Re: Tweaking an AjaxFormLoop

2010-04-09 Thread Peter Stavrinides
Nice post! and came at just the right time for me too... so thanks for the tips!

+1 for feature addition, any Jira open?

cheers,
Peter 
 
- Original Message -
From: "Juan Isern" 
To: users@tapestry.apache.org
Sent: Friday, 9 April, 2010 08:09:40 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: Tweaking an AjaxFormLoop


Robert, following your recomendation finally implemented a component that
does basically nothing but register itself as a trigger and has an id
assigned by tap as well.

On the client side, I have a global map and a
function triggerRowInjector(triggerId) so that I can inject rows
selectively.

As for the effect thing, you can see that they're hardcoded in the function
Tapestry.Initializer.formLoopRemoveLink so I overrode it making them
consistent.

I'm using tapestry 5.1.0.5, so I expect this "solution" to be broken by...
5.2, maybe? :P




Robert Zeigler wrote:
> 
> That just sounds like you're asking for trouble down the road,  
> though. ;)
> You're effectively relying on implementation details of the component.  
> It'll break if:
>* AjaxFormLoop changes the id of the contained RowInjector component
>* You want more than one AjaxFormLoop on the page
> 
> I'll grant you that it works... for now. :) And it's the sort of  
> solution I might put in projects that I write for myself, but not a  
> solution I would put into a project I write for clients.
> 
> It's probably worth submitting a jira for a feature addition to make  
> this sort of functionality easier/more robust.
> 
> Robert
> 
> On Apr 8, 2010, at 4/89:20 PM , Brian Heston wrote:
> 
>> I've done something similar without much hacking.  In my case I have  
>> an autocomplete field in each row, and when a selection is made I  
>> needed to add a new row automatically so the user can enter the next  
>> item.  I found that the row injector always has the same name, so I  
>> just call the trigger function defined in tapestry.js when I want to  
>> add the new row.  The addRow parameter is empty so the link doesn't  
>> render, but the trigger still does.
>>
>> 
>>
>>> t:mixins="autocomplete2" t:afterUpdateElement="itemSelected"/>
>>
>>...
>>
>> 
>>
>> function itemSelected() {
>>$("rowInjector").trigger();
>> }
>>
>> You may notice that I'm using my own autocomplete mixin, which I had  
>> to make to expose the afterUpdateElement event, but if you've got  
>> some other logic that invokes the adding of a row the idea should be  
>> the same.
>>
>> Hope this helps,
>> Brian
>>
>>
>> 
>> From: Juan Isern [juanis...@gmail.com]
>> Sent: Thursday, April 08, 2010 6:43 PM
>> To: users@tapestry.apache.org
>> Subject: Re: Tweaking an AjaxFormLoop
>>
>> Robert, I've got to say that you gave me the answer that I feared  
>> most.
>>
>> Hehe, REALLY thanks for your tips, I knew already that sooner or  
>> later I had
>> to hack into tapestry.js
>>
>> Cheers!
>>
>>
>> Robert Zeigler wrote:
>>>
>>>
>>> On Apr 8, 2010, at 4/81:48 PM , Juan Isern wrote:
>>>
 What I would like to do is to trigger an "addRow" event by executing
 some
 javascript (that will be invoked when an upload finishes). I thought
 of
 simulating a click event on an invisible "add row" link but I'm sure
 there's
 a prettier solution out there.

>>>
>>> There are other ways to do it, although I'm not sure I would call  
>>> them
>>> "prettier". :)
>>> AjaxFormLoop places an "AjaxFormLoopContext" object into the
>>> environment when it renders.
>>> You can access this object and add a call to "addAddRowTrigger".   
>>> That
>>> part is pretty. The main issue (for you) is that tapestry then  
>>> assumes
>>> that the trigger is going to be invoked on the "click" action, which
>>> isn't what you want in this case.
>>> There's a way around it, and that's where things get uglier. You can
>>> monkey patch tapestry.js to override
>>> Tapestry.Initializer.ajaxFormLoop, and make it behave how you want.
>>> This is typically how I've implemented custom "add row"  
>>> functionality.
>>>
>>> It might be a nifty change to enable a second form of the
>>> "addAddRowTrigger" that takes, say, a js callback name as a 2nd
>>> argument.  Or perhaps some flag triggering whether the first argument
>>> is an id or a callback.  In any event, the initializer could then
>>> check for the appropriate condition, and if the condition is met, the
>>> initializer would delegate the setup to the callback, passing in the
>>> row injector, rather than assuming a click.  If there's enough
>>> interest in something like this, I would be willing to do the work to
>>> add it to the framework (the exact api would need to be worked out,
>>> though).
>>>
>>>
 The same question could apply to any client-side ajax behavior, like
 refreshing zones. Is there any way to do it programmatically via
 javascript?

>>>
>>> The best answer here is to take a look for yourself through (

Re: using other namespaces

2010-04-09 Thread Alejandro Scandroli
That's very much what I have, and it works for me.
eg:

Layout.tml:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.facebook.com/2008/fbml";
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";
  xmlns:p="tapestry:parameter">

Index.tml

http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";
  xmlns:p="tapestry:parameter"
  xmlns:fb="http://www.facebook.com/2008/fbml";>


Alejandro.

On Fri, Apr 9, 2010 at 11:35 AM, Kath Ede  wrote:
> how is it possible to integrate other namespaces than the tapestry-ns (t:) in 
> tapestry5?
>
> we have this:
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"; 
> xmlns:fb="http://www.facebook.com/2008/fbml"; >
>
> and in out page we want to include this:
>  onlogin='window.location="http://apps.facebook.com/asdf";;'>
>
> when we try to run that, we get an exception.
>
> has anybody successfully integrated a facebook-connect button into a tapestry 
> project?
>
> thanks in advance
> --
> Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
> jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser
>
> -
> 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



Get final ouput of page rendering

2010-04-09 Thread iapilgrim

Hi all,
I'd like to get the final output of Page ( to cache for example)
I do this by using 
public static PageResponseRenderer decoratePageResponseRenderer(
   ... grabs // content here
}
But at this phase, I still miss some css and js files that included in each
component in page.

So my question is:
Is there another way to get final content ?

Thanks,
Van


-- 
View this message in context: 
http://old.nabble.com/Get-final-ouput-of-page-rendering-tp28190294p28190294.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



using other namespaces

2010-04-09 Thread Kath Ede
how is it possible to integrate other namespaces than the tapestry-ns (t:) in 
tapestry5?

we have this:
http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"; 
xmlns:fb="http://www.facebook.com/2008/fbml"; >

and in out page we want to include this:


when we try to run that, we get an exception.

has anybody successfully integrated a facebook-connect button into a tapestry 
project?

thanks in advance
-- 
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser

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



Re: Google Map Module and JavaScript-only PDF viewer component | GSOC2010

2010-04-09 Thread Charith Madusanka
Hi all ,

I need comments about my proposal.

Charith

On Thu, Apr 8, 2010 at 11:10 PM, Charith Madusanka wrote:

> *Proposal Title:*
>
> Google Map Module and JavaScript-only PDF viewer component
>
>
> *Student Name:*
>
> Charitha Madusanka Elvitigala
>
> *
> *
>
> *Student E-mail:*
>
> charithc...@gmail.com
>
> *
> *
>
> *Organization*
>
> Apache Tapestry
>
> *
> *
>
> *Project Assigned Mentor*:
>
> Thiago H. de Paula Figueiredo
>
> Ulrich Stärk
>
> *
> *
>
> *Proposal Abstract:***
>
> Apache Tapestry is an open source java framework. Tapestry component make
> easer to developers creating dynamic, robust, highly scalable web
> applications in Java.Google Map component provides an interface to the
> Google map API with Tapestry5. PDF viewer component provide to Tapestry
> user view PDF document through the web browser. Both components are mainly
> based on Java Script.
>
> *
> *
>
> *Deliverables*
>
>
>- Implementation of Google Map component
>- Implementation of JavaScript-only PDF viewer component
>- Documentation to support continuation of the project
>
>
>
> *Overview*
>
> *
> *
>
> *Google Map component***
>
> This component provide users to a clickable map for entering
> latitude and longitude as well as it can  add content to the map through a
> variety of services, allowing you to create robust maps applications on your
> T5 web application.
>
> Google Map component can be used to create interactive maps with various
> map markers. I’m hoping to implement this module by using Tapestry5 Ajax
> package and Java Script (Tapestry5AndJavaScriptExplained) make an
> interaction with Google Map API.
>
>
>
> *JavaScript-only PDF viewer component*
>
> These components allow to viewing PDF file directly in web
> browser .Now look at my implementation of this component. One of the
> effective and powerful way to view PDF in web browser by using Java Script.
>
> My implementation includes classes, object and method that
> enable you to easily manipulate PDF file, provide database connections and
> other use full things. To render PDF, I will do render the whole document at
> once and cache the pages, then contents shown to the user. Ajax is used to
> load the content asynchronously.
>
>
>
> *Project Plan*
>
> *I have planned the project under 4 steps as follows*
>
> *Step 1: Initial Planning and Designing*
>
> *I will look at both Tapestry 5 framework Google map API then will create
> a basic design for Google map component.** *In* *PDF viewer component I
> will design all the Java Script classes, method and workflows. **
>
> Estimated Completion: 23ed May 2010* *
>
> *Step 2: Implementation*
>
> I would start working on the code. Deliverable(s): Prototype and
> documentation for mid evaluation
>
> Estimated Completion: 11th July 2010**
>
> *Step 3: Improvements and Testing*
>
> Modifications or improvements suggested at the mid evaluation would be
> completed in this step. Write unit tests for finished segments and Test
> Component.
>
> Estimated Completion: 9th August 2010**
>
> *Step 4: Final Product and Documents*
>
> With the completion of this step, will finish the Google Map Component and
> JavaScript-only PDF viewer component for T5. Necessary documents would also
> be present with the final products. Deliverable(s): Final products and
> documentation.
>
>
>
> *Biography*
>
> I am Charitha Madusaka Elvitigal 2rd year Computer Science undergraduate of
> University of Colombo School of Computing (UCSC), Sri Lanka. I have been
> involved in Open Source development regarding Web Services based on Apache,
> java and Java Script.
>


Re: Exception with T5 & checkbox

2010-04-09 Thread jaques robert
Another question is how to traduce : 


to tapestry component ?

--- En date de : Ven 9.4.10, jaques robert  a écrit :

De: jaques robert 
Objet: Re: Exception with T5 & checkbox
À: "Tapestry users" 
Date: Vendredi 9 avril 2010, 9h34

I've already tried that but IE & FF when meeting checked="" or 
checked="checked" are considerating that the checkbox are checked :( ...

I'm using this html component because if I use the T5 component, I've got type 
coercion error (see my other posts inside this ML)

So the idea is to use a  to display checked or not. However the test to use 
can be of that sort : 
 ?


Regards,
Mondes.


--- En date de : Jeu 8.4.10, Thiago H. de Paula Figueiredo  
a écrit :

De: Thiago H. de Paula Figueiredo 
Objet: Re: Exception with T5 & checkbox
À: "Tapestry users" 
Date: Jeudi 8 avril 2010, 19h00

On Thu, 08 Apr 2010 13:42:28 -0300, jaques robert  
wrote:

>  value="${documentField.documentFieldDN}" ${documentField.checked}/>

The ${documentField.checked} part is valid HTML but not valid XML, and Tapestry 
templates must be valid XML even when outputting HTML. If you really want not 
to use the Checkbox component, use checked="${checked}" and add this method to 
your class:

public String getChecked() {
    return documentField.checked ? "checked" : "";
}



--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: Exception with T5 & checkbox

2010-04-09 Thread jaques robert
I've already tried that but IE & FF when meeting checked="" or 
checked="checked" are considerating that the checkbox are checked :( ...

I'm using this html component because if I use the T5 component, I've got type 
coercion error (see my other posts inside this ML)

So the idea is to use a  to display checked or not. However the test to use 
can be of that sort : 
 ?


Regards,
Mondes.


--- En date de : Jeu 8.4.10, Thiago H. de Paula Figueiredo  
a écrit :

De: Thiago H. de Paula Figueiredo 
Objet: Re: Exception with T5 & checkbox
À: "Tapestry users" 
Date: Jeudi 8 avril 2010, 19h00

On Thu, 08 Apr 2010 13:42:28 -0300, jaques robert  
wrote:

>  value="${documentField.documentFieldDN}" ${documentField.checked}/>

The ${documentField.checked} part is valid HTML but not valid XML, and Tapestry 
templates must be valid XML even when outputting HTML. If you really want not 
to use the Checkbox component, use checked="${checked}" and add this method to 
your class:

public String getChecked() {
    return documentField.checked ? "checked" : "";
}



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