문제

On my wicket page I have a link that opens a second page in another tab/new window.

<a href="/MySecondPage" target="_blank">Click here for second window</a>

These windows are meant to be used in parallel (e.g. in a two-monitor-environment). But I don't want to spread out different menu entries over both screens, so I want all menu entries to stay on MyFirstPage, even if they should influence MySecondPage only.

My ultimate goal is to click a menu entry on MyFirstPage that results in displaying a new Component on MySecondPage. Is this even possible? How can I obtain a java-reference of MySecondPage inside MyFirstPage or establish some other sort of communication? Everything I found while researching only applied to modal windows or Wicket 1.4, but MySecondPage is not modal.

도움이 되었습니까?

해결책

Maybe wicket's event bus is an option, see: http://code.google.com/p/wicket-guide/downloads/list - Chapter 15.3 Wicket events infrastructure

You could send the event in MyFirstPage , receive it in your Session or Application and there send it to MySecondPage. Session and Application implement IEventSink: http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/event/IEventSink.html

다른 팁

There is WebSocket support in Wicket 6: http://wicketinaction.com/2012/07/wicket-6-native-websockets/

Basically you need to add WebSocketBehavior to the page to make it available for messages from the server.

On the other hand, you can send messages to the server via Wicket.WebSocket.send("A message sent by the client");

I have never tired it but it sounds very promising.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top