Re: Output streams from external servlet

2008-06-25 Thread Daniel Frisk
I think this can be achived most easily with two requests. Create a  
class called ExternalPanel that displays a page that redirects to the  
servlet. Like this:


public class ExternalPanel extends Panel {
public ExternalPanel(String id, String url) {
super(id);
add(new InlineFrame(include, new RedirectPage(url)));
}
}

Hope this works for you.

// Daniel Frisk
jalbum.net


On 2008-06-25, at 01:28, krisNog wrote:



Hello everyone!

I have a question regarding external servlets. I have a panel that I  
would

like to stream content into from an external servlet. The overridden
onRender method I'm using for the Panel is shown below where / 
whatever is

the servlet that is outputting some arbitrary HTML that I would like
rendered in my wicket panel. I know this isn't the proper way of  
doing

things but I have no control over the external servlet and need to
incorporate its output into my wicket panel...

My problem the code below dispatches to the servlet and the  
servlet
begins streaming out of sequence from the wicket panel. So the html  
from the

servlet starts streaming then the wicket page starts streaming and the
servlet html isn't within my wicket panel and then I start getting  
errors

(shown after the onRender method)...

Please let me know if I'm not being clear enough I'd be happy to  
elaborate!


protected void onRender(MarkupStream markupStream) {

	ServletWebRequest servletWebRequest = (ServletWebRequest)  
getRequest();
	HttpServletRequest request =  
servletWebRequest.getHttpServletRequest();


WebResponse webResponse = (WebResponse) getResponse();
	HttpServletResponse response =  
webResponse.getHttpServletResponse();


RequestDispatcher dispatcher =
request.getRequestDispatcher(/whatever);
try {
dispatcher.include(request, response);
response.flushBuffer();

} catch (ServletException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}


Error stack trace:

ERROR - WicketFilter   - closing the buffer error
java.lang.IllegalStateException: getWriter can't be used after
getOutputStream was invoked
at
org 
.apache 
.jetspeed 
.aggregator 
.impl.HttpBufferedResponse.getWriter(HttpBufferedResponse.java:68)

at
javax 
.servlet 
.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:112)
	at  
org.apache.wicket.protocol.http.WebResponse.write(WebResponse.java: 
355)

at
org 
.apache 
.wicket 
.protocol.http.BufferedWebResponse.close(BufferedWebResponse.java:73)

at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java: 
391)

at
org 
.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java: 
199)

at
org 
.apache 
.catalina 
.core 
.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 
215)

at
org 
.apache 
.catalina 
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

at
org 
.apache 
.catalina 
.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)

at
org 
.apache 
.catalina 
.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594)

at
org 
.apache 
.catalina 
.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505)

at
org 
.apache 
.jetspeed 
.dispatcher 
.JetspeedRequestDispatcher.include(JetspeedRequestDispatcher.java:73)

at
org 
.apache 
.wicket 
.protocol 
.http.portlet.WicketPortlet.processRequest(WicketPortlet.java:519)

at
org 
.apache 
.wicket 
.protocol.http.portlet.WicketPortlet.doView(WicketPortlet.java:416)

at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:247)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:175)
at
org 
.apache 
.jetspeed 
.factory.JetspeedPortletInstance.render(JetspeedPortletInstance.java: 
103)

at
org 
.apache 
.jetspeed 
.container 
.JetspeedContainerServlet.doGet(JetspeedContainerServlet.java:277)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org 
.apache 
.catalina 
.core 
.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 
269)

at
org 
.apache 
.catalina 
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

at
org 
.apache 
.catalina 
.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)

at
org 
.apache 
.catalina 
.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594)

at
org 
.apache 
.catalina 

Re: AjaxLink in a DataView causing issues when loading multiple instance of the page

2008-06-25 Thread mfs

To me the problem seems to be related to the hybridUrlCoding strategy (where
the same page instance is reloaded when the user tries to open up a new
tab/window by doing right-click on AjaxLink) and the DataView which gets
re-rendered everytime (irrespective of the urlcodingstrategy), resulting in
a new instance of each items in it and similarly a new ajaxlink for each
item, so with that the page-component heirarchy for that version changes,
whereas the first-tab/window is still displaying the dataview-items which
are not in the component-heirarchy anymore and hence the Component Not
Found on Page exception.

Am looking for some feedback from the experts, i am in a bit of time crunch
here, and have a release coming pretty soon..

Thanks in advance...




mfs wrote:
 
 Let me add a couple of things here, 
 
 1) Page-Versioning has not been turned off.
 2) Using HybridURLCodingStrategy to render the page.
 
 Opinions please..
 
 
 
 
 mfs wrote:
 
 Hi Guys, 
 
 I am facing a problem with the usage of AjaxLink within a DataView. The
 dataview is contained in a container since the DataView is updated on
 ajaxform.submit. The AjaxLink is on each Item of the DataView, which
 opens up a modal window (with a panel as the content) with further
 details of each item listed in the DV.
 
 Everything works fine, unless the user tries to open up the same Page
 (containing the above components) in another window/tab, which apparently
 results in the wicket component tree getting out of sync with the actual
 DOM, and hence clicking the ajaxlink on the first window/tab results in
 the following exception...(must be obvious but just for info, if i do a
 refresh of the same page in the first tab/window, the ajaxlink would work
 fine) 
 
 org.apache.wicket.WicketRuntimeException: component
 certificateDataViewContainer:certificateList:2:certificateSummaryLink not
 found on page company.wicket.product.page.CertificateSearchPage[id = 0],
 listener interface = [RequestListenerInterface name=IBehaviorListener,
 method=public abstract void
 org.apache.wicket.behavior.IBehaviorListener.onRequest()]
 at
 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:416)
 at
 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461)
 at
 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1246)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1366)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
 at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:387)
 at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:199)
 at
 com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)
 at
 com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
 at
 com.evermind.server.http.HttpRequestHandler.handleNotFound(HttpRequestHandler.java:1041)
 at
 com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:911)
 at
 com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
 at
 com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302)
 at
 com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190)
 at
 oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
 at
 com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java
 
 
 Waiting for followup..
 
 Thanks in advance
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/AjaxLink-in-a-DataView-causing-issues-when-loading-multiple-instance-of-the-page-tp18099619p18106617.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Contextual autoCompleteTextField

2008-06-25 Thread Bertrand DATAS
Hello everybody,

Do you know if there is a way to make contextual the list of
autocompletTextfield that is to say to make it relative to other fields that
are in the form ?
Actually i have two Fields, Town and ZipCode and when there are filled, my
autoCompleteTextField must display the list of the streets available for
this Town and ZipCode.

Do you have any trick for making this ??

Thanks

Bertrand Datas


POST or GET Request

2008-06-25 Thread TH Lim

Hi,

Is there a way to know if a request is a POST or GET in WebPage? 

TQ
-- 
View this message in context: 
http://www.nabble.com/POST-or-GET-Request-tp18108556p18108556.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



RE: Contextual autoCompleteTextField

2008-06-25 Thread Hoover, William
Are you referring to something like
http://issues.apache.org/jira/browse/WICKET-488? 

-Original Message-
From: Bertrand DATAS [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2008 4:21 AM
To: users@wicket.apache.org
Subject: Contextual autoCompleteTextField

Hello everybody,

Do you know if there is a way to make contextual the list of
autocompletTextfield that is to say to make it relative to other fields
that are in the form ?
Actually i have two Fields, Town and ZipCode and when there are filled,
my autoCompleteTextField must display the list of the streets available
for this Town and ZipCode.

Do you have any trick for making this ??

Thanks

Bertrand Datas


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



Re: Strange Error - ModalWindow from ModalWindow - error when closing

2008-06-25 Thread Artur W.

More info:

- Error appears only once in a session
- When it appears it never happen again in the same session
- Only appear when the pageMapName was not set for the second ModalWindow

I thought that setPageMapName is not a mandatory, isn't it?

Artur
-- 
View this message in context: 
http://www.nabble.com/Strange-Error---ModalWindow-from-ModalWindow---error-when-closing-tp18109667p18110239.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Contextual autoCompleteTextField

2008-06-25 Thread Bertrand DATAS
Not really because i dont want to use the onselect of this component but to
use the content of two other fields to construct the list that will be
displayed in my AutoCompleteTextField.

2008/6/25 Hoover, William [EMAIL PROTECTED]:

 Are you referring to something like
 http://issues.apache.org/jira/browse/WICKET-488?

 -Original Message-
 From: Bertrand DATAS [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 4:21 AM
 To: users@wicket.apache.org
 Subject: Contextual autoCompleteTextField

 Hello everybody,

 Do you know if there is a way to make contextual the list of
 autocompletTextfield that is to say to make it relative to other fields
 that are in the form ?
 Actually i have two Fields, Town and ZipCode and when there are filled,
 my autoCompleteTextField must display the list of the streets available
 for this Town and ZipCode.

 Do you have any trick for making this ??

 Thanks

 Bertrand Datas


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




redirect page in the constructor

2008-06-25 Thread Eyal Golan
Hi,
After reviewing some discussion regarding the issue.
http://issues.apache.org/jira/browse/WICKET-696

and
http://www.mail-archive.com/[EMAIL PROTECTED]/msg30288.html

What is the conclusion?
Is the original page being mapped or no?

thanks

-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P Save a tree. Please don't print this e-mail unless it's really necessary


Tomcat 6 clustering problem

2008-06-25 Thread Artem D.

Hi all,
I've got wicket 1.4-m2 based application running on two different network
hosts configured as Tomcat 6 Simple TCP cluster.
I try to simulate failover with session replication using the following
schema:
1) Log into the first server, store some info in HTTP session
2) Access mounted page on the first server, i.e.
http://first.server/mounted/page
3) Try to access the same page on the second server, i.e.
http://second.server/mounted/page

I assume that HTTP session should replicate between Tomcat's and I want to
get immediate reply from the second server, but all I get is forwarding me
to the login screen and the following entries in log:

Jun 25, 2008 5:10:39 PM org.apache.catalina.ha.session.DeltaManager
messageReceived
SEVERE: Manager [localhost#/mas]: Unable to receive message through TCP
channel
java.lang.IllegalArgumentException: Unknown object type null
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.restoreAfterSerialization(DiskPageStore.java:1211)
at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.readObject(SecondLevelCacheSessionStore.java:403)
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.readObject(ObjectInputStream.java:351)
at
org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.readExternal(DeltaRequest.java:361)
at
org.apache.catalina.ha.session.DeltaRequest.readExternal(DeltaRequest.java:255)
at
org.apache.catalina.ha.session.DeltaManager.deserializeDeltaRequest(DeltaManager.java:619)
at
org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(DeltaManager.java:1363)
at
org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1320)
at
org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:1083)
at
org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:87)
at
org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:899)
at
org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:880)
at
org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:269)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
at
org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:110)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
at
org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:241)
at
org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:225)
at
org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:188)
at
org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:91)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

Is there a way to resolve this issue?
-- 
View this message in context: 
http://www.nabble.com/Tomcat-6-clustering-problem-tp18112263p18112263.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Tomcat 6 clustering problem

2008-06-25 Thread Matej Knopp
Any chance you can try it with latest trunk?

-Matej

On Wed, Jun 25, 2008 at 3:18 PM, Artem D. [EMAIL PROTECTED] wrote:

 Hi all,
 I've got wicket 1.4-m2 based application running on two different network
 hosts configured as Tomcat 6 Simple TCP cluster.
 I try to simulate failover with session replication using the following
 schema:
 1) Log into the first server, store some info in HTTP session
 2) Access mounted page on the first server, i.e.
 http://first.server/mounted/page
 3) Try to access the same page on the second server, i.e.
 http://second.server/mounted/page

 I assume that HTTP session should replicate between Tomcat's and I want to
 get immediate reply from the second server, but all I get is forwarding me
 to the login screen and the following entries in log:

 Jun 25, 2008 5:10:39 PM org.apache.catalina.ha.session.DeltaManager
 messageReceived
 SEVERE: Manager [localhost#/mas]: Unable to receive message through TCP
 channel
 java.lang.IllegalArgumentException: Unknown object type null
at
 org.apache.wicket.protocol.http.pagestore.DiskPageStore.restoreAfterSerialization(DiskPageStore.java:1211)
at
 org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.readObject(SecondLevelCacheSessionStore.java:403)
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.readObject(ObjectInputStream.java:351)
at
 org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.readExternal(DeltaRequest.java:361)
at
 org.apache.catalina.ha.session.DeltaRequest.readExternal(DeltaRequest.java:255)
at
 org.apache.catalina.ha.session.DeltaManager.deserializeDeltaRequest(DeltaManager.java:619)
at
 org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(DeltaManager.java:1363)
at
 org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1320)
at
 org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:1083)
at
 org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:87)
at
 org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:899)
at
 org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:880)
at
 org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:269)
at
 org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
at
 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:110)
at
 org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
at
 org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
at
 org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:241)
at
 org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:225)
at
 org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:188)
at
 org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:91)
at
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

 Is there a way to resolve this issue?
 --
 View this message in context: 
 http://www.nabble.com/Tomcat-6-clustering-problem-tp18112263p18112263.html
 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: help with RadioGroup in Table

2008-06-25 Thread jnorris

Hi Thomas,

Using the row model worked.  I changed the value of the text box with data
from the domain object in the row model, and set that as the target and
bingo!

Thank you for your help.

Jim
-- 
View this message in context: 
http://www.nabble.com/help-with-RadioGroup-in-Table-tp18036005p18112563.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



UTF-8 Byte Order Marks in .html files

2008-06-25 Thread Miguel Paraz
Hi,
I found out - through a lot of trial and error - that if your .html
file has a Byte Order Mark, the ?xml encoding=utf-8 ? at the top
of the document is ignored.
The document is treated as something else - I'm not sure what.

The effect is that the special output characters become the ?
unknown characters.

Is this a known issue?
Thanks.

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



RE: Contextual autoCompleteTextField

2008-06-25 Thread Hoover, William
What is stopping you from using the models from the other fields when
constructing your list?

-Original Message-
From: Bertrand DATAS [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2008 8:05 AM
To: users@wicket.apache.org
Subject: Re: Contextual autoCompleteTextField

Not really because i dont want to use the onselect of this component but
to use the content of two other fields to construct the list that will
be displayed in my AutoCompleteTextField.

2008/6/25 Hoover, William [EMAIL PROTECTED]:

 Are you referring to something like
 http://issues.apache.org/jira/browse/WICKET-488?

 -Original Message-
 From: Bertrand DATAS [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 4:21 AM
 To: users@wicket.apache.org
 Subject: Contextual autoCompleteTextField

 Hello everybody,

 Do you know if there is a way to make contextual the list of 
 autocompletTextfield that is to say to make it relative to other 
 fields that are in the form ?
 Actually i have two Fields, Town and ZipCode and when there are 
 filled, my autoCompleteTextField must display the list of the streets 
 available for this Town and ZipCode.

 Do you have any trick for making this ??

 Thanks

 Bertrand Datas


 -
 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: Tomcat 6 clustering problem

2008-06-25 Thread Artem D.

Just tried with 1.4-SNAPSHOT.
Same exception but different line in the DiskPageStore.java
SEVERE: Manager [localhost#/mas]: Unable to receive message through TCP
channel
java.lang.IllegalArgumentException: Unknown object type null
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.restoreAfterSerialization(DiskPageStore.java:1215)



Matej Knopp-2 wrote:
 
 Any chance you can try it with latest trunk?
 
 -Matej
 
 On Wed, Jun 25, 2008 at 3:18 PM, Artem D. [EMAIL PROTECTED] wrote:

 Hi all,
 I've got wicket 1.4-m2 based application running on two different network
 hosts configured as Tomcat 6 Simple TCP cluster.
 I try to simulate failover with session replication using the following
 schema:
 1) Log into the first server, store some info in HTTP session
 2) Access mounted page on the first server, i.e.
 http://first.server/mounted/page
 3) Try to access the same page on the second server, i.e.
 http://second.server/mounted/page

 I assume that HTTP session should replicate between Tomcat's and I want
 to
 get immediate reply from the second server, but all I get is forwarding
 me
 to the login screen and the following entries in log:

 Jun 25, 2008 5:10:39 PM org.apache.catalina.ha.session.DeltaManager
 messageReceived
 SEVERE: Manager [localhost#/mas]: Unable to receive message through TCP
 channel
 java.lang.IllegalArgumentException: Unknown object type null
at
 org.apache.wicket.protocol.http.pagestore.DiskPageStore.restoreAfterSerialization(DiskPageStore.java:1211)
at
 org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.readObject(SecondLevelCacheSessionStore.java:403)
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.readObject(ObjectInputStream.java:351)
at
 org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.readExternal(DeltaRequest.java:361)
at
 org.apache.catalina.ha.session.DeltaRequest.readExternal(DeltaRequest.java:255)
at
 org.apache.catalina.ha.session.DeltaManager.deserializeDeltaRequest(DeltaManager.java:619)
at
 org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(DeltaManager.java:1363)
at
 org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1320)
at
 org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:1083)
at
 org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:87)
at
 org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:899)
at
 org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:880)
at
 org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:269)
at
 org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
at
 org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:110)
at
 org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
at
 org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
at
 org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:241)
at
 org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:225)
at
 org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:188)
at
 org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:91)
at
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

 Is there a way to resolve this issue?
 --
 View this message in context:
 http://www.nabble.com/Tomcat-6-clustering-problem-tp18112263p18112263.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


 
 -
 

Re: redirect page in the constructor

2008-06-25 Thread Igor Vaynberg
use restartresponseexception instead

-igor

On Wed, Jun 25, 2008 at 5:36 AM, Eyal Golan [EMAIL PROTECTED] wrote:
 Hi,
 After reviewing some discussion regarding the issue.
 http://issues.apache.org/jira/browse/WICKET-696

 and
 http://www.mail-archive.com/[EMAIL PROTECTED]/msg30288.html

 What is the conclusion?
 Is the original page being mapped or no?

 thanks

 --
 Eyal Golan
 [EMAIL PROTECTED]

 Visit: http://jvdrums.sourceforge.net/
 LinkedIn: http://www.linkedin.com/in/egolan74

 P Save a tree. Please don't print this e-mail unless it's really necessary


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



RE: Tomcat 6 clustering problem

2008-06-25 Thread Zappaterrini, Larry
Well in a production situation there would be one host name used and
failover would just change which server the requests to that host name
get routed to. In that scenario the same cookies would be used so no
problem.

You should be able to use some trickery in your hosts file to mimic
this. Add a host name (clustertest perhaps)  that points to the first
server's IP address, access the site, switch the IP address in the hosts
file to the second server, verify that the second server is indeed hit
and that the behavior is correct.

I'm not sure if you are familiar with working with a hosts file so just
know that on all Unix-like systems I have encountered it is found at
/etc/hosts and on all Windows systems I have encountered it is found at
C:\WINDOWS\system32\drivers\etc\hosts

Larry

-Original Message-
From: Artem D. [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2008 10:05 AM
To: users@wicket.apache.org
Subject: RE: Tomcat 6 clustering problem


Disabling cookies in browser made it work!
Servers are configured with jvmRoutes jvm1 and jvm2, i.e. for the first
server:

Engine name=Catalina defaultHost=localhost jvmRoute=jvm1

jsessionid request parameter while requesting the first server looks
like
jsessionid=3E526DD2214AEA5B5C2DAB9C6713AF26.jvm1

When switching to the second server jvm2 suffix is used.

What's the correct way to make it work with enabled cookies?

-Artem.


lzappaterrini wrote:
 
 Are you sure that the same JSESSIONID cookie is being sent to both
 servers? Cookies only get sent when the host value matches the host in
 the URL. Might that be your issue?  
 
 -Original Message-
 From: Artem D. [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, June 25, 2008 9:18 AM
 To: users@wicket.apache.org
 Subject: Tomcat 6 clustering problem
 
 
 Hi all,
 I've got wicket 1.4-m2 based application running on two different
 network
 hosts configured as Tomcat 6 Simple TCP cluster.
 I try to simulate failover with session replication using the
following
 schema:
 1) Log into the first server, store some info in HTTP session
 2) Access mounted page on the first server, i.e.
 http://first.server/mounted/page
 3) Try to access the same page on the second server, i.e.
 http://second.server/mounted/page
 
 I assume that HTTP session should replicate between Tomcat's and I
want
 to
 get immediate reply from the second server, but all I get is
forwarding
 me
 to the login screen and the following entries in log:
 
 Jun 25, 2008 5:10:39 PM org.apache.catalina.ha.session.DeltaManager
 messageReceived
 SEVERE: Manager [localhost#/mas]: Unable to receive message through
TCP
 channel
 java.lang.IllegalArgumentException: Unknown object type null
 at

org.apache.wicket.protocol.http.pagestore.DiskPageStore.restoreAfterSeri
 alization(DiskPageStore.java:1211)
 at

org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevel
 CachePageMap.readObject(SecondLevelCacheSessionStore.java:403)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
 a:39)
 at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
 Impl.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.readObject(ObjectInputStream.java:351)
 at

org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.readExternal(D
 eltaRequest.java:361)
 at

org.apache.catalina.ha.session.DeltaRequest.readExternal(DeltaRequest.ja
 va:255)
 at

org.apache.catalina.ha.session.DeltaManager.deserializeDeltaRequest(Delt
 aManager.java:619)
 at

org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(DeltaMan
 ager.java:1363)
 at

org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager
 .java:1320)
 at

org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaMan
 ager.java:1083)
 at

org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(Cl
 usterSessionListener.java:87)
 at

org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpClu
 ster.java:899)
 at

org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpClu
 ster.java:880)
 at

org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChann
 el.java:269)
 at

org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(
 ChannelInterceptorBase.java:79)
 at

org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.message
 Received(TcpFailureDetector.java:110)
 

Re: Contextual autoCompleteTextField

2008-06-25 Thread Bertrand DATAS
yes i could do like that but my field are generated in a listview so how can
I retrieve them ??


2008/6/25 Hoover, William [EMAIL PROTECTED]:

 What is stopping you from using the models from the other fields when
 constructing your list?

 -Original Message-
 From: Bertrand DATAS [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 8:05 AM
 To: users@wicket.apache.org
 Subject: Re: Contextual autoCompleteTextField

 Not really because i dont want to use the onselect of this component but
 to use the content of two other fields to construct the list that will
 be displayed in my AutoCompleteTextField.

 2008/6/25 Hoover, William [EMAIL PROTECTED]:

  Are you referring to something like
  http://issues.apache.org/jira/browse/WICKET-488?
 
  -Original Message-
  From: Bertrand DATAS [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, June 25, 2008 4:21 AM
  To: users@wicket.apache.org
  Subject: Contextual autoCompleteTextField
 
  Hello everybody,
 
  Do you know if there is a way to make contextual the list of
  autocompletTextfield that is to say to make it relative to other
  fields that are in the form ?
  Actually i have two Fields, Town and ZipCode and when there are
  filled, my autoCompleteTextField must display the list of the streets
  available for this Town and ZipCode.
 
  Do you have any trick for making this ??
 
  Thanks
 
  Bertrand Datas
 
 
  -
  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: Trying to use spring with wicket

2008-06-25 Thread Piller Sébastien

It works very well, thanks ;)


Igor Vaynberg a écrit :

i think this maven archetype might be what you are looking for

http://www.wicketstuff.org/teamcity/viewType.html?buildTypeId=bt17

-igor

On Tue, Jun 24, 2008 at 8:29 AM, Piller Sébastien [EMAIL PROTECTED] wrote:
  

Hello guys,

I'm trying to get Wicket use Spring  Hibernate correctly. I don't know
Spring very well, so I probably made some great errors.

I have some question for the beginning:

- I saw a SpringWebApplication in wicket. Does my app must extends this
class or is it possible to use spring  an AuthenticatedWebApplication?
- Is it possible to use spring with filters or do I need to use servlets?
- Does anybody have a quickstart project that runs with Spring 2.5,
Hibernate 3.2 and Wicket 1.3.1?


Thanks you

-
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: Tomcat 6 clustering problem

2008-06-25 Thread Artem D.

Just tested you suggestion - it works like a charm!
Thanks for your help!

Artem.


lzappaterrini wrote:
 
 Well in a production situation there would be one host name used and
 failover would just change which server the requests to that host name
 get routed to. In that scenario the same cookies would be used so no
 problem.
 
 You should be able to use some trickery in your hosts file to mimic
 this. Add a host name (clustertest perhaps)  that points to the first
 server's IP address, access the site, switch the IP address in the hosts
 file to the second server, verify that the second server is indeed hit
 and that the behavior is correct.
 
 I'm not sure if you are familiar with working with a hosts file so just
 know that on all Unix-like systems I have encountered it is found at
 /etc/hosts and on all Windows systems I have encountered it is found at
 C:\WINDOWS\system32\drivers\etc\hosts
 
 Larry
 
 -Original Message-
 From: Artem D. [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, June 25, 2008 10:05 AM
 To: users@wicket.apache.org
 Subject: RE: Tomcat 6 clustering problem
 
 
 Disabling cookies in browser made it work!
 Servers are configured with jvmRoutes jvm1 and jvm2, i.e. for the first
 server:
 
 Engine name=Catalina defaultHost=localhost jvmRoute=jvm1
 
 jsessionid request parameter while requesting the first server looks
 like
 jsessionid=3E526DD2214AEA5B5C2DAB9C6713AF26.jvm1
 
 When switching to the second server jvm2 suffix is used.
 
 What's the correct way to make it work with enabled cookies?
 
 -Artem.
 
 
 lzappaterrini wrote:
 
 Are you sure that the same JSESSIONID cookie is being sent to both
 servers? Cookies only get sent when the host value matches the host in
 the URL. Might that be your issue?  
 
 -Original Message-
 From: Artem D. [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, June 25, 2008 9:18 AM
 To: users@wicket.apache.org
 Subject: Tomcat 6 clustering problem
 
 
 Hi all,
 I've got wicket 1.4-m2 based application running on two different
 network
 hosts configured as Tomcat 6 Simple TCP cluster.
 I try to simulate failover with session replication using the
 following
 schema:
 1) Log into the first server, store some info in HTTP session
 2) Access mounted page on the first server, i.e.
 http://first.server/mounted/page
 3) Try to access the same page on the second server, i.e.
 http://second.server/mounted/page
 
 I assume that HTTP session should replicate between Tomcat's and I
 want
 to
 get immediate reply from the second server, but all I get is
 forwarding
 me
 to the login screen and the following entries in log:
 
 Jun 25, 2008 5:10:39 PM org.apache.catalina.ha.session.DeltaManager
 messageReceived
 SEVERE: Manager [localhost#/mas]: Unable to receive message through
 TCP
 channel
 java.lang.IllegalArgumentException: Unknown object type null
 at

 org.apache.wicket.protocol.http.pagestore.DiskPageStore.restoreAfterSeri
 alization(DiskPageStore.java:1211)
 at

 org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevel
 CachePageMap.readObject(SecondLevelCacheSessionStore.java:403)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
 a:39)
 at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
 Impl.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.readObject(ObjectInputStream.java:351)
 at

 org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.readExternal(D
 eltaRequest.java:361)
 at

 org.apache.catalina.ha.session.DeltaRequest.readExternal(DeltaRequest.ja
 va:255)
 at

 org.apache.catalina.ha.session.DeltaManager.deserializeDeltaRequest(Delt
 aManager.java:619)
 at

 org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(DeltaMan
 ager.java:1363)
 at

 org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager
 .java:1320)
 at

 org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaMan
 ager.java:1083)
 at

 org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(Cl
 usterSessionListener.java:87)
 at

 org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpClu
 ster.java:899)
 at

 org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpClu
 ster.java:880)
 at

 org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChann
 el.java:269)
 at

 

lossing form data on ajax repaint

2008-06-25 Thread taygolf

Hey guys. I have a small problem. I have a group of textfields that are
created on the fly from the database by using a panel. All of the textfields
use modal windows as popups to populate them with data except for 2. These 2
are manually filled in my the user. All of the textfields are in a
WebMarkupContainer. The reason I have them in a WebMarkupContainer is
because I need to default some fields based on what is selected in another
field and I use ajax to repaint the WebMarkupContainer to show my changes.

The problem is when I repaint the WebMarkupContainer the 2 testfields that
have data that was manually entered by the users are completely erased and
set back to blank.

How can I keep the data from being cleared on an ajax repaint?

Thanks

T
-- 
View this message in context: 
http://www.nabble.com/lossing-form-data-on-ajax-repaint-tp18114293p18114293.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: lossing form data on ajax repaint

2008-06-25 Thread Igor Vaynberg
either dont repaint them, or pass their values to the server along
with that ajax request like AjaxFormComponentUpdatingBehavior does.

-igor

On Wed, Jun 25, 2008 at 7:46 AM, taygolf [EMAIL PROTECTED] wrote:

 Hey guys. I have a small problem. I have a group of textfields that are
 created on the fly from the database by using a panel. All of the textfields
 use modal windows as popups to populate them with data except for 2. These 2
 are manually filled in my the user. All of the textfields are in a
 WebMarkupContainer. The reason I have them in a WebMarkupContainer is
 because I need to default some fields based on what is selected in another
 field and I use ajax to repaint the WebMarkupContainer to show my changes.

 The problem is when I repaint the WebMarkupContainer the 2 testfields that
 have data that was manually entered by the users are completely erased and
 set back to blank.

 How can I keep the data from being cleared on an ajax repaint?

 Thanks

 T
 --
 View this message in context: 
 http://www.nabble.com/lossing-form-data-on-ajax-repaint-tp18114293p18114293.html
 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: Updating ListView via AJAX

2008-06-25 Thread Ryan O'Hara
Thanks, again, Igor.  I'm certain that getGroupMemberships() is  
returning good data, so it seems the listview isn't refreshing.  I'll  
play around with it some more.  Thanks for the help.  I'll let you  
know if/when I find a solution.


Ryan

On Jun 24, 2008, at 5:01 PM, Igor Vaynberg wrote:


is it that the listview doesnt refresh or that your
getGroupMemberships() returns stale data? why dont you set up a
breakpoint and see what its doing

-igor

On Tue, Jun 24, 2008 at 1:08 PM, Ryan O'Hara
[EMAIL PROTECTED] wrote:
Thanks for the quick response, Igor.  Unfortunately, the ListView  
is still

not updating after making those changes.  Any other ideas?

Thanks again,
Ryan

On Jun 24, 2008, at 3:46 PM, Igor Vaynberg wrote:


protected void populateItem(final ListItem item) {
 GroupMembership groupMembership = (GroupMembership)
item.getModelObject();
 item.add(new Label(group, new PropertyModel(item.getmodel(),  
group));

 item.add(new CheckBox(member, new PropertyModel(item.getmodel(),
selected)));
}

-igor

On Tue, Jun 24, 2008 at 10:28 AM, Ryan O'Hara
[EMAIL PROTECTED] wrote:


Also, tried using a LoadableDetachableModel in the ListView:

ListView groupMemberRows = new ListView(groupMemberRow, new
LoadableDetachableModel(){
  protected Object load(){
  return getGroupMemberships();
  }
  }) {
  protected void populateItem(final ListItem item) {
  GroupMembership groupMembership = (GroupMembership)
item.getModelObject();
  item.add(new Label(group,  
groupMembership.getGroup()));

  item.add(new CheckBox(member, new
PropertyModel(groupMembership, selected)));
  }
  };

Still no luck.

Ryan

On Jun 24, 2008, at 1:21 PM, Ryan O'Hara wrote:

I'm trying to update a ListView via AJAX.  I've looked over a  
bunch of
examples in the archives, but I'm still having some trouble.   
I'm trying

to
wrap the ListView with a WebMarkupContainer and then update that
WebMarkupContainer.  I also created a GroupMembership object,  
which is

passed into the ListView.  When the form is submitted, the
ListGroupMembership is populated fine, it's just not  
rendering.  Below

is
the Java and HTML.  Any help would be greatly appreciated.   
Thanks!


-Ryan

Java:

  groupManager = new WebMarkupContainer(groupManager);
  groupManager.setOutputMarkupId(true);
  form.add(groupManager);

  AjaxSubmitLink submit = new AjaxSubmitLink(submit) {
  public void onSubmit(AjaxRequestTarget target, Form  
form) {

  try {
  setGroupMemberships();
  target.addComponent(groupManager);
  } catch (Exception e) {
  error(Unable to get groups for user  +  
email + .);

  }
  target.addComponent(feedbackPanel);
  }
  };
  form.add(submit);

  ListView groupMemberRows = new ListView(groupMemberRow,
getGroupMemberships()) {
  protected void populateItem(final ListItem item) {
  GroupMembership groupMembership = (GroupMembership)
item.getModelObject();
  item.add(new Label(group,  
groupMembership.getGroup()));

  item.add(new CheckBox(member, new
PropertyModel(groupMembership, selected)));
  }
  };
  groupManager.add(groupMemberRows);

public void setGroupMemberships() {
  groupMemberships.clear();
  ListString userGroups = groupQuery.getGroupsByUser 
(getEmail());

  ListString allGroups = groupQuery.getGroups(*);
  GroupMembership groupMembership;
  for (String group : allGroups) {
  groupMembership = new GroupMembership();
  if (userGroups.contains(group)) {
  groupMembership.setGroup(group);
  groupMembership.setSelected(true);
  } else {
  groupMembership.setGroup(group);
  groupMembership.setSelected(false);
  }
  groupMemberships.add(groupMembership);
  }
  }

  public ListGroupMembership getGroupMemberships() {
  return groupMemberships;
  }


HTML:

  form wicket:id=manageGroups name=manageGroups
table align=center width=50% wicket:id=groupManager
  tr
  thGroup/th
  thMember/th
  /tr
  tr wicket:id=groupMemberRow class=hideRow
  tdspan wicket:id=group/span/td
  tdinput wicket:id=member type=checkbox//td
  /tr
  tr
  td/td
  td align=righta wicket:id=save
class=formButtonAlignedRightSave/a/td
  /tr
  /table
  /form





 
-

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: More issues w/ external images and DynamicWebResource

2008-06-25 Thread Nino Saturnino Martinez Vazquez Wael

Did you try searching the wiki about this?

http://cwiki.apache.org/WICKET/uploaddownload.html

There might be more...

V. Jenks wrote:

I'm having non-stop issues w/ DynamicWebResource and trying to load images
external to my .ear deployment now that I've moved to 1.3.  First off, I'm
hoping someone can suggest an easier way to do it because what I have now is
code that someone was nice enough to give me, here on the Wicket mailing
list.  However, I don't entirely understand how it works and while it worked
for 2 years in Wicket 1.2, it is now causing me problem after problem in
Wicket 1.3.x - for whatever reason.

First what I've got is a class called ImageResource which extends
DynamicWebResource:

/*/
public class ImageResource extends DynamicWebResource
{
private ImageService imgSrv;

public ImageResource()
{
super();
imgSrv = new ImageServiceEngine();
}

public String getImage(String image)
{
String retImg = null;

try
{
retImg = imgSrv.getImage(image).toString();
}
catch (IOException exp)
{
LogProxy.saveEntry(exp);
}

return retImg;
}

protected ResourceState getResourceState()
{
ImageResourceState state = null;

try
{
ValueMap params = getParameters();

byte[] data = null;
String imageId = params.getString(file);
  
			//Date lastModified = getImageLastMod(imageId);	

state = new ImageResourceState(Time.valueOf(new 
Date()));
state.setContentType(image/jpeg);

//SECURITY PRECAUTION - DO NOT ALLOW ANYTHING BUT 
IMAGES!
			if (imageId.contains(PropertyProxy.getExternalImagesRoot()) || 
	imageId.contains(PropertyProxy.getExternalImagesAltRoot()))

{
data = imgSrv.getImage(imageId);
}
else
{
//change image to not found warning image
data = 
imgSrv.getImage(PropertyProxy.getImageNotFound());

//TODO: send email to notify of inappropriate 
access
}

state.setData(data);
}
catch (FileNotFoundException exp)
{
LogProxy.saveEntry(exp);
}
catch (IOException exp)
{
LogProxy.saveEntry(exp);
}
catch (NullPointerException exp)
{
LogProxy.saveEntry(exp);
}

return state;
}

/**
	 * 
	 * @author vjenks
	 * 
	 */

protected class ImageResourceState extends ResourceState
{
private String contentType;
private byte[] data;
private Time lastModified;

ImageResourceState(Time lastModified)
{
super();
this.lastModified = lastModified;
}

public String getContentType()
{
return contentType;
}

void setContentType(String contentType)
{
this.contentType = contentType;
}

public byte[] getData()
{
return data;
}

void setData(byte[] data)
{
this.data = data;
}

public int getLength()
{
if (data != null)
return data.length;
else
return 0;
}

public Time lastModifiedTime()
{
return lastModified;
}
}
}
/*/


You can see that it uses a class called ImageServiceEngine:

/*/
public class ImageServiceEngine implements ImageService, Serializable
{
private int thumbnailSize;

public ImageServiceEngine()
{
super();
}

public int getThumbnailSize()
{
return this.thumbnailSize;
}


Re: More issues w/ external images and DynamicWebResource

2008-06-25 Thread Igor Vaynberg
why not just create a dead simple servlet that streams images? in fact
there are tons of them online you can just take. it is a much simpler
solution then dealing with wicket's resources for this particular
usecase.

-igor

On Wed, Jun 25, 2008 at 7:59 AM, V. Jenks [EMAIL PROTECTED] wrote:

 I'm having non-stop issues w/ DynamicWebResource and trying to load images
 external to my .ear deployment now that I've moved to 1.3.  First off, I'm
 hoping someone can suggest an easier way to do it because what I have now is
 code that someone was nice enough to give me, here on the Wicket mailing
 list.  However, I don't entirely understand how it works and while it worked
 for 2 years in Wicket 1.2, it is now causing me problem after problem in
 Wicket 1.3.x - for whatever reason.

 First what I've got is a class called ImageResource which extends
 DynamicWebResource:

 /*/
 public class ImageResource extends DynamicWebResource
 {
private ImageService imgSrv;

public ImageResource()
{
super();
imgSrv = new ImageServiceEngine();
}

public String getImage(String image)
{
String retImg = null;

try
{
retImg = imgSrv.getImage(image).toString();
}
catch (IOException exp)
{
LogProxy.saveEntry(exp);
}

return retImg;
}

protected ResourceState getResourceState()
{
ImageResourceState state = null;

try
{
ValueMap params = getParameters();

byte[] data = null;
String imageId = params.getString(file);

//Date lastModified = getImageLastMod(imageId);
state = new ImageResourceState(Time.valueOf(new 
 Date()));
state.setContentType(image/jpeg);

//SECURITY PRECAUTION - DO NOT ALLOW ANYTHING BUT 
 IMAGES!
if 
 (imageId.contains(PropertyProxy.getExternalImagesRoot()) ||

 imageId.contains(PropertyProxy.getExternalImagesAltRoot()))
{
data = imgSrv.getImage(imageId);
}
else
{
//change image to not found warning image
data = 
 imgSrv.getImage(PropertyProxy.getImageNotFound());

//TODO: send email to notify of inappropriate 
 access
}

state.setData(data);
}
catch (FileNotFoundException exp)
{
LogProxy.saveEntry(exp);
}
catch (IOException exp)
{
LogProxy.saveEntry(exp);
}
catch (NullPointerException exp)
{
LogProxy.saveEntry(exp);
}

return state;
}

/**
 *
 * @author vjenks
 *
 */
protected class ImageResourceState extends ResourceState
{
private String contentType;
private byte[] data;
private Time lastModified;

ImageResourceState(Time lastModified)
{
super();
this.lastModified = lastModified;
}

public String getContentType()
{
return contentType;
}

void setContentType(String contentType)
{
this.contentType = contentType;
}

public byte[] getData()
{
return data;
}

void setData(byte[] data)
{
this.data = data;
}

public int getLength()
{
if (data != null)
return data.length;
else
return 0;
}

public Time lastModifiedTime()
{
return lastModified;
}
}
 }
 /*/


 You can see that it uses a class called ImageServiceEngine:

 /*/
 public class ImageServiceEngine implements ImageService, Serializable
 {
private int thumbnailSize;

public ImageServiceEngine()
{
  

Re: More issues w/ external images and DynamicWebResource

2008-06-25 Thread V. Jenks

Ha!  The author of that article is the guy who gave me that very same code
here on the mailing list.  Look through the code I posted and you'll see the
similarities - it's literally unchanged.  

However, as I described - it's not working now that I have to use a Wicket
Filter in 1.3.


Nino.Martinez wrote:
 
 Did you try searching the wiki about this?
 
 http://cwiki.apache.org/WICKET/uploaddownload.html
 
 There might be more...
 
 V. Jenks wrote:
 I'm having non-stop issues w/ DynamicWebResource and trying to load
 images
 external to my .ear deployment now that I've moved to 1.3.  First off,
 I'm
 hoping someone can suggest an easier way to do it because what I have now
 is
 code that someone was nice enough to give me, here on the Wicket mailing
 list.  However, I don't entirely understand how it works and while it
 worked
 for 2 years in Wicket 1.2, it is now causing me problem after problem in
 Wicket 1.3.x - for whatever reason.

 First what I've got is a class called ImageResource which extends
 DynamicWebResource:

 /*/
 public class ImageResource extends DynamicWebResource
 {
  private ImageService imgSrv;

  public ImageResource()
  {
  super();
  imgSrv = new ImageServiceEngine();
  }

  public String getImage(String image)
  {
  String retImg = null;

  try
  {
  retImg = imgSrv.getImage(image).toString();
  }
  catch (IOException exp)
  {
  LogProxy.saveEntry(exp);
  }

  return retImg;
  }

  protected ResourceState getResourceState()
  {
  ImageResourceState state = null;
  
  try
  {
  ValueMap params = getParameters();

  byte[] data = null;
  String imageId = params.getString(file);
   
  //Date lastModified = getImageLastMod(imageId); 
  state = new ImageResourceState(Time.valueOf(new 
 Date()));
  state.setContentType(image/jpeg);
  
  //SECURITY PRECAUTION - DO NOT ALLOW ANYTHING BUT 
 IMAGES!
  if 
 (imageId.contains(PropertyProxy.getExternalImagesRoot()) || 
  
 imageId.contains(PropertyProxy.getExternalImagesAltRoot()))
  {
  data = imgSrv.getImage(imageId);
  }
  else
  {
  //change image to not found warning image
  data = 
 imgSrv.getImage(PropertyProxy.getImageNotFound());
  
  //TODO: send email to notify of inappropriate 
 access
  }
  
  state.setData(data);
  }
  catch (FileNotFoundException exp)
  {
  LogProxy.saveEntry(exp);
  }
  catch (IOException exp)
  {
  LogProxy.saveEntry(exp);
  }
  catch (NullPointerException exp)
  {
  LogProxy.saveEntry(exp);
  }
  
  return state;
  }

  /**
   * 
   * @author vjenks
   * 
   */
  protected class ImageResourceState extends ResourceState
  {
  private String contentType;
  private byte[] data;
  private Time lastModified;

  ImageResourceState(Time lastModified)
  {
  super();
  this.lastModified = lastModified;
  }

  public String getContentType()
  {
  return contentType;
  }

  void setContentType(String contentType)
  {
  this.contentType = contentType;
  }

  public byte[] getData()
  {
  return data;
  }

  void setData(byte[] data)
  {
  this.data = data;
  }

  public int getLength()
  {
  if (data != null)
  return data.length;
  else
  return 0;
  }

  public Time lastModifiedTime()
  {
  return lastModified;
  }
  }
 }
 /*/


 You can see that it uses a class called ImageServiceEngine:

 /*/
 public class ImageServiceEngine implements ImageService, Serializable
 {
  private int 

RE: Contextual autoCompleteTextField

2008-06-25 Thread Hoover, William
If you need the components:

final ListFormComponent yourViewFormComponents = new
ArrayListFormComponent();
final IteratorWebMarkupContainer items = yourView.iterator();
if (items != null) {
while (items.hasNext()) {
items.next().visitChildren(new Component.IVisitor() {
public final Object component(final Component
component) {
if (component instanceof FormComponent)
{

yourViewFormComponents.add((FormComponent) component); 
}
return CONTINUE_TRAVERSAL;
}
});
}
}

If you only need the model objects:

final ListYourModelObject yourViewModelObjects = new
ArrayListYourModelObject();
final IteratorWebMarkupContainer items = yourView.iterator();
if (items != null) {
while (items.hasNext()) {
yourViewModelObjects.add((YourModelObject)
items.next().getModelObject());
}
}


-Original Message-
From: Bertrand DATAS [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2008 10:25 AM
To: users@wicket.apache.org
Subject: Re: Contextual autoCompleteTextField

yes i could do like that but my field are generated in a listview so how
can I retrieve them ??


2008/6/25 Hoover, William [EMAIL PROTECTED]:

 What is stopping you from using the models from the other fields when 
 constructing your list?

 -Original Message-
 From: Bertrand DATAS [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 8:05 AM
 To: users@wicket.apache.org
 Subject: Re: Contextual autoCompleteTextField

 Not really because i dont want to use the onselect of this component 
 but to use the content of two other fields to construct the list that 
 will be displayed in my AutoCompleteTextField.

 2008/6/25 Hoover, William [EMAIL PROTECTED]:

  Are you referring to something like
  http://issues.apache.org/jira/browse/WICKET-488?
 
  -Original Message-
  From: Bertrand DATAS [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, June 25, 2008 4:21 AM
  To: users@wicket.apache.org
  Subject: Contextual autoCompleteTextField
 
  Hello everybody,
 
  Do you know if there is a way to make contextual the list of 
  autocompletTextfield that is to say to make it relative to other 
  fields that are in the form ?
  Actually i have two Fields, Town and ZipCode and when there are 
  filled, my autoCompleteTextField must display the list of the 
  streets available for this Town and ZipCode.
 
  Do you have any trick for making this ??
 
  Thanks
 
  Bertrand Datas
 
 
  
  - 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]



OpenSessionInView (OSIV), LoadableDetachableModel and Transactions

2008-06-25 Thread cretzel

Hi,

I'm using Wicket together with Spring and Hibernate. And it's quite common,
I think, to use an OpenSessionInViewFilter and a LoadableDetachableModel
which wraps the domain objects loaded with Hibernate, so that when the model
is detached it only holds the ID of the domain object and when its
load()-method is called it uses the ID to load the entity again from the
database (see 
http://www.nabble.com/How-to-avoid-Lazy-loading-exception-td17040941.html#a17041351
this post  for an example). So one advantage of this pattern is that you
mainly never get into problems with detached entities
(LazyInitializingException and so on).

I only got one issue with this when using Spring's transaction support.
Suppose you are editing a domain object in a form and you submit the form
and it passes conversion and validation. Actually the changes you've made
have been written into the domain object when you are in onSubmit() for
example. Then in this situation these changes could easily get persistet to
the DB, even if you don't want them to at this point, e.g. because you want
to do some backend validation first. This can happen when Hibernate flushes
the session, for example before another query. The problem is that the
changes on the domain object are made outside of a transaction
[OpenSessionInViewFilter just opens a Session but doesn't start a
transaction].

An example:
Suppose you are editing an entity User, changing the username for example.
The onSubmit()-method could look like this:

onSubmit() {
   // User with changed username, attached to the Session
   User user = (User) getModelObject(); 
   // Do a query. This will cause the changes made to user 
   // to be flushed to the DB
   userService.getUsers();
   // This method does some backend validation, possibly 
   // fails and the transaction is rolled back so that the 
   // changes should not be persisted
   userService.saveUser(user); 
}

After this, the changes could be persistent in the DB, although they
shouldn't because the validation in the backend failed which should have
rolled back the changes.

I hope I made clear the point.

What do you think?

-- 
View this message in context: 
http://www.nabble.com/OpenSessionInView-%28OSIV%29%2C-LoadableDetachableModel-and-Transactions-tp18115802p18115802.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: OpenSessionInView (OSIV), LoadableDetachableModel and Transactions

2008-06-25 Thread Michael Sparer

I'd say either enable transactions only for write operations or put all
together in one transaction (i.e. don't let hibernate flush the session
before you did your backend checks) ...



cretzel wrote:
 
 Hi,
 
 I'm using Wicket together with Spring and Hibernate. And it's quite
 common, I think, to use an OpenSessionInViewFilter and a
 LoadableDetachableModel which wraps the domain objects loaded with
 Hibernate, so that when the model is detached it only holds the ID of the
 domain object and when its load()-method is called it uses the ID to load
 the entity again from the database (see 
 http://www.nabble.com/How-to-avoid-Lazy-loading-exception-td17040941.html#a17041351
 this post  for an example). So one advantage of this pattern is that you
 mainly never get into problems with detached entities
 (LazyInitializingException and so on).
 
 I only got one issue with this when using Spring's transaction support.
 Suppose you are editing a domain object in a form and you submit the form
 and it passes conversion and validation. Actually the changes you've made
 have been written into the domain object when you are in onSubmit() for
 example. Then in this situation these changes could easily get persistet
 to the DB, even if you don't want them to at this point, e.g. because you
 want to do some backend validation first. This can happen when Hibernate
 flushes the session, for example before another query. The problem is that
 the changes on the domain object are made outside of a transaction
 [OpenSessionInViewFilter just opens a Session but doesn't start a
 transaction].
 
 An example:
 Suppose you are editing an entity User, changing the username for example.
 The onSubmit()-method could look like this:
 
 onSubmit() {
// User with changed username, attached to the Session
User user = (User) getModelObject(); 
// Do a query. This will cause the changes made to user 
// to be flushed to the DB
userService.getUsers();
// This method does some backend validation, possibly 
// fails and the transaction is rolled back so that the 
// changes should not be persisted
userService.saveUser(user); 
 }
 
 After this, the changes could be persistent in the DB, although they
 shouldn't because the validation in the backend failed which should have
 rolled back the changes.
 
 I hope I made clear the point.
 
 What do you think?
 
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/OpenSessionInView-%28OSIV%29%2C-LoadableDetachableModel-and-Transactions-tp18115802p18115882.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Trying to make bookmarkablelink

2008-06-25 Thread Mathias P.W Nilsson

Hi!

I get this error when trying to make a bookmarkable page.

java.lang.IllegalArgumentException: Too many path parts, please provide
sufficient number of path parameter names

This is my mouting, mount(new MixedParamUrlCodingStrategy(ItemInterceptor,
ItemInterceptor.class,new String[]{}));

This is the code for making the link 

Brand brand = (Brand) item.getModelObject();
PageParameters params = new PageParameters();
params.add( Brand,  brand.getId().toString() 
);
Link brandLink = new BookmarkablePageLink( 
brandLink
,ItemInterceptor.class, params );

And it generates this url... I don't know why the slash is there. Anyone

https://localhost/hairless-web/ItemInterceptor/?Brand=76
-- 
View this message in context: 
http://www.nabble.com/Trying-to-make-bookmarkablelink-tp18115889p18115889.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: More issues w/ external images and DynamicWebResource

2008-06-25 Thread Nino Saturnino Martinez Vazquez Wael
I believe there was a post on this not too many weeks ago, you can use 
nabble to search for it. Something about serving images or something 
along those lines...


ps I didnt realize that the source you posted were the same...Was a 
quick mail..


V. Jenks wrote:

Thanks Igor, I'll look into this - not something I've tried yet.  I was
hoping there'd be a short-term tweak to what I already have in place because
there are references to that imageResource lookup URL in several spots in my
code that I'd now have to go and swap out.


igor.vaynberg wrote:
  

why not just create a dead simple servlet that streams images? in fact
there are tons of them online you can just take. it is a much simpler
solution then dealing with wicket's resources for this particular
usecase.

-igor

On Wed, Jun 25, 2008 at 7:59 AM, V. Jenks [EMAIL PROTECTED] wrote:


I'm having non-stop issues w/ DynamicWebResource and trying to load
images
external to my .ear deployment now that I've moved to 1.3.  First off,
I'm
hoping someone can suggest an easier way to do it because what I have now
is
code that someone was nice enough to give me, here on the Wicket mailing
list.  However, I don't entirely understand how it works and while it
worked
for 2 years in Wicket 1.2, it is now causing me problem after problem in
Wicket 1.3.x - for whatever reason.

First what I've got is a class called ImageResource which extends
DynamicWebResource:

/*/
public class ImageResource extends DynamicWebResource
{
   private ImageService imgSrv;

   public ImageResource()
   {
   super();
   imgSrv = new ImageServiceEngine();
   }

   public String getImage(String image)
   {
   String retImg = null;

   try
   {
   retImg = imgSrv.getImage(image).toString();
   }
   catch (IOException exp)
   {
   LogProxy.saveEntry(exp);
   }

   return retImg;
   }

   protected ResourceState getResourceState()
   {
   ImageResourceState state = null;

   try
   {
   ValueMap params = getParameters();

   byte[] data = null;
   String imageId = params.getString(file);

   //Date lastModified = getImageLastMod(imageId);
   state = new ImageResourceState(Time.valueOf(new
Date()));
   state.setContentType(image/jpeg);

   //SECURITY PRECAUTION - DO NOT ALLOW ANYTHING BUT
IMAGES!
   if
(imageId.contains(PropertyProxy.getExternalImagesRoot()) ||
  
imageId.contains(PropertyProxy.getExternalImagesAltRoot()))

   {
   data = imgSrv.getImage(imageId);
   }
   else
   {
   //change image to not found warning
image
   data =
imgSrv.getImage(PropertyProxy.getImageNotFound());

   //TODO: send email to notify of
inappropriate access
   }

   state.setData(data);
   }
   catch (FileNotFoundException exp)
   {
   LogProxy.saveEntry(exp);
   }
   catch (IOException exp)
   {
   LogProxy.saveEntry(exp);
   }
   catch (NullPointerException exp)
   {
   LogProxy.saveEntry(exp);
   }

   return state;
   }

   /**
*
* @author vjenks
*
*/
   protected class ImageResourceState extends ResourceState
   {
   private String contentType;
   private byte[] data;
   private Time lastModified;

   ImageResourceState(Time lastModified)
   {
   super();
   this.lastModified = lastModified;
   }

   public String getContentType()
   {
   return contentType;
   }

   void setContentType(String contentType)
   {
   this.contentType = contentType;
   }

   public byte[] getData()
   {
   return data;
   }

   void setData(byte[] data)
   {
   this.data = data;
   }

   public int getLength()
   {
   if (data != null)
   return data.length;
   else
   return 0;
   }

   public Time 

Re: OpenSessionInView (OSIV), LoadableDetachableModel and Transactions

2008-06-25 Thread Nino Saturnino Martinez Vazquez Wael
you could take a look at blog tutorial(wiki) or wicket iolite(wicket 
stuff)...


cretzel wrote:

Hi,

I'm using Wicket together with Spring and Hibernate. And it's quite common,
I think, to use an OpenSessionInViewFilter and a LoadableDetachableModel
which wraps the domain objects loaded with Hibernate, so that when the model
is detached it only holds the ID of the domain object and when its
load()-method is called it uses the ID to load the entity again from the
database (see 
http://www.nabble.com/How-to-avoid-Lazy-loading-exception-td17040941.html#a17041351

this post  for an example). So one advantage of this pattern is that you
mainly never get into problems with detached entities
(LazyInitializingException and so on).

I only got one issue with this when using Spring's transaction support.
Suppose you are editing a domain object in a form and you submit the form
and it passes conversion and validation. Actually the changes you've made
have been written into the domain object when you are in onSubmit() for
example. Then in this situation these changes could easily get persistet to
the DB, even if you don't want them to at this point, e.g. because you want
to do some backend validation first. This can happen when Hibernate flushes
the session, for example before another query. The problem is that the
changes on the domain object are made outside of a transaction
[OpenSessionInViewFilter just opens a Session but doesn't start a
transaction].

An example:
Suppose you are editing an entity User, changing the username for example.
The onSubmit()-method could look like this:

onSubmit() {
   // User with changed username, attached to the Session
   User user = (User) getModelObject(); 
   // Do a query. This will cause the changes made to user 
   // to be flushed to the DB

   userService.getUsers();
   // This method does some backend validation, possibly 
   // fails and the transaction is rolled back so that the 
   // changes should not be persisted
   userService.saveUser(user); 
}


After this, the changes could be persistent in the DB, although they
shouldn't because the validation in the backend failed which should have
rolled back the changes.

I hope I made clear the point.

What do you think?

  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: Contextual autoCompleteTextField

2008-06-25 Thread Bertrand DATAS
Ok I will try that but I am not sure that model object will be updated with
the new data entered by the when I want to populate the list of my
AutoCompleteTextField. Oh may be i can update it in the onChange of all my
fields (this will add network traffic but i don't know how to make it
better).

2008/6/25 Hoover, William [EMAIL PROTECTED]:

 If you need the components:

 final ListFormComponent yourViewFormComponents = new
 ArrayListFormComponent();
 final IteratorWebMarkupContainer items = yourView.iterator();
 if (items != null) {
while (items.hasNext()) {
items.next().visitChildren(new Component.IVisitor() {
public final Object component(final Component
 component) {
if (component instanceof FormComponent)
 {

 yourViewFormComponents.add((FormComponent) component);
}
return CONTINUE_TRAVERSAL;
}
});
}
 }

 If you only need the model objects:

 final ListYourModelObject yourViewModelObjects = new
 ArrayListYourModelObject();
 final IteratorWebMarkupContainer items = yourView.iterator();
 if (items != null) {
while (items.hasNext()) {
yourViewModelObjects.add((YourModelObject)
 items.next().getModelObject());
 }
 }


 -Original Message-
 From: Bertrand DATAS [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 10:25 AM
 To: users@wicket.apache.org
 Subject: Re: Contextual autoCompleteTextField

 yes i could do like that but my field are generated in a listview so how
 can I retrieve them ??


 2008/6/25 Hoover, William [EMAIL PROTECTED]:

  What is stopping you from using the models from the other fields when
  constructing your list?
 
  -Original Message-
  From: Bertrand DATAS [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, June 25, 2008 8:05 AM
  To: users@wicket.apache.org
  Subject: Re: Contextual autoCompleteTextField
 
  Not really because i dont want to use the onselect of this component
  but to use the content of two other fields to construct the list that
  will be displayed in my AutoCompleteTextField.
 
  2008/6/25 Hoover, William [EMAIL PROTECTED]:
 
   Are you referring to something like
   http://issues.apache.org/jira/browse/WICKET-488?
  
   -Original Message-
   From: Bertrand DATAS [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, June 25, 2008 4:21 AM
   To: users@wicket.apache.org
   Subject: Contextual autoCompleteTextField
  
   Hello everybody,
  
   Do you know if there is a way to make contextual the list of
   autocompletTextfield that is to say to make it relative to other
   fields that are in the form ?
   Actually i have two Fields, Town and ZipCode and when there are
   filled, my autoCompleteTextField must display the list of the
   streets available for this Town and ZipCode.
  
   Do you have any trick for making this ??
  
   Thanks
  
   Bertrand Datas
  
  
   
   - 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: OpenSessionInView (OSIV), LoadableDetachableModel and Transactions

2008-06-25 Thread Igor Vaynberg
map a form to a bean and apply the changes to the entity yourself

or do all validation via I(Form)Validators

-igor

On Wed, Jun 25, 2008 at 8:51 AM, cretzel [EMAIL PROTECTED] wrote:

 Hi,

 I'm using Wicket together with Spring and Hibernate. And it's quite common,
 I think, to use an OpenSessionInViewFilter and a LoadableDetachableModel
 which wraps the domain objects loaded with Hibernate, so that when the model
 is detached it only holds the ID of the domain object and when its
 load()-method is called it uses the ID to load the entity again from the
 database (see
 http://www.nabble.com/How-to-avoid-Lazy-loading-exception-td17040941.html#a17041351
 this post  for an example). So one advantage of this pattern is that you
 mainly never get into problems with detached entities
 (LazyInitializingException and so on).

 I only got one issue with this when using Spring's transaction support.
 Suppose you are editing a domain object in a form and you submit the form
 and it passes conversion and validation. Actually the changes you've made
 have been written into the domain object when you are in onSubmit() for
 example. Then in this situation these changes could easily get persistet to
 the DB, even if you don't want them to at this point, e.g. because you want
 to do some backend validation first. This can happen when Hibernate flushes
 the session, for example before another query. The problem is that the
 changes on the domain object are made outside of a transaction
 [OpenSessionInViewFilter just opens a Session but doesn't start a
 transaction].

 An example:
 Suppose you are editing an entity User, changing the username for example.
 The onSubmit()-method could look like this:

 onSubmit() {
   // User with changed username, attached to the Session
   User user = (User) getModelObject();
   // Do a query. This will cause the changes made to user
   // to be flushed to the DB
   userService.getUsers();
   // This method does some backend validation, possibly
   // fails and the transaction is rolled back so that the
   // changes should not be persisted
   userService.saveUser(user);
 }

 After this, the changes could be persistent in the DB, although they
 shouldn't because the validation in the backend failed which should have
 rolled back the changes.

 I hope I made clear the point.

 What do you think?

 --
 View this message in context: 
 http://www.nabble.com/OpenSessionInView-%28OSIV%29%2C-LoadableDetachableModel-and-Transactions-tp18115802p18115802.html
 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: Trying to use spring with wicket

2008-06-25 Thread Nino Saturnino Martinez Vazquez Wael

No problem, please say if you have any RFE's:)

I know that packages arent being generated but dont know howto do it any 
better when doing a multi project archetype...


Piller Sébastien wrote:

It works very well, thanks ;)


Igor Vaynberg a écrit :

i think this maven archetype might be what you are looking for

http://www.wicketstuff.org/teamcity/viewType.html?buildTypeId=bt17

-igor

On Tue, Jun 24, 2008 at 8:29 AM, Piller Sébastien 
[EMAIL PROTECTED] wrote:
 

Hello guys,

I'm trying to get Wicket use Spring  Hibernate correctly. I don't know
Spring very well, so I probably made some great errors.

I have some question for the beginning:

- I saw a SpringWebApplication in wicket. Does my app must extends 
this

class or is it possible to use spring  an AuthenticatedWebApplication?
- Is it possible to use spring with filters or do I need to use 
servlets?

- Does anybody have a quickstart project that runs with Spring 2.5,
Hibernate 3.2 and Wicket 1.3.1?


Thanks you

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



--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: UTF-8 Byte Order Marks in .html files

2008-06-25 Thread Miguel Paraz
On Wed, Jun 25, 2008 at 9:51 PM, Brill Pappin [EMAIL PROTECTED] wrote:
 I think it might be your browser that is not displaying the unicode chars.
 That you see the odd symbols at all means that the made it to the client
 side.

 Are you on a Mac?

Hi! Thanks for the reply.

No, I'm on Firefox 3 on Windows.

Do you have an idea why removing the BOM fixes it?

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



Multipart form throws exception

2008-06-25 Thread Michael Mehrle
I'm on Wicket 1.3.3 and am experiencing problems with multipart content
on Safari and IE. The backend page receiving the image processes it just
fine and returns a response like this:

 

RequestCycle.get().setRequestTarget(new IRequestTarget() {

public void detach(RequestCycle
requestCycle) {

}

public void respond(RequestCycle
requestCycle) {

// formulate the JSON
response 

StringBuffer response =
new StringBuffer({\n);

if (StringUtils.isNotEmpty(error)) {

response.append(\error\:
\).append(getString(error)).append(\);

} else {

response.append(\msg\:
\).append(getString(successfulFileUploadNotification)).append(\,\n
);

response.append(\photoId\:
\).append(photo.getId()).append(\,\n);

response.append(\uri\:
\).append(photoService.getPhotoSrc(photo)).append(\);

}

response.append(\n});

Response rep =
requestCycle.getResponse();

 
rep.setContentType(text/javascript);

rep.write(response);

}

});

 

As you can see I'm bouncing a JSON response back, which is received and
handled on my front end. It works in Firefox but fails in Safari and IE
with an error message which I would love to post but I'm not getting
every time. I do remember however that it complained about the response
not being 'multipart'.

 

There is a similar bug report that was posted a while ago and claimed
this to be fixed in 1.3.3.

 

http://www.nabble.com/Multipart-form-with-nested-ajaxform-throws-excepti
on-in-1.3.1-td15975693.html

 

Any suggestions would be welcome.

 

Thanks!

 

Michael



Re: Multipart form throws exception

2008-06-25 Thread Igor Vaynberg
response not being multipart? wasnt aware there was such a thing...

-igor

On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle [EMAIL PROTECTED] wrote:
 I'm on Wicket 1.3.3 and am experiencing problems with multipart content
 on Safari and IE. The backend page receiving the image processes it just
 fine and returns a response like this:



 RequestCycle.get().setRequestTarget(new IRequestTarget() {

public void detach(RequestCycle
 requestCycle) {

}

public void respond(RequestCycle
 requestCycle) {

// formulate the JSON
 response

StringBuffer response =
 new StringBuffer({\n);

if (StringUtils.isNotEmpty(error)) {

response.append(\error\:
 \).append(getString(error)).append(\);

} else {

response.append(\msg\:
 \).append(getString(successfulFileUploadNotification)).append(\,\n
 );

response.append(\photoId\:
 \).append(photo.getId()).append(\,\n);

response.append(\uri\:
 \).append(photoService.getPhotoSrc(photo)).append(\);

}

response.append(\n});

Response rep =
 requestCycle.getResponse();


 rep.setContentType(text/javascript);

rep.write(response);

}

});



 As you can see I'm bouncing a JSON response back, which is received and
 handled on my front end. It works in Firefox but fails in Safari and IE
 with an error message which I would love to post but I'm not getting
 every time. I do remember however that it complained about the response
 not being 'multipart'.



 There is a similar bug report that was posted a while ago and claimed
 this to be fixed in 1.3.3.



 http://www.nabble.com/Multipart-form-with-nested-ajaxform-throws-excepti
 on-in-1.3.1-td15975693.html



 Any suggestions would be welcome.



 Thanks!



 Michael



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



Re: UTF-8 Byte Order Marks in .html files

2008-06-25 Thread Brill Pappin

Not sure what you mean by BOM (Bill Of Materials?)

However I have seen something odd with documents there were generated  
on a Mac with little ? in various places.


- Brill Pappin

On 25-Jun-08, at 2:22 PM, Miguel Paraz wrote:


On Wed, Jun 25, 2008 at 9:51 PM, Brill Pappin [EMAIL PROTECTED] wrote:
I think it might be your browser that is not displaying the unicode  
chars.
That you see the odd symbols at all means that the made it to the  
client

side.

Are you on a Mac?


Hi! Thanks for the reply.

No, I'm on Firefox 3 on Windows.

Do you have an idea why removing the BOM fixes it?

-
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: Multipart form throws exception

2008-06-25 Thread Michael Mehrle
Just ran into the exception again:

java.lang.IllegalStateException: ServletRequest does not contain
multipart content
at
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init
(MultipartServletWebRequest.java:90)
at
com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
.java:66)
at
com.evite.event.web.create.MainImageUpload.init(MainImageUpload.java:3
8)


Sorry, I meant to say 'request'

MainImageUpload is what the file uploader points to.

Michael

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2008 11:34 AM
To: users@wicket.apache.org
Subject: Re: Multipart form throws exception

response not being multipart? wasnt aware there was such a thing...

-igor

On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
[EMAIL PROTECTED] wrote:
 I'm on Wicket 1.3.3 and am experiencing problems with multipart
content
 on Safari and IE. The backend page receiving the image processes it
just
 fine and returns a response like this:



 RequestCycle.get().setRequestTarget(new IRequestTarget() {

public void detach(RequestCycle
 requestCycle) {

}

public void respond(RequestCycle
 requestCycle) {

// formulate the JSON
 response

StringBuffer response =
 new StringBuffer({\n);

if (StringUtils.isNotEmpty(error)) {

response.append(\error\:
 \).append(getString(error)).append(\);

} else {

response.append(\msg\:

\).append(getString(successfulFileUploadNotification)).append(\,\n
 );

response.append(\photoId\:
 \).append(photo.getId()).append(\,\n);

response.append(\uri\:
 \).append(photoService.getPhotoSrc(photo)).append(\);

}

response.append(\n});

Response rep =
 requestCycle.getResponse();


 rep.setContentType(text/javascript);

rep.write(response);

}

});



 As you can see I'm bouncing a JSON response back, which is received
and
 handled on my front end. It works in Firefox but fails in Safari and
IE
 with an error message which I would love to post but I'm not getting
 every time. I do remember however that it complained about the
response
 not being 'multipart'.



 There is a similar bug report that was posted a while ago and claimed
 this to be fixed in 1.3.3.




http://www.nabble.com/Multipart-form-with-nested-ajaxform-throws-excepti
 on-in-1.3.1-td15975693.html



 Any suggestions would be welcome.



 Thanks!



 Michael



-
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: Trying to use spring with wicket

2008-06-25 Thread Piller Sébastien

One little question:

why isn't there some *.hbm.xml? How is the mapping between pojo and db 
done?


Is it possible to use *.hbm.xml with this exemple? They are already 
writted, and I would like to use them?


Could you point me to a direction?

Thanks!

Nino Saturnino Martinez Vazquez Wael a écrit :

No problem, please say if you have any RFE's:)

I know that packages arent being generated but dont know howto do it 
any better when doing a multi project archetype...


Piller Sébastien wrote:

It works very well, thanks ;)


Igor Vaynberg a écrit :

i think this maven archetype might be what you are looking for

http://www.wicketstuff.org/teamcity/viewType.html?buildTypeId=bt17

-igor

On Tue, Jun 24, 2008 at 8:29 AM, Piller Sébastien 
[EMAIL PROTECTED] wrote:
 

Hello guys,

I'm trying to get Wicket use Spring  Hibernate correctly. I don't 
know

Spring very well, so I probably made some great errors.

I have some question for the beginning:

- I saw a SpringWebApplication in wicket. Does my app must 
extends this
class or is it possible to use spring  an 
AuthenticatedWebApplication?
- Is it possible to use spring with filters or do I need to use 
servlets?

- Does anybody have a quickstart project that runs with Spring 2.5,
Hibernate 3.2 and Wicket 1.3.1?


Thanks you

-
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: Multipart form throws exception

2008-06-25 Thread Igor Vaynberg
are you submitting the form via ajax?

-igor

On Wed, Jun 25, 2008 at 12:09 PM, Michael Mehrle [EMAIL PROTECTED] wrote:
 Just ran into the exception again:

 java.lang.IllegalStateException: ServletRequest does not contain
 multipart content
at
 org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init
(MultipartServletWebRequest.java:90)
at
 com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
 .java:66)
at
 com.evite.event.web.create.MainImageUpload.init(MainImageUpload.java:3
 8)


 Sorry, I meant to say 'request'

 MainImageUpload is what the file uploader points to.

 Michael

 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 11:34 AM
 To: users@wicket.apache.org
 Subject: Re: Multipart form throws exception

 response not being multipart? wasnt aware there was such a thing...

 -igor

 On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
 [EMAIL PROTECTED] wrote:
 I'm on Wicket 1.3.3 and am experiencing problems with multipart
 content
 on Safari and IE. The backend page receiving the image processes it
 just
 fine and returns a response like this:



 RequestCycle.get().setRequestTarget(new IRequestTarget() {

public void detach(RequestCycle
 requestCycle) {

}

public void respond(RequestCycle
 requestCycle) {

// formulate the JSON
 response

StringBuffer response =
 new StringBuffer({\n);

if (StringUtils.isNotEmpty(error)) {

response.append(\error\:
 \).append(getString(error)).append(\);

} else {

response.append(\msg\:

 \).append(getString(successfulFileUploadNotification)).append(\,\n
 );

response.append(\photoId\:
 \).append(photo.getId()).append(\,\n);

response.append(\uri\:
 \).append(photoService.getPhotoSrc(photo)).append(\);

}

response.append(\n});

Response rep =
 requestCycle.getResponse();


 rep.setContentType(text/javascript);

rep.write(response);

}

});



 As you can see I'm bouncing a JSON response back, which is received
 and
 handled on my front end. It works in Firefox but fails in Safari and
 IE
 with an error message which I would love to post but I'm not getting
 every time. I do remember however that it complained about the
 response
 not being 'multipart'.



 There is a similar bug report that was posted a while ago and claimed
 this to be fixed in 1.3.3.




 http://www.nabble.com/Multipart-form-with-nested-ajaxform-throws-excepti
 on-in-1.3.1-td15975693.html



 Any suggestions would be welcome.



 Thanks!



 Michael



 -
 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: UTF-8 Byte Order Marks in .html files

2008-06-25 Thread Sven Meier

Hi,

if your editor prefixes your templates with a BOM(1), Wicket is not able 
to recognize the encoding in your xml declaration, see 
org.apache.wicket.util.io.XmlReader#xmlDecl .


You might want to create a JIRA request, that Wicket should skip a 
leading BOM in the encoding detection.


Regards

Sven

1 - http://de.wikipedia.org/wiki/Byte_Order_Mark

Brill Pappin schrieb:

Not sure what you mean by BOM (Bill Of Materials?)

However I have seen something odd with documents there were generated 
on a Mac with little ? in various places.


- Brill Pappin

On 25-Jun-08, at 2:22 PM, Miguel Paraz wrote:


On Wed, Jun 25, 2008 at 9:51 PM, Brill Pappin [EMAIL PROTECTED] wrote:
I think it might be your browser that is not displaying the unicode 
chars.
That you see the odd symbols at all means that the made it to the 
client

side.

Are you on a Mac?


Hi! Thanks for the reply.

No, I'm on Firefox 3 on Windows.

Do you have an idea why removing the BOM fixes it?

-
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: Multipart form throws exception

2008-06-25 Thread Igor Vaynberg
doesnt jquery use an iframe? so it is not submitted via ajax...

-igor

On Wed, Jun 25, 2008 at 1:27 PM, Michael Mehrle [EMAIL PROTECTED] wrote:
 Yeah, remember I build it around jQuery according to that link you sent
 me - not using Wicket for the upload only for bouncing back the
 response.

 Thing is that this worked until 1.3.2 and somehow since updating to
 1.3.3 it's broken again. The issue seems to be the content type - had it
 working with 'text/javascript' on all three browsers but now it won't.

 M.

 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 1:22 PM
 To: users@wicket.apache.org
 Subject: Re: Multipart form throws exception

 are you submitting the form via ajax?

 -igor

 On Wed, Jun 25, 2008 at 12:09 PM, Michael Mehrle
 [EMAIL PROTECTED] wrote:
 Just ran into the exception again:

 java.lang.IllegalStateException: ServletRequest does not contain
 multipart content
at

 org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init
(MultipartServletWebRequest.java:90)
at

 com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
 .java:66)
at

 com.evite.event.web.create.MainImageUpload.init(MainImageUpload.java:3
 8)


 Sorry, I meant to say 'request'

 MainImageUpload is what the file uploader points to.

 Michael

 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 11:34 AM
 To: users@wicket.apache.org
 Subject: Re: Multipart form throws exception

 response not being multipart? wasnt aware there was such a thing...

 -igor

 On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
 [EMAIL PROTECTED] wrote:
 I'm on Wicket 1.3.3 and am experiencing problems with multipart
 content
 on Safari and IE. The backend page receiving the image processes it
 just
 fine and returns a response like this:



 RequestCycle.get().setRequestTarget(new IRequestTarget() {

public void detach(RequestCycle
 requestCycle) {

}

public void respond(RequestCycle
 requestCycle) {

// formulate the JSON
 response

StringBuffer response
 =
 new StringBuffer({\n);

if (StringUtils.isNotEmpty(error)) {

response.append(\error\:
 \).append(getString(error)).append(\);

} else {

response.append(\msg\:


 \).append(getString(successfulFileUploadNotification)).append(\,\n
 );

response.append(\photoId\:
 \).append(photo.getId()).append(\,\n);

response.append(\uri\:
 \).append(photoService.getPhotoSrc(photo)).append(\);

}

response.append(\n});

Response rep =
 requestCycle.getResponse();


 rep.setContentType(text/javascript);

rep.write(response);

}

});



 As you can see I'm bouncing a JSON response back, which is received
 and
 handled on my front end. It works in Firefox but fails in Safari and
 IE
 with an error message which I would love to post but I'm not getting
 every time. I do remember however that it complained about the
 response
 not being 'multipart'.



 There is a similar bug report that was posted a while ago and claimed
 this to be fixed in 1.3.3.





 http://www.nabble.com/Multipart-form-with-nested-ajaxform-throws-excepti
 on-in-1.3.1-td15975693.html



 Any suggestions would be welcome.



 Thanks!



 Michael



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



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



RE: Multipart form throws exception

2008-06-25 Thread Michael Mehrle
Yes, that's true - it IS using a dynamic iFrame. Again, the *submition*
process works just fine and I get the data on the backend. What's
causing the problem is the data being returned and the IE/Safari for
some reason not liking 'text/javascript' as a content type anymore.
Something has changed from 1.3.2 to 1.3.3-SNAPSHOT that causes this.

Michael

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2008 2:10 PM
To: users@wicket.apache.org
Subject: Re: Multipart form throws exception

doesnt jquery use an iframe? so it is not submitted via ajax...

-igor

On Wed, Jun 25, 2008 at 1:27 PM, Michael Mehrle [EMAIL PROTECTED]
wrote:
 Yeah, remember I build it around jQuery according to that link you
sent
 me - not using Wicket for the upload only for bouncing back the
 response.

 Thing is that this worked until 1.3.2 and somehow since updating to
 1.3.3 it's broken again. The issue seems to be the content type - had
it
 working with 'text/javascript' on all three browsers but now it won't.

 M.

 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 1:22 PM
 To: users@wicket.apache.org
 Subject: Re: Multipart form throws exception

 are you submitting the form via ajax?

 -igor

 On Wed, Jun 25, 2008 at 12:09 PM, Michael Mehrle
 [EMAIL PROTECTED] wrote:
 Just ran into the exception again:

 java.lang.IllegalStateException: ServletRequest does not contain
 multipart content
at


org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init
(MultipartServletWebRequest.java:90)
at


com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
 .java:66)
at


com.evite.event.web.create.MainImageUpload.init(MainImageUpload.java:3
 8)


 Sorry, I meant to say 'request'

 MainImageUpload is what the file uploader points to.

 Michael

 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 11:34 AM
 To: users@wicket.apache.org
 Subject: Re: Multipart form throws exception

 response not being multipart? wasnt aware there was such a thing...

 -igor

 On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
 [EMAIL PROTECTED] wrote:
 I'm on Wicket 1.3.3 and am experiencing problems with multipart
 content
 on Safari and IE. The backend page receiving the image processes it
 just
 fine and returns a response like this:



 RequestCycle.get().setRequestTarget(new IRequestTarget() {

public void detach(RequestCycle
 requestCycle) {

}

public void respond(RequestCycle
 requestCycle) {

// formulate the JSON
 response

StringBuffer response
 =
 new StringBuffer({\n);

if (StringUtils.isNotEmpty(error)) {

response.append(\error\:
 \).append(getString(error)).append(\);

} else {

response.append(\msg\:



\).append(getString(successfulFileUploadNotification)).append(\,\n
 );

response.append(\photoId\:
 \).append(photo.getId()).append(\,\n);

response.append(\uri\:
 \).append(photoService.getPhotoSrc(photo)).append(\);

}

response.append(\n});

Response rep =
 requestCycle.getResponse();


 rep.setContentType(text/javascript);

rep.write(response);

}

});



 As you can see I'm bouncing a JSON response back, which is received
 and
 handled on my front end. It works in Firefox but fails in Safari and
 IE
 with an error message which I would love to post but I'm not getting
 every time. I do remember however that it complained about the
 response
 not being 'multipart'.



 There is a similar bug report that was posted a while ago and
claimed
 this to be fixed in 1.3.3.






http://www.nabble.com/Multipart-form-with-nested-ajaxform-throws-excepti
 on-in-1.3.1-td15975693.html



 Any suggestions would be welcome.



 Thanks!



 Michael



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



-
To unsubscribe, 

Re: Trying to make bookmarkablelink

2008-06-25 Thread Gwyn Evans
I think that MixedParamUrlCodingStrategy is expecting you to specify at
least one parameter - Are you sure you don't want HybridUrlCodingStrategy?

/Gwyn

On Wed, Jun 25, 2008 at 5:18 PM, Mathias P.W Nilsson [EMAIL PROTECTED]
wrote:


 Hi!

 I get this error when trying to make a bookmarkable page.

 java.lang.IllegalArgumentException: Too many path parts, please provide
 sufficient number of path parameter names

 This is my mouting, mount(new
 MixedParamUrlCodingStrategy(ItemInterceptor,
 ItemInterceptor.class,new String[]{}));

 This is the code for making the link

 Brand brand = (Brand) item.getModelObject();
PageParameters params = new
 PageParameters();
params.add( Brand,
  brand.getId().toString() );
Link brandLink = new BookmarkablePageLink(
 brandLink
 ,ItemInterceptor.class, params );

 And it generates this url... I don't know why the slash is there. Anyone

 https://localhost/hairless-web/ItemInterceptor/?Brand=76
 --
 View this message in context:
 http://www.nabble.com/Trying-to-make-bookmarkablelink-tp18115889p18115889.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: Multipart form throws exception

2008-06-25 Thread Igor Vaynberg
that is because this is a response to a regular request. i do not see
how that could have ever worked. you cant just write text/javascript
into the browser and expect it to do anything, that is the same as
putting foo.com/bar.js link in the address bar, what happens? you just
view the file.

what you need to do is set the response as text/html and spit out html
that in body onload executes some javascript.

-igor

On Wed, Jun 25, 2008 at 3:02 PM, Michael Mehrle [EMAIL PROTECTED] wrote:
 Yes, that's true - it IS using a dynamic iFrame. Again, the *submition*
 process works just fine and I get the data on the backend. What's
 causing the problem is the data being returned and the IE/Safari for
 some reason not liking 'text/javascript' as a content type anymore.
 Something has changed from 1.3.2 to 1.3.3-SNAPSHOT that causes this.

 Michael

 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 2:10 PM
 To: users@wicket.apache.org
 Subject: Re: Multipart form throws exception

 doesnt jquery use an iframe? so it is not submitted via ajax...

 -igor

 On Wed, Jun 25, 2008 at 1:27 PM, Michael Mehrle [EMAIL PROTECTED]
 wrote:
 Yeah, remember I build it around jQuery according to that link you
 sent
 me - not using Wicket for the upload only for bouncing back the
 response.

 Thing is that this worked until 1.3.2 and somehow since updating to
 1.3.3 it's broken again. The issue seems to be the content type - had
 it
 working with 'text/javascript' on all three browsers but now it won't.

 M.

 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 1:22 PM
 To: users@wicket.apache.org
 Subject: Re: Multipart form throws exception

 are you submitting the form via ajax?

 -igor

 On Wed, Jun 25, 2008 at 12:09 PM, Michael Mehrle
 [EMAIL PROTECTED] wrote:
 Just ran into the exception again:

 java.lang.IllegalStateException: ServletRequest does not contain
 multipart content
at


 org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init
(MultipartServletWebRequest.java:90)
at


 com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
 .java:66)
at


 com.evite.event.web.create.MainImageUpload.init(MainImageUpload.java:3
 8)


 Sorry, I meant to say 'request'

 MainImageUpload is what the file uploader points to.

 Michael

 -Original Message-
 From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 11:34 AM
 To: users@wicket.apache.org
 Subject: Re: Multipart form throws exception

 response not being multipart? wasnt aware there was such a thing...

 -igor

 On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
 [EMAIL PROTECTED] wrote:
 I'm on Wicket 1.3.3 and am experiencing problems with multipart
 content
 on Safari and IE. The backend page receiving the image processes it
 just
 fine and returns a response like this:



 RequestCycle.get().setRequestTarget(new IRequestTarget() {

public void detach(RequestCycle
 requestCycle) {

}

public void respond(RequestCycle
 requestCycle) {

// formulate the JSON
 response

StringBuffer response
 =
 new StringBuffer({\n);

if (StringUtils.isNotEmpty(error)) {

response.append(\error\:
 \).append(getString(error)).append(\);

} else {

response.append(\msg\:



 \).append(getString(successfulFileUploadNotification)).append(\,\n
 );

response.append(\photoId\:
 \).append(photo.getId()).append(\,\n);

response.append(\uri\:
 \).append(photoService.getPhotoSrc(photo)).append(\);

}

response.append(\n});

Response rep =
 requestCycle.getResponse();


 rep.setContentType(text/javascript);

rep.write(response);

}

});



 As you can see I'm bouncing a JSON response back, which is received
 and
 handled on my front end. It works in Firefox but fails in Safari and
 IE
 with an error message which I would love to post but I'm not getting
 every time. I do remember however that it complained about the
 response
 not being 'multipart'.



 There is a similar bug report that was posted a while ago and
 claimed
 this to be fixed in 1.3.3.






 http://www.nabble.com/Multipart-form-with-nested-ajaxform-throws-excepti
 on-in-1.3.1-td15975693.html



 Any suggestions would be welcome.



 Thanks!



 Michael



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


 -
 To 

Re: Trying to make bookmarkablelink

2008-06-25 Thread Mathias P.W Nilsson

No, I'm not sure. I just want to make my urls google friendly. And tried some
strategies. 

Do you have a better solution for making urls google friendly?
-- 
View this message in context: 
http://www.nabble.com/Trying-to-make-bookmarkablelink-tp18115889p18124088.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Must I settle for bookmarkable pages?

2008-06-25 Thread David Leangen

My wicket app is mounted on / (for various reasons). However, my
server is behind a proxy, which means that from the outside, I can only
view pages that have a certain path (also desired behaviour for various
reasons).

Problem: when submitting a form, the URL shows up as something like:

   http://localhost:8080/?wicket:interface=:0:1:::

This works behind the firewall, but will not work from outside.


Is my only solution to use bookmarkable pages (with all the implications
of parsing parameters manually)?


Thanks!
David



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



Re: Must I settle for bookmarkable pages?

2008-06-25 Thread Igor Vaynberg
solution is to either fix the firewall or use a /foo/* mapping

-igor

On Wed, Jun 25, 2008 at 5:22 PM, David Leangen [EMAIL PROTECTED] wrote:

 My wicket app is mounted on / (for various reasons). However, my
 server is behind a proxy, which means that from the outside, I can only
 view pages that have a certain path (also desired behaviour for various
 reasons).

 Problem: when submitting a form, the URL shows up as something like:

   http://localhost:8080/?wicket:interface=:0:1:::

 This works behind the firewall, but will not work from outside.


 Is my only solution to use bookmarkable pages (with all the implications
 of parsing parameters manually)?


 Thanks!
 David



 -
 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: Must I settle for bookmarkable pages?

2008-06-25 Thread David Leangen

Hey, Igor,

  Problem: when submitting a form, the URL shows up as something like:
 
http://localhost:8080/?wicket:interface=:0:1:::
 
  This works behind the firewall, but will not work from outside.
 
 
  Is my only solution to use bookmarkable pages (with all the implications
  of parsing parameters manually)?

 solution is to either fix the firewall or use a /foo/* mapping

Well, that would be difficult for various reasons. I assume you mean
a /foo/* mapping for the servlet filter, right?

So, you are saying that the only possible solutions are:

1. Allow proxying on null path (not possible for me)

2. Change the wicket instance mapping to /foo/* from /*
 (possible, but not what I want)

3. Use bookmarkable pages with all the trouble of parsing
 (want to avoid if possible)


And there are no other possible solutions? Or is there something
somewhere I can fiddle with so I can change the way the URL is rendered
for the form, in the spirit of MixedURLParamCodingStrategy or something?


Cheers,
David



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



Re: Must I settle for bookmarkable pages?

2008-06-25 Thread Igor Vaynberg
so why are the /?wicket:interface urls interfering with that?

-igor

On Wed, Jun 25, 2008 at 8:27 PM, David Leangen [EMAIL PROTECTED] wrote:

 you can roll your own webrequest coding strategy. But then you are on your 
 own.

 Cool. Thanks!

 The problem here is that you map wicket to a  URL space but then don't
 want it to use that space...doesn't make sense to me.

 The thing is that I'm in an OSGi environment, and I have a WicketService
 that provides my Wicket instance. I attach Applications as bundles to
 the Wicket instance and mount them on a certain path.

 It would be possible to create a new Wicket instance for each
 Application bundle, but that's not really the ideal way to work. Rather,
 I'm trying to have one single Wicket instance that can host my various
 Application bundles.

 Generally, this is working fine, except for this form bump I hit along
 the way. If I can get this part working, then it seems that the setup
 should be working almost exactly as I'd hoped.


 Cheers,
 David




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