You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Casper Bang <ca...@gmail.com> on 2008/11/20 19:13:28 UTC

Open FAQ/wiki somewhere?

In "Wicket in Action" it's mentioned briefly how one could use a
SimpleAttributeModifier to limit the text length of an input, by binding to
a JPA @Column annotation and its length attribute. This sounds nice DRY to
me (albeit perhaps a bit expensive?!) so I gave it a try:

    protected String getColumnLength(Class entityName, String fieldName){
        try {
            Field field = entityName.getDeclaredField(fieldName);
            field.setAccessible(true);
            return
String.valueOf(field.getAnnotation(Column.class).length());
        } catch (Exception ex) {
            return "";
        }
    }

Which got me thinking (after spending an hour figuring out I had to use
setAccessible) if there's an open FAQ/wiki for these kind of things? I have
not been able to find any except the locked down official confluence. Google
is nice, but as a newbie it would be nice to have a central place with lots
of micro-examples/snippets to get you going.

/Casper 
-- 
View this message in context: http://www.nabble.com/Open-FAQ-wiki-somewhere--tp20607065p20607065.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Open FAQ/wiki somewhere?

Posted by Michael O'Cleirigh <mi...@rivulet.ca>.
Hi Casper,

Have you seen the reference library documentation on the main wiki:

http://cwiki.apache.org/WICKET/reference-library.html

Any one can create an account and then edit the wiki pages. 

Mike
> In "Wicket in Action" it's mentioned briefly how one could use a
> SimpleAttributeModifier to limit the text length of an input, by binding to
> a JPA @Column annotation and its length attribute. This sounds nice DRY to
> me (albeit perhaps a bit expensive?!) so I gave it a try:
>
>     protected String getColumnLength(Class entityName, String fieldName){
>         try {
>             Field field = entityName.getDeclaredField(fieldName);
>             field.setAccessible(true);
>             return
> String.valueOf(field.getAnnotation(Column.class).length());
>         } catch (Exception ex) {
>             return "";
>         }
>     }
>
> Which got me thinking (after spending an hour figuring out I had to use
> setAccessible) if there's an open FAQ/wiki for these kind of things? I have
> not been able to find any except the locked down official confluence. Google
> is nice, but as a newbie it would be nice to have a central place with lots
> of micro-examples/snippets to get you going.
>
> /Casper 
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Open FAQ/wiki somewhere?

Posted by Casper Bang <ca...@gmail.com>.
Oh wow, that's a virtual gold mine. Thanks!.

/Casper


jWeekend wrote:
> 
> Casper,
> 
> Something like 
> http://cwiki.apache.org/WICKET/how-to-do-things-in-wicket.html this ?
> 
> Regards - Cemal
>  http://www.jWeekend.co.uk http://jWeekend.co.uk 
> 
> 
> 
> Casper Bang wrote:
>> 
>> In "Wicket in Action" it's mentioned briefly how one could use a
>> SimpleAttributeModifier to limit the text length of an input, by binding
>> to a JPA @Column annotation and its length attribute. This sounds nice
>> DRY to me (albeit perhaps a bit expensive?!) so I gave it a try:
>> 
>>     protected String getColumnLength(Class entityName, String fieldName){
>>         try {
>>             Field field = entityName.getDeclaredField(fieldName);
>>             field.setAccessible(true);
>>             return
>> String.valueOf(field.getAnnotation(Column.class).length());
>>         } catch (Exception ex) {
>>             return "";
>>         }
>>     }
>> 
>> Which got me thinking (after spending an hour figuring out I had to use
>> setAccessible) if there's an open FAQ/wiki for these kind of things? I
>> have not been able to find any except the locked down official
>> confluence. Google is nice, but as a newbie it would be nice to have a
>> central place with lots of micro-examples/snippets to get you going.
>> 
>> /Casper 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Open-FAQ-wiki-somewhere--tp20607065p20607796.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Open FAQ/wiki somewhere?

Posted by jWeekend <jw...@cabouge.com>.
Casper,

Something like 
http://cwiki.apache.org/WICKET/how-to-do-things-in-wicket.html this ?

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 



Casper Bang wrote:
> 
> In "Wicket in Action" it's mentioned briefly how one could use a
> SimpleAttributeModifier to limit the text length of an input, by binding
> to a JPA @Column annotation and its length attribute. This sounds nice DRY
> to me (albeit perhaps a bit expensive?!) so I gave it a try:
> 
>     protected String getColumnLength(Class entityName, String fieldName){
>         try {
>             Field field = entityName.getDeclaredField(fieldName);
>             field.setAccessible(true);
>             return
> String.valueOf(field.getAnnotation(Column.class).length());
>         } catch (Exception ex) {
>             return "";
>         }
>     }
> 
> Which got me thinking (after spending an hour figuring out I had to use
> setAccessible) if there's an open FAQ/wiki for these kind of things? I
> have not been able to find any except the locked down official confluence.
> Google is nice, but as a newbie it would be nice to have a central place
> with lots of micro-examples/snippets to get you going.
> 
> /Casper 
> 

-- 
View this message in context: http://www.nabble.com/Open-FAQ-wiki-somewhere--tp20607065p20607391.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org