Variant Change Behavior

2014-09-03 Thread Thibault Kruse
Hi,

playing around with Variants for Components, I am wondering whether
there is an elegant way to steer Variant markup loading via a
Behavior.

In our case we want to use a different markup layout based on the
width of the container the component is going to be used in, visually.

So if we imagine a Browser window with desktop size, we might want to
use a component on the full width, on a third of the width, or a
quarter of the width.

For each such container width, we need different responsive design
markup. Since this may affect many of our components which inherit
from different wicket components, I'd like to just add another html
markup file for the variant, and add a Behavior to the component that
decides the Variant.

cheers,
  Thibault

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



Re: Variant Change Behavior

2014-09-03 Thread Martin Grigorov
Hi,

The behaviors are not used for variations.
For such use cases you should
override org.apache.wicket.Component#getVariation() on the (base) page.
This way all components will know the correct variation.

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


On Wed, Sep 3, 2014 at 1:09 PM, Thibault Kruse tibokr...@googlemail.com
wrote:

 Hi,

 playing around with Variants for Components, I am wondering whether
 there is an elegant way to steer Variant markup loading via a
 Behavior.

 In our case we want to use a different markup layout based on the
 width of the container the component is going to be used in, visually.

 So if we imagine a Browser window with desktop size, we might want to
 use a component on the full width, on a third of the width, or a
 quarter of the width.

 For each such container width, we need different responsive design
 markup. Since this may affect many of our components which inherit
 from different wicket components, I'd like to just add another html
 markup file for the variant, and add a Behavior to the component that
 decides the Variant.

 cheers,
   Thibault

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




wicket atmosphere not updating the page

2014-09-03 Thread fachhoch
I am  trying to use wicket-atmosphere (0.18) in wicket 6.12.0, on post, 
subscribe method is getting called but any component I add to target is not
updating  in  the page, ajax debug window  shows empty ajax-response, and
browser  console has this error.

wicket/bookmarkable/resource/org.apache.wic…bstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1409764822476.js
404 (Not Found) 

Please advice.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-atmosphere-not-updating-the-page-tp4667321.html
Sent from the Users forum mailing list archive at Nabble.com.

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



adding wicket generated link to javascript

2014-09-03 Thread Jason Novotny

Hi,

My designer gave me code where HTML is created in javascript as part of 
a jquery dataTable:


script
$(document).ready(function() {
$('#datatable').dataTable( {

$('.clientinvoices .dropholder').html('div 
class=opener/div*button class=btn type=resetCancel 
Order/button*');

..
/script


And I need that button to be a wicket button, is there a way to pass it 
a generated link, etc? What would be the best way to deal with this?


Thanks, Jason



Re: adding wicket generated link to javascript

2014-09-03 Thread Pierre Goupil
Good evening,

You can use a Behavior:

- subclass AbstractDefaultAjaxBehavior,
- in the overriden renderHead(final Component component, final
IHeaderResponse response) use template interpolation to pass the URL to the
JS: template.interpolate(variables);
- in the JS, use the Wicket client-side API to do a call to server:
Wicket.Ajax.get({u:the/url/to/the/link, e: click, c:linkId});  (
https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax)
- and lastly, in the Behavior overridden respond(final AjaxRequestTarget
target) do whatever component manipulation you need and play with the
AjaxRequestTarget.

So: in your JS, you have to find the right place to use the
Wicket.Ajax.get() call and you can pass any value from server, not just the
Behavior URL.

Sorry, I was unable to find a link explaining more template interpolation,
but if you like, I can provide you with some code.

HTH,

Pierre




On Wed, Sep 3, 2014 at 10:15 PM, Jason Novotny jason.novo...@gmail.com
wrote:

 Hi,

 My designer gave me code where HTML is created in javascript as part of a
 jquery dataTable:

 script
 $(document).ready(function() {
 $('#datatable').dataTable( {
 
 $('.clientinvoices .dropholder').html('div class=opener/div*button
 class=btn type=resetCancel Order/button*');
 ..
 /script


 And I need that button to be a wicket button, is there a way to pass it a
 generated link, etc? What would be the best way to deal with this?

 Thanks, Jason




-- 
La vie est source de joie, la mort est source de paix, seule la transition
est difficile.


Problem downloading a Resource from an HTTPS same server: SSLHandshake Error

2014-09-03 Thread Tope Faro
Hello all,

I have been trying repeatedly to get a download code that I had previously
working on a non-https server work on a different server with HTTPS enabled.

I keep getting an SSLHandShake error, and on researching further found I
may need to install and enable SSL certs on Tomcat. Problem is I still get
this error even after enabling SSL on Tomcat.

This is extract from my code below:

private void downloadReport(ReportFormat format) {
final String formattedUrl = formatUrl(urlWithoutFormat, format);
try {
getRequestCycle().scheduleRequestHandlerAfterCurrent(
new ResourceStreamRequestHandler(new
AbstractResourceStreamWriter() {
@Override
public void write(OutputStream out) throws IOException {
String url = getReportUrl(formattedUrl);
log.debug(Generated URL:  + url);
Streams.copyAndClose(new URL(url).openStream(), out);
}
}, fv_report. + format.getFormat()));
} catch (Exception ex) {
log.error(, ex);
}
}


Re: Problem downloading a Resource from an HTTPS same server: SSLHandshake Error

2014-09-03 Thread topriddy
I have this fixed by installing SSL cert keys and enabling them in my Tomcat.

Also, I had to specify 8443 the SSL port my Tomcat is using as
request.getServerPort() was returning Apache's SSL port 443 which is wrong
for my case.

Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-downloading-a-Resource-from-an-HTTPS-same-server-SSLHandshake-Error-tp4667330p4667331.html
Sent from the Users forum mailing list archive at Nabble.com.

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