Re: data persistence using hibernate

2023-01-25 Thread Vit Rozkovec

Check out JDBI as well.

Vit


On 25. 01. 23 3:23, Locke, Jonathan (Luo Shibo) wrote:

JOOQ is good for me most of the time.

Jon

On Jan 24, 2023, at 6:34 PM, James Pollard  wrote:

I don't need hibernates added level of abstraction

I was taught in the past to do database connectivity using jdbc
drivers/connectors, hikaricp just takes this a step further
by providing a pool of connections to use. Basically I've looked at orm
frameworks in the past and just couldn't get my
head around how to use it, I much prefer spelling out my query exactly
myself.

Best Regards
James Pollard
james.poll...@iinet.net.au<mailto:james.poll...@iinet.net.au>

On 24/1/23 6:49 pm, Martin Grigorov wrote:
On Tue, Jan 24, 2023 at 8:50 AM James Pollard 
wrote:

I've managed to make some progress with database connectivity, ended up
using hikaricp instead

HikariCP is a just a connection pool.
I am not sure what exactly you mean with "instead". A connection pool is
not a replacement of an ORM framework like Hibernate.



However, I can't workout where the most appropriate place to put the
connection pool close call, is there a close or shutdown function
I can override so that the connection pool can be closed cleanly. I
haven't had any luck in my search so far

Additionally, I keep running into the following error:
  java.lang.IllegalStateException: Illegal access: this web
application instance has been stopped already.
 Could not load [META-INF/services/org.mariadb.jdbc.plugin.Codec].
The following stack trace is thrown for debugging purposes as well as to
 attempt to terminate the thread which caused the illegal access.

I'm assuming this is a error more to do hikaricp so I'll enquire among
their community about it, but if someone has encountered this before feel
to volunteer any suggestions or recommended actions. The odd thing is I
still seem to be able to send queries to the database from what I can
tell

MyWicketApplication#onDestroy()
https://github.com/apache/wicket/blob/4affb7b18424e40663239ac9c93d9ec33a432541/wicket-core/src/main/java/org/apache/wicket/Application.java#L569



Best Regards
James Pollard
james.poll...@iinet.net.au

On 27/12/22 8:23 am, Vit Rozkovec wrote:
But I'm not sure where to put the following parts
Session sess = sessionFactory.openSession();
ManagedSessionContext.bind(sess);
This is done in some utility method when you retrieve the session for
the first time in the request.

You should also check if the session is already bound by calling

ManagedSessionContext.hasBind(SessionFactory factory)

and binding it only once per request.


unbindSessionFactory
I have this in my custom implementation of
IRequestCycleListener.onEndRequest(RequestCycle cycle)

that you add in Application.init() method

getRequestCycleListeners().add(new DataRequestCycleListener());

To be honest, I've until now stayed away from Spring as it still seems
to me as a too much of a black box that I didn't find a time to invest
in learning it, so I may not be the right person to give you advice,
because my solution may not be the best one either, although it seems
to be as javadoc of the ManagedSessionContext suggests. The solution I
now use took heavy inspiration in old old, now nonexistent, Databinder
that came around the time Wicket 1.2 or so and when I was tasked to
select new java framework after landing my first job and found Wicket.
Old times :D.

Vit



Thank you for the help so far both of you, I've probably made
mistakes with implement parts
of the previously outlined process.
I've come from experimenting with javafx so wicket has been a radical
change of direction for me
so far. But since there is very little in the way of examples for
database integration I'm struggling
to get my head around how to implement it correctly, as well as
knowing for sure whether I've
done it correctly

Best Regards
James Pollard
james.poll...@iinet.net.au

On 23/12/22 10:16 am, Ernesto Reinaldo Barreiro wrote:
Hi James,

On Thu, Dec 22, 2022 at 2:24 PM James 
wrote:

Thanks for the guidance so far, that pointed me to find additional
resources on JPA
I believe I have this configured correctly, but I'm confused about how
to integrate JPA/Hibernate into a
pure wicket authenticated web application project since the
resource you
directed me to previously
seems to be more heavily on the spring side of things.

This is true. I have used Hibernate/JPA without the SpringBoot
parts... But
those projects are private: some owned by me, others no.


Thank you for accommodating all my questions and misunderstandings so
far, I tend to use a reverse
engineer learning style so it's helped me immensely.

Glad to be of some help. This is why this place is for.
I've included screenshots of the project file list and the application
class in the hopes that it makes

They didn't


understanding what I'm trying to convey easier


Re: data persistence using hibernate

2022-12-26 Thread Vit Rozkovec





But I'm not sure where to put the following parts
Session sess = sessionFactory.openSession();
ManagedSessionContext.bind(sess);


This is done in some utility method when you retrieve the session for 
the first time in the request.


You should also check if the session is already bound by calling

ManagedSessionContext.hasBind(SessionFactory factory)

and binding it only once per request.




unbindSessionFactory


I have this in my custom implementation of 
IRequestCycleListener.onEndRequest(RequestCycle cycle)


that you add in Application.init() method

getRequestCycleListeners().add(new DataRequestCycleListener());

To be honest, I've until now stayed away from Spring as it still seems 
to me as a too much of a black box that I didn't find a time to invest 
in learning it, so I may not be the right person to give you advice, 
because my solution may not be the best one either, although it seems to 
be as javadoc of the ManagedSessionContext suggests. The solution I now 
use took heavy inspiration in old old, now nonexistent, Databinder that 
came around the time Wicket 1.2 or so and when I was tasked to select 
new java framework after landing my first job and found Wicket. Old 
times :D.


Vit





Thank you for the help so far both of you, I've probably made mistakes 
with implement parts

of the previously outlined process.
I've come from experimenting with javafx so wicket has been a radical 
change of direction for me
so far. But since there is very little in the way of examples for 
database integration I'm struggling
to get my head around how to implement it correctly, as well as 
knowing for sure whether I've

done it correctly

Best Regards
James Pollard
james.poll...@iinet.net.au

On 23/12/22 10:16 am, Ernesto Reinaldo Barreiro wrote:

Hi James,

On Thu, Dec 22, 2022 at 2:24 PM James  
wrote:



Thanks for the guidance so far, that pointed me to find additional
resources on JPA
I believe I have this configured correctly, but I'm confused about how
to integrate JPA/Hibernate into a
pure wicket authenticated web application project since the resource 
you

directed me to previously
seems to be more heavily on the spring side of things.

This is true. I have used Hibernate/JPA without the SpringBoot 
parts... But

those projects are private: some owned by me, others no.



Thank you for accommodating all my questions and misunderstandings so
far, I tend to use a reverse
engineer learning style so it's helped me immensely.

Glad to be of some help. This is why this place is for.



I've included screenshots of the project file list and the application
class in the hopes that it makes


They didn't



understanding what I'm trying to convey easier

Best Regards
James Pollard
james.poll...@iinet.net.au

On 20/12/22 12:58 pm, Ernesto Reinaldo Barreiro wrote:
https://github.com/MarcGiffing/wicket-spring-boot/blob/master/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/model/Customer.java 


This defines a JPA entity and this JPA/Hibernate


https://github.com/MarcGiffing/wicket-spring-boot/blob/master/wicket-spring-boot-starter-example/src/main/resources/application.yml 


Project uses Spring magic I guess and will start a Hibernate with H2.
Wicket is also started via SpringBoot.


On Tue, Dec 20, 2022 at 7:44 AM James 

wrote:
I've had a look through it but couldn't find any reference to 
hibernate

so far, its entirely
possible that I managed to miss it while I was searching though

Best Regards
James Pollard
james.poll...@iinet.net.au

On 19/12/22 5:06 pm, Ernesto Reinaldo Barreiro wrote:

Hi,

This project

https://github.com/MarcGiffing/wicket-spring-boot

contains a sample project that integrates with JPA/hibernate.


On Mon, Dec 19, 2022 at 9:12 AM James 

wrote:

Hi,
can anyone direct me to any resources on how to integrate hibernate

for

data persistence?

the closest I've managed to find is


https://www.infoworld.com/article/2077901/web-development-with-wicket--part-3--many-ways-to-persist.html?page=7 


but there's still things that are confusing me on how to ingrate an
authenticated application with hibernate

--
Best Regards
James Pollard
james.poll...@iinet.net.au


- 


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



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




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






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

Re: data persistence using hibernate

2022-12-22 Thread Vit Rozkovec

Hi,

I'm currently using Hibernate without Spring and what you want to 
achieve can be done in several steps:


- prepare your org.hibernate.cfg.Configuration
- set Configuration's property: 
config.setProperty("hibernate.current_session_context_class", "managed");

- get SessionFactory by caling org.hibernate.cfg.Configuration.build()
- store SessionFactory's instance somewhere and keep it for the duration 
of your application

- when you request a session, bind it:
Session sess = sessionFactory.openSession();
ManagedSessionContext.bind(sess);

- at the end of request cycle, unbind SessionFactory. Implement your own 
IRequestCycleListener and in IRequestCycleListener.onEndRequest call 
unbind logic.

Here's what I use:

public void unbindSessionFactory(Object key, boolean closeSessionFactory)
    {
    SessionFactory sf = getHibernateSessionFactory(key);

    if (hasBoundSession(sf))
    {
        Session sess = sf.getCurrentSession();

        if (sess.isOpen())
        {
            try
            {
                if (sess.getTransaction().isActive())
                {
                    sess.getTransaction().rollback();
                }
            }
            finally
            {
                sess.close();
            }
        }

        ManagedSessionContext.unbind(sf);

        if (closeSessionFactory)
            sf.close();
    }
    }

- when application exits, close session factory

Hope that helped.

Vit



On 22. 12. 22 8:23, James wrote:
Thanks for the guidance so far, that pointed me to find additional 
resources on JPA
I believe I have this configured correctly, but I'm confused about how 
to integrate JPA/Hibernate into a
pure wicket authenticated web application project since the resource 
you directed me to previously

seems to be more heavily on the spring side of things.

Thank you for accommodating all my questions and misunderstandings so 
far, I tend to use a reverse

engineer learning style so it's helped me immensely.

I've included screenshots of the project file list and the application 
class in the hopes that it makes

understanding what I'm trying to convey easier

Best Regards
James Pollard
james.poll...@iinet.net.au

On 20/12/22 12:58 pm, Ernesto Reinaldo Barreiro wrote:
https://github.com/MarcGiffing/wicket-spring-boot/blob/master/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/model/Customer.java 



This defines a JPA entity and this JPA/Hibernate

https://github.com/MarcGiffing/wicket-spring-boot/blob/master/wicket-spring-boot-starter-example/src/main/resources/application.yml 



Project uses Spring magic I guess and will start a Hibernate with H2.
Wicket is also started via SpringBoot.


On Tue, Dec 20, 2022 at 7:44 AM James  
wrote:



I've had a look through it but couldn't find any reference to hibernate
so far, its entirely
possible that I managed to miss it while I was searching though

Best Regards
James Pollard
james.poll...@iinet.net.au

On 19/12/22 5:06 pm, Ernesto Reinaldo Barreiro wrote:

Hi,

This project

https://github.com/MarcGiffing/wicket-spring-boot

contains a sample project that integrates with JPA/hibernate.


On Mon, Dec 19, 2022 at 9:12 AM James 

wrote:

Hi,
can anyone direct me to any resources on how to integrate 
hibernate for

data persistence?

the closest I've managed to find is


https://www.infoworld.com/article/2077901/web-development-with-wicket--part-3--many-ways-to-persist.html?page=7 


but there's still things that are confusing me on how to ingrate an
authenticated application with hibernate

--
Best Regards
James Pollard
james.poll...@iinet.net.au


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




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





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




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



Re: How can a component know if it's being rendered as part of Ajax response?

2020-04-07 Thread Vit Rozkovec

Hi Thomas,

thank you for sharing,

I've come up with something similar, but will definitely take some 
inspiration from your code.


Cheers
Vit

On 4/5/20 9:51 PM, Thomas Heigl wrote:

Hi Vit,

I'm using a utility class to encapsulate these use cases:

/** Utility class for interacting with {@link AjaxRequestTarget}s */

public final class AjaxTarget {
private AjaxTarget() {
// utility class
}
/**
* Checks if there is an active {@link AjaxRequestTarget}
*
* @return {@code true} if there is a request target bound to the thread,
else {@code false}
*/
public static boolean exists() {
return find().isPresent();
}
/** @return the {@link AjaxRequestTarget} bound to the thread or {@code
null} */
public static AjaxRequestTarget get() {
return find().orElse(null);
}
/** @return the optional {@link AjaxRequestTarget} bound to the thread */
public static Optional find() {
return RequestCycle.get().find(AjaxRequestTarget.class);
}
/**
* Adds the given components to the active request target if available.
*
* @param component the first component to add
* @param otherComponents the other components to add
* @see AjaxRequestTarget#add(org.apache.wicket.Component...)
*/
public static void add(Component component, Component... otherComponents) {
find().ifPresent(t -> {
if (component != null) {
t.add(component);
}
t.add(otherComponents);
});
}
/**
* Adds all components of the given class to the active request target if
available.
*
* @param childCriteria the child component class
* @param  the type of child component
* @see AjaxRequestTarget#addChildren(org.apache.wicket.MarkupContainer,
Class)
*/
public static  void add(Class childCriteria) {
find().ifPresent(t -> add(t.getPage(), childCriteria));
}


/**

* Appends JavaScript to the active request target if available
*
* @param javaScript the script to append
* @see AjaxRequestTarget#appendJavaScript(CharSequence)
*/
public static void appendJavaScript(CharSequence javaScript) {
find().ifPresent(t -> t.appendJavaScript(javaScript));
}
/**
* Prepends JavaScript to the active request target if available
*
* @param javaScript the script to prepend
* @see AjaxRequestTarget#prependJavaScript(CharSequence)
*/
public static void prependJavaScript(CharSequence javaScript) {
find().ifPresent(t -> t.prependJavaScript(javaScript));
}

}


Best regards,

Thomas

On Sun, Apr 5, 2020 at 6:58 PM Vit Rozkovec  wrote:


In my project it is around 40 cases of such usage. Is it little? Is it a
lot. I don't know.
Never mind :)

Have a nice day.
Vit

On 4/5/20 11:20 AM, Sven Meier wrote:

Hi,

actually it's not that common, in wicket-core and -extensions this
pattern is used 9 times only.

When the RequestCycle API emerged, we decided against a specific
method and chose a generic one with parameter instead.

Have fun
Sven


On 05.04.20 08:47, Vit Rozkovec wrote:

Hi, this seems to be a frequent use case, wouldn't there be a good
fit for some shorthand method?

Like

/getRequestCycle().onAjax(t-> {});/
boolean getRequestCycle().isAjax();

?

Vit


On 4/4/20 11:51 PM, Sven Meier wrote:

Hi,

you can test for the appropriate request handler:



getRequestCycle().find(IPartialPageRequestHandler.class).ifPresent(target

-> /* do things on partial page update */));

Have fun
Sven


On 04.04.20 23:43, Vilius Vaivada wrote:

Hey guys,

I'm pretty sure I'm missing something obvious here, but I can't
figure out
a simple way for a component to contribute slightly different
Javascript
based on whether it's being rendered for a full page load or a
partial Ajax
response. Any clues?

Thanks a lot!


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




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



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





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



Re: How can a component know if it's being rendered as part of Ajax response?

2020-04-05 Thread Vit Rozkovec
In my project it is around 40 cases of such usage. Is it little? Is it a 
lot. I don't know.

Never mind :)

Have a nice day.
Vit

On 4/5/20 11:20 AM, Sven Meier wrote:

Hi,

actually it's not that common, in wicket-core and -extensions this 
pattern is used 9 times only.


When the RequestCycle API emerged, we decided against a specific 
method and chose a generic one with parameter instead.


Have fun
Sven


On 05.04.20 08:47, Vit Rozkovec wrote:
Hi, this seems to be a frequent use case, wouldn't there be a good 
fit for some shorthand method?


Like

/getRequestCycle().onAjax(t-> {});/
boolean getRequestCycle().isAjax();

?

Vit


On 4/4/20 11:51 PM, Sven Meier wrote:

Hi,

you can test for the appropriate request handler:

getRequestCycle().find(IPartialPageRequestHandler.class).ifPresent(target 
-> /* do things on partial page update */));


Have fun
Sven


On 04.04.20 23:43, Vilius Vaivada wrote:

Hey guys,

I'm pretty sure I'm missing something obvious here, but I can't 
figure out
a simple way for a component to contribute slightly different 
Javascript
based on whether it's being rendered for a full page load or a 
partial Ajax

response. Any clues?

Thanks a lot!



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






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




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



Re: How can a component know if it's being rendered as part of Ajax response?

2020-04-04 Thread Vit Rozkovec
Hi, this seems to be a frequent use case, wouldn't there be a good fit 
for some shorthand method?


Like

/getRequestCycle().onAjax(t-> {});/
boolean getRequestCycle().isAjax();

?

Vit


On 4/4/20 11:51 PM, Sven Meier wrote:

Hi,

you can test for the appropriate request handler:

getRequestCycle().find(IPartialPageRequestHandler.class).ifPresent(target 
-> /* do things on partial page update */));


Have fun
Sven


On 04.04.20 23:43, Vilius Vaivada wrote:

Hey guys,

I'm pretty sure I'm missing something obvious here, but I can't 
figure out

a simple way for a component to contribute slightly different Javascript
based on whether it's being rendered for a full page load or a 
partial Ajax

response. Any clues?

Thanks a lot!



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





Re: Display indicator on AjaxButton when it reloads target components

2019-09-12 Thread Vit Rozkovec

Hi,
try to look into the wicket-bootstrap [1] and there are LaddaAjaxLink 
and LaddaAjaxButton that do exactly what you want.


Vit

[1] https://github.com/l0rdn1kk0n/wicket-bootstrap

On 9/12/19 8:36 AM, Arunachalam Sibisakkaravarthi wrote:

Hi Guys Good afternoon,
I have created a panel with IndicatingAjaxButton and DataTable.
DataTable is added into Target when clicks the button.
Is it possible to display Indicator icon on button until the components get
refreshed?



*Thanks And RegardsSibi.ArunachalammCruncher*




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



Re: Wicket & Jdbi & Guice

2019-02-07 Thread Vit Rozkovec

Hi, thanks for comments.

With supplier it works, but then in your code you need to have:

@Inject
private IJdbiSupplier jdbiSupplier;

...

Jdbi jdbi = jdbiSupplier.get();
jdbi.useHandle(h->{
    ...
});


which I wanted to avoid.


Would it be a solution to add a check to GuiceFieldValueFactory?
There is this code on line 86:

if (wrapInProxies)
{
    target = LazyInitProxyFactory.createProxy(field.getType(), locator);
}


I propose this change:

|boolean isTransient = Modifier.isTransient(field.getModifiers());|
if (wrapInProxies && !isTransient)
{
    target = LazyInitProxyFactory.createProxy(field.getType(), locator);
}


which I think is fine as there is no need for proxy as the field is not 
serialized anyway.


Then you can just do:

@Inject
private transient Jdbi jdbi;

...

jdbi.useHandle(h->{
..
});


And as Jdbi is used as a singleton, this approach makes sense to me, am 
I missing something?


If you are fine with that, should I make a pull request?

Adding Objenesis did not help.

Thanks.

Vit



On 2/7/19 7:45 AM, Martin Grigorov wrote:

Hi,

On Wed, Feb 6, 2019 at 7:55 PM Vit Rozkovec  wrote:


Hi,

have any of you tried to inject Jdbi [1] via Guice to your component
hierarchy? I cannot do so without using intermediate Jdbi supplier.


Using supplier/provider is perfectly fine!



Please see this issue:

https://github.com/jdbi/jdbi/issues/1451

I've tried to turn off wrapping in proxies for Guice, but it gives me:

org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream$ObjectCheckException:
The object type is not Serializable!
A problem occurred while checking object with type: org.jdbi.v3.core.Jdbi


As you already know this is not good. The appication should not
(de)serialize the Jdbi instance between requests.



with wrapInProxies set to true in GuiceComponentInjector the exception is:

java.lang.IllegalArgumentException: No visible constructors in class
org.jdbi.v3.core.Jdbi


You can try to add Objenesis to the classpath. LazyInitProxyFactory will
use it instead of CGLIB if it is available.
CGLIB requires the constructor.



I see where it comes from: LazyInitProxyFactory

It seems to me that it is possible only to make happy Guice or Wicket,
but not both.


Just use supplier/provider!



Any hints appreciated.

Thank you.

Vit


[1] http://jdbi.org/






Re: Wicket & Jdbi & Guice

2019-02-07 Thread Vit Rozkovec

Hi, thanks for comments.

With supplier it works, but then in your code you need to have:

@Inject
private IJdbiSupplier jdbiSupplier;

...

Jdbi jdbi = jdbiSupplier.get();
jdbi.useHandle(h->{
    ...
});


which I wanted to avoid.


Would it be a solution to add a check to GuiceFieldValueFactory?
There is this code on line 86:

if (wrapInProxies)
{
    target = LazyInitProxyFactory.createProxy(field.getType(), locator);
}


I propose this change:

|boolean isTransient = Modifier.isTransient(field.getModifiers());|
if (wrapInProxies && !isTransient)
{
    target = LazyInitProxyFactory.createProxy(field.getType(), locator);
}


which I think is fine as there is no need for proxy as the field is not 
serialized anyway.


Then you can just do:

@Inject
private transient Jdbi jdbi;

...

jdbi.useHandle(h->{
..
});


And as Jdbi is used as a singleton, this approach makes sense to me, am 
I missing something?


If you are fine with that, should I make a pull request?

Adding Objenesis did not help.

Thanks.

Vit


On 2/7/19 7:45 AM, Martin Grigorov wrote:

Hi,

On Wed, Feb 6, 2019 at 7:55 PM Vit Rozkovec  wrote:


Hi,

have any of you tried to inject Jdbi [1] via Guice to your component
hierarchy? I cannot do so without using intermediate Jdbi supplier.


Using supplier/provider is perfectly fine!



Please see this issue:

https://github.com/jdbi/jdbi/issues/1451

I've tried to turn off wrapping in proxies for Guice, but it gives me:

org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream$ObjectCheckException:
The object type is not Serializable!
A problem occurred while checking object with type: org.jdbi.v3.core.Jdbi


As you already know this is not good. The appication should not
(de)serialize the Jdbi instance between requests.



with wrapInProxies set to true in GuiceComponentInjector the exception is:

java.lang.IllegalArgumentException: No visible constructors in class
org.jdbi.v3.core.Jdbi


You can try to add Objenesis to the classpath. LazyInitProxyFactory will
use it instead of CGLIB if it is available.
CGLIB requires the constructor.



I see where it comes from: LazyInitProxyFactory

It seems to me that it is possible only to make happy Guice or Wicket,
but not both.


Just use supplier/provider!



Any hints appreciated.

Thank you.

Vit


[1] http://jdbi.org/






Wicket & Jdbi & Guice

2019-02-06 Thread Vit Rozkovec

Hi,

have any of you tried to inject Jdbi [1] via Guice to your component 
hierarchy? I cannot do so without using intermediate Jdbi supplier.


Please see this issue:

https://github.com/jdbi/jdbi/issues/1451

I've tried to turn off wrapping in proxies for Guice, but it gives me:

org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream$ObjectCheckException:
 The object type is not Serializable!
A problem occurred while checking object with type: org.jdbi.v3.core.Jdbi

with wrapInProxies set to true in GuiceComponentInjector the exception is:

java.lang.IllegalArgumentException: No visible constructors in class 
org.jdbi.v3.core.Jdbi


I see where it comes from: LazyInitProxyFactory

It seems to me that it is possible only to make happy Guice or Wicket, 
but not both.


Any hints appreciated.

Thank you.

Vit


[1] http://jdbi.org/



Re: Code Generator with Wicket...

2017-10-19 Thread Vit Rozkovec

Awesome, PR welcomed.

Cheers.

On 10/18/2017 11:29 AM, badgers wrote:

Yes!

I will check it. When I did my adaptions I will do a pull request.

Thx in advance

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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





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



Re: Code Generator with Wicket...

2017-10-18 Thread Vit Rozkovec

As a quickfix I've commited missing package with behaviors.

Regarding Hibernate, instead of that, there could be this dependency 
http://search.maven.org/#artifactdetails%7Cjavax.persistence%7Cpersistence-api%7C1.0.2%7Cjar


If you'd like to have it even without that, I guess that would mean 
introducing your own set of annotations.


And for generated templates, the way how is it prepared now, it is easy 
to generate your own project specific logic from the template that is 
located in your own project.


Was that what you have meant?


On 10/16/2017 06:32 PM, badgers wrote:

I understand it. I develop Maven based Velocity Generator using Reflection.
We are on the same knowledge path ;-)

* cz.newforms.wicket.behaviors is missing...difficult to test it...is it
possible that you sent me fragments or a jar file to test it?
* I would prefer not to use hibernate...it should be more open.
* I want to generate additonally the DB/NoSQL Layer based on that. e.g. when
the data is saved in a MySQL i would like to generate the SQL Skript.

What do you think?

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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





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



Re: Code Generator with Wicket...

2017-10-16 Thread Vit Rozkovec

Hi, happy you like it.

Feel free to do whatever you want with it, at the moment I use it 
regularly to generate admin interfaces that I then customize according 
to usecase.
There are some areas that could receive more attention, generator could 
get more clever in guessing correct formcomponent, more templates for 
different approaches could be added..
For now it just suits my needs, but if someone would send me a pull 
request with new template or an improvement, I'll be happy to merge it.


Best regards,
Vit

On 10/13/2017 08:38 AM, badgers wrote:

Hi Vit,

I am an pure Java Developer since many years ;-)  ... I like it to use
annotations.
I know that many frameworks use DSL and whatever today...but Java Classes to
configure is an Java developer friendly was.

What is your goal with the project?`

best regards
badgers

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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





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



Re: Code Generator with Wicket...

2017-10-10 Thread Vit Rozkovec

Hi badgers,

have a look here: https://github.com/vrozkovec/wicket-code-generator

Please note that it is a quickly created project that was part of the 
set of my internal utilities and some imports in the generated classes 
will be missing.
Generated files contain also unnecessary imports, I use IDE for 
organizing them.


Pretty simple and someone may say a dumb way to do, but hey, worked for 
me and allows me to quickly create admin interfaces and because it 
generates working wicket components for you, there is no hidden magic in 
how things work - they work the way you have prepared them in your 
template.


Just try and see what I mean.

Clone a repository, set proper path and run the application.

If you are interested in making this tool a bit better, I will be happy 
to help you.


Best regards,
Vit

On 10/09/2017 04:43 PM, badgers wrote:

Hi Vit,

would be nice and I'm intertested.

Maybe I can participate ;-)

best regards
badgers


--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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





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



Re: Code Generator with Wicket...

2017-10-09 Thread Vit Rozkovec
I've developed one simple generator that consumes java POJOs, inspects 
them via reflection and produces CRUD wicket components from the template.

If you are interested, I can publish it on the github as a separate project.

Vit

On 10/09/2017 09:57 AM, badgers wrote:

Hi,

in my project I have a lot of easy master data gui's...nothing complex.
mostly with one foerign key in its data store.

I want to develop a code generator which is based on metamodel.
Goal is to generate based on a DSL? Beans with Annotations? or something
similar wicket gui's, service's that at the end automatically persists all
in a database when the persistence is generated too.

But the first goal is to generate the Wicket GUI, the binding and the GUI
Model who calls a Service.

How would you recommend to start such an approach?

thx

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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





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



Re: Hidden to visible not working, even after having set up .setOutputMarkupId(true);

2017-08-03 Thread Vit Rozkovec

Hi,
you have to use setOutputMarkupPlaceholderTag(true), see javadoc for 
this method.


Vit

On 08/03/2017 05:50 PM, lucast wrote:

Dear Forum,

I have a page component that initially is hidden.
These are the steps taken:


When I try to make the component visible, inside an AjaxLink.onClick(), I do
it like so:
pageComponent.setVisible(true);
target.add(pageComponent);

However, on the page, the component is not made visible at all. On wicket
Ajax debug, I get the following error:


Would you happen to know what I am missing, please?

Thank you,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Hidden-to-visible-not-working-even-after-having-set-up-setOutputMarkupId-true-tp4678430.html
Sent from the Users forum mailing list archive at Nabble.com.

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





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



Re: using CssResourceReference for css file that lives in webapp

2017-07-31 Thread Vit Rozkovec

Hi,
have a look at those classes:

ContextRelativeResource
ContextRelativeResourceReference

Vit

On 07/31/2017 01:01 PM, lucast wrote:

Thank you, Maxim.

Since I am managing all css files and js files form my java class, I was
wondering if there is an equivalent to the HTML of http://apache-wicket.1842946.n4.nabble.com/using-CssResourceReference-for-css-file-that-lives-in-webapp-tp4678358p4678360.html
Sent from the Users forum mailing list archive at Nabble.com.

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





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



Re: Toastr popups and Form's onSubmit

2017-07-27 Thread Vit Rozkovec
Would it work to add a behavior to the component, passing behavior's url 
to Toastr and calling this url via Wicket.Ajax?

In the behavior you would then redirect to the page you need.



On 07/27/2017 04:43 PM, Martin Grigorov wrote:

You will have to do some refactoring ...

Instead of using Wicket's setResponsePage() you will need to use Toastr's
callbacks

toastr.options.onHidden = function() { console.log('goodbye');
}toastr.options.onCloseClick = function() { console.log('close button
clicked'); }


and do the redirect with JavaScript: document.location='../the/next/page';

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jul 27, 2017 at 5:18 PM, ssamarin  wrote:


I probably don't need a label, problem is that onSubmit of the form
typically
calls redirect to another page.

I tried AjaxButton, but can't get redirect being called *after* toastr
popup
shows up. Ideally, I want popup, wait few seconds till it closes (or user
closes it) - do redirect.

--
View this message in context: http://apache-wicket.1842946.
n4.nabble.com/Toastr-popups-and-Form-s-onSubmit-tp4678320p4678329.html
Sent from the Users forum mailing list archive at Nabble.com.

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





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



Re: Proper way of sharing reference to Application

2017-07-09 Thread Vit Rozkovec

Perfect, thank you.
Vit

On 07/10/2017 06:05 AM, Martin Grigorov wrote:

Hi,

On Sat, Jul 8, 2017 at 5:33 PM, Vit Rozkovec  wrote:


Hi,

I'm using Quartz Scheduler for scheduling regular jobs or for keeping time
intensive work units out from the Application's init method.

Please see Task execution. What is the right way to set application to the
ThreadContext? Is it fine to do it like this without introducing leaks of
any kind? Tasks may repeat forever in a few minutes interval.

Or should I code tasks in a way that does not need application set in
thread local?

Thank you in advance.
Vit





Scheduler setup - Application's init() method
=

JobDataMap jobDataMap = new JobDataMap();
jobDataMap.put("application", application);  <--- reference to the
application


I'd pass just the name (Application#getName()).



JobDetail job5min = newJob(Job5Min.class).withIdentity("MyIdentity",
"group1").setJobData(jobDataMap).build();
Trigger trigger5min = newTrigger().withIdentity("trigger.5min", "group1")
.withSchedule(simpleSchedule().withIntervalInMinutes(5).repeatForever())
 .startNow().build();

scheduler.scheduleJob(job5min, trigger5min);


Task execution
=


 public void execute(JobExecutionContext context) throws
JobExecutionException
 {
 Application application = (Application)context.getMerged
JobDataMap().get("application");


And then use it to lookup the application instance: Application app =
Application.get(appName);



 ThreadContext.setApplication(application);

 ... code ...

 ThreadContext.setApplication(null);
 ThreadContext.detach();


This logic should be in try/finally, i.e. the cleanup methods should be in
finally.



 }



Scheduler stop - Application's onDestroy() method
=

scheduler.stopScheduler();





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





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



Proper way of sharing reference to Application

2017-07-08 Thread Vit Rozkovec

Hi,

I'm using Quartz Scheduler for scheduling regular jobs or for keeping 
time intensive work units out from the Application's init method.


Please see Task execution. What is the right way to set application to 
the ThreadContext? Is it fine to do it like this without introducing 
leaks of any kind? Tasks may repeat forever in a few minutes interval.


Or should I code tasks in a way that does not need application set in 
thread local?


Thank you in advance.
Vit





Scheduler setup - Application's init() method
=

JobDataMap jobDataMap = new JobDataMap();
jobDataMap.put("application", application);  <--- reference to the 
application


JobDetail job5min = newJob(Job5Min.class).withIdentity("MyIdentity", 
"group1").setJobData(jobDataMap).build();

Trigger trigger5min = newTrigger().withIdentity("trigger.5min", "group1")
.withSchedule(simpleSchedule().withIntervalInMinutes(5).repeatForever())
.startNow().build();

scheduler.scheduleJob(job5min, trigger5min);


Task execution
=


public void execute(JobExecutionContext context) throws 
JobExecutionException

{
Application application = 
(Application)context.getMergedJobDataMap().get("application");

ThreadContext.setApplication(application);

... code ...

ThreadContext.setApplication(null);
ThreadContext.detach();
}



Scheduler stop - Application's onDestroy() method
=

scheduler.stopScheduler();





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



Re: WicketTester's possible bug?

2017-05-07 Thread Vit Rozkovec

I see now, thanks a lot.
Vit

On 05/07/2017 03:41 PM, Martin Grigorov wrote:

The setting is DebugSettings#componentUseCheck:
https://github.com/apache/wicket/blob/e22614277685199ed56c3aa855fdb0daf454027e/wicket-core/src/main/java/org/apache/wicket/settings/DebugSettings.java#L137
The rendering is markup driven, i.e. for every component in the HTML Wicket
tries to find a component in Java. So technically the extra child in Java
is not really a problem.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sat, May 6, 2017 at 8:31 PM, Martijn Dashorst 
wrote:
This is as designed. We are stricter in our markup checking in dev
mode than in prod mode. Mostly because of performance considerations.
You can fiddle with the settings to make dev and prod similar.

Search the archives or see the one of the *Settings classes for which
setting to en/disable. (I don't know it by name)

Martijn


On Sat, May 6, 2017 at 2:37 PM, Vit Rozkovec 
wrote:

Hi,

when testing the application which is in deployment mode, test passes

even

when the child is missing:

Code:

 TextField input = new TextField("input");
 add(new WebMarkupContainer("border").add(input));

HTML:

 
 

Test:

 //start and render the test page
 tester.startPage(HomePage.class);

 //assert rendered page class
 tester.assertRenderedPage(HomePage.class);


In development mode, this test fails, in deployment passes. Is it

desirable

effect or a bug?

I've used Wicket 8.0.0-M5 quickstart which shows this behavior that I can
provide.

Thanks,
Vit


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




--
Become a Wicket expert, learn from the best: http://wicketinaction.com

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





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



WicketTester's possible bug?

2017-05-06 Thread Vit Rozkovec

Hi,

when testing the application which is in deployment mode, test passes 
even when the child is missing:


Code:

TextField input = new TextField("input");
add(new WebMarkupContainer("border").add(input));

HTML:




Test:

//start and render the test page
tester.startPage(HomePage.class);

//assert rendered page class
tester.assertRenderedPage(HomePage.class);


In development mode, this test fails, in deployment passes. Is it 
desirable effect or a bug?


I've used Wicket 8.0.0-M5 quickstart which shows this behavior that I 
can provide.


Thanks,
Vit


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



Re: Wicket Appl - Cleanup & Scale

2016-10-19 Thread Vit Rozkovec

There exists also java wrapper:
https://github.com/jhonnymertz/java-wkhtmltopdf-wrapper



On 10/18/2016 05:13 PM, Ernesto Reinaldo Barreiro wrote:

Thanks for the pointer: did not know about this project :-)

On Tue, Oct 18, 2016 at 4:19 PM, Vit Rozkovec  wrote:


I would recommend wkhtmltopdf as flying saucer does not play well with
Bootstrap and CSS3 features in general.

https://github.com/wkhtmltopdf/wkhtmltopdf

For generating PDF I prefer flying-saucer and wicket

https://github.com/reiern70/wicket-flyingsaucer



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







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



Re: Wicket Appl - Cleanup & Scale

2016-10-18 Thread Vit Rozkovec
I would recommend wkhtmltopdf as flying saucer does not play well with 
Bootstrap and CSS3 features in general.


https://github.com/wkhtmltopdf/wkhtmltopdf


For generating PDF I prefer flying-saucer and wicket

https://github.com/reiern70/wicket-flyingsaucer



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



Re: Large forms

2015-02-23 Thread Vit Rozkovec

I have solved it by creating a code generator, that for each POJO passed,
it makes physical html, java and properties files at given package path.
According to the template you pass to the generator, it can generate any 
code for you.



Drawbacks
Once generated, there is no link between POJO and generated files, if 
you change POJO,
you have to run the generator again, overwrtiting existing files at 
given path.

Therefore it is necessary to move your files to another package
and once you add your custom code, transfer new generated changes by hand.


May not be the best approach, but this way you can fully customize 
generated files,
they are the same files you woud prepare by hand, only automatically 
generated.


Would you be interested in using such a tool? So far I have used it just 
for me,

but can make it available at Github if you would like.


Regards
Vit Rozkovec


Dne 23.2.2015 v 17:10 ChambreNoire napsal(a):

Hey there,

In the case of large forms with 20+ fields, how should one go about coding
the wicket components? I have a large form of over 300 fields divided into
20 pages to code. Instantiating and wiring up each of these one by one would
take an age.

Any ideas?

Many thanks,

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Large-forms-tp4669718.html
Sent from the Users forum mailing list archive at Nabble.com.

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





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



Re: Unable to open resource stream (status=500)

2014-03-05 Thread Vit Rozkovec

Yes it is.

The file is in the package, checked the war and also the dir where war 
contents are unpacked. Running on linux with Jetty webserver and Apache 
as a proxy.


Also when inspecting page with firebug, it does not have altered name 
with version number included as other resources have, such as

../wicket/resource/name.berries.projects.kaplickyprize.references.KaplickyCssResourceReference/file-upload-ver-ECB4619F0CA76E0EE037BD81A9515B42.css

the address is
../wicket/resource/cz.newforms.wicket.behaviors.NprogressBehavior/nprogress.js

but I guess it is because it could not be found.



On 5.3.2014 16:48, Martin Grigorov wrote:

Hi,

This should work fine.
Check that the .js file is properly packed in the .jar file next to
NprogressBehavior.class.


On Wed, Mar 5, 2014 at 5:41 PM, Vit Rozkovec  wrote:


Hi,
I came across interesting problem:

I have one project which is packaged as .jar file along with all required
assets. The behavior inside this project is defined like this:

public class NprogressBehavior extends Behavior
{

  @Override
 public void renderHead(Component component, IHeaderResponse response)
 {
 super.renderHead(component, response);

 response.render(JavaScriptHeaderItem.forReference(new
JavaScriptResourceReference(
 NprogressBehavior.class, "nprogress.js")));
 response.render(JavaScriptHeaderItem.forReference(new
JavaScriptResourceReference(
 NprogressBehavior.class, "nprogress-init.js")));
 response.render(CssHeaderItem.forReference(new
CssResourceReference(
 NprogressBehavior.class, "nprogress.css")));
 }
}


Other project has defined the first project as dependency and in one page
I simply add the NprogressBehavior behavior in onInitialize() method.

However this does not work and when using on my server throws following
error:



WARN  - PackageResource- resource [path =
cz/newforms/wicket/behaviors/nprogress.js, style = null, variation =
null, locale = null]: Unable to open resource

stream (status=500)


Is this intended behavior, eg. I cannot use resources like this -
packaging behaviors with their according js and css files into one project,
referencing this project in another project and using this behavior there?

Does all resources have to reside in the actual project where there are
used? Seems strange to me. What am I doing wrong?

Thanks for any advice.
Vit


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





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



Unable to open resource stream (status=500)

2014-03-05 Thread Vit Rozkovec

Hi,
I came across interesting problem:

I have one project which is packaged as .jar file along with all 
required assets. The behavior inside this project is defined like this:


public class NprogressBehavior extends Behavior
{

 @Override
public void renderHead(Component component, IHeaderResponse response)
{
super.renderHead(component, response);

response.render(JavaScriptHeaderItem.forReference(new 
JavaScriptResourceReference(

NprogressBehavior.class, "nprogress.js")));
response.render(JavaScriptHeaderItem.forReference(new 
JavaScriptResourceReference(

NprogressBehavior.class, "nprogress-init.js")));
response.render(CssHeaderItem.forReference(new 
CssResourceReference(

NprogressBehavior.class, "nprogress.css")));
}
}


Other project has defined the first project as dependency and in one 
page I simply add the NprogressBehavior behavior in onInitialize() method.


However this does not work and when using on my server throws following 
error:




WARN  - PackageResource- resource [path = 
cz/newforms/wicket/behaviors/nprogress.js, style = null, variation = 
null, locale = null]: Unable to open resource stream (status=500)



Is this intended behavior, eg. I cannot use resources like this - 
packaging behaviors with their according js and css files into one 
project, referencing this project in another project and using this 
behavior there?


Does all resources have to reside in the actual project where there are 
used? Seems strange to me. What am I doing wrong?


Thanks for any advice.
Vit


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



Re: 42lines wicket full calendar

2014-01-09 Thread Vit Rozkovec
Looking at github, there is already one pull request pending that seems 
to have the feature you need:

https://github.com/42Lines/wicket-fullcalendar/pulls


On 13.9.2012 10:04, Gytis wrote:

Hello,
Recently I started to use wicket-fullcalendar of 42lines.
I`d like to ask is there any possibility to change week starting day (by
default it is Sunday, but I need it to be Monday)?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/42lines-wicket-full-calendar-tp4651969.html
Sent from the Users forum mailing list archive at Nabble.com.

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





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



Re: How to localize options in drop down.

2013-10-09 Thread Vit Rozkovec
If you would be using Eclipse IDE you can use this: 
http://propedit.sourceforge.jp/index_en.html


On 9.10.2013 10:45, cosmindumy wrote:

Yes,
Now they are unicode. Something like property.date=F\u00E4llig ab.
But I want to use native characters in propery file as is easier to handle.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-localize-options-in-drop-down-tp4661751p4661763.html
Sent from the Users forum mailing list archive at Nabble.com.

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





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



Re: WicketTester with Atmosphere

2013-10-08 Thread Vit Rozkovec
Ok, so I'll have to either introduce conditions in the code to check if 
I am running the application in test mode

or use something else like a selenium perhaps..
Thanks anyway.

On 8.10.2013 14:08, Martin Grigorov wrote:

WebSocketTester is for Native WebSockets, not for Wicket-Atmosphere
integration.



v.


On 8.10.2013 12:09, Martin Grigorov wrote:


Yes, because WicketTester doesn't use web.xml/atmosphere.xml.
The bootstrap of Atmosphere should be done manually. But I'm not sure that
even this will be enough. WicketTester doesn't do real http calls, so
Atmosphere won't be able to process them.

You can see WebSocketTester in Native WebSocket module. It works like
WicketTester.


On Tue, Oct 8, 2013 at 1:02 PM, francois meillet <
francois.meil...@gmail.com


wrote:
The WicketRuntimeException says that there is no Atmosphere
BroadcasterFactory configured


On Tue, Oct 8, 2013 at 11:58 AM, Martin Grigorov 
wrote:
On Tue, Oct 8, 2013 at 12:55 PM, francois meillet <
francois.meil...@gmail.com> wrote:

  Did you include the atmosphere.xml configuration file and configured
the
AtmosphereServlet ?

  He asks about WicketTester+Atmosphere.


  François


On Tue, Oct 8, 2013 at 11:26 AM, Vit Rozkovec 
wrote:

  Any hints, please?

Vit


On 6.10.2013 17:43, Vit Rozkovec wrote:

  How is it possible to unit test Wicket application that uses
Atmosphere?

When I run the application everything is ok, when testing, see

excerpt

of

the stacktrace -

org.apache.wicket.WicketRuntimeException: There is no Atmosphere
BroadcasterFactory configured. Did you include the atmosphere.xml
configuration file and configured AtmosphereServlet?
  at org.apache.wicket.atmosphere.EventBus.**
lookupDefaultBroadcaster(EventBus.java:131)
  at


org.apache.wicket.atmosphere.EventBus.(EventBus.**java:**

  123)

  at name.berries.projects.doprava42.DopravaApplication.
init(DopravaApplication.java:144)
.


I'm creating the EventBus in the init() method as is done in the


examples:
  eventBus = new EventBus(this);

  eventBus.getParameters().setTransport(

AtmosphereTransport.STREAMING)***


  *;

eventBus.getParameters().setLogLevel(
AtmosphereLogLevel.DEBUG);


How can I use WicketTester along with properly setted up Atmosphere
application (using AtmosphereServlet)?


Thank you.
Vit


  --**

--**-


  To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apa**che.org<http://apache.org>

<


users-unsubscribe@wicket.**apache.org

For additional commands, e-mail: users-h...@wicket.apache.org





  --**

--**-


To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apa**che.org<http://apache.org>

<


users-unsubscribe@wicket.**apache.org

For additional commands, e-mail: users-h...@wicket.apache.org




--**--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apache.org

For additional commands, e-mail: users-h...@wicket.apache.org





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



Re: WicketTester with Atmosphere

2013-10-08 Thread Vit Rozkovec


Thank you, I'll check it out.
v.

On 8.10.2013 12:09, Martin Grigorov wrote:

Yes, because WicketTester doesn't use web.xml/atmosphere.xml.
The bootstrap of Atmosphere should be done manually. But I'm not sure that
even this will be enough. WicketTester doesn't do real http calls, so
Atmosphere won't be able to process them.

You can see WebSocketTester in Native WebSocket module. It works like
WicketTester.


On Tue, Oct 8, 2013 at 1:02 PM, francois meillet 
wrote:
The WicketRuntimeException says that there is no Atmosphere
BroadcasterFactory configured


On Tue, Oct 8, 2013 at 11:58 AM, Martin Grigorov 
wrote:
On Tue, Oct 8, 2013 at 12:55 PM, francois meillet <
francois.meil...@gmail.com> wrote:


Did you include the atmosphere.xml configuration file and configured

the

AtmosphereServlet ?


He asks about WicketTester+Atmosphere.



François


On Tue, Oct 8, 2013 at 11:26 AM, Vit Rozkovec 
wrote:


Any hints, please?

Vit


On 6.10.2013 17:43, Vit Rozkovec wrote:


How is it possible to unit test Wicket application that uses

Atmosphere?

When I run the application everything is ok, when testing, see

excerpt

of

the stacktrace -

org.apache.wicket.**WicketRuntimeException: There is no Atmosphere
BroadcasterFactory configured. Did you include the atmosphere.xml
configuration file and configured AtmosphereServlet?
 at org.apache.wicket.atmosphere.**EventBus.**
lookupDefaultBroadcaster(**EventBus.java:131)
 at

org.apache.wicket.atmosphere.**EventBus.(EventBus.java:**

123)
 at name.berries.projects.**doprava42.DopravaApplication.**
init(DopravaApplication.java:**144)
.


I'm creating the EventBus in the init() method as is done in the

examples:

 eventBus = new EventBus(this);


eventBus.getParameters().**setTransport(**AtmosphereTransport.STREAMING)*

*;
eventBus.getParameters().**setLogLevel(**AtmosphereLogLevel.DEBUG);


How can I use WicketTester along with properly setted up Atmosphere
application (using AtmosphereServlet)?


Thank you.
Vit



--**--**-

To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<

users-unsubscr...@wicket.apache.org>

For additional commands, e-mail: users-h...@wicket.apache.org






--**--**-

To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<

users-unsubscr...@wicket.apache.org>

For additional commands, e-mail: users-h...@wicket.apache.org





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



Re: WicketTester with Atmosphere

2013-10-08 Thread Vit Rozkovec

In normal production mode everything is ok,
but the problem is when unittesting atmospherised wicket application 
with WicketTester as application trips on init() method when 
inicializing EventBus.
And I did not wanted to check in the code whether I am in test mode to 
disable atmosphere calls.





On 8.10.2013 12:02, francois meillet wrote:

The WicketRuntimeException says that there is no Atmosphere
BroadcasterFactory configured


On Tue, Oct 8, 2013 at 11:58 AM, Martin Grigorov wrote:


On Tue, Oct 8, 2013 at 12:55 PM, francois meillet <
francois.meil...@gmail.com> wrote:


Did you include the atmosphere.xml configuration file and configured the
AtmosphereServlet ?


He asks about WicketTester+Atmosphere.



François


On Tue, Oct 8, 2013 at 11:26 AM, Vit Rozkovec 
wrote:


Any hints, please?

Vit


On 6.10.2013 17:43, Vit Rozkovec wrote:


How is it possible to unit test Wicket application that uses

Atmosphere?

When I run the application everything is ok, when testing, see excerpt

of

the stacktrace -

org.apache.wicket.**WicketRuntimeException: There is no Atmosphere
BroadcasterFactory configured. Did you include the atmosphere.xml
configuration file and configured AtmosphereServlet?
 at org.apache.wicket.atmosphere.**EventBus.**
lookupDefaultBroadcaster(**EventBus.java:131)
 at org.apache.wicket.atmosphere.**EventBus.(EventBus.java:**
123)
 at name.berries.projects.**doprava42.DopravaApplication.**
init(DopravaApplication.java:**144)
.


I'm creating the EventBus in the init() method as is done in the

examples:

 eventBus = new EventBus(this);


eventBus.getParameters().**setTransport(**AtmosphereTransport.STREAMING)*

*;
eventBus.getParameters().**setLogLevel(**AtmosphereLogLevel.DEBUG);


How can I use WicketTester along with properly setted up Atmosphere
application (using AtmosphereServlet)?


Thank you.
Vit



--**--**-

To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<

users-unsubscr...@wicket.apache.org>

For additional commands, e-mail: users-h...@wicket.apache.org






--**--**-

To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<

users-unsubscr...@wicket.apache.org>

For additional commands, e-mail: users-h...@wicket.apache.org





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



Re: WicketTester with Atmosphere

2013-10-08 Thread Vit Rozkovec

Any hints, please?

Vit

On 6.10.2013 17:43, Vit Rozkovec wrote:

How is it possible to unit test Wicket application that uses Atmosphere?

When I run the application everything is ok, when testing, see excerpt 
of the stacktrace -


org.apache.wicket.WicketRuntimeException: There is no Atmosphere 
BroadcasterFactory configured. Did you include the atmosphere.xml 
configuration file and configured AtmosphereServlet?
at 
org.apache.wicket.atmosphere.EventBus.lookupDefaultBroadcaster(EventBus.java:131)

at org.apache.wicket.atmosphere.EventBus.(EventBus.java:123)
at 
name.berries.projects.doprava42.DopravaApplication.init(DopravaApplication.java:144)

.


I'm creating the EventBus in the init() method as is done in the 
examples:

eventBus = new EventBus(this);
eventBus.getParameters().setTransport(AtmosphereTransport.STREAMING);
eventBus.getParameters().setLogLevel(AtmosphereLogLevel.DEBUG);


How can I use WicketTester along with properly setted up Atmosphere 
application (using AtmosphereServlet)?



Thank you.
Vit

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





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



WicketTester with Atmosphere

2013-10-06 Thread Vit Rozkovec

How is it possible to unit test Wicket application that uses Atmosphere?

When I run the application everything is ok, when testing, see excerpt 
of the stacktrace -


org.apache.wicket.WicketRuntimeException: There is no Atmosphere 
BroadcasterFactory configured. Did you include the atmosphere.xml 
configuration file and configured AtmosphereServlet?
at 
org.apache.wicket.atmosphere.EventBus.lookupDefaultBroadcaster(EventBus.java:131)

at org.apache.wicket.atmosphere.EventBus.(EventBus.java:123)
at 
name.berries.projects.doprava42.DopravaApplication.init(DopravaApplication.java:144)

.


I'm creating the EventBus in the init() method as is done in the examples:
eventBus = new EventBus(this);
eventBus.getParameters().setTransport(AtmosphereTransport.STREAMING);
eventBus.getParameters().setLogLevel(AtmosphereLogLevel.DEBUG);


How can I use WicketTester along with properly setted up Atmosphere 
application (using AtmosphereServlet)?



Thank you.
Vit

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



Re: What is your setup for Rapid Application Development?

2013-04-25 Thread Vit Rozkovec

Hi,
in past there was project Wicket Web Beans that we have used, but it is 
dead now.
You could just pass an annotated bean object and form would be created 
for you.

There were also components to list records along with basic CRUD operations.


There is also one project - Wicketopia - http://wicketopia.sourceforge.net/
which may server the same purpose but I haven't tried it yet..


Vit





On 26.4.2013 08:01, Alexey Mukas wrote:

Hi Andrew,

For UI we use jquery ui, select2, noty and other js components. Integration
is pretty simple in wicket.
We don't really need any UI designer or CRUD form generation, we just create
html then bind it to the logic. CRUD generation could be added easily if
needed.
"Basic core services" as you said, in our case is something that allows us
to work rapidly, may be because we don't work on a CRUD app...

I forgot to mention one very nice tool - lombok. It significantly decreases
amount lines in code.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/What-is-your-setup-for-Rapid-Application-Development-tp4658278p4658287.html
Sent from the Users forum mailing list archive at Nabble.com.

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





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



Migration from wicket 1.4.x

2012-07-03 Thread Vit Rozkovec

Hi,
what is the best approach when migrating from wicket 1.4.x?
Wait for stable 6.0 version and then start migration or migrate to 1.5.x 
version?


All my projects now use 1.4.x with Hibernate via Databinder. I want to 
save myself the effort to do a double migration and would rather wait 
and stick with 1.4.x until 6.0 comes out, what do you recommend?


Thank you.

Vit

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



Wicketopia

2012-07-03 Thread Vit Rozkovec

Hi,
is it still possible to use Wicketopia with wicket 1.4.x?
What is the status of the project? It has not been updated for six 
months, does it need still some work?


Thanks.

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



Re: UploadProgressBar alternative that supports Chrome and Safari?

2010-12-08 Thread Vit Rozkovec
Hi Žilvinas, would you mind to share some code how to wire this uploader 
to wicket?


Thanks for the link.

Vit

On 12/08/2010 04:08 PM, Zilvinas Vilutis wrote:

I use this AJAX uploader: http://valums.com/ajax-upload/

Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cika...@gmail.com



On Wed, Dec 8, 2010 at 7:46 AM, Martin Grigorov  wrote:

On Wed, Dec 8, 2010 at 3:18 PM, Wayne W  wrote:


Hi,

I just want to check that there isn't an alternative out there already
that someone has done that supports webkit browsers?
We're finding nearly 20% of our users now are on these browsers so we
must support them better, hence why we're looking at alternatives.

If not we'll have to write something ourselves - I looked at the
current code, but cannot figure out a way of patching that.


Download Wicket source =>  patch it locally =>  test it against any browser =>
attach the patch in Jira ticket and it will be incorporated for the next
versions of Wicket ;-)


thanks!

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



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





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



Re: DatePicker "onblur"

2010-03-10 Thread Vit Rozkovec

Hi,
this may help you:

I am using DateTextField from the package 
org.apache.wicket.datetime.markup.html.form;


In the panel where I add this field, you can do:
   @Override
   protected void onBeforeRender()
   {
   super.onBeforeRender();
   if (!hasBeenRendered())
   {
   dateField.get("date").add(new 
AjaxFormComponentUpdatingBehavior("onchange")

   {

   @Override
   protected void onUpdate(AjaxRequestTarget target)
   {

   }
   });
   }
   }

Regards
Vitek

Arnaud Garcia wrote:

Hi list !

I add an AjaxFormComponentUpdatingBehavior on my DateTextField to update my
model "on the fly"...

The updating behavior is based on the "onblur" event...
it works well, but since I added a DatePicker to the dateTextField I can't
"react" on the "onblur" javascript event.

How can I intercept the moment when the dateTextField is updated by the
DatePicker ?

Thanks

Arnaud

  



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



Re: Setting selected value for DropDownChoice

2010-03-07 Thread Vit Rozkovec
This may help you with your problem: 
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#hashCode%28%29


And this as well (in case you use Hibernate, but may be applicable to 
other frameworks too): https://www.hibernate.org/109.html


Regards
Vitek


Sigmar Muuga wrote:

I got it working with ISO2.
Thanks Vit, I got your idea, I'll investigate later, why it didnt work with
ID.

On Sun, Mar 7, 2010 at 7:35 PM, Sigmar Muuga  wrote:

  

Actually it works even randomly now, when I change the values:S

I've read docs and books and still have no idea with that :S DropDownChoice
has hard API design problems IMHO...


On Sun, Mar 7, 2010 at 7:18 PM, Sigmar Muuga  wrote:



Still not working actually, got another problem.
When I select the item with ID 241, I get item with ID 239.

My country pojo is like this:
import lombok.Data;

@Data
public class Country extends BaseModel {

private static final long serialVersionUID = 1L;

private long id;
private String iso2;
private String iso3;
private String nameShort;
private String nameLong;

@Override
public String toString() {
return nameShort;
}

@Override
public boolean equals(Object o) {
if (o != null) {
if (o instanceof Country) {
return id == ((Country) o).getId();
}
}
return false;
}

}

Weird.


On Sun, Mar 7, 2010 at 7:05 PM, Vit Rozkovec wrote:

  

Hallo,
try something like this:


List countryList = generalDAO.findAllCountries();
Country country = getSelectedCountryByISO3(141, countryList);
inal DropDownChoice countryId = new
DropDownChoice("countryId",
new Model(country), countryList);
  add(countryId);

You must pass the model, which contains the element you want to select.

Vitek


Sigmar Muuga wrote:



Hello, I am trying to use one of the hardest part in Wicket:
DropDownChoice

the code looks like this:

   List countryList = generalDAO.findAllCountries();
   Country country = getSelectedCountryByISO3(141, countryList);
   final DropDownChoice countryId = new
DropDownChoice("countryId",
new PropertyModel(country, "id"), countryList);
   add(countryId);

I want to select an item, and set it selected on my dropdown, but its
not
selected. How to set the selected value for it?


Sigmar



  

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





  



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



Re: Setting selected value for DropDownChoice

2010-03-07 Thread Vit Rozkovec

Hallo,
try something like this:

List countryList = generalDAO.findAllCountries();
Country country = getSelectedCountryByISO3(141, countryList);
inal DropDownChoice countryId = new 
DropDownChoice("countryId",
new Model(country), countryList);
   add(countryId);

You must pass the model, which contains the element you want to select.

Vitek

Sigmar Muuga wrote:

Hello, I am trying to use one of the hardest part in Wicket: DropDownChoice

the code looks like this:

List countryList = generalDAO.findAllCountries();
Country country = getSelectedCountryByISO3(141, countryList);
final DropDownChoice countryId = new DropDownChoice("countryId",
new PropertyModel(country, "id"), countryList);
add(countryId);

I want to select an item, and set it selected on my dropdown, but its not
selected. How to set the selected value for it?


Sigmar

  



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



Custom url generation

2010-02-16 Thread Vit Rozkovec

Dear friends in code,
how would it be possible to make wicket work in a scenario like this:

Standard generation of urls:
http://www.mysite.com/site/user1/home
http://www.mysite.com/site/user1/gallery
http://www.mysite.com/site/user1/shop

Virtual host aware generation of url:
http://www.user1domain.com/home
http://www.user1domain.com/gallery
http://www.user1domain.com/shop


I do know how to setup Apache to do url rewriting, I do not know, 
however, how to make Wicket generate such urls.
Pages are mounted with IndexedHybridUrlCodingStrategy, I have tried to 
look into this strategy's encode() method, but I could not find how 
should I change the behaviour, as this method returns only the part 
after host www.mysite.com.


I will be grateful for any kick that will direct me the right way.

Thank you very much.

Regards
Vitek


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



Re: Wicket Release Plans for 1.5

2009-11-01 Thread Vit Rozkovec

+100 for that, I am looking forward to new url stuff.

vitek

Igor Vaynberg wrote:

possibly. i think i would like this release to be as small as
possible, centered around the new url stuff. once that is in release
1.5 and put the new ajax support from ng into 1.6.

trying to release more and more often instead of taking over a year
and a half like we did with 1.4.0

-igor

On Fri, Oct 30, 2009 at 5:10 AM, Richard Allen
 wrote:
  

Is the Wicket Ajax Next Generation work going into 1.5?

Also, is there plans for an event bus, sort of like what you see in Jonathan
Locke's 26 wicket tricks source code? I've seen some really nice use of
event bus in GWT that I think Wicket could benefit from.

-Richard


On Fri, Oct 30, 2009 at 4:43 AM, Dave B  wrote:



I'm still eager to make WicketTester a first class citizen.


I'm keen on this too -- is there a 'voting' mechanism in the bug
tracker for this sort of thing?

Cheers,
Dave



On Fri, Oct 30, 2009 at 7:27 PM, Martijn Dashorst
 wrote:
  

I'm still eager to make WicketTester a first class citizen.

Martijn

On Thu, Oct 29, 2009 at 7:01 PM, dtoffe  wrote:


   Thanks for your answer,

Daniel


igor.vaynberg wrote:
  

the focus of this release is to rewrite url and page handling. the
focus is on flexibility and pluggability as well as simplification of
use to the end user.

the other major feature is the markupfragment implementation, which
will allow users access to the markup the component is attached to,
possibly, at a time earlier then render time.

other then that there will probably be smaller features that will not
go into 1.4.x because they require an api break.

-igor

On Thu, Oct 29, 2009 at 10:38 AM, dtoffe  wrote:


   Besides, it would be very interesting to know what changes and new
features are planned.

Cheers,

Daniel

  


--
View this message in context:
  

http://www.nabble.com/Wicket-Release-Plans-for-1.5-tp26115807p26117927.html
  

Sent from the Wicket - User mailing list archive at Nabble.com.


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


  


--
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

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




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


  


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


  



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



Re: Proposal: Fake implementation of AjaxRequestTarget instead of null

2009-10-24 Thread Vit Rozkovec

In case of AjaxFallback components you would construct them anyway.

Martin Grigorov wrote:

I think he meant wasting CPU cycles for constructing your components
which will be added to no-op ajaxrequesttarget

then you'll have to make check like "if (target instanceOf
NullAjaxRequestTarget) {return;}" which is not better than before

El sáb, 24-10-2009 a las 12:18 +0200, Andreas Petersson escribió:
  

I think it absolutely makes sense (for a future release of wicket).
having a NullObject instance of AjaxRequestTarget would not waste a lot 
of cpu cycles at all, at least not how i use it. the only thing i do 
with the object is call .addComponent() and then refering a 
already-initialized variable.


how likely is it that the object is in fact null? its <5% of users who 
have javascript disabled. so this would affect only a small amount of 
requests.


from a jvm perspective calling methods with empty bodys very often is 
not something expensive. they will get inlined by the hotspot compiler 
and be effectively free. (i am not 100% sure if this also applys to 
polymorphism chains.)


from a "clean-code" prespective it is often considered a code smell to 
have a lot of null checks.
in your example providing a FakeDatabaseConnection that throws an 
UnsrupportedOperationException("you have no database!") is better than 
seeing a null pointer exception.




Sounds weird.

Why should my component burn cpu cycles to feed a fake ajax target 
which does nothing at all?


I would prefer some null checks in that case.

Would you also provide a FakeDatabaseConnection in case you 
application does not support databases? :-)



Am 24.10.2009 um 07:42 schrieb Vladimir Kovalyuk:

  
I believe all those null-checks of request target can be omited in 
user code

if fallback components would provide fake implementation of
AjaxRequestTarget instead of passing null.

Does it make sense?


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






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


  



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



Mount different page for second parameter

2009-09-07 Thread Vit Rozkovec

Hallo,
which encoding strategy should one use if one would like to achieve this:

http://somesite/somepath/user1/products --> mounted on ProductsPage.class
http://somesite/somepath/user1/profile --> mounted on ProfilePage.class

http://somesite/somepath/user2/products --> mounted on ProductsPage.class
http://somesite/somepath/user2/profile --> mounted on ProfilePage.class

on ProductsPage.class and ProfilePage.class you know which user acesses 
the page.


Thank you for any hints.

Vit

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



Re: UTF-8

2009-09-01 Thread Vit Rozkovec

In case you use Eclipse, there is an utility called Properties Editor
http://propedit.sourceforge.jp/index_en.html


Vit


Olivier Bourgeois wrote:

That's exactly what I said : I had to use XML properties files to have
UTF-8 localized properties.

You can't use simple properties format because Java can't handle
natively anything else than ISO. We use also Tapestry here, and you
can use UTF-8 properties files (thanks to the wrapper around native
Java properties).

XML files are allright, but they are definitively verbose.

2009/9/1 Eelco Hillenius :
  

Erm 
http://chillenious.wordpress.com/2006/11/13/wicket-now-supports-resource-bundles-in-xml-format/
  

Which says Wicket 2.0 (yes, it's that old), but it was also one of the
first things backported. Loading is automatic, and .xml takes
precedence over .properties.

Eelco

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





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


  



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



Re: Error filterStart -- how to know what caused tomcat start failure?

2009-05-30 Thread Vit Rozkovec
There are also other tomcat logs, have you looked into them? I found an 
cause of this error in other log, but I do not remember which one was that.


Vitek

David Chang wrote:

I googled a lot but failed to find satisfactory answers. I just find a way to 
make tomcat to produce more error info than simply

May 30, 2009 12:06:57 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
May 30, 2009 12:06:57 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/wic] startup failed due to previous errors

I am learning from the book Wicket in Action. The funny thing is that the new 
stuff is no problem, but the tomcat error is.



--- On Sat, 5/30/09, Mathias Nilsson  wrote:

  

From: Mathias Nilsson 
Subject: Re: Error filterStart -- how to know what caused tomcat start failure?
To: users@wicket.apache.org
Date: Saturday, May 30, 2009, 12:07 PM

I guess this isn't wicket specific. goggle on your error
and you may get
information on how to solve this.
--
View this message in context: 
http://www.nabble.com/Error-filterStarthow-to-know-what-caused-tomcat-start-failure--tp23794740p23794783.html
Sent from the Wicket - User mailing list archive at
Nabble.com.


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






  


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


  



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



Re: DefaultDataTable: How to add a DDChoice to change rows per page

2009-04-26 Thread Vit Rozkovec

Hi, check this out:
http://www.nabble.com/nice-small-component-to-share-Toolbar-for-DataTable-to16743136.html

Vladimir Kovalyuk wrote:

I would like to add some component, say DropDownChoice, to allow user to
change default rows per page setting for data table.

I've investigated two ways: 1) extend NavigationToolbar or PagingNavigator
2) extends NavigationToolbar to add extra panel right to PagingNavigator

Althought it is possible to completely override PagingNavigator component it
is not so straightforward as I expected.

Please improve DefaultDataTable so it will be capable to change rows per
page.

I also suggest creating child components in all the non-final components via
createXXX methods instead of new keyword in order to simplify overriding.

  



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



Just a little thank you

2009-03-20 Thread Vit Rozkovec

Hallo,
I just wanted to say a little thank you.
I have a lot of gratitude towards people who made this framework and to 
the whole community. It is really pleasure to work with such nice and 
well thought framework, I really enjoy it. After spending some years 
with PHP, now, after a year and a half with wicket I see there is no way 
back. In this case I do not fear being dogmatic. Wicket, the only way :).


Really, thank you.

Vitek

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



Re: What IDE best fits with Wicket?

2009-02-23 Thread Vit Rozkovec
But in the eclipse version 3.4 when renaming java file, WicketBench 
stopped renaming for me html and css files with the same name as the 
java file, which is a bit pity.


Vitek

Pierre Goupil wrote:

+1, I like Wicket Bench. And with M2Eclipse, you have the full sources &
JavaDoc just by adding Wicket as a dependency, which is very convenient. But
don't expect Wicket Bench to do too much, it's just a small, useful tool.

Pierre


  

Hi, I use Eclipse with Wicket Bench plugin and it works very fine.



  



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



Re: Plain IMG src urls

2009-01-19 Thread Vit Rozkovec

That was too easy :)


Vit Rozkovec wrote:



Try this:

public class ExternalImage extends WebComponent
{

   /**
* Construct.
*
* @param id
* @param url
*/
   public ExternalImage(String id, String url)
   {
   this(id, new Model(url));
   }

   /**
* Construct.
*
* @param id
* @param model
*/
   public ExternalImage(String id, IModel model)
   {
   super(id, model);
   }

   @Override
   protected void onComponentTag(ComponentTag tag)
   {
   super.onComponentTag(tag);
   checkComponentTag(tag, "img");
   tag.put("src", getModelObjectAsString());
   }

}

Vitek


Prag wrote:

I have a DB table that contains plain URL's in text like
http://someExternalServer/blabla/1.jpg.

How can I put this plain text URL in a HTML IMG elements' SRC attribute
without Wicket making modifications to the URL?
  



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




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



Re: Plain IMG src urls

2009-01-19 Thread Vit Rozkovec



Try this:

public class ExternalImage extends WebComponent
{

   /**
* Construct.
*
* @param id
* @param url
*/
   public ExternalImage(String id, String url)
   {
   this(id, new Model(url));
   }

   /**
* Construct.
*
* @param id
* @param model
*/
   public ExternalImage(String id, IModel model)
   {
   super(id, model);
   }

   @Override
   protected void onComponentTag(ComponentTag tag)
   {
   super.onComponentTag(tag);
   checkComponentTag(tag, "img");
   tag.put("src", getModelObjectAsString());
   }

}

Vitek


Prag wrote:

I have a DB table that contains plain URL's in text like
http://someExternalServer/blabla/1.jpg.

How can I put this plain text URL in a HTML IMG elements' SRC attribute
without Wicket making modifications to the URL?
  



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



Re: PrototipBehaviour problems

2009-01-12 Thread Vit Rozkovec

You must include its javascript libraries:
add(ScriptaculousAjaxBehavior.newJavascriptBindingBehavior());

you need to have a scriptaculous dependency in your project's pom.xml

Vitek

Ryan O'Hara wrote:

I'm trying to use PrototipBehaviour.  Below is my code:

Link detailsLink = new Link("Sample", new Model(sample));
Label label = new Label("sampleid", sample);
detailsLink.add(label);
PrototipBehaviour pb = new PrototipBehaviour("hallelujah!!");
label.add(pb);
add(detailsLink);

And below is the source that is produced:

]]>*/

href="../../../../../../resources/org.wicketstuff.minis.prototipbehaviour.PrototipBehaviour/prototip.css" 
media="screen" />
src="../../../../../../resources/org.wicketstuff.minis.prototipbehaviour.PrototipBehaviour/prototip-min.js"> 


]]>*/

]]>*/

...

I would expect "hallelujah!!" to pop up during onmouseover of the 
label, but I'm not seeing it.  Any help would be greatly appreciated.  
I'm using wicketstuff-minis-1.4.0-SNAPSHOT and Wicket 1.3.3.


Thanks,
Ryan

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




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



Re: Help,How to download all files in one folder ?


You're welcome.

Michael Sparer wrote:

didn't know that one - thanks Vitek. now I know the answer to 90% of the
questions I get asked everyday :-D


Vit Rozkovec wrote:
  

Sorry, but: http://letmegooglethatforyou.com/?q=java+zip+files

Vitek

wch2001 wrote:


thanks , Pills.

How can  I zip it ?

thanks



Pills wrote:
  
  

Zip them on the fly, then download the zip.

wch2001 a écrit :



in the folder: c:/cw/adsmart, there are 3 files: aa.txt, bb.txt,
cc.txt,

how can i download it ? if it possible that  when clicking button/link
and
so on to download those 3 files?

thanks



PSkarthic wrote:
  
  
  
I am also a newbie but i will try 
could u be please more specific or elabrate






  
  
  

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





  
  

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







-
Michael Sparer
http://talk-on-tech.blogspot.com
  



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



Re: Help,How to download all files in one folder ?


Sorry, but: http://letmegooglethatforyou.com/?q=java+zip+files

Vitek

wch2001 wrote:

thanks , Pills.

How can  I zip it ?

thanks



Pills wrote:
  

Zip them on the fly, then download the zip.

wch2001 a écrit :


in the folder: c:/cw/adsmart, there are 3 files: aa.txt, bb.txt, cc.txt,

how can i download it ? if it possible that  when clicking button/link
and
so on to download those 3 files?

thanks



PSkarthic wrote:
  
  
I am also a newbie but i will try 
could u be please more specific or elabrate





  
  

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






  



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



Re: Help,How to download all files in one folder ?

I would try to pack all the files to one archive and then download the 
archive.


Vitek

wch2001 wrote:

Deal all,

I need to download all files in one folder(for example: c:/dw/adsmart), How
can I do ?

Thanks a lot,

Wu
  



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



Re: How to add cookies to WicketTester?



Hallo,
I think it should work with one of those methods:

public final Page startPage(final ITestPageSource testPageSource)
public final Page startPage(final Page page)
instead of wicketTester.startPage(FooPage.class);

and also you should use wicket tester's request for adding cookies:
wicketTester.getServletRequest()

have not tried it though.

Vitek


Peter Gardfjell wrote:

Hi all,

does anyone know of some easy way of adding cookies to WicketTester prior to
having it visit page?

That is something along the line of

WicketTester wicketTester = new WicketTester(new 
MyApplication());
Cookie cookie = new Cookie("name", "value");
/*
... insert code for adding cookie to request here ...
*/
wicketTester.startPage(FooPage.class);
wicketTester.assertRenderedPage(FooPage.class);

regards, Peter
  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: controlling number with wicket?


Hallo,
you can do with AttributeModifier or AttributeAppender.

Vitek

Sami wrote:

Hello,
I have been trying to control the colspan in a table but no luck :(

any one has an example of how to do it?

code:
-

wicket:id="categoryName">[Category]


   wicket:id="Info">[Info]
   wicket:id="Type">[Type]
   wicket:id="Date">[Date]

 

-

I want to control the number in the colspan markup?
I tried  but didnt work.

Many thanks
Sami


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



Send file from external page to wicket


Hallo,

I have an applet, which is run on users computer. In this applet I scan 
some photo and describe it.

I would like to send this foto along with the data to a wicket application.
How should I do that?

I thought of setting the form action parameter in the external 
non-wicket page to point to a bookmarkable wicket page, where I would 
handle the POST, but I do not know how should I extract the parameters 
and file from the POST.


How would you do it?

Thank you.

Vitek

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: users, please give us your opinion: what is your take on generics with Wicket




1) Generifying* Wicket
   [X] Can best be done in a limited fashion, where we only generify
IModel but not components. I care more about what generifying can do
for API clarity (declaring a component to only accept certain models
for instance) than static type checking.

2) How strongly do you feel about your choice above?
   [X] I might rethink upgrading if my choice doesn't win.
  

*Reason* for new people who want to start with wicket the way generics are now 
may not be very clear and harder to grasp at the beginning. Most of the people 
here is long time in the business, so it may seem natural to you, but try to 
imagine those just entering.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Display a String when null


Hi!
Maybe there is a better way, but I would do:

   add(new Label("country", new PropertyModel(this,
   "ipLocationInfo.country") {
   @Override
   public Object getObject() {
   String country = (String) super.getObject();
   country = country == null ? "unknown" : country;
   return country;
   }
   }));


Vitek


AlexTM wrote:

Hi!

I'm quite new to Wicket and help with something easy, i guess.

I'm displaying some info on my page:

add(new Label("country", new PropertyModel(this,
"ipLocationInfo.country")));

The country information is sometimes null and then i would like to display
"unknown" instead. Is this easily managed or do i have to change the country
value of the ipLocationInfo object?

Regards Alex
  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with german error messages in feedback panel

Actually if you are on linux, I made a tiny script for myself which 
recursively converts all .properties files in the current directory and 
subdirectories:


#!/bin/sh
for file in $(find . -name *.properties); do
   native2ascii $file $file
   echo $file
done

Regards
Vitek

greeklinux wrote:

Hello,

thank you. I converted the properties file with native2ascii and it works.





Vit Rozkovec wrote:
  

Hi,
try to convert the property file with native2ascii tool.


greeklinux wrote:


Hello,

I am using IDEA as IDE. I configured it to use UTF-8.
Did I forget something? 
In the property file it is not possible to write "& uuml" instead of "ü",

because
the "&" will be escaped to "& amp".




Timm Helbig wrote:
  
  

Yes I had the same one. After switching my favourite IDE (Netbeans) to
UTF-8 
Encoding everything was fine. 


So, either you use Unicode Characters in your String literals, which is
plain 
ugly, or use an editor which is capable of using UTF-8 Encodings.


Am Sonntag, 27. April 2008 11:35:16 schrieb greeklinux:



Hello,

I have problems with german umlauts in a feedback panel.
I define the error messages in a property file.
It displays as follows:
Bitte geben Sie eine gültige E-Mail ein

In my HTML:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>



...

My editor is configured to use UTF-8 as encoding.
I tried to initialize the Wicket Application with
getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
but the error is still there.

Has someone the same problem?
  
  

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






  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with german error messages in feedback panel


Hi,
try to convert the property file with native2ascii tool.


greeklinux wrote:

Hello,

I am using IDEA as IDE. I configured it to use UTF-8.
Did I forget something? 
In the property file it is not possible to write "& uuml" instead of "ü",

because
the "&" will be escaped to "& amp".




Timm Helbig wrote:
  

Yes I had the same one. After switching my favourite IDE (Netbeans) to
UTF-8 
Encoding everything was fine. 


So, either you use Unicode Characters in your String literals, which is
plain 
ugly, or use an editor which is capable of using UTF-8 Encodings.


Am Sonntag, 27. April 2008 11:35:16 schrieb greeklinux:


Hello,

I have problems with german umlauts in a feedback panel.
I define the error messages in a property file.
It displays as follows:
Bitte geben Sie eine gültige E-Mail ein

In my HTML:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>



...

My editor is configured to use UTF-8 as encoding.
I tried to initialize the Wicket Application with
getRequestCycleSettings().setResponseRequestEncoding("UTF-8");
but the error is still there.

Has someone the same problem?
  


-
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: make source jars part of wicket distribution


Please have a look at the maven repository, it is already there.

http://repo1.maven.org/maven2/org/apache/wicket/wicket/

Regards Vitek


Peter Ertl wrote:

Dear wicket developers,

could you make the wicket source jars part of the distribution (even 
when this means more megabytes)?


Or maybe an additional apache-wicket-1.x-sources.tar.gz (.zip) ?

This would be very helpful for debugging and ensure that wicket-jar 
and wicket-source-jars do match exactly.


Regards,
Peter


-
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: Wicket component?


You can attach WebMarkupContainer to it.

Vitek

Michael Mehrle wrote:

I need to create a  in my template that is being set to a different
css class before it gets drawn. So, a regular non-wicket  HTML tag
is out. How can I create a simple  tag without using a wicket
panel? (I'm inside a form, so I don't want to use a panel).

 


Thanks,

 


Michael

 

 



  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



how to get the war name wicket application is running from?


Hallo,
is there a way how could you get a name of the WAR file the application 
is running from?
I would like to do create the WAR once and then copy it multiple times 
under the different names to the container. By the name I would then 
decide what client is running the application and set the appropriate 
style of the application.
I know I can introduce the attribute in the compile time, but if 
possible, I would like to do it the way I described before.


Regards Vitek

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How can i Customize the style of Feedback Messages ?


Hallo,
apparently you want to have a look at
setEscapeModelStrings()
and
setRenderBodyOnly()
methods of the Label.

Vitek

Alonso Sanchez, Daniel wrote:

Hi again folks! Thanks for replying me to my first question, it wordked!
If you don't remember, I asked about how to show feedback messages
associated only with a field, so I can show a message next to a input
field.

 


The next step is that I'm trying to change the default behaviour in
order to put a simple html image tag instead of the default
"message1message2"

 


The html code that I'm getting at this moment is this:

 



  

  

  

 
The thing is that I'm putting the image tag as a property, but I don't

know how to change this, in order to show only the image tag?
 
Any kind soul knows how to solve this? Your help would be very

appreciated :D. Thanks in advance.
 
 
Daniel Alonso


 



  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Binding application to another thred


Thank you,
I will have a look at it.
Vitek

Eelco Hillenius wrote:

Thanks.
I just thought that there would be some "correct" way how to do it
because as I read Application.set() is not part of public api.



The correct way is not to do it *typically*. If you have a good
reason, you can always ignore such comments :-)

  

My scenario is this:
I have a wizard.
After proceeding to second step I need to transfer large amount of data
and store information to database.
This operation may take sometimes over five minutes and I want to let
user know what is going on.

So far, upon step initialization, I did it by attaching
AjaxSelfUpdatingTimerBehavior to a component which shows current status.
In the step initialization routine I also spin of new thread which makes
the transfer and update one shared field, which component with
AjaxSelfUpdatingTimerBehavior uses.

If any of you would know of better way how to solve this problem, I
would be grateful to hear.



Take a look at the UploadProgressBar in package
org.apache.wicket.extensions.ajax.markup.html.form.upload. I think
Andrew and Igor did a great job at that.

Eelco

-
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: Binding application to another thred


Thanks.
I just thought that there would be some "correct" way how to do it 
because as I read Application.set() is not part of public api.


My scenario is this:
I have a wizard.
After proceeding to second step I need to transfer large amount of data 
and store information to database.
This operation may take sometimes over five minutes and I want to let 
user know what is going on.


So far, upon step initialization, I did it by attaching 
AjaxSelfUpdatingTimerBehavior to a component which shows current status. 
In the step initialization routine I also spin of new thread which makes 
the transfer and update one shared field, which component with 
AjaxSelfUpdatingTimerBehavior uses.


If any of you would know of better way how to solve this problem, I 
would be grateful to hear.


Kind regards
Vitek

Eelco Hillenius wrote:

On Nov 30, 2007 2:40 AM, Vit Rozkovec <[EMAIL PROTECTED]> wrote:
  

Good day,
when I create new thread, what is the proper way of binding application
to this new thread?



If you are sure you want to do this, you can use Application.set(app)

Eelco

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



Binding application to another thred


Good day,
when I create new thread, what is the proper way of binding application 
to this new thread?


Vitek


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Issue with Internationalization of Non ascii characters


If you're on Linux,
I have made a little script for conversion, which finds all .properties 
files in current directory and subdirectories and encode them proper way:


#!/bin/sh
for file in $(find . -name *.properties); do
   native2ascii $file $file
   echo $file
done

You can find native2ascii also for other platforms

vitek



Frank Bille wrote:

I have the same problem even though only 3 characters (Danish: æ, ø, å), but
I use http://www.resourcebundleeditor.com for eclipse, which creates
.properties files without me having to worry about non-ascii, linebreaks
etc. Nice little tool.

Frank


On Nov 27, 2007 8:52 PM, abaijal <[EMAIL PROTECTED]> wrote:

  

Thanks for the help.
From the example I see that I need to convert the text into Unicode
characters.


Eelco Hillenius wrote:


I am new to wicket framework and am trying to implement
internationalization
for Russian Characters.

When displaying Russian characters on screen, Wicket rendering displays
garbage values


Check out http://wicketstuff.org/wicket13/forminput/. You can select
Russian from the drop down and that looks fine to me. I think that
should work for 1.2 as well, though one of the improvements of 1.3 is
that you can use XML (UTF-8) encoded properties files (even if you're
using Java 1.4).

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  

--
View this message in context:
http://www.nabble.com/Issue-with-Internationalization-of-Non-ascii-characters-tf4883325.html#a13978245
Sent from the Wicket - User mailing list archive at Nabble.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: dummy question, how to set wicket in Deloyment mode?


You're all so fast :)

Suad AlShamsi wrote:

You can either override getConfigurationType() in the Application class


@Override
   public String getConfigurationType() {
   return Application.DEPLOYMENT;
   }

or you can set in in the web.xml

   
   configuration
   deployment
   

Regards,
Suad

raybristol wrote:

dummy question, how to set wicket in Deloyment mode? There is a
Application#getConfigurationType() but I expect something like
Application#setConfigurationType() which does not exist so I thing I 
must

miss something here...

Many thanks
  



-
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: dummy question, how to set wicket in Deloyment mode?


Or you can override it in your application to return the mode you want.

@Override
public String getConfigurationType() {
return Application.DEVELOPMENT;
// return Application.DEPLOYMENT;
}

Vitek

raybristol wrote:

dummy question, how to set wicket in Deloyment mode? There is a
Application#getConfigurationType() but I expect something like
Application#setConfigurationType() which does not exist so I thing I must
miss something here...

Many thanks
  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: TabbedPanel with image tabs - how to contribute ?


That's great!

I added to the article a different approach - custom image in every tab :)

Regards
Vitek

Stefan Simik wrote:
Thank you, 
I added new article:

http://cwiki.apache.org/confluence/display/WICKET/Tabs+with+image

but the last problem is, that I copied the article from one place to another
(better location), but now
I want to delete the the first article, because both are the same now.
(ARTICLE I WANT TO DELETE IS 
http://cwiki.apache.org/confluence/display/WICKET/TabbedPanel+with+image+tabs)


.. and there is a problem with message: "You do not have permission"

Who can I contact to delete the unwanted doubled article ?
  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket extension 1.3


Hi,
the best way is to set up Maven and let it download all the required 
references.
With maven, you can create quickstart project then and in its pom.xml 
add a dependency

   
   org.apache.wicket
   wicket-extensions
   1.3.0-beta3
   

Regards
Vitek

anita nichols wrote:

Where can I get the Wicket 1.3 extension for my quickstart
Where can I put those extension? Can I put it under Referenced Libraries?

Thank you,
Anita

  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: TabbedPanel with image tabs


Thank you,
I will have a look at it.

Vitek

Fabio Fioretti wrote:

On 10/7/07, Erik van Oosten <[EMAIL PROTECTED]> wrote:
  

You can override a method on TabbedPanel to create the component that is
put in the tab.
I can not look it up now, but can do so later if you want.



The method you are talking about is newLink.


Kindest regards,

Fabio Fioretti - WindoM

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



TabbedPanel with image tabs


Good day,
I would like to have a possibility to have a small image next to the 
text in tab in the TabbedPanel.

How can I contribute this feature to Wicket? To have a constructor like
public AbstractTab(IModel title, ResourceReference image)?

Vitek

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Threading wicket


swaroop belur wrote:


But  mind u- that thread may not have references to stuff like
ur session,application objects- they might be null. So you will have to
first get
the reqd stuff (any dependecies- say something from ur service layer for
example)
and then start the thread. 


-swaroop
  
Would you mind sharing a bit of your code? So far I did 
Application.set(app) in the run() method (app is reference to 
application from standart thread Wicket is running in), but I think this 
is not the right way as the set() method is not part of the public API.


What is the best way to do this?

Thanks alot.

Vitek




Ví­t Rozkovec wrote:
  

Hallo,
how can I force from a middle of the loop, which may run up to few 
minutes to update a component's value?
I am manipulating a lot of files and I would like to let the user know 
how much of the processing is already done.
I would like to start processing the files when user reaches certain 
page and on this same page I want to display statistics of the process.
As an example I tried to use a Clock from your ajax example, but I 
cannot manage it to update during running of the loop. I thought of 
achieving it somehow with threads, is this right direction?

What is the correct way to do it?

Thank you.

Vitek

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



Threading wicket


Hallo,
how can I force from a middle of the loop, which may run up to few 
minutes to update a component's value?
I am manipulating a lot of files and I would like to let the user know 
how much of the processing is already done.
I would like to start processing the files when user reaches certain 
page and on this same page I want to display statistics of the process.
As an example I tried to use a Clock from your ajax example, but I 
cannot manage it to update during running of the loop. I thought of 
achieving it somehow with threads, is this right direction?

What is the correct way to do it?

Thank you.

Vitek

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Disabling of Wizard Cancel button


Thank you, I missed that.
Vit

Andrew Klochkov wrote:

Hi!

What about overriding IWizardModel.isCancelVisible() ?

Vit Rozkovec wrote:

Hi,
I am using wizard, its dynamic variant with DynamicWizardModel, 
DynamicWizardStep and IDynamicWizardStep.
Would it be possible to add to wizard the possibility to also disable 
the cancel button? Or if I can do it somehow myself and get it to 
trunk, I will do, just tell me.
I use wizard for importing many files into database and last step of 
wizard is just summary, both buttons - Cancel and Finish - do the 
same and there is no possibility to go back, so I would like to make 
availiable only Finish button.


Thank you.

Vitek

P.S. I just found the "threads" button in my e-mail client :)

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



Disabling of Wizard Cancel button


Hi,
I am using wizard, its dynamic variant with DynamicWizardModel, 
DynamicWizardStep and IDynamicWizardStep.
Would it be possible to add to wizard the possibility to also disable 
the cancel button? Or if I can do it somehow myself and get it to trunk, 
I will do, just tell me.
I use wizard for importing many files into database and last step of 
wizard is just summary, both buttons - Cancel and Finish - do the same 
and there is no possibility to go back, so I would like to make 
availiable only Finish button.


Thank you.

Vitek

P.S. I just found the "threads" button in my e-mail client :)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Disabling of Wizard Cancel button


Ups, thanks, I forgot to delete it.

Vit

Ballist1c wrote:

Hey Vit,

umm you may want to create a new thread for this topic


Ví­t Rozkovec wrote:
  

Hi,
I am using wizard, its dynamic variant with DynamicWizardModel, 
DynamicWizardStep and IDynamicWizardStep.
Would it be possible to add to wizard the possibility to also disable 
the cancel button? Or if I can do it somehow myself and get it to trunk, 
I will do, just tell me.
I use wizard for importing many files into database and last step of 
wizard is just summary, both buttons - Cancel and Finish - do the same 
and there is no possibility to go back, so I would like to make 
availiable only Finish button.


Thank you.

Vitek

Ballist1c wrote:


Thanks mate, thats PERFECT! haha.. i just found attributeModifier
setup!!!
lol rad!!!


Martijn Dashorst wrote:
  
  

Create a YouTubePanel:

class YouTubePanel extends Panel {
private int width;
private int height;

public YouTubePanel(String id, IModel src) {
super(src);
add(new AttributeModifier("width", true, new
PropertyModel(this, "width")));
add(new AttributeModifier("height", true, new
PropertyModel(this, "height")));
add(new WebMarkupContainer("movie").add(new
AttributeModifier("value", true, src)));
add(new WebMarkupContainer("embed").add(new
AttributeModifier("src", true, src)));
}
/* add component tag check for object */
}










On 10/1/07, Ballist1c <[EMAIL PROTECTED]> wrote:



Hey guys,

Right now I am attempting to setup a mechanism which allows users to
submit
there own youtube video links and getting them to display in an
embedded
fashion.

e.g.  (ignore the dashes in HTML)

  http://www.youtube.com/v/Z3ClCwcCvdQ";>
  
  http://www.youtube.com/v/Z3ClCwcCvdQ";
type="application/x-shockwave-flash"
wmode="transparent" width="425" height="350">



There are some non-standard HTML tags and attributes in use and from
what
I
can tell, it looks like I would have to write my own wicket component. 
The

bit that throws me off, is the HTML to embed youtube videos is nested
with
multiple levels...

Any advice on this matter would be appreciated, i am stuck for a
starting
point on how to tackle nested HTML and there respective components

Thanks guys,
Have a great day :)
--
View this message in context:
http://www.nabble.com/Setting-up-ComponentTags-for-user-submitted-youtube-links-tf4546357.html#a12973665
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  
  

--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

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






  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Disabling of Wizard Cancel button


Hi,
I am using wizard, its dynamic variant with DynamicWizardModel, 
DynamicWizardStep and IDynamicWizardStep.
Would it be possible to add to wizard the possibility to also disable 
the cancel button? Or if I can do it somehow myself and get it to trunk, 
I will do, just tell me.
I use wizard for importing many files into database and last step of 
wizard is just summary, both buttons - Cancel and Finish - do the same 
and there is no possibility to go back, so I would like to make 
availiable only Finish button.


Thank you.

Vitek


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Disabling of Wizard Cancel button


Hi,
I am using wizard, its dynamic variant with DynamicWizardModel, 
DynamicWizardStep and IDynamicWizardStep.
Would it be possible to add to wizard the possibility to also disable 
the cancel button? Or if I can do it somehow myself and get it to trunk, 
I will do, just tell me.
I use wizard for importing many files into database and last step of 
wizard is just summary, both buttons - Cancel and Finish - do the same 
and there is no possibility to go back, so I would like to make 
availiable only Finish button.


Thank you.

Vitek

Ballist1c wrote:

Thanks mate, thats PERFECT! haha.. i just found attributeModifier setup!!!
lol rad!!!


Martijn Dashorst wrote:
  

Create a YouTubePanel:

class YouTubePanel extends Panel {
private int width;
private int height;

public YouTubePanel(String id, IModel src) {
super(src);
add(new AttributeModifier("width", true, new
PropertyModel(this, "width")));
add(new AttributeModifier("height", true, new
PropertyModel(this, "height")));
add(new WebMarkupContainer("movie").add(new
AttributeModifier("value", true, src)));
add(new WebMarkupContainer("embed").add(new
AttributeModifier("src", true, src)));
}
/* add component tag check for object */
}










On 10/1/07, Ballist1c <[EMAIL PROTECTED]> wrote:


Hey guys,

Right now I am attempting to setup a mechanism which allows users to
submit
there own youtube video links and getting them to display in an embedded
fashion.

e.g.  (ignore the dashes in HTML)

  http://www.youtube.com/v/Z3ClCwcCvdQ";>
  
  http://www.youtube.com/v/Z3ClCwcCvdQ";
type="application/x-shockwave-flash"
wmode="transparent" width="425" height="350">



There are some non-standard HTML tags and attributes in use and from what
I
can tell, it looks like I would have to write my own wicket component. 
The

bit that throws me off, is the HTML to embed youtube videos is nested
with
multiple levels...

Any advice on this matter would be appreciated, i am stuck for a starting
point on how to tackle nested HTML and there respective components

Thanks guys,
Have a great day :)
--
View this message in context:
http://www.nabble.com/Setting-up-ComponentTags-for-user-submitted-youtube-links-tf4546357.html#a12973665
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  

--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

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



Wicket Listeners


Hallo,
I would like to achieve following functionality, how is it possible?

I have an abstract panel with upload field in it.
The panel is to be used as a form component.

In the panel there is an abstract method
processFile(FileUpload fileUpload)
which I would like to get called everytime a form gets submitted, so I 
would just add the element, fill the method and done.


At first I thought that it would work by letting panel implement 
IFormSubmitListener and in panel implement interface method this way:


onFormSubmitted() {
   processFile(uploadField.getFileUpload());
}

But it does not work this way.

I am using this panel in a wizard, which has already its own Form, so I 
cannot override onSubmit method of this form and I do not want to alter 
much code, I thought that this would be an elegant way how to do it.


Is there any other way how to do it? Or do you have some reading where 
can I find beside studying the code, which is a bit difficult for me at 
this time?


Thank you.

Vitek

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: File downloading with Wicket


There is a DownloadLink for this scenarion.

Vitek

Ian Godman wrote:

Can any one give me a pointer or 2 on how to download a file from a wicket page?

I have a LinkTree representing a directory tree which is lazy loaded via ajax. 
When the user clicks on a file node I need to download the file to them. 
However the file is stored with a different name (allows for versioning etc)   
so it needs to arrive at the browser as a file with the name as displayed in 
the tree not as saved on the hard disk.

This was previously implemented in a Tapestry system using a servelet but I 
just cant get my head around the issues of using a servlet in Wicket (does not 
seem the right way to me).

Any help in clearing the fog most appreciated, example code even more so 



Ian





  ___
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 
  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ModalWindow bug - unable to close when added AjaxButton in content of the window

Yes, the form validates, I put the breakpoint at onSubmit and that 
method was invoked.

I tried it also with empty form.
The behavior is following:
when I have only AjaxLinks in the form, it is ok.
When I add AjaxButton, the behavior changes - the first time the modal 
window is displayed, it is possible to close the window with the cross 
in the upper right corner and with any AjaxLink I have in the form. But 
only when the first click goes to one of these elements.
When I first click on the button to close the window, suddently the 
cross and the links became dead too.


Vitek

Matej Knopp wrote:

Are you sure your Form validates, when you click AjaxLink? Because
otherwise the onSubmit is not invoked. Can you put a breakpoint in
onSubmit? Also there is onError handler that is invoked when form
validation fails.

-Matej

On 9/14/07, Vit Rozkovec <[EMAIL PROTECTED]> wrote:
  

I am sorry, I could not replicate it in quickstart. The button works
fine there. For now I solved the problem by replacing AjaxButtons with
AjaxLinks.

Vitek

Matej Knopp wrote:


Plase create a jira issue and attach a quickstart to it. Thanks.

-Matej

On 9/13/07, Vit Rozkovec <[EMAIL PROTECTED]> wrote:

  

Good day,
I am using last snapshot of wicket and there is a problem with modal
window - I create instance of the window and add it to the page. As a
content I use a panel which has these components:

public class ModalConfirmationPanel extends Panel {

public ModalConfirmationPanel(String id, final ModalWindow window) {
super(id);

window.setTitle(getString("titulek"));

Form form = new Form("confirmation");
add(form);
form.add(new TextArea("explanation", new Model("")));
form.add(new AjaxLink("ok") {
@Override
public void onClick(AjaxRequestTarget target) {
window.close(target);
}
});
form.add(new AjaxLink("storno") {
@Override
public void onClick(AjaxRequestTarget target) {
window.close(target);
}
});
//form.add(new AjaxSubmitButton("buttonOk", form) {
//@Override
//protected void onSubmit(AjaxRequestTarget target, Form form) {
//window.close(target);
//}
//});
//form.add(new AjaxButton("buttonStorno", form) {
//@Override
//protected void onSubmit(AjaxRequestTarget target, Form form) {
//window.close(target);
//}
//});


When I uncomment the lines and add AjaxSubmitButtons or AjaxButtons, the
modal window cannot be closed anymore, neither with the buttons, nor
with the close button in the header or with links. When I add just
links, it works ok. It does not matter if there is window.close() method
in the button's onSubmit method.

If you would like I can make a quickstart. I cannot test anymore, but in
beta3 it worked.

Vitek

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


  

-
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: ModalWindow bug - unable to close when added AjaxButton in content of the window

I am sorry, I could not replicate it in quickstart. The button works 
fine there. For now I solved the problem by replacing AjaxButtons with 
AjaxLinks.


Vitek

Matej Knopp wrote:

Plase create a jira issue and attach a quickstart to it. Thanks.

-Matej

On 9/13/07, Vit Rozkovec <[EMAIL PROTECTED]> wrote:
  

Good day,
I am using last snapshot of wicket and there is a problem with modal
window - I create instance of the window and add it to the page. As a
content I use a panel which has these components:

public class ModalConfirmationPanel extends Panel {

public ModalConfirmationPanel(String id, final ModalWindow window) {
super(id);

window.setTitle(getString("titulek"));

Form form = new Form("confirmation");
add(form);
form.add(new TextArea("explanation", new Model("")));
form.add(new AjaxLink("ok") {
@Override
public void onClick(AjaxRequestTarget target) {
window.close(target);
}
});
form.add(new AjaxLink("storno") {
@Override
public void onClick(AjaxRequestTarget target) {
window.close(target);
}
});
//form.add(new AjaxSubmitButton("buttonOk", form) {
//@Override
//protected void onSubmit(AjaxRequestTarget target, Form form) {
//window.close(target);
//}
//});
//form.add(new AjaxButton("buttonStorno", form) {
//@Override
//protected void onSubmit(AjaxRequestTarget target, Form form) {
//window.close(target);
//}
//});


When I uncomment the lines and add AjaxSubmitButtons or AjaxButtons, the
modal window cannot be closed anymore, neither with the buttons, nor
with the close button in the header or with links. When I add just
links, it works ok. It does not matter if there is window.close() method
in the button's onSubmit method.

If you would like I can make a quickstart. I cannot test anymore, but in
beta3 it worked.

Vitek

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

  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ModalWindow bug - unable to close when added AjaxButton in content of the window


Good day,
I am using last snapshot of wicket and there is a problem with modal 
window - I create instance of the window and add it to the page. As a 
content I use a panel which has these components:


public class ModalConfirmationPanel extends Panel {

   public ModalConfirmationPanel(String id, final ModalWindow window) {
   super(id);
  
   window.setTitle(getString("titulek"));
  
   Form form = new Form("confirmation");

   add(form);
   form.add(new TextArea("explanation", new Model("")));
   form.add(new AjaxLink("ok") {
   @Override
   public void onClick(AjaxRequestTarget target) {
   window.close(target);   
   }

   });
   form.add(new AjaxLink("storno") {
   @Override
   public void onClick(AjaxRequestTarget target) {
   window.close(target);   
   }

   });
//form.add(new AjaxSubmitButton("buttonOk", form) {
//@Override
//protected void onSubmit(AjaxRequestTarget target, Form form) {
//window.close(target);
//}
//});
//form.add(new AjaxButton("buttonStorno", form) {
//@Override
//protected void onSubmit(AjaxRequestTarget target, Form form) {
//window.close(target);
//}
//});


When I uncomment the lines and add AjaxSubmitButtons or AjaxButtons, the 
modal window cannot be closed anymore, neither with the buttons, nor 
with the close button in the header or with links. When I add just 
links, it works ok. It does not matter if there is window.close() method 
in the button's onSubmit method.


If you would like I can make a quickstart. I cannot test anymore, but in 
beta3 it worked.


Vitek

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Finishing wizard by pressing Enter


Eelco Hillenius wrote:

As I said earlier, in Wizard.java's method

protected void onBeforeRender()
{
super.onBeforeRender();
Component buttonBar = get(BUTTONS_ID);
if (buttonBar instanceof IDefaultButtonProvider)
{
IFormSubmittingComponent defaultButton =
((IDefaultButtonProvider)buttonBar)
.getDefaultButton(wizardModel);
form.setDefaultButton(defaultButton);
}
}



Ugh. That get call should have been done on form of course. Sorry for
the oversight. It is fixed now.

Eelco
  
It works perfect now. The only last thing I would do when accessing form 
is to either use in both cases  getForm() or form, but maybe I am too 
pedant :)


Vitek

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Finishing wizard by pressing Enter


Eelco Hillenius wrote:

On 9/12/07, Vit Rozkovec <[EMAIL PROTECTED]> wrote:
  

Eelco Hillenius wrote:


On 9/12/07, Vit Rozkovec <[EMAIL PROTECTED]> wrote:

  

I checked the code out with svn, and run my project with last revision,
however the behavior is still the same.
In the Wizard.java method onBeforeRender() there is a condition
if (buttonBar instanceof IDefaultButtonProvider){}
which in my case never evaluates to true and so the form never gets set
the default button.



Am I correct that you provide your own button bar then? Please take a
look at how WizardButtonBar is implemented.


  

In fact no, I use standard WizardButtonBar. I checked the implementation
and I understand what it should do, but it does not. At the moment I
solved the problem a bit dirty way - inerhited WizardButtonBar and in
the template changed Finish button to be the first one, so on the last
step Enter is catched correctly by Finish button.



I'm sorry I didn't mention this, but this
https://issues.apache.org/jira/browse/WICKET-954 was a related bug I
fixed two days ago. So for the update to work you also need the latest
snapshot of wicket, not just wicket-extensions.

If it still doesn't work, that's a bug. Could you try please?

Eelco
  


Yes, I checked out all trunk and did mvn install in parent directory. To 
be sure, I checked content of the Form.class in included jar and there 
is the patched code.

The behavior is the same.

But I do not think it is the problem, if I understand it well.

As I said earlier, in Wizard.java's method

protected void onBeforeRender()
   {
   super.onBeforeRender();
   Component buttonBar = get(BUTTONS_ID);
   if (buttonBar instanceof IDefaultButtonProvider)
   {
   IFormSubmittingComponent defaultButton = 
((IDefaultButtonProvider)buttonBar)

   .getDefaultButton(wizardModel);
   form.setDefaultButton(defaultButton);
   }
   }

in Component buttonBar = get(BUTTONS_ID); the buttonBar variable is 
assigned null, so we do not even reach form.setDefaultButton(defaultButton);


Vitek


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Finishing wizard by pressing Enter


Eelco Hillenius wrote:

On 9/12/07, Vit Rozkovec <[EMAIL PROTECTED]> wrote:
  

I checked the code out with svn, and run my project with last revision,
however the behavior is still the same.
In the Wizard.java method onBeforeRender() there is a condition
if (buttonBar instanceof IDefaultButtonProvider){}
which in my case never evaluates to true and so the form never gets set
the default button.



Am I correct that you provide your own button bar then? Please take a
look at how WizardButtonBar is implemented.

  
In fact no, I use standard WizardButtonBar. I checked the implementation 
and I understand what it should do, but it does not. At the moment I 
solved the problem a bit dirty way - inerhited WizardButtonBar and in 
the template changed Finish button to be the first one, so on the last 
step Enter is catched correctly by Finish button.



Do you want a code of my class? I do not do there something special, I
copied the class from wicket examples.



Sure.

Eelco
  

Here it is (full source with imports at http://rafb.net/p/sjz60X77.html )

public class NewRecordWizardPanel extends Wizard {

   /**
* file from UploadPanel
*/
   private Soubor soubor;

   /**
* Step for uploading file
*/
   private final class UploadFileStep extends WizardStep {
   UploadPanel uploadPanel;

   /**
* Construct.
*/
   public UploadFileStep() {
   setTitleModel(new ResourceModel("upload.title"));
   setSummaryModel(new ResourceModel("upload.summary"));

   // where to upload files
   // TODO move to .properties
   Folder uploadFolder = new Folder("data/", "ds-upload");
   add(this.uploadPanel = new UploadPanel("uploadPanel", 
uploadFolder));

   }

   @Override
   protected void onInit(IWizardModel wizardModel) {
   // form settings
   Form form = NewRecordWizardPanel.this.getForm();
   form.setMultiPart(true);
   form.setMaxSize(this.uploadPanel.getMaxUploadSize());
   super.onInit(wizardModel);
   }

   @Override
   public void applyState() {
   // after submitting step make appropriate actions in panel
   this.uploadPanel.submitActions();

   // get uploaded file
   soubor = this.uploadPanel.getSoubor();
   super.applyState();
   }
   }

   /**
* Dublin Core input form
*/
   private final class EditDCStep extends WizardStep {

   private NewDCPanel panel;

   public EditDCStep() {
   setTitleModel(new ResourceModel("dublinCore.title"));
   add(panel = new NewDCPanel("editDC"));
   }

   @Override
   public void applyState() {
   panel.submitActions(soubor);
   super.applyState();
   }
   }

   private Class responsePage = WizardPage.class;

   /**
* Construct.
*
* @param id
*The component id
* @param responsePage
*page where cancel and finish go
*/
   public NewRecordWizardPanel(String id, Class responsePage) {
   this(id);
   this.responsePage = responsePage;
   }

   /**
* Construct.
*
* @param id
*The component id
*/
   public NewRecordWizardPanel(String id) {
   super(id, false);
   add(Shorthand.getCssForClass(NewRecordWizardPanel.class));
   setModel(new CompoundPropertyModel(this));
   WizardModel model = new WizardModel();
   model.add(new UploadFileStep());
   model.add(new EditDCStep());

   // initialize the wizard with the wizard model we just built
   init(model);
   }

   /**
* @see org.apache.wicket.extensions.wizard.Wizard#onCancel()
*/
   public void onCancel() {
   File file = new File(soubor.getFilePath());
   if (file.exists()) {
   file.delete();
   }

   // in case of Cancel button, delete already persisted data in 
database

   Session session = DataStaticService.getHibernateSession();
   session.createQuery("delete Soubor as s where 
s.id=:id").setParameter(

   "id", soubor.getId()).executeUpdate();
   setResponsePage(this.responsePage);
   }

   /**
* @see org.apache.wicket.extensions.wizard.Wizard#onFinish()
*/
   public void onFinish() {
   setResponsePage(this.responsePage);
   }
}



Vitek



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Finishing wizard by pressing Enter

I checked the code out with svn, and run my project with last revision, 
however the behavior is still the same.

In the Wizard.java method onBeforeRender() there is a condition
if (buttonBar instanceof IDefaultButtonProvider){}
which in my case never evaluates to true and so the form never gets set 
the default button.


Do you want a code of my class? I do not do there something special, I 
copied the class from wicket examples.


Vitek

I didn't quite make 'today', but it is fixed now. See
https://issues.apache.org/jira/browse/WICKET-955

Defaults in WizardButtonBar should work for most people, but if you
want something different, you can let your button bar implement
IDefaultButtonProvider (which is a new interface).

Eelco

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



Finishing wizard by pressing Enter


Hi,
what is the best way to make a Finish button the default processing 
button of the Wizard component?
When I am in the last step of the wizard and in the form field I press 
Enter, it takes me to the previous step. I would like to finish the 
wizard. Is it possible?


Thank you for any suggestion.

Vitek

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]