Re: Wicket HTML pages are not compiled

2010-06-04 Thread david_

Are you sure the resource files are packaged? Check you pom.xml settings, it
should contain something like:
 

false
src/main/resources


false
src/main/java

**


**/*.java




2010/6/4 jeremycod [via Apache Wicket] <
ml-node+2243760-1240322438-232...@n4.nabble.com
>

> Hi everybody,
>
> I have the wicket project that used to work fine on my other PC. However,
> on the PC I'm using at home I can't set it to work properly. During the
> maven-build in eclipse it seems that there are not a problems, but wicket
> html pages are not compiled.
>
> This is output of eclipse console during the maven build:
>
> [INFO] Scanning for projects...
> [INFO]
>
> [INFO]
> 
> [INFO] Building intelleo-mavenized Maven Webapp 0.0.1-SNAPSHOT
> [INFO]
> 
> 2010-06-04 22:29:52.417:INFO::Logging to StdErrLog::DEBUG=false via
> org.eclipse.jetty.util.log.StdErrLog
> Downloading:
> http://ws.zones.apache.org/repository2/org/apache/santuario/xmlsec/1.4.0/xmlsec-1.4.0.pom
> Downloading:
> http://repo1.maven.org/maven2/org/apache/santuario/xmlsec/1.4.0/xmlsec-1.4.0.pom
> [WARNING] Missing POM for org.apache.santuario:xmlsec:jar:1.4.0
> Downloading:
> http://ws.zones.apache.org/repository2/opensaml/opensaml/1.1/opensaml-1.1.pom
> Downloading:
> http://repo1.maven.org/maven2/opensaml/opensaml/1.1/opensaml-1.1.pom
> [WARNING] Missing POM for opensaml:opensaml:jar:1.1
> Downloading:
> http://people.apache.org/repo/m2-snapshot-repository/org/apache/santuario/xmlsec/1.4.1/xmlsec-1.4.1.pom
> Downloading:
> http://ws.zones.apache.org/repository2/org/apache/santuario/xmlsec/1.4.1/xmlsec-1.4.1.pom
> [WARNING] Missing POM for org.apache.santuario:xmlsec:jar:1.4.1
> Downloading:
> http://people.apache.org/repo/m2-snapshot-repository/opensaml/opensaml/1.1/opensaml-1.1.pom
> Downloading:
> http://ws.zones.apache.org/repository2/opensaml/opensaml/1.1/opensaml-1.1.pom
> [WARNING] Missing POM for opensaml:opensaml:jar:1.1
> Downloading:
> http://people.apache.org/repo/m2-snapshot-repository/org/apache/santuario/xmlsec/1.4.1/xmlsec-1.4.1.pom
> Downloading:
> http://ws.zones.apache.org/repository2/org/apache/santuario/xmlsec/1.4.1/xmlsec-1.4.1.pom
> [WARNING] Missing POM for org.apache.santuario:xmlsec:jar:1.4.1
> Downloading:
> http://people.apache.org/repo/m2-snapshot-repository/opensaml/opensaml/1.1/opensaml-1.1.pom
> Downloading:
> http://ws.zones.apache.org/repository2/opensaml/opensaml/1.1/opensaml-1.1.pom
> [WARNING] Missing POM for opensaml:opensaml:jar:1.1
> Downloading:
> http://people.apache.org/repo/m2-snapshot-repository/org/apache/santuario/xmlsec/1.4.1/xmlsec-1.4.1.pom
> Downloading:
> http://ws.zones.apache.org/repository2/org/apache/santuario/xmlsec/1.4.1/xmlsec-1.4.1.pom
> [WARNING] Missing POM for org.apache.santuario:xmlsec:jar:1.4.1
> Downloading:
> http://people.apache.org/repo/m2-snapshot-repository/opensaml/opensaml/1.1/opensaml-1.1.pom
> Downloading:
> http://ws.zones.apache.org/repository2/opensaml/opensaml/1.1/opensaml-1.1.pom
> [WARNING] Missing POM for opensaml:opensaml:jar:1.1
> [WARNING] Invalid POM for org.apache.lucene:lucene-core:jar:2.3.1,
> transitive dependencies (if any) will not be available, enable debug logging
> for more details
> [INFO]
> [INFO] --- maven-enforcer-plugin:1.0-beta-1:enforce (enforce-versions) @
> intelleo-mavenized ---
> [INFO]
> 
> [INFO] BUILD SUCCESS
> [INFO]
> 
> [INFO] Total time: 16.535s
> [INFO] Finished at: Fri Jun 04 22:30:05 CEST 2010
> [INFO] Final Memory: 13M/307M
> [INFO]
> 
>
>
> And I get this when I try to access the wicket html page after running of
> application:
>
> 
> *** WARNING: Wicket is running in DEVELOPMENT mode.  ***
> ***   ^^^***
> *** Do NOT deploy to your live server(s) without changing this.  ***
> *** See Application#getConfigurationType() for more information. ***
> 
> 2010-06-04 22:46:54,710 ERROR
> org.apache.wicket.RequestCycle.logRuntimeException(RequestCycle.java:1521) -
> Markup of type 'html' for component 'org.intelleo.webui.Home' not found.
> Enable debug messages for org.apache.wicket.util.resource to get a list of
> all filenames tried.: [Page class = org.intelleo.webui.Home, id = 0, version
> = 0]
> org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html

Re: SessionStore life cycle in cluster?

2010-06-04 Thread Igor Vaynberg
On Fri, Jun 4, 2010 at 10:32 PM, DmitryM  wrote:
>
> Igor,
>
> Can you please comment on the following couple of points I got?
>
> 1. "Pulling session from memcached node": I double checked the
> recommendation and it looks like fetching session from the memcached node
> doesn't take much time (around 200ms at most). But there was a
> recommendation about immediate session attributes deserialization after
> session replication
> (http://apache-wicket.1842946.n4.nabble.com/A-few-clustering-questions-td1863992.html#a1863993).
> Do you think it may be a potential issue causing the request processing
> delay I experienced?

i would use a profiler and see where the time goes, that way you dont
have to guess.

> 2. The memcached-session-manager's developer suggested I could try to use
> plain HttpSessionStore (instead of default SecondLevelCacheSessionStore).
> But when I tried his suggestion I got the following stacktrace:
>
> java.lang.ExceptionInInitializerError
...
> which is caused by the Injector usage in one of the classes used by a Page.
> Why do you think Application.get() method may blow up? Why isn't the
> ThreadLocal application instance get set?

unless memcached serializer works asynchronously in its own thread.

-igor

>
> Thanks,
> Dmitry
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/SessionStore-life-cycle-in-cluster-tp2242105p2244022.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



Re: SessionStore life cycle in cluster?

2010-06-04 Thread DmitryM

Igor,

Can you please comment on the following couple of points I got?

1. "Pulling session from memcached node": I double checked the
recommendation and it looks like fetching session from the memcached node
doesn't take much time (around 200ms at most). But there was a
recommendation about immediate session attributes deserialization after
session replication
(http://apache-wicket.1842946.n4.nabble.com/A-few-clustering-questions-td1863992.html#a1863993).
Do you think it may be a potential issue causing the request processing
delay I experienced?

2. The memcached-session-manager's developer suggested I could try to use
plain HttpSessionStore (instead of default SecondLevelCacheSessionStore).
But when I tried his suggestion I got the following stacktrace:

java.lang.ExceptionInInitializerError
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at
sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
at
sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
at java.lang.reflect.Field.getLong(Field.java:528)
at 
java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1614)
at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:425)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.(ObjectStreamClass.java:413)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310)
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:547)
at 
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at 
java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480)
at org.apache.wicket.Component.readObject(Component.java:4457)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputSt

Re: TextField that renders a link

2010-06-04 Thread Mauro Ciancio
Hello,

  An option is to create a panel that inside of it has
two components, a textbox and a link. Via ajax
you can update the textbox's model and show the
link if needed.

  I don't know if there is a pre-made component with
that functions, but I've wrapped two components
into a panel and it works pretty good.

Regards.

On Fri, Jun 4, 2010 at 1:27 PM, Josh Chappelle  wrote:

> Does anyone know of a TextField component or perhaps a Behavior that can be
> added to a TextField that will render a link when the user types a URL into
> it?
>
>
>
> Thanks,
>
>
>
> Josh
>
>


-- 
Mauro Ciancio 


Re: Question about usage of PageMap

2010-06-04 Thread Pedro Santos
I believe that passing the page where user click "Add" as parameter to the
wizard is an simple solution to has an reference to set on the cancel
response.

On Fri, Jun 4, 2010 at 3:55 AM, Swanthe Lindgren <
swanthe.lindg...@megasol.se> wrote:

> Hello all.
> I our application we have a lot of search and maintenance pages for
> different type of entities. On each of these pages we put an "Add" button,
> which takes the user to a wizard to add a new entity of that type. In the
> wizard, we want to be able to send the user back to where it came from if
> the "Cancel" button is pressed.
>
> Questions:
> Is there a simple way to know how the user entered the wizard?
> Is this where the PageMap comes in, or is there any other way to track the
> users path in the application?
>
> //Swanthe
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
Pedro Henrique Oliveira dos Santos


Re: How to do a multiple page form?

2010-06-04 Thread Pedro Santos
Do you searching for an wizard implementation?
http://www.wicket-library.com/wicket-examples/wizard/

On Fri, Jun 4, 2010 at 11:49 PM, David Chang wrote:

> Hi, I would like to do a multiple page form. For example, I have a two-page
> form. Both pages have a few fields that need validation. The first page has
> a button called "Next" and the second page has a "Previous" button and a
> "Submit" button.
>
> Any pointers or how-to info will be greatly appreciated.
>
> Best and have a great weekend!
>
> -David
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos


How to do a multiple page form?

2010-06-04 Thread David Chang
Hi, I would like to do a multiple page form. For example, I have a two-page 
form. Both pages have a few fields that need validation. The first page has a 
button called "Next" and the second page has a "Previous" button and a "Submit" 
button.

Any pointers or how-to info will be greatly appreciated.

Best and have a great weekend!

-David


  

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



Re: Frustrating behavior ... same browser, same war, same tomcat version - different behavior!!!

2010-06-04 Thread Igor Vaynberg
right, sounds like the session is being lost and the page is being
rerendered fresh.

-igor

On Fri, Jun 4, 2010 at 1:46 PM, Scott Swank  wrote:
> Do you have apache or a load balancer or anything else in the network?
>  Is there maybe a simple difference in your httpd.conf pertaining to
> sessions?
>
> On Fri, Jun 4, 2010 at 1:32 PM, Bryan Montgomery  wrote:
>> Thanks for the ideas. Still no joy.
>>
>> The behavior is consistent between three different clients, all running
>> different versions of IE (6,7 and 8).
>> I was able to use the debugging feature built in to IE 8 to see that the
>> wicket ajax javascript was gettting called. At some point in that process it
>> lost the value of the field and it got set to an empty field.
>>
>> I have the feeling that there is something different with the environment on
>> this particular server - but I have no idea what at this point.
>>
>> On Fri, Jun 4, 2010 at 1:32 PM, gnul  wrote:
>>
>>> >
>>> > Essentially, part of the process generates dynamic web forms based on xml
>>> > configuration files. We noticed that on one of our servers when we
>>> deployed
>>> > the war file that the fields would not hold their values, and as soon as
>>> you
>>> > tabbed out, the entry would disappear. Taking the same war file and
>>> > deploying it to another server the form acts as expected.
>>> >
>>>
>>> If it works on one server, but not the other, and they are configured
>>> the same (meaning same appserver/tomcat version, same jvm, same
>>> user/group/perms, etc.), the first thing I do is "clean" the appserver
>>> and do a fresh deploy.
>>>
>>> For example, say you are deploying to /var/lib/tomcat/webapps/, I
>>> would shutdown both tomcats, remove the exploded directories (e.g.
>>> myapp.war => myapp/ ) and re-deploy the war files to each server.  I
>>> would also clean out tomcat's temp directory (e.g.
>>> /var/cache/tomcat5/temp), then restart them both.
>>>
>>>  -gnul
>>>
>>> -
>>> 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: DataTable in DataTable

2010-06-04 Thread Igor Vaynberg
just like you would with any other component, wicket doesnt care

-igor

On Fri, Jun 4, 2010 at 2:23 AM, midikem
 wrote:
>
> Hi is it possible to add a dataTable in a DataTable and how?
> I have a dataTable and when i press on a line in it i want a new dataTable
> to popup
> below the line i have pressed. How do i do this?
> I have a DefaultDataTable("dataTable", columns, provider, 10)
> where i have added the columns to a arrayList.
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/DataTable-in-DataTable-tp2242922p2242922.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



Re: Dialog involving multiple pages and a VO: some best practices?

2010-06-04 Thread Igor Vaynberg
obviously you have to know what you are passing around. you shouldnt
pass around objects that link to page instances, such as anonymous
classes of models.

-igor

On Fri, Jun 4, 2010 at 2:04 AM, Joseph Pachod  wrote:
> Igor Vaynberg wrote:
>>
>> usually i simply allow pages to take models of whatever it is they
>> need, just like any other component. in case of a dto being passed
>> around you can simply use the default model: new Model(new
>> Dto()); and pass that to any page. that way the page does not need to
>> worry about where the objects comes from or how to store it.
>>
>> -igor
>
> As answered to Maruo, is there any "dragon lurking" there, with some return
> page de serialized instance's references pointing to some other reference
> that the one behind the current model being given around ?
>
> I was somehow under the impression it was kind of risky...
>
> -
> 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: Can I develop without recompiling/restarting after every change?

2010-06-04 Thread bht
Hi,

My suggestions were meant to be general, and with "best" I actually
meant in all environments including certified J2EE servers.

Any number of environments (Igor suggested Jetty) may work with or
without these suggestions.

That is because deployment environments may or may not make decisions
on which way to deploy different file types, or depending on
directories they are loaded from. Files in the web directory are quite
obviously candidates for the fastest deployment method.

If the environment thinks that HTML files need to be deployed in the
same way as Java files, which is quite likely if they are stored in
Java packages, then deploy-on-save setups may slow down the
development process of complex applications due to heavy CPU use.

Therefore, fetching markup from the web directory not from the
classpath is clearly superior under some of these conditions.

This would not break the ability of packaging markup of some
components in the classpath because Wicket can handle that at the same
time.

There is no need to squeeze my comments into the frame of your
"community consensus". I am perfectly happy if my comments are correct
only for the other 100% of the community that I am targeting.

OT:

If Wicket adds the trivial feature of resolving HTML resource links
differently then finally there will be separation of concerns.
It will be possible to resolve links to resources e.g. css files,
images when loading HTML files from the local file system in the
package structure in the web directory.

And finally one would be able to use markup refactoring that is
available in today's tools. This is cheap stuff and I am perplexed why
it is not happening. Three lines of code -> better practice.

See https://issues.apache.org/jira/browse/WICKET-2881


Regards

Bernard


On Thu, 3 Jun 2010 08:26:45 -0400, you wrote:

>Hrm, perhaps you should have qualified your advice: "If you're using
>NetBeans, then for best performance..."
>
>Also, the packaging of markup on the classpath allows you to create
>re-usable JARs of components and IMHO is one of the best features of
>Wicket. So perhaps the qualification should really be, "If you're using
>NetBeans, and you're not planning on packaging your Wicket components in
>a re-usable JAR, then for best performance..."
>
>The way your original post is phrased makes it sound like a best
>practice, and it implies the Wicket default to fetch markup from the
>classpath is inferior. I don't think this is a consensus among the
>community.
>
>jk
>
>On Thu, Jun 03, 2010 at 08:57:43PM +1200, b...@actrix.gen.nz wrote:
>> Martijn,
>> 
>> You are making a *lot* of assumptions.
>> 
>> Not everybody uses Eclipse.
>> 
>> Nobody in this thread would consider restarts acceptable, still we are
>> using this subject.
>> 
>> HTML files location has to do with performance in the developing
>> process depending on how the IDE handles the files.
>> 
>> Please advise how to configure the NetBeans IDE to redeploy a HTML
>> file in a Java package in a J2EE app server with the same speed as
>> HTML files in the web directory (milliseconds not seconds).
>> 
>> 
>> Thanks
>> 
>> Bernard
>> 
>> 
>> 
>> 
>> On Sun, 30 May 2010 15:23:09 +0200, you wrote:
>> 
>> >Huh?
>> >
>> >Storing the HTML in the packages has *nothing* to do with requiring
>> >restarts. Only wrongly configured IDEs may cause that.
>> >
>> >If your HTML doesn't get reloaded when you change it, then you should
>> >run Wicket in DEVELOPMENT mode. Also make sure you've configured
>> >Eclipse to copy all resources (not just .properties files)
>> >
>> >The Wicket Quickstart project and using Maven to generate your eclipse
>> >project files (mvn eclipse:eclipse) will configure everything
>> >correctly.
>> >
>> >Martijn
>> >
>> >On Sat, May 29, 2010 at 11:18 PM,   wrote:
>> >> Hi,
>> >>
>> >> For best performance of redeploys in Wicket, consider storing HTML not
>> >> in the Java package structure but in the web directory. So if your IDE
>> >> and app server allow for hot deployment, then HTML changes deploy much
>> >> faster, ie instantly. In your application init(), you add one
>> >> statement
>> >>
>> >> getResourceSettings().addResourceFolder("wicket");
>> >>
>> >> where "wicket" matches the url-pattern in your filter-mapping in
>> >> web.xml.
>> >>
>> >> PLease see https://issues.apache.org/jira/browse/WICKET-2881 for some
>> >> background on how to take this one step further.
>> >>
>> >> Additionally, with GlassFish V3, you get session preservation on hot
>> >> deployment of Java classes.
>> >>
>> >> You can enable "deploy on save" for convenience.
>> >>
>> >> If that is not fast enough, you can run your app in debug mode and hot
>> >> swap classes after save while you are debugging it.
>> >>
>> >> All this comes with the NetBeans IDE. You really don't have to worry
>> >> about this stuff anymore.
>> >>
>> >> Regards
>> >>
>> >> Bernard
>> >>
>> >>
>> >>
>> >> On Sat, 29 May 2010 16:12:46 +0100, you wrote:
>> >>
>> >>>have you tried JRebel? 

Re: Frustrating behavior ... same browser, same war, same tomcat version - different behavior!!!

2010-06-04 Thread Scott Swank
Do you have apache or a load balancer or anything else in the network?
 Is there maybe a simple difference in your httpd.conf pertaining to
sessions?

On Fri, Jun 4, 2010 at 1:32 PM, Bryan Montgomery  wrote:
> Thanks for the ideas. Still no joy.
>
> The behavior is consistent between three different clients, all running
> different versions of IE (6,7 and 8).
> I was able to use the debugging feature built in to IE 8 to see that the
> wicket ajax javascript was gettting called. At some point in that process it
> lost the value of the field and it got set to an empty field.
>
> I have the feeling that there is something different with the environment on
> this particular server - but I have no idea what at this point.
>
> On Fri, Jun 4, 2010 at 1:32 PM, gnul  wrote:
>
>> >
>> > Essentially, part of the process generates dynamic web forms based on xml
>> > configuration files. We noticed that on one of our servers when we
>> deployed
>> > the war file that the fields would not hold their values, and as soon as
>> you
>> > tabbed out, the entry would disappear. Taking the same war file and
>> > deploying it to another server the form acts as expected.
>> >
>>
>> If it works on one server, but not the other, and they are configured
>> the same (meaning same appserver/tomcat version, same jvm, same
>> user/group/perms, etc.), the first thing I do is "clean" the appserver
>> and do a fresh deploy.
>>
>> For example, say you are deploying to /var/lib/tomcat/webapps/, I
>> would shutdown both tomcats, remove the exploded directories (e.g.
>> myapp.war => myapp/ ) and re-deploy the war files to each server.  I
>> would also clean out tomcat's temp directory (e.g.
>> /var/cache/tomcat5/temp), then restart them both.
>>
>>  -gnul
>>
>> -
>> 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: Frustrating behavior ... same browser, same war, same tomcat version - different behavior!!!

2010-06-04 Thread Bryan Montgomery
Thanks for the ideas. Still no joy.

The behavior is consistent between three different clients, all running
different versions of IE (6,7 and 8).
I was able to use the debugging feature built in to IE 8 to see that the
wicket ajax javascript was gettting called. At some point in that process it
lost the value of the field and it got set to an empty field.

I have the feeling that there is something different with the environment on
this particular server - but I have no idea what at this point.

On Fri, Jun 4, 2010 at 1:32 PM, gnul  wrote:

> >
> > Essentially, part of the process generates dynamic web forms based on xml
> > configuration files. We noticed that on one of our servers when we
> deployed
> > the war file that the fields would not hold their values, and as soon as
> you
> > tabbed out, the entry would disappear. Taking the same war file and
> > deploying it to another server the form acts as expected.
> >
>
> If it works on one server, but not the other, and they are configured
> the same (meaning same appserver/tomcat version, same jvm, same
> user/group/perms, etc.), the first thing I do is "clean" the appserver
> and do a fresh deploy.
>
> For example, say you are deploying to /var/lib/tomcat/webapps/, I
> would shutdown both tomcats, remove the exploded directories (e.g.
> myapp.war => myapp/ ) and re-deploy the war files to each server.  I
> would also clean out tomcat's temp directory (e.g.
> /var/cache/tomcat5/temp), then restart them both.
>
>  -gnul
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Problem with Crypted URL

2010-06-04 Thread kugaprakash

Actually I should say, that it is not force re-directing even on using the
recommended approach. It still stays in the same current page. 

Am I doing something wrong here? I tried to remove the finally block
{Session.get().invalidate(); } and moved that code to detach(), still no
success.

Please let me know if there is some thing wrong being done here.

Thanks in Advance.
Kuga
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-with-Crypted-URL-tp1875435p2243721.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



TabbedPanel with AjaxSelfUpdatingTimerBehavior

2010-06-04 Thread Decebal Suiu
Hello

I use AjaxSelfUpdatingTimerBehavior on one tab and when switching to
another tab I want to stop it.
The AjaxSelfUpdatingTimerBehavior will be active only if this tab is
selected (start timer behavior when select the tab and stop it when
select other tab).
Any help is welcome.

Thanks,
Decebal

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



Re: Introduction: restauracie.sk (new project based on Wicket)

2010-06-04 Thread Marek Šabo
Nice one. Bookmarking... :)

--
Marek Šabo



On 06/04/2010 08:46 PM, David Skuben wrote:
> Hello Wicket comunity,
>
> let me introduce the new web project based on Wicket from Slovakia.
>
> Project name is RESTAURACIE.SK and you can find it at http://restauracie.sk.
>
> RESTAURACIE.SK is restaurant guide showcasting restaurant across the
> Slovakia.
> Today we support only slovak locale, but in the future english will be also
> supported.
>
> We are two programmers and we have worked on it for last two years.
>
> I would like to thanks the wicket founders and also all wicket comunity for
> great work with this
> framework.
>
> One more thanks.
>
>   


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



Introduction: restauracie.sk (new project based on Wicket)

2010-06-04 Thread David Skuben
Hello Wicket comunity,

let me introduce the new web project based on Wicket from Slovakia.

Project name is RESTAURACIE.SK and you can find it at http://restauracie.sk.

RESTAURACIE.SK is restaurant guide showcasting restaurant across the
Slovakia.
Today we support only slovak locale, but in the future english will be also
supported.

We are two programmers and we have worked on it for last two years.

I would like to thanks the wicket founders and also all wicket comunity for
great work with this
framework.

One more thanks.


Re: Frustrating behavior ... same browser, same war, same tomcat version - different behavior!!!

2010-06-04 Thread gnul
>
> Essentially, part of the process generates dynamic web forms based on xml
> configuration files. We noticed that on one of our servers when we deployed
> the war file that the fields would not hold their values, and as soon as you
> tabbed out, the entry would disappear. Taking the same war file and
> deploying it to another server the form acts as expected.
>

If it works on one server, but not the other, and they are configured
the same (meaning same appserver/tomcat version, same jvm, same
user/group/perms, etc.), the first thing I do is "clean" the appserver
and do a fresh deploy.

For example, say you are deploying to /var/lib/tomcat/webapps/, I
would shutdown both tomcats, remove the exploded directories (e.g.
myapp.war => myapp/ ) and re-deploy the war files to each server.  I
would also clean out tomcat's temp directory (e.g.
/var/cache/tomcat5/temp), then restart them both.

 -gnul

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



Re: Frustrating behavior ... same browser, same war, same tomcat version - different behavior!!!

2010-06-04 Thread Bryan Montgomery
Yeah, I thought it might be as simple as that - but unfortunately not.

On Fri, Jun 4, 2010 at 12:29 PM, James Carman wrote:

> Have you tried clearing your cache on your browsers?
>
> On Fri, Jun 4, 2010 at 11:57 AM, Bryan Montgomery 
> wrote:
> > Hello,
> > I've been banging my head against the proverbial brick wall for the last
> > day. I have a fairly large web application which I've been modifying part
> > of.
> >
> > Essentially, part of the process generates dynamic web forms based on xml
> > configuration files. We noticed that on one of our servers when we
> deployed
> > the war file that the fields would not hold their values, and as soon as
> you
> > tabbed out, the entry would disappear. Taking the same war file and
> > deploying it to another server the form acts as expected.
> >
> > This has been tried on both ie 7 and ie 8 with the same results.
> >
> > Looking at the html on the browser, it is pretty simple. If I save the
> file
> > to the local machine and replace the relative links with absolute links I
> > can't reproduce the errors - although I do get javascript errors.
> Comparing
> > the html between the working server and the problematic server, the only
> > difference is wicket field references.
> >
> > Comparing the javascript files and ccs files, they are identical. I'm
> > guessing it has something to do with the onblur in the html below - but
> why
> > would it exhibt a different behavior between the servers? I'm not sure
> why
> > we're using ajax there as the page doesn't have any ajax / callback
> features
> > to it as far as I know.
> >
> > Is there some other tomcat setting that could be effecting this?
> Somewhere
> > else I should look?
> >
> > Thanks,
> > Bryan.
> >
> > 
> >
> >
> >   >
> href="../../../../resources/com.abc.reports.page.MainPage/style/nrgWeb.css
> >  http://coned-avl:8080/nrg/app/resources/com.samsix.reports.page.MainPage/style/nrgWeb.css
> >"
> > />
> >
> >  > href='../../../../../favicon_oru.ico
> > http://coned-avl:8080/nrg/favicon_oru.ico>' />
> >
> >  > href='../../../../../favicon_oru.ico
> > http://coned-avl:8080/nrg/favicon_oru.ico>' />
> >
> >  >
> src="../../../../resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
> >  http://coned-avl:8080/nrg/app/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
> >">
> >
> >  >
> src="../../../../resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js
> >  http://coned-avl:8080/nrg/app/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js
> >">
> >
> > 
> >Analysis
> >
> >Single Analysis
> >
> >
> >http://coned-avl:8080/nrg/app/startup>">
> >
> >
> > src="../../../../resources/org.apache.wicket.Application/back_button
> >  http://coned-avl:8080/nrg/app/resources/org.apache.wicket.Application/back_button
> >"
> > border="0"/>
> >
> > 
> >
> > 
> >
> >
> >Analysis
> >Single pass analysis.
> >
> >
> >
> > 
> > >
> action="../../../../?wicket:interface=:7:queryForm::IFormSubmitListener::"> > style="display:none"> > id="queryForm7_hf_0" />
> >
> >  
> >
> >  
> >Circuit
> >
> >  
> >
> >  
> > > id="circuitField8" onblur="var
> >
> wcall=wicketAjaxPost('../../../../?wicket:interface=:7:queryForm:circuitField::IBehaviorListener:0:4',
> > wicketSerialize(Wicket.$('circuitField8')),null,null, function()
> > {return Wicket.$('circuitField8') != null;}.bind(this));"/>
> >
> >  
> >
> >
> >  
> >Segment
> >
> >  
> >
> >  
> > > id="segmentField9" onblur="var
> >
> wcall=wicketAjaxPost('../../../../?wicket:interface=:7:queryForm:segmentField::IBehaviorListener:0:4',
> > wicketSerialize(Wicket.$('segmentField9')),null,null, function()
> > {return Wicket.$('segmentField9') != null;}.bind(this));"/>
> >
> >  
> >
> >
> >  
> >
> >  
> >
> >
> >  
> >
> >  
> >
> >
> >  
> > 
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Frustrating behavior ... same browser, same war, same tomcat version - different behavior!!!

2010-06-04 Thread James Carman
Have you tried clearing your cache on your browsers?

On Fri, Jun 4, 2010 at 11:57 AM, Bryan Montgomery  wrote:
> Hello,
> I've been banging my head against the proverbial brick wall for the last
> day. I have a fairly large web application which I've been modifying part
> of.
>
> Essentially, part of the process generates dynamic web forms based on xml
> configuration files. We noticed that on one of our servers when we deployed
> the war file that the fields would not hold their values, and as soon as you
> tabbed out, the entry would disappear. Taking the same war file and
> deploying it to another server the form acts as expected.
>
> This has been tried on both ie 7 and ie 8 with the same results.
>
> Looking at the html on the browser, it is pretty simple. If I save the file
> to the local machine and replace the relative links with absolute links I
> can't reproduce the errors - although I do get javascript errors. Comparing
> the html between the working server and the problematic server, the only
> difference is wicket field references.
>
> Comparing the javascript files and ccs files, they are identical. I'm
> guessing it has something to do with the onblur in the html below - but why
> would it exhibt a different behavior between the servers? I'm not sure why
> we're using ajax there as the page doesn't have any ajax / callback features
> to it as far as I know.
>
> Is there some other tomcat setting that could be effecting this? Somewhere
> else I should look?
>
> Thanks,
> Bryan.
>
> 
>
>
>   href="../../../../resources/com.abc.reports.page.MainPage/style/nrgWeb.css
> http://coned-avl:8080/nrg/app/resources/com.samsix.reports.page.MainPage/style/nrgWeb.css>"
> />
>
>  href='../../../../../favicon_oru.ico
> http://coned-avl:8080/nrg/favicon_oru.ico>' />
>
>  href='../../../../../favicon_oru.ico
> http://coned-avl:8080/nrg/favicon_oru.ico>' />
>
>  src="../../../../resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js
> http://coned-avl:8080/nrg/app/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js>">
>
>  src="../../../../resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js
> http://coned-avl:8080/nrg/app/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js>">
>
> 
>    Analysis
>
>    Single Analysis
>    
>
>    http://coned-avl:8080/nrg/app/startup>">
>
>        
>         src="../../../../resources/org.apache.wicket.Application/back_button
> http://coned-avl:8080/nrg/app/resources/org.apache.wicket.Application/back_button>"
> border="0"/>
>
> 
>    
> 
>    
>
>    Analysis
>    Single pass analysis.
>
>    
>
> 
>     action="../../../../?wicket:interface=:7:queryForm::IFormSubmitListener::"> style="display:none"> id="queryForm7_hf_0" />
>
>      
>        
>          
>            Circuit
>
>          
>
>          
>             id="circuitField8" onblur="var
> wcall=wicketAjaxPost('../../../../?wicket:interface=:7:queryForm:circuitField::IBehaviorListener:0:4',
> wicketSerialize(Wicket.$('circuitField8')),null,null, function()
> {return Wicket.$('circuitField8') != null;}.bind(this));"/>
>
>          
>        
>        
>          
>            Segment
>
>          
>
>          
>             id="segmentField9" onblur="var
> wcall=wicketAjaxPost('../../../../?wicket:interface=:7:queryForm:segmentField::IBehaviorListener:0:4',
> wicketSerialize(Wicket.$('segmentField9')),null,null, function()
> {return Wicket.$('segmentField9') != null;}.bind(this));"/>
>
>          
>        
>        
>              
>
>          
>            
>
>          
>        
>      
>    
>
>  
> 
>

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



TextField that renders a link

2010-06-04 Thread Josh Chappelle
Does anyone know of a TextField component or perhaps a Behavior that can be
added to a TextField that will render a link when the user types a URL into
it?

 

Thanks,

 

Josh



Frustrating behavior ... same browser, same war, same tomcat version - different behavior!!!

2010-06-04 Thread Bryan Montgomery
Hello,
I've been banging my head against the proverbial brick wall for the last
day. I have a fairly large web application which I've been modifying part
of.

Essentially, part of the process generates dynamic web forms based on xml
configuration files. We noticed that on one of our servers when we deployed
the war file that the fields would not hold their values, and as soon as you
tabbed out, the entry would disappear. Taking the same war file and
deploying it to another server the form acts as expected.

This has been tried on both ie 7 and ie 8 with the same results.

Looking at the html on the browser, it is pretty simple. If I save the file
to the local machine and replace the relative links with absolute links I
can't reproduce the errors - although I do get javascript errors. Comparing
the html between the working server and the problematic server, the only
difference is wicket field references.

Comparing the javascript files and ccs files, they are identical. I'm
guessing it has something to do with the onblur in the html below - but why
would it exhibt a different behavior between the servers? I'm not sure why
we're using ajax there as the page doesn't have any ajax / callback features
to it as far as I know.

Is there some other tomcat setting that could be effecting this? Somewhere
else I should look?

Thanks,
Bryan.




  http://coned-avl:8080/nrg/app/resources/com.samsix.reports.page.MainPage/style/nrgWeb.css>"
/>





http://coned-avl:8080/nrg/app/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js>">

http://coned-avl:8080/nrg/app/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js>">


Analysis

Single Analysis


http://coned-avl:8080/nrg/app/startup>">


http://coned-avl:8080/nrg/app/resources/org.apache.wicket.Application/back_button>"
border="0"/>






Analysis
Single pass analysis.






  

  
Circuit

  

  


  


  
Segment

  

  


  


  

  


  

  


  



[wicketstuff-core] planning a 1.4.9.1 point release next week.

2010-06-04 Thread Michael O'Cleirigh

Hello,

For release I'm doing at work I need to generate a wicketstuff-core 
1.4.9.1 release.


I see that there have been some updates to trunk (1.4.10-SNAPSHOT) so if 
you would like these changes to be included in the this point release 
please back port your changes to the 1.4.9 branch.


I've also just turned on snapshot building (through my Hudson instance) 
for the 1.4.9.1-SNAPSHOT and the 1.4.8.1-SNAPSHOT versions and they are 
being deployed into the oss.sonatype.org snapshot repository.  The 
polling is every 15 minutes (at 0:15:30:45) just like with trunk.


The 1.4.9 wicketstuff-core branch is here: 
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicketstuff-core-1.4.9/


Probably I am going to cut the point release on Thursday or Friday next 
week.


Regards,

Mike






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



RE: drag and drop

2010-06-04 Thread DerBernd

Ok, thank you,
good to know. At the moment I don't need to watch the dragStop or DragStart
Event. So I can leave it as it is.





-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2243182.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



Re: Javascript string formatting problem with DateTextField and DatePicker

2010-06-04 Thread Jimi

Thanks Igor. I was already running 1.4.7, but I just upgraded to 1.4.9 and
that solved the problem. But strange that the bugfix wasn't mentioned on the
http://wicket.apache.org/news.html page.

Regards
/Jimi


Igor Vaynberg-2 wrote:
> 
> i think this is fixed in 1.4.7+, you should upgrade
> 



-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Javascript-string-formatting-problem-with-DateTextField-and-DatePicker-tp2241433p2243120.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



Re: Image subclass not getting its model object

2010-06-04 Thread Ernesto Reinaldo Barreiro
Hi Erwin,

On Fri, Jun 4, 2010 at 1:03 PM, Erwin Bolwidt  wrote:
> Hi Ernesto,
>
> Just got the 1.4.9 source code and I see what you mean.

As a rule I always install the source code of any OpenSouce software I
use: Javadoc could be wrong or outdated but source code will never
mislead you;-)

> But why is it like this?
> I copied the whole Image source code to a new class, removed this initModel
> method, and then things work fine if I don't supply a model.
>

Sorry Erwin but i don't know why this decision was taken... I just did
the same as you did: look into the source code and figured out this
was the reason. Maybe some of the core developers can comment on this?
Or if you think your  use case is a valid one just file a RFE on
wicket site.

Best,

Ernesto

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



Renderer does not work when datePicker is initially displayed

2010-06-04 Thread rawe

I`m using  a renderer to work with the OutOfBoundsDate,
but it doesn't work when the DatePicker is initially displayed. 
When I do some action in the DatePicker (e.g. change the month) the
OutOfBoundsDate is correctly rendered (here sundays and saturdays are
disabled)

e.g. I disable the weekend days, so I override the method
getAdditionalJavascript():

@Override
protected String getAdditionalJavascript() {
if (additionalJavascript == null)
additionalJavascript = "";

additionalJavascript += "${calendar}.addWeekdayRenderer(1,
${calendar}.renderOutOfBoundsDate);"; // disable sundays
additionalJavascript += "${calendar}.addWeekdayRenderer(7,
${calendar}.renderOutOfBoundsDate);"; // disable saturdays

return additionalJavascript;
}

Thanks for any help!

rawe
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Renderer-does-not-work-when-datePicker-is-initially-displayed-tp2243041p2243041.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



Re: Image subclass not getting its model object

2010-06-04 Thread James Carman
I would say you need to use your own image resource, not subclass Image itself.

On Fri, Jun 4, 2010 at 7:03 AM, Erwin Bolwidt  wrote:
> Hi Ernesto,
>
> Just got the 1.4.9 source code and I see what you mean.
> But why is it like this?
> I copied the whole Image source code to a new class, removed this initModel
> method, and then things work fine if I don't supply a model.
>
> Why would the Image component behave different from the other components?
> This isn't documented in the Javadoc so I didn't expect this, but even then,
> what is the need for making Image work differently than others like Label?
>
> I can think of some usecases where it is fine to display in image that is
> derived from some property on a domain object that is accessed with a
> CompoundPropertyModel:
>
> - when you have a Boolean (like here) or Enum-type property and you want to
> change the image depending on its value
> - when you have want to dynamically generate an image with some text (on top
> of a template image), the image is much like a label then
>
> I can't disable this initModel behavior in a subclass, since you can't call
> super.super.initModel, so to disable this behavior, I have to copy the whole
> source of the Image class and remove this method.
>
> That seems like "waste" and you're not benefiting from future improvements
> in the Image class then.
>
> Cheers,
>  Erwin Bolwidt
>
> On 6/4/10 9:33 AM, Ernesto Reinaldo Barreiro wrote:
>>
>> Maybe this is related to this override on Image class?
>>
>> @Override
>>        protected IModel  initModel()
>>        {
>>                // Images don't support Compound models. They either have a
>> simple
>>                // model, explicitly set, or they use their tag's src or
>> value
>>                // attribute to determine the image.
>>                return null;
>>        }
>>
>> Ernesto
>>
>>
>> On Fri, Jun 4, 2010 at 9:30 AM, Erwin Bolwidt
>>  wrote:
>>
>>>
>>> Oops, I went a bit too far in pruning non-essential code.
>>>
>>> InStockIconImage has a second constructor:
>>>
>>>    public InStockIconImage(String id) {
>>>        super(id);
>>>    }
>>>
>>> I think it centers around this. If I pass a PropertyModel(listingModel,
>>> "inStock") explicitly to the constructor, it works, but not if I depend
>>> on
>>> the automatic property resolution that works well if I use a Label.
>>>
>>> How can I get it to work if I don't want to pass a PropertyModel
>>> explicitly?
>>>
>>> Erwin
>>>
>>> On 6/4/10 9:15 AM, Erwin Bolwidt wrote:
>>>

 Hi,

 I'm trying to make an image subclass that shows an icon. Which icon it
 shows depends on its model object, which is a boolean. Problem is,  I'm
 not
 getting the model object: it's always null. If I use a Label instead of
 InStockIconImage, it works: the label shows a boolean (true/false).

 Any idea what could cause this?

 Thanks,
  Erwin


 Here's the icon:

 public class InStockIconImage extends Image {
    private static final String PATH_IN_STOCK = "in_stock.png";
    private static final String PATH_NOT_IN_STOCK = "not_in_stock.png";
    private static final String PATH_NO_MODEL_OBJECT = "empty.png";

    public InStockIconImage(String id, IModel  model) {
        super(id, model);
    }

   �...@override
    protected ResourceReference getImageResourceReference() {
        Boolean inStock = (Boolean) getDefaultModelObject();
        String path;
        if (inStock == null) {
            path = PATH_NO_MODEL_OBJECT;
        } else if (inStock) {
            path = PATH_IN_STOCK;
        } else {
            path = PATH_NOT_IN_STOCK;
        }
        return new ResourceReference(Icons.class, path);
    }
 }

 Here's how I use it:

        RefreshingListView  listingRepeater = new
 RefreshingListView(
                "listing", new
 PropertyModel>(getModel(), "listings")) {
           �...@override
            protected void populateItem(Item  item) {
                item.add(new Label("webShop.name"));
                item.add(new Label("price"));
                item.add(new InStockIconImage("inStock"));
            }
        };
        add(listingRepeater);

 RefreshingListView is a utility class which decorates a normal
 RefreshingView:

 public abstract class RefreshingListView  extends RefreshingView
  {

    public RefreshingListView(String id) {
        super(id);
    }

    public RefreshingListView(String id, IModel>
 model) {
        super(id, model);
    }

   �...@override
    protected Iterator>  getItemModels() {
        Collection  modelObject = getModelObject();
        if (modelObject == null) {
            modelObject = new ArrayList();
        }
        return new ModelIteratorAdapter(modelObject.i

Re: Image subclass not getting its model object

2010-06-04 Thread Erwin Bolwidt

Hi Ernesto,

Just got the 1.4.9 source code and I see what you mean.
But why is it like this?
I copied the whole Image source code to a new class, removed this 
initModel method, and then things work fine if I don't supply a model.


Why would the Image component behave different from the other 
components? This isn't documented in the Javadoc so I didn't expect 
this, but even then, what is the need for making Image work differently 
than others like Label?


I can think of some usecases where it is fine to display in image that 
is derived from some property on a domain object that is accessed with a 
CompoundPropertyModel:


- when you have a Boolean (like here) or Enum-type property and you want 
to change the image depending on its value
- when you have want to dynamically generate an image with some text (on 
top of a template image), the image is much like a label then


I can't disable this initModel behavior in a subclass, since you can't 
call super.super.initModel, so to disable this behavior, I have to copy 
the whole source of the Image class and remove this method.


That seems like "waste" and you're not benefiting from future 
improvements in the Image class then.


Cheers,
  Erwin Bolwidt

On 6/4/10 9:33 AM, Ernesto Reinaldo Barreiro wrote:

Maybe this is related to this override on Image class?

@Override
protected IModel  initModel()
{
// Images don't support Compound models. They either have a 
simple
// model, explicitly set, or they use their tag's src or value
// attribute to determine the image.
return null;
}

Ernesto


On Fri, Jun 4, 2010 at 9:30 AM, Erwin Bolwidt  wrote:
   

Oops, I went a bit too far in pruning non-essential code.

InStockIconImage has a second constructor:

public InStockIconImage(String id) {
super(id);
}

I think it centers around this. If I pass a PropertyModel(listingModel,
"inStock") explicitly to the constructor, it works, but not if I depend on
the automatic property resolution that works well if I use a Label.

How can I get it to work if I don't want to pass a PropertyModel explicitly?

Erwin

On 6/4/10 9:15 AM, Erwin Bolwidt wrote:
 

Hi,

I'm trying to make an image subclass that shows an icon. Which icon it
shows depends on its model object, which is a boolean. Problem is,  I'm not
getting the model object: it's always null. If I use a Label instead of
InStockIconImage, it works: the label shows a boolean (true/false).

Any idea what could cause this?

Thanks,
  Erwin


Here's the icon:

public class InStockIconImage extends Image {
private static final String PATH_IN_STOCK = "in_stock.png";
private static final String PATH_NOT_IN_STOCK = "not_in_stock.png";
private static final String PATH_NO_MODEL_OBJECT = "empty.png";

public InStockIconImage(String id, IModel  model) {
super(id, model);
}

@Override
protected ResourceReference getImageResourceReference() {
Boolean inStock = (Boolean) getDefaultModelObject();
String path;
if (inStock == null) {
path = PATH_NO_MODEL_OBJECT;
} else if (inStock) {
path = PATH_IN_STOCK;
} else {
path = PATH_NOT_IN_STOCK;
}
return new ResourceReference(Icons.class, path);
}
}

Here's how I use it:

RefreshingListView  listingRepeater = new
RefreshingListView(
"listing", new
PropertyModel>(getModel(), "listings")) {
@Override
protected void populateItem(Item  item) {
item.add(new Label("webShop.name"));
item.add(new Label("price"));
item.add(new InStockIconImage("inStock"));
}
};
add(listingRepeater);

RefreshingListView is a utility class which decorates a normal
RefreshingView:

public abstract class RefreshingListView  extends RefreshingView  {

public RefreshingListView(String id) {
super(id);
}

public RefreshingListView(String id, IModel>
model) {
super(id, model);
}

@Override
protected Iterator>  getItemModels() {
Collection  modelObject = getModelObject();
if (modelObject == null) {
modelObject = new ArrayList();
}
return new ModelIteratorAdapter(modelObject.iterator()) {
@Override
protected IModel  model(T object) {
return new CompoundPropertyModel(object);
}
};
}

public Collection  getModelObject() {
return getModel().getObject();
}

@SuppressWarnings("unchecked")
public IModel>  getModel() {
return (IModel>) getDefaultModel();
}

}

   


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



Re: How can override calendar formatting at initialization using DatePicker? getAdditionalJavascript not always working...

2010-06-04 Thread rawe

I got the same problem!
Did you solve it already?
If yes, I would be glad to get some help!

I just disabled the weekend days in DatePicker by overriding the method

@Override
protected String getAdditionalJavascript() {

additionalJavascript += "${calendar}.addWeekdayRenderer(1,
${calendar}.renderOutOfBoundsDate);"; // disable sundays
additionalJavascript += "${calendar}.addWeekdayRenderer(7,
${calendar}.renderOutOfBoundsDate);"; // disable saturdays

return additionalJavascript;
}

It works, but not when displaying the DatePicker first time. Just after I
did some action in it. (e.g. changing the month)

Thank you!

Ralph

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-can-override-calendar-formatting-at-initialization-using-DatePicker-getAdditionalJavascript-not--tp1880352p2243002.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



RE: drag and drop

2010-06-04 Thread Stefan Lindner
This is a general Ajax problem. The ajax calls fired by the jQuery handlers 
dragStart/drag/dragEnd are not sychronized with each other. So it may happen 
that the onDrop event of the droppable is fired BEFORE the dragEnd.
In the onDrop method you replace the dragged component wit a new one (redrawing 
your repeaters).
Then, afterwards, the dragStop event occurs and your component no longer exists.
If you really need to watch teh dragStop in addition to the onDrop, you need to 
synchronize your actions. This means you have to wait for the onDrop response 
BEFORE you redraw you components or in othe rwords: move the onDrop code to the 
onDragEnd.

Sorry, but this is a general problem that can't be fixed in jWicket.

Stefan

-Ursprüngliche Nachricht-
Von: DerBernd [mailto:beha...@web.de] 
Gesendet: Freitag, 4. Juni 2010 11:36
An: users@wicket.apache.org
Betreff: RE: drag and drop


So here is my Example Case
I have several "Platzhalter" which implement IDroppable and some
"FeldKurs"Objects which implement IDraggable. The FeldKurs Components are 
dragged on Placeholders.

When I define
dragger.setWantOnDragStartNotification(true);
dragger.setWantOnDragStopNotification(true);
there occurs an error like:
"WicketMessage: org.apache.wicket.WicketRuntimeException: component
panelInhalt:listPanel:panelWochenplanung:platzhalter_t0r0:listPanel:feldKurs101
not found on page kursa.wochenplanung.WochenplanungPage[id = 3], listener
interface = [RequestListenerInterface name=IBehaviorListener, method=public
abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()]"


When I set them false or don't even set anything (default) the error doesn't
occur

Heres the code

public class Platzhalter extends Panel implements IDroppable{

...
private final RepeatingView listPanel;

public void onDrop(AjaxRequestTarget target, Component draggedComponent,
SpecialKeys specialKeys) {
this.listPanel.add(draggedComponent);
WochenplanungPage wochenplanungPage = 
findParent(WochenplanungPage.class);
  // Parent Page of Platzhalter
target.addComponent(wochenplanungPage);
}
}


public class FeldKurs extends Panel implements IDraggable{
...

public FeldKurs(String id, Kurs kurs) {
super(id);
this.kurs = kurs;
dragger = new DraggableBehavior();
dragger.setRevert(DraggableBehavior.DragRevertMode.INVALID);
dragger.setDistance(20);
dragger.setOpacity(0.99);
  dragger.setName("one");
dragger.setWantOnDragStartNotification(true);
dragger.setWantOnDragStopNotification(true);
dragger.setCursor(CssCursor.MOVE);
add(dragger);

}
...
}




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2242938.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



Re: AW: drag and drop

2010-06-04 Thread DerBernd

Thank you setRawOptions("handle: 'h2'"); works great, just want I was
searching for!!!

Bernd
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2242954.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



RE: drag and drop

2010-06-04 Thread DerBernd

So here is my Example Case
I have several "Platzhalter" which implement IDroppable and some
"FeldKurs"Objects which implement IDraggable. The FeldKurs Components are 
dragged on Placeholders.

When I define
dragger.setWantOnDragStartNotification(true);
dragger.setWantOnDragStopNotification(true);
there occurs an error like:
"WicketMessage: org.apache.wicket.WicketRuntimeException: component
panelInhalt:listPanel:panelWochenplanung:platzhalter_t0r0:listPanel:feldKurs101
not found on page kursa.wochenplanung.WochenplanungPage[id = 3], listener
interface = [RequestListenerInterface name=IBehaviorListener, method=public
abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()]"


When I set them false or don't even set anything (default) the error doesn't
occur

Heres the code

public class Platzhalter extends Panel implements IDroppable{

...
private final RepeatingView listPanel;

public void onDrop(AjaxRequestTarget target, Component draggedComponent,
SpecialKeys specialKeys) {
this.listPanel.add(draggedComponent);
WochenplanungPage wochenplanungPage = 
findParent(WochenplanungPage.class);
  // Parent Page of Platzhalter
target.addComponent(wochenplanungPage);
}
}


public class FeldKurs extends Panel implements IDraggable{
...

public FeldKurs(String id, Kurs kurs) {
super(id);
this.kurs = kurs;
dragger = new DraggableBehavior();
dragger.setRevert(DraggableBehavior.DragRevertMode.INVALID);
dragger.setDistance(20);
dragger.setOpacity(0.99);
  dragger.setName("one");
dragger.setWantOnDragStartNotification(true);
dragger.setWantOnDragStopNotification(true);
dragger.setCursor(CssCursor.MOVE);
add(dragger);

}
...
}




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2242938.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



AW: drag and drop

2010-06-04 Thread Stefan Lindner
Look into the original jQuery docs for draggable and set any options that are 
not implementet now with

setRawOptions("handle: 'h2'");

This should do the trick. If you have any suggestion for implementing a

setHandle(???)

method that doesn't simple have a String parameter, please let me know.

Stefan

-Ursprüngliche Nachricht-
Von: DerBernd [mailto:beha...@web.de] 
Gesendet: Freitag, 4. Juni 2010 11:14
An: users@wicket.apache.org
Betreff: Re: drag and drop


No I have a absolutely specific question to jwicket-jquery.

I want to set the "handle" option on a draggable, to define the tag which is
used to drag the panel. 
e.g. handle: 'h2'

Unfortunately theres no setter for the handle option.


Thank you

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2242910.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



Re: Unit Test InMethod DataGrid

2010-06-04 Thread Ronan O'Connell

Thank you very much Nino and Kent,

I've read about Wicketpagetest before and I've been planning to try it 
out. Looks like now is my chance :-)


Ronan

On 04/06/2010 02:16, Kent Tong wrote:

Hi Ronan,

Looking at the output of WicketTester.debugComponentTrees() I can see 
that the grid row is the deepest level with a wicket id:

...
panel:storyGrid:form:bodyContainer:body:row:2:item 
com.inmethod.grid.common.AbstractGridRow


If you use http://wicketpagetest.sourceforge.net, then you can test
it easily like:

   Selenium s = ...;
   assert 
s.getText("wicket=//storyGrid//body//row[2]//item[3]").equals("foo";


In this example you're checking the the 3rd cell in the 2nd row (both
are 0-based).




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



DataTable in DataTable

2010-06-04 Thread midikem

Hi is it possible to add a dataTable in a DataTable and how?
I have a dataTable and when i press on a line in it i want a new dataTable
to popup
below the line i have pressed. How do i do this?
I have a DefaultDataTable("dataTable", columns, provider, 10)
where i have added the columns to a arrayList.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DataTable-in-DataTable-tp2242922p2242922.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



RE: drag and drop

2010-06-04 Thread Stefan Lindner
The default value for both is false! The code:

private boolean onDragStartNotificationWanted = false;
/**
 * If set to {...@code true}, the callback-Method {...@link 
#onDragStart(AjaxRequestTarget,SpecialKeys)} 
 * is called when the drag operation starts.
 * @param value {...@code true} or {...@code false}.
 * @return this object
 */
public DraggableBehavior setWantOnDragStartNotification(final boolean 
value) {
onDragStartNotificationWanted = value;
return this;
}

So I can't see any side effect of calling

wantOnDragStartNotification(false);

There must be some other strange situation.

Stefan

-Ursprüngliche Nachricht-
Von: DerBernd [mailto:beha...@web.de] 
Gesendet: Freitag, 4. Juni 2010 11:06
An: users@wicket.apache.org
Betreff: Re: drag and drop


Thank you for your help. 
So I solved it by using repeaters "RepeatingView".
On DropEvent I add the droppedComponent to the repeating view and update the
page.
I also had to set wantOnDragStartNotification(false),
wantOnDragStopNotification(false), otherwise the dropped Component was not
found on page - don't know really why




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2242897.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



Re: drag and drop

2010-06-04 Thread DerBernd

No I have a absolutely specific question to jwicket-jquery.

I want to set the "handle" option on a draggable, to define the tag which is
used to drag the panel. 
e.g. handle: 'h2'

Unfortunately theres no setter for the handle option.


Thank you

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2242910.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



RE: drag and drop

2010-06-04 Thread Stefan Lindner
Could you provide a small testcase? I'm using d&d very intensive in a calendar 
app and never had any problems with this.

Stefan

-Ursprüngliche Nachricht-
Von: DerBernd [mailto:beha...@web.de] 
Gesendet: Freitag, 4. Juni 2010 11:06
An: users@wicket.apache.org
Betreff: Re: drag and drop


Thank you for your help. 
So I solved it by using repeaters "RepeatingView".
On DropEvent I add the droppedComponent to the repeating view and update the
page.
I also had to set wantOnDragStartNotification(false),
wantOnDragStopNotification(false), otherwise the dropped Component was not
found on page - don't know really why




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2242897.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



Re: drag and drop

2010-06-04 Thread DerBernd

Thank you for your help. 
So I solved it by using repeaters "RepeatingView".
On DropEvent I add the droppedComponent to the repeating view and update the
page.
I also had to set wantOnDragStartNotification(false),
wantOnDragStopNotification(false), otherwise the dropped Component was not
found on page - don't know really why




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/drag-and-drop-tp1881857p2242897.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



Re: Dialog involving multiple pages and a VO: some best practices?

2010-06-04 Thread Joseph Pachod

Igor Vaynberg wrote:

usually i simply allow pages to take models of whatever it is they
need, just like any other component. in case of a dto being passed
around you can simply use the default model: new Model(new
Dto()); and pass that to any page. that way the page does not need to
worry about where the objects comes from or how to store it.

-igor
As answered to Maruo, is there any "dragon lurking" there, with some 
return page de serialized instance's references pointing to some other 
reference that the one behind the current model being given around ?


I was somehow under the impression it was kind of risky...

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



Re: Dialog involving multiple pages and a VO: some best practices?

2010-06-04 Thread Joseph Pachod

Mauro Ciancio wrote:

Hi,

On Wed, Jun 2, 2010 at 7:43 PM, Joseph Pachod
 wrote:
  

I've recently been wondering about the following use case: an instance of Foo 
class,
used as a detached value object, is edited in a FooEditPage. For some reasons, 
let's
say this page then needs to launch dialogs spanning over different pages. Each 
of
these pages could then change some fields of the VO being passed around.



  Have you taken a look to wicket-wizards?
http://www.wicket-library.com/wicket-examples/wizard/
  

not yet ;)

I thought this wizard widget wouldn't spread on multiple pages. I'll 
look closer then :)

in fact, I mainly wonder about the pages' serialization... are there some 
pitfalls to avoid ?



  If you have to track the object's state through several pages,
you'll need a serializable
object, because reloading it using a LDM in every request will throw
away all the changes
made before.
  So, your Foo must implement Serializable, or you could create some
proxy object that
tracks the changes and when the user finish the editing process, apply
the changes to
the real model object.
  

yep, for sure the VO is Serializable.

But is there any "dragon lurking" there, with some return page de 
serialized instance's references pointing to some other reference that 
the one behind the current model being given around ?



thanks a lot !

best
joseph

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



Re: SV: Dialog involving multiple pages and a VO: some best practices?

2010-06-04 Thread Joseph Pachod

Wilhelmsen Tor Iver wrote:

I've recently been wondering about the following use case: an instance
of Foo class, used as a detached value object, is edited in a
FooEditPage. For some reasons, let's say this page then needs to launch
dialogs spanning over different pages. Each of these pages could then
change some fields of the VO being passed around.



Sharing between pages is easier done by placing it in the Session which is 
accessible from all of them.

- Tor Iver
  

Thanks for the answer.

However, Mauro put forward some of the issues it raised, the one with 2 
browser windows.


I would add as well that would have to care about the cleanup of this 
stuff, because having it session's scoped would be enough IMHO (if the 
user is editing heavily), it would have to be linked to the action 
completeness.
Then, putting the VO directly in the Session spoils the memory 
consumption, so you would probably, on top of that, want to put it in 
some dedicated datastore.


In the end, I feel it to be quite error prone. Did you try it already ? 
I would welcome some feedback :$


:)

cheers
joseph



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



Re: Image subclass not getting its model object

2010-06-04 Thread Ernesto Reinaldo Barreiro
Maybe this is related to this override on Image class?

@Override
protected IModel initModel()
{
// Images don't support Compound models. They either have a 
simple
// model, explicitly set, or they use their tag's src or value
// attribute to determine the image.
return null;
}

Ernesto


On Fri, Jun 4, 2010 at 9:30 AM, Erwin Bolwidt  wrote:
> Oops, I went a bit too far in pruning non-essential code.
>
> InStockIconImage has a second constructor:
>
>    public InStockIconImage(String id) {
>        super(id);
>    }
>
> I think it centers around this. If I pass a PropertyModel(listingModel,
> "inStock") explicitly to the constructor, it works, but not if I depend on
> the automatic property resolution that works well if I use a Label.
>
> How can I get it to work if I don't want to pass a PropertyModel explicitly?
>
> Erwin
>
> On 6/4/10 9:15 AM, Erwin Bolwidt wrote:
>>
>> Hi,
>>
>> I'm trying to make an image subclass that shows an icon. Which icon it
>> shows depends on its model object, which is a boolean. Problem is,  I'm not
>> getting the model object: it's always null. If I use a Label instead of
>> InStockIconImage, it works: the label shows a boolean (true/false).
>>
>> Any idea what could cause this?
>>
>> Thanks,
>>  Erwin
>>
>>
>> Here's the icon:
>>
>> public class InStockIconImage extends Image {
>>    private static final String PATH_IN_STOCK = "in_stock.png";
>>    private static final String PATH_NOT_IN_STOCK = "not_in_stock.png";
>>    private static final String PATH_NO_MODEL_OBJECT = "empty.png";
>>
>>    public InStockIconImage(String id, IModel model) {
>>        super(id, model);
>>    }
>>
>>   �...@override
>>    protected ResourceReference getImageResourceReference() {
>>        Boolean inStock = (Boolean) getDefaultModelObject();
>>        String path;
>>        if (inStock == null) {
>>            path = PATH_NO_MODEL_OBJECT;
>>        } else if (inStock) {
>>            path = PATH_IN_STOCK;
>>        } else {
>>            path = PATH_NOT_IN_STOCK;
>>        }
>>        return new ResourceReference(Icons.class, path);
>>    }
>> }
>>
>> Here's how I use it:
>>
>>        RefreshingListView listingRepeater = new
>> RefreshingListView(
>>                "listing", new
>> PropertyModel>(getModel(), "listings")) {
>>           �...@override
>>            protected void populateItem(Item item) {
>>                item.add(new Label("webShop.name"));
>>                item.add(new Label("price"));
>>                item.add(new InStockIconImage("inStock"));
>>            }
>>        };
>>        add(listingRepeater);
>>
>> RefreshingListView is a utility class which decorates a normal
>> RefreshingView:
>>
>> public abstract class RefreshingListView extends RefreshingView {
>>
>>    public RefreshingListView(String id) {
>>        super(id);
>>    }
>>
>>    public RefreshingListView(String id, IModel>
>> model) {
>>        super(id, model);
>>    }
>>
>>   �...@override
>>    protected Iterator> getItemModels() {
>>        Collection modelObject = getModelObject();
>>        if (modelObject == null) {
>>            modelObject = new ArrayList();
>>        }
>>        return new ModelIteratorAdapter(modelObject.iterator()) {
>>           �...@override
>>            protected IModel model(T object) {
>>                return new CompoundPropertyModel(object);
>>            }
>>        };
>>    }
>>
>>    public Collection getModelObject() {
>>        return getModel().getObject();
>>    }
>>
>>   �...@suppresswarnings("unchecked")
>>    public IModel> getModel() {
>>        return (IModel>) getDefaultModel();
>>    }
>>
>> }
>>
>>
>> -
>> 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: Image subclass not getting its model object

2010-06-04 Thread Erwin Bolwidt

Oops, I went a bit too far in pruning non-essential code.

InStockIconImage has a second constructor:

public InStockIconImage(String id) {
super(id);
}

I think it centers around this. If I pass a PropertyModel(listingModel, 
"inStock") explicitly to the constructor, it works, but not if I depend 
on the automatic property resolution that works well if I use a Label.


How can I get it to work if I don't want to pass a PropertyModel explicitly?

Erwin

On 6/4/10 9:15 AM, Erwin Bolwidt wrote:

Hi,

I'm trying to make an image subclass that shows an icon. Which icon it 
shows depends on its model object, which is a boolean. Problem is,  
I'm not getting the model object: it's always null. If I use a Label 
instead of InStockIconImage, it works: the label shows a boolean 
(true/false).


Any idea what could cause this?

Thanks,
  Erwin


Here's the icon:

public class InStockIconImage extends Image {
private static final String PATH_IN_STOCK = "in_stock.png";
private static final String PATH_NOT_IN_STOCK = "not_in_stock.png";
private static final String PATH_NO_MODEL_OBJECT = "empty.png";

public InStockIconImage(String id, IModel model) {
super(id, model);
}

@Override
protected ResourceReference getImageResourceReference() {
Boolean inStock = (Boolean) getDefaultModelObject();
String path;
if (inStock == null) {
path = PATH_NO_MODEL_OBJECT;
} else if (inStock) {
path = PATH_IN_STOCK;
} else {
path = PATH_NOT_IN_STOCK;
}
return new ResourceReference(Icons.class, path);
}
}

Here's how I use it:

RefreshingListView listingRepeater = new 
RefreshingListView(
"listing", new 
PropertyModel>(getModel(), "listings")) {

@Override
protected void populateItem(Item item) {
item.add(new Label("webShop.name"));
item.add(new Label("price"));
item.add(new InStockIconImage("inStock"));
}
};
add(listingRepeater);

RefreshingListView is a utility class which decorates a normal 
RefreshingView:


public abstract class RefreshingListView extends RefreshingView {

public RefreshingListView(String id) {
super(id);
}

public RefreshingListView(String id, IModelCollection> model) {

super(id, model);
}

@Override
protected Iterator> getItemModels() {
Collection modelObject = getModelObject();
if (modelObject == null) {
modelObject = new ArrayList();
}
return new ModelIteratorAdapter(modelObject.iterator()) {
@Override
protected IModel model(T object) {
return new CompoundPropertyModel(object);
}
};
}

public Collection getModelObject() {
return getModel().getObject();
}

@SuppressWarnings("unchecked")
public IModel> getModel() {
return (IModel>) getDefaultModel();
}

}


-
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



Image subclass not getting its model object

2010-06-04 Thread Erwin Bolwidt

Hi,

I'm trying to make an image subclass that shows an icon. Which icon it 
shows depends on its model object, which is a boolean. Problem is,  I'm 
not getting the model object: it's always null. If I use a Label instead 
of InStockIconImage, it works: the label shows a boolean (true/false).


Any idea what could cause this?

Thanks,
  Erwin


Here's the icon:

public class InStockIconImage extends Image {
private static final String PATH_IN_STOCK = "in_stock.png";
private static final String PATH_NOT_IN_STOCK = "not_in_stock.png";
private static final String PATH_NO_MODEL_OBJECT = "empty.png";

public InStockIconImage(String id, IModel model) {
super(id, model);
}

@Override
protected ResourceReference getImageResourceReference() {
Boolean inStock = (Boolean) getDefaultModelObject();
String path;
if (inStock == null) {
path = PATH_NO_MODEL_OBJECT;
} else if (inStock) {
path = PATH_IN_STOCK;
} else {
path = PATH_NOT_IN_STOCK;
}
return new ResourceReference(Icons.class, path);
}
}

Here's how I use it:

RefreshingListView listingRepeater = new 
RefreshingListView(
"listing", new 
PropertyModel>(getModel(), "listings")) {

@Override
protected void populateItem(Item item) {
item.add(new Label("webShop.name"));
item.add(new Label("price"));
item.add(new InStockIconImage("inStock"));
}
};
add(listingRepeater);

RefreshingListView is a utility class which decorates a normal 
RefreshingView:


public abstract class RefreshingListView extends RefreshingView {

public RefreshingListView(String id) {
super(id);
}

public RefreshingListView(String id, IModelCollection> model) {

super(id, model);
}

@Override
protected Iterator> getItemModels() {
Collection modelObject = getModelObject();
if (modelObject == null) {
modelObject = new ArrayList();
}
return new ModelIteratorAdapter(modelObject.iterator()) {
@Override
protected IModel model(T object) {
return new CompoundPropertyModel(object);
}
};
}

public Collection getModelObject() {
return getModel().getObject();
}

@SuppressWarnings("unchecked")
public IModel> getModel() {
return (IModel>) getDefaultModel();
}

}


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



Re: Regression: @Inject'ed objects cannot be passed to Threads

2010-06-04 Thread Douglas Ferguson
Also, I'm starting to dig into these and fix them and most of them make sense 
to me. They are obviously asynchronous threads that we start.

But this one has be a bit baffled. Does anybody recognize the classes in the 
stack? 

2010-06-04 00:06:34,623 ERROR [main] session.ManagerBase - Exception loading 
sessions from persistent storage
net.sf.cglib.core.CodeGenerationException: 
org.apache.wicket.WicketRuntimeException-->There is no application attached to 
current thread main
at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:216)
at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:643)
at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
at 
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285)
at 
org.apache.wicket.proxy.LazyInitProxyFactory.createProxy(LazyInitProxyFactory.java:174)
at 
org.apache.wicket.proxy.LazyInitProxyFactory$ProxyReplacement.readResolve(LazyInitProxyFactory.java:240)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at 
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1402)
at 
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:931)
at 
org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:394)
at 
org.apache.catalina.session.StandardManager.load(StandardManager.java:321)
at 
org.apache.catalina.session.StandardManager.start(StandardManager.java:637)
at 
org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:432)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4160)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at 
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:448)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at 
org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)
Caused by: org.apache.wicket.WicketRuntimeException: There is no application 
attached to current thread main
at org.apache.wicket.Application.get(Application.java:1