Tapestry 5.3.6 JSONObject No null checking leads to NPE in Palette component

2013-09-16 Thread Michael

*java.lang.NullPointerException* :

   * at
 org.apache.tapestry5.json.JSONObject.printValue(JSONObject.java:887)
   * at org.apache.tapestry5.json.JSONArray.print(JSONArray.java:436)
   * at
 org.apache.tapestry5.json.JSONCollection.toString(JSONCollection.java:47)

   * at
 org.apache.tapestry5.json.JSONCollection.toString(JSONCollection.java:63)

   * at
 
org.apache.tapestry5.corelib.components.Palette.beginRender(Palette.java:393)




There is no null checking in printValue(JSONPrintSession session, Object 
value)


Adding :

if (NULL.equals(value))
{
session.print(NULL.toString());
return;
}

solves the problem.

--
Best regards,
Michael Gagauz



Re: Connection problem (On the Server)

2013-09-16 Thread Thiago H de Paula Figueiredo

On Mon, 16 Sep 2013 13:03:03 -0300, Will N.  wrote:


Hi,


Hi!

This is a question completely unrelated to Tapestry, so it shouldn't be  
posted. In addition, the error is very easy to spot from reading the end  
of the stack trace:



Caused by: org.dom4j.DocumentException: Error on line 98 of document  :
The element type "hibernate-configuration" must be terminated by the
matching end-tag "". Nested exception: The
element type "hibernate-configuration" must be terminated by the
matching end-tag "".


You have a hibernate.cfg.xml file which isn't valid XML.

--
Thiago H. de Paula Figueiredo

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



Re: [T5.4] JQuery / Bootstrap etc. from CDN by default?

2013-09-16 Thread Lenny Primak
JQuery has its own well-established CDN:
jQuery's CDN provided by MaxCDN

---
To use the jQuery CDN, just reference the file directly from 
http://code.jquery.com in the script tag:
http://code.jquery.com/jquery-1.10.1.min.js";>
http://code.jquery.com/jquery-migrate-1.2.1.min.js";>
--

Bootstrap has it's own as well:
http://www.bootstrapcdn.com

As far as your other points:
Your web site is much more likely to go down than the CDN
Your web site usage is tracked no matter what you do anyway.
Using any google services, etc.  most users use google to go to your web site 
anyway these days.
NSA will track your web site (or more likely your users) anyway if they run 
windows at least.
They have hooks into ISPs, and this is especially true if you use any cloud 
services.

Bottom line is you have lots of higher risks with any technology than using the 
CDNs,
and benefits from CDNs are huge, like non-duplication of JQuery / bootstrap 
from other web sites people use,
giving your web site superior performance, etc.


On Sep 16, 2013, at 8:01 AM, Thiago H de Paula Figueiredo wrote:

> On Sun, 15 Sep 2013 20:14:55 -0300, Lenny Primak  
> wrote:
> 
>> I think there are lots of advantages and few downsides of doing this.
>> It can, of course (optionally) can be turned off, but, in this day and age, 
>> I think Tapestry should consider it.
> 
> A huge -1 to that.
> 
> 1) Which CDN?
> 2) If the CDN goes down, all your JavaScript goes down too.
> 3) The CDN would be able to track your website users, and there's already too 
> many organizations doing that (NSA included).
> 
> -- 
> Thiago H. de Paula Figueiredo
> 
> -
> 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.4] BeanEditor and Friends don't look as good as in Tap 5.3

2013-09-16 Thread Howard Lewis Ship
This is part of using Boostrap; which is mobile-first and therefore likes
everything stacked vertically and full width.  Add "form-horizontal" to the
[BeanEdit]Form and the layout will look nicer.  You have to wrap the
form-control elements in .col-md-N (md for medium device size) to keep them
from being 100% wide.


On Sun, Sep 15, 2013 at 8:41 PM, Lenny Primak wrote:

> Hi guys,
>
> I noticed something else that's not as pretty out of the box in T5.4 due
> to bootstrap probably
>
> In T5.3, beaneditor looks something like this:
>
> Label [Input Text]
> Label [Input Text]
>
> In T5.4, it looks like this:
>
> Label
> [Input Text  (takes up the whole width of the page)]
> Label
> [Input Text  (takes up the whole width of the page)]
>
>
> I think this should be fixed out of the box
>
> Issue created: https://issues.apache.org/jira/browse/TAP5-2182
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com


Re: [T5.4] BeanEditor and Friends don't look as good as in Tap 5.3

2013-09-16 Thread Barry Books
For BeanEditor you would have to do this with a mixin. The mixin might take
some work but it could then be added go all the BeanEditors

On Monday, September 16, 2013, Lenny Primak wrote:

> I think this should be the default, at least for compatibility's sake.
> Sounds like a lot of custom styling just to make it look like it used to
> in T5.3
>
> On Sep 16, 2013, at 11:35 AM, Howard Lewis Ship wrote:
>
> > This is part of using Boostrap; which is mobile-first and therefore likes
> > everything stacked vertically and full width.  Add "form-horizontal" to
> the
> > [BeanEdit]Form and the layout will look nicer.  You have to wrap the
> > form-control elements in .col-md-N (md for medium device size) to keep
> them
> > from being 100% wide.
> >
> >
> > On Sun, Sep 15, 2013 at 8:41 PM, Lenny Primak 
> > 
> >wrote:
> >
> >> Hi guys,
> >>
> >> I noticed something else that's not as pretty out of the box in T5.4 due
> >> to bootstrap probably
> >>
> >> In T5.3, beaneditor looks something like this:
> >>
> >> Label [Input Text]
> >> Label [Input Text]
> >>
> >> In T5.4, it looks like this:
> >>
> >> Label
> >> [Input Text  (takes up the whole width of the page)]
> >> Label
> >> [Input Text  (takes up the whole width of the page)]
> >>
> >>
> >> I think this should be fixed out of the box
> >>
> >> Issue created: https://issues.apache.org/jira/browse/TAP5-2182
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: 
> >> users-h...@tapestry.apache.org
> >>
> >>
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator of Apache Tapestry
> >
> > The source for Tapestry training, mentoring and support. Contact me to
> > learn how I can get you up and productive in Tapestry fast!
> >
> > (971) 678-5210
> > http://howardlewisship.com
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


[T5.3.6] AjaxFormLoop not populating values after submission

2013-09-16 Thread TNO

Hi,

I'm trying to use AjaxFormLoop inspired from

 * http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloop1

 * 
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/AjaxFormLoop.html


but I have a big problem. My new pojos are not populated with their values.

Did I miss something ?
Can somebody help me ??

Thanks


 Here's the java code :


public class MatchDetail extends BasePageEquipe {

@Property
private Match _match;

@Property
private Buteur _buteur;

@Property(read=false)
private List _listButeur;



public List getListButeur() {
if (_listButeur == null) {
_listButeur = _match.getListButeur();
}
return _listButeur;
}


@Inject
private ServiceDAO _dao;

@Property
private boolean _update = false;

public void onActivate(final Long idMatch) {
_match = _dao.getMatchDAO().get1N(idMatch);
if (_match == null) {
_match = new Match();
_match.setIdMatch(idMatch);
_match.setIdConvocation(idMatch);
}
}

public Long onPassivate() {
if (_match == null || _match.getIdMatch() == null) {
return 0L;
} else {
return _match.getIdMatch();
}
}

public void onSuccess() {
getWebUtilisateur();
try {
_dao.getMatchDAO().save(_match, _listButeur);
setOkMsg("Mise à jour OK");
} catch (Exception e) {
setErrorMsg(e.getMessage());
}
}


@Property
private SelectLicencieIdModel _licencieModel = new 
SelectLicencieIdModel();


@Property
private MyButeurValueEncoder _buteurEncoder = new 
MyButeurValueEncoder();


Object onAddRowFromButeurs() {
getWebUtilisateur();
Buteur buteur = new Buteur();
try {
Licencie licencie = _dao.getLicencieDAO().getFirstLicencie();
buteur.setIdMatch(_match.getIdMatch());
buteur.setIdLicencie(licencie.getIdLicencie());
_dao.getButeurDAO().save(buteur);

_listButeur.add(buteur);
} catch (Exception e) {
setErrorMsg(e.getMessage());
}

return buteur;
}

void onRemoveRowFromButeurs(Buteur buteur) {
getWebUtilisateur();
try {
_dao.getButeurDAO().delete(buteur.getIdButeur());
_listButeur.remove(buteur);
} catch (Exception e) {
setErrorMsg(e.getMessage());
}
}

private class MyButeurValueEncoder extends BaseValueEncoder {


public String toClient(Buteur buteur) {
Long id = buteur.getIdButeur();
return id == null ? null : id.toString();
}

public Buteur toValue(String value) {
Buteur buteur = null;
Long idButeur = LongUtil.toLong(value);
if (idButeur == null) {
buteur = new Buteur();
} else {
buteur = getButeurDAO().get(idButeur);
}

if (buteur == null) {
_logger.error(String.format("Probléme Buteur 
introuvable id: [%s]", idButeur));

buteur = new Buteur();
}
return buteur;
}

private ButeurDAO getButeurDAO() {
return getDAO().getButeurDAO();
}

}

}


 Here's the tml code :

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






content="${msg}" duration="${duration}" />



Détail Match



context="match.idConvocation" class="pure-button pure-button-active">
src="actions/edit-find-replace.png" title="Edition" alt="Edition" 
border="0" />

Retour à la convocation











Id



[${match.idMatch}]


t:mixins="tynamo/ckeditor" value="match.compteRendu" width="70%" />





source="listButeur" value="buteur" t:encoder="buteurEncoder" t:show="show">


${buteur.idButeur}

model="licencieModel" />



|
Suppression


Ajouter un buteur












thanks, Thomas


Re: [T5.4] BeanEditor and Friends don't look as good as in Tap 5.3

2013-09-16 Thread Lenny Primak
I think this should be the default, at least for compatibility's sake.
Sounds like a lot of custom styling just to make it look like it used to in T5.3

On Sep 16, 2013, at 11:35 AM, Howard Lewis Ship wrote:

> This is part of using Boostrap; which is mobile-first and therefore likes
> everything stacked vertically and full width.  Add "form-horizontal" to the
> [BeanEdit]Form and the layout will look nicer.  You have to wrap the
> form-control elements in .col-md-N (md for medium device size) to keep them
> from being 100% wide.
> 
> 
> On Sun, Sep 15, 2013 at 8:41 PM, Lenny Primak wrote:
> 
>> Hi guys,
>> 
>> I noticed something else that's not as pretty out of the box in T5.4 due
>> to bootstrap probably
>> 
>> In T5.3, beaneditor looks something like this:
>> 
>> Label [Input Text]
>> Label [Input Text]
>> 
>> In T5.4, it looks like this:
>> 
>> Label
>> [Input Text  (takes up the whole width of the page)]
>> Label
>> [Input Text  (takes up the whole width of the page)]
>> 
>> 
>> I think this should be fixed out of the box
>> 
>> Issue created: https://issues.apache.org/jira/browse/TAP5-2182
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
>> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com


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



Re: [T5.4] JQuery / Bootstrap etc. from CDN by default?

2013-09-16 Thread Thiago H de Paula Figueiredo
On Mon, 16 Sep 2013 09:52:59 -0300, Johan Stuyts  
 wrote:


3) The CDN would be able to track your website users, and there's  
already too many organizations doing that (NSA included).


Not only that, they would be able to take control of all of your pages:


To be safe all JavaScript must be downloaded from your site. You'll  
manually have to track updates to scripts though.


Very good point, Johan!

--
Thiago H. de Paula Figueiredo

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



Re: [T5.4] JQuery / Bootstrap etc. from CDN by default?

2013-09-16 Thread Johan Stuyts
3) The CDN would be able to track your website users, and there's  
already too many organizations doing that (NSA included).


Not only that, they would be able to take control of all of your pages:


To be safe all JavaScript must be downloaded from your site. You'll  
manually have to track updates to scripts though.


--
Regards, Johan

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



Re: [T5.4] JQuery / Bootstrap etc. from CDN by default?

2013-09-16 Thread Thiago H de Paula Figueiredo
On Sun, 15 Sep 2013 20:14:55 -0300, Lenny Primak   
wrote:



I think there are lots of advantages and few downsides of doing this.
It can, of course (optionally) can be turned off, but, in this day and  
age, I think Tapestry should consider it.


A huge -1 to that.

1) Which CDN?
2) If the CDN goes down, all your JavaScript goes down too.
3) The CDN would be able to track your website users, and there's already  
too many organizations doing that (NSA included).


--
Thiago H. de Paula Figueiredo

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



Re: Eclipse Tapestry5 Plugin update

2013-09-16 Thread Dmitry Gusev
Thank you Bob!

On Mon, Sep 16, 2013 at 2:31 PM, Bob Harner  wrote:

> I just tried this plugin for the first time. Very nice! I could really get
> addicted to having the Tapestry Context view on the screen.
>
>
I like Tapestry Context view also, but I usually work in full-screen
(maximized) mode so all my views are minimized -- which is not very
convenient. I have one idea how to workaround this, hope I can do this in
the next release.


> Also, I noticed that in my component classes the properties that I have
> annotated with @Property or @Parameter no longer show the yellow underline
> "value not used" warnings, so I don't need to litter my code
> with @SuppressWarnings("unused") annotations. Sweet!
>
>
That wasn't me :) I think this is the default behavior of eclipse JDT --
you may put any annotation to private field that you're not using in this
class and Eclipse won't be marking it as unused.

P.S.
There is a bug in version 1.2.0 that affects default hyperlink detectors
for *.java files, so CMD+Hover on some method calls may be broken.
Please update to 1.2.1 to get the fix.



> On Mon, Sep 16, 2013 at 2:25 AM, Dmitry Gusev  >wrote:
>
> > New version with "Jump to Definition" available for update.
> >
> >
> > As usual, checkout screenshots & readme here:
> >
> > https://github.com/anjlab/eclipse-tapestry5-plugin
> >
> >
> >
> > On Mon, Sep 9, 2013 at 10:42 AM, Dmitry Gusev  > >wrote:
> >
> > > New version with Tapestry Context View available for update.
> > >
> > > Checkout screenshots & readme:
> > >
> > > https://github.com/anjlab/eclipse-tapestry5-plugin
> > >
> > >
> > > --
> > > Dmitry Gusev
> > >
> > > AnjLab Team
> > > http://anjlab.com
> > >
> >
> >
> >
> > --
> > Dmitry Gusev
> >
> > AnjLab Team
> > http://anjlab.com
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Eclipse Tapestry5 Plugin update

2013-09-16 Thread Bob Harner
I just tried this plugin for the first time. Very nice! I could really get
addicted to having the Tapestry Context view on the screen.

Also, I noticed that in my component classes the properties that I have
annotated with @Property or @Parameter no longer show the yellow underline
"value not used" warnings, so I don't need to litter my code
with @SuppressWarnings("unused") annotations. Sweet!


On Mon, Sep 16, 2013 at 2:25 AM, Dmitry Gusev wrote:

> New version with "Jump to Definition" available for update.
>
>
> As usual, checkout screenshots & readme here:
>
> https://github.com/anjlab/eclipse-tapestry5-plugin
>
>
>
> On Mon, Sep 9, 2013 at 10:42 AM, Dmitry Gusev  >wrote:
>
> > New version with Tapestry Context View available for update.
> >
> > Checkout screenshots & readme:
> >
> > https://github.com/anjlab/eclipse-tapestry5-plugin
> >
> >
> > --
> > Dmitry Gusev
> >
> > AnjLab Team
> > http://anjlab.com
> >
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>