Re: How to load javascript file in apache wicket?

2012-11-19 Thread Andrea Del Bene

Hi,

which version of Wicket are you using? I think you should handle your js 
file as  package resource or shared resource...


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



Re: Wicket 1.5.8 + EJB 3.1 - strange problem

2012-11-19 Thread Martin Grigorov
Hi,

I don't use Wicketstuff-javaee and I have no idea what could be the problem.
But I want to tell you that there are several releases of this project
after 1.5-RC1:
http://central.maven.org/maven2/org/wicketstuff/wicketstuff-javaee-inject/1.5.9/.
Note the different groupId.


On Sun, Nov 18, 2012 at 3:59 PM, Satrix satrix...@gmail.com wrote:

 Hello,

 Im using Wicket 1.5.8 + EJB 3.1. To configure Wicket with EJB Im using:
 dependency
groupIdorg.wicketstuff/groupId
artifactIdjavaee-inject/artifactId
version1.5-RC5.1/version
 /dependency

 Everything seemed to work when I was using only @Stateless beans. But now,
 it's the time that I need to introduce @Stateful bean into the application.
 And because of that I'm struggling with a very strange problem. Everything
 works as expected except... back button. When I click back button -
 @Stateful EJB is being recreated each time I press back button. So it's
 ruining my logic.

 Any idea what's happening ?

 Thank you in advance, Satrix



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: any book about wicket 6?

2012-11-19 Thread Martin Grigorov
Hi Andrea,

Thank you!
I think this example will be very useful for someone who used extensively
the old SWING-based model.


On Fri, Nov 16, 2012 at 9:07 PM, Andrea Del Bene an.delb...@gmail.comwrote:

 I didn't write an article on tree components yet :) , but I've built a
 very basic example for NestedTree. The code is quite simple and it uses
 both nodes and model from Swing package (like the old Tree component). You
 can find it here:

 https://github.com/bitstorm/**Wicket-tutorial-examples/tree/**
 master/CheckBoxAjaxTreehttps://github.com/bitstorm/Wicket-tutorial-examples/tree/master/CheckBoxAjaxTree


 On 11/15/2012 03:27 PM, Martin Grigorov wrote:

 I'd like an article about the new Tree/TreeTable components in Wicket 6.
 I find it hard to grasp. Maybe because most of its code is in
 wicket-examples and the example there is too big and abstract.
 I tried twice to migrate from the old/deprecated TableTree and both times
 I
 gave up.


 On Wed, Nov 14,



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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: How to load javascript file in apache wicket?

2012-11-19 Thread Martin Grigorov
Hi,

Can you give more details ?
What does it mean: The eval method won't start because the .js file is
not recongnized
by the browser ?

How do you load the .js and JSON in the markup ?


On Sun, Nov 18, 2012 at 6:23 AM, delta458 delta...@hotmail.com wrote:

 Hi ;)

 I have a javascript file in my web application that uses the
 eval(jsonString) Method. Eval() because I am working with JSON too.

 My javascript file is inside a package in netbeans. What should I do to
 make
 my javascript file globally aviable for the application and browser?

 The problem: The eval method won't start because the .js file is not
 recongnized by the browser. JSON.parse(..) does not work too.

 So: How do I correctly add this javascript file to my web application. So I
 can manipulate it by the web application during runtime and execute the
 eval
 Method?

 Any help would be great, thanks




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-load-javascript-file-in-apache-wicket-tp4653976.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: Include one .js file into another .js file in wicket

2012-11-19 Thread Martin Grigorov
Hi,

Check org.apache.wicket.util.template.PackageTextTemplate
and org.apache.wicket.util.string.interpolator.MapVariableInterpolator.


On Sat, Nov 17, 2012 at 7:56 PM, delta458 delta...@hotmail.com wrote:

 Hello,

 I have 2 .js files.

 Invoice.js: content is something like:
 /var price
 var recipient
 .../

 Rules.js: content is something like:
 /if(price  100){
 //do Something
 }/

 What I need: I need to include the Invoice.js into Rules.js.
 What my application does: I fill in a form and with compound proporty model
 my POJO Invoice.java will be set. If I submit my form. The Invoice Object
 will be mapped to the Invoice.js file. That means

 /var price;/ inside Invoice.js will be generated from /private double
 price;/ inside Invoice.java

 Then Rules.js should be able to read var price.
 But how can I include my Invoice.js into the Rules.js in wicket?

 Any help appreciated!
 regards



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Include-one-js-file-into-another-js-file-in-wicket-tp4653973.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: how to fix this error in wicket app

2012-11-19 Thread Martin Grigorov
Hi,

Do you have idea how many target.appendJS/prependJS calls do you have for
this Ajax request ?
The error says that you have a lot of those in the ajax-response.

If you look closely at
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js#L118
you'll
see that this method works with recursion until its 1000th call, then it
uses setTimeout(callMySelf) to restart the recursion in a new stack frame.

Few months ago I did some testing:
https://issues.apache.org/jira/browse/WICKET-4675?focusedCommentId=13426609page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13426609
and
Firefox 14 was able to do ~5200 recursive calls before filling the stack.
Which version of Firefox do you use ?



On Fri, Nov 16, 2012 at 8:51 PM, saty satya...@gmail.com wrote:

 I have this additional info on wicket debug panel.

 ERROR: Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript:
 InternalError: too much recursion, text:

 Wicket.Ajax.ajax({f:forma,u:./?1-3.IBehaviorListener.1-homePageTabs-panel-pricingPropertyTabs-panel-fitlerGridPanel-snapshotGridForm-snapshotGrid-form-bodyContainer-body-row-147,e:click,c:id147682,pre:[function(attrs){return

 InMethod.XTable.canSelectRow(attrs.event);}],ad:true,m:POST,dep:[function(attrs){return
 {'column': Wicket.$(attrs.c).imxtClickedColumn}}]});
 ERROR: FunctionsExecuter.processNext: InternalError: too much recursion
 ERROR: FunctionsExecuter.processNext: [Exception... Component returned
 failure code: 0x80004002 (NS_NOINTERFACE) [nsIObserverService.addObserver]
 nsresult: 0x80004002 (NS_NOINTERFACE)  location: JS frame ::
 resource:///components/ConsoleAPI.js :: CA_init :: line 57  data: no]


 I dont know why its complaining about too much recursion, if there is a way
 to increase the limit, any help would be appreciated, thanks



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/how-to-fix-this-error-in-wicket-app-tp4653954p4653956.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: How to load javascript file in apache wicket?

2012-11-19 Thread delta458
@Martin: yes, by the browser...

I made a detailed description of the problem here:
http://stackoverflow.com/questions/13447212/serialize-several-null-objects-with-gson
http://stackoverflow.com/questions/13447212/serialize-several-null-objects-with-gson
  

regards 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-load-javascript-file-in-apache-wicket-tp4653976p4653988.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



Re: How to load javascript file in apache wicket?

2012-11-19 Thread delta458
Edit: This is the correct link

http://stackoverflow.com/questions/13443361/load-resources-javascript-in-a-web-application-framework-wicket-correctly
http://stackoverflow.com/questions/13443361/load-resources-javascript-in-a-web-application-framework-wicket-correctly
  



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-load-javascript-file-in-apache-wicket-tp4653976p4653989.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



Re: Wicket 1.5.8 + EJB 3.1 - strange problem

2012-11-19 Thread Satrix
Hello Martin,

I'll check this out today and let you know if it helps.

Regards, Satrix



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653990.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



Re: Wicket 1.5.8 + EJB 3.1 - strange problem

2012-11-19 Thread Satrix
Unfortunately even after changing the version of the
wicketstuff-javaee-inject to newer version the problem still exists. 

What's more interesing is that when I navigate over the page (everything
except back button) the @Stateful bean works. Only back button click
recreates the @Stateful bean (but... after the bean has been recreated, when
I click on a links etc, container returns me correct bean instance (previous
bean - before recreation)).

I wonder if you know someone from the wicketstuff-javaee-inject, so maybe
they could provide me a workaround or smth ?

Regards, Satrix



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653991.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



Re: Wicket 1.5.8 + EJB 3.1 - strange problem

2012-11-19 Thread Martin Grigorov
https://github.com/aldaris - this is the guy who made this contribution


On Mon, Nov 19, 2012 at 3:16 PM, Satrix satrix...@gmail.com wrote:

 Unfortunately even after changing the version of the
 wicketstuff-javaee-inject to newer version the problem still exists.

 What's more interesing is that when I navigate over the page (everything
 except back button) the @Stateful bean works. Only back button click
 recreates the @Stateful bean (but... after the bean has been recreated,
 when
 I click on a links etc, container returns me correct bean instance
 (previous
 bean - before recreation)).

 I wonder if you know someone from the wicketstuff-javaee-inject, so maybe
 they could provide me a workaround or smth ?

 Regards, Satrix



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653991.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: Wicket 1.5.8 + EJB 3.1 - strange problem

2012-11-19 Thread Wujek Srujek
If the container returns the correct bean, this means your login works
fine, is this correct? Why do you then care that the @Stateful-annotated
field is different? It probably is just a proxy generated by your
container's injection framework anyways.


On Mon, Nov 19, 2012 at 2:16 PM, Satrix satrix...@gmail.com wrote:

 Unfortunately even after changing the version of the
 wicketstuff-javaee-inject to newer version the problem still exists.

 What's more interesing is that when I navigate over the page (everything
 except back button) the @Stateful bean works. Only back button click
 recreates the @Stateful bean (but... after the bean has been recreated,
 when
 I click on a links etc, container returns me correct bean instance
 (previous
 bean - before recreation)).

 I wonder if you know someone from the wicketstuff-javaee-inject, so maybe
 they could provide me a workaround or smth ?

 Regards, Satrix



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653991.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




Re: Wicket 1.5.8 + EJB 3.1 - strange problem

2012-11-19 Thread Satrix
Nope. Look at the example:

1. User has chose to add a product to the Cart (so now the cart number is 1
and he can see that number in a proper place on the page).

2. Now when he clicks back button - bean is recreated - so the cart number
is 0 (list is recreated).

3. BUT now when I click on any other link on my page container returns
previous EJB bean so the cart number is 1.

Btw Im using LoadableDetachableModel so there is no way that the user is
seeing stale data.

Regards, Satrix



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-8-EJB-3-1-strange-problem-tp4653977p4653995.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



Disallowing a logged-in user to access some page

2012-11-19 Thread pureza
Hi,

How can I prevent access to certain pages (such as the sign-in page or the
account creation page) for logged-in users?

Right now I'm just adding a check to every such page and redirect to another
page if the user is signed-in, but I'd like to know if there is a cleaner
solution.

Thanks

Luis





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Disallowing-a-logged-in-user-to-access-some-page-tp4654000.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



Re: Disallowing a logged-in user to access some page

2012-11-19 Thread Martijn Dashorst
Not sure how you have implemented your authorization stuff, but with
auth-roles it should be trivial to implement a @OnlyNotLoggedIn
annotation for your pages, and extend the authorization check to check
for the presence of that annotation.

Another way would be to register an OnBeforeRenderListener in your
application that performs this check and issues the redirect.

Martijn

On Mon, Nov 19, 2012 at 3:39 PM, pureza pur...@gmail.com wrote:
 Hi,

 How can I prevent access to certain pages (such as the sign-in page or the
 account creation page) for logged-in users?

 Right now I'm just adding a check to every such page and redirect to another
 page if the user is signed-in, but I'd like to know if there is a cleaner
 solution.

 Thanks

 Luis





 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Disallowing-a-logged-in-user-to-access-some-page-tp4654000.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




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

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



How to override URLs generated by bookmarkable mapper

2012-11-19 Thread shimin_q
I have an Apache Wicket-based application that I'd like to integrate with
JQuery Mobile on so it looks more pleasing on mobile devices. 
Unfortunately, I am getting Error Loading Page errors for all the
bookmarkable page links, which I never had problems with before JQuery
Mobile was added to the mix.  The root cause appears to be the URLs
contained in the HTTP requests.  I used Wicket 1.5.5, locally tested using
jetty server 6.1.26 and FireFox 16.0, JQuery Mobile 1.2.0, JQuery 1.8.0. 
Here is the code snippet:


ul data-role=listview data-theme=b
  li List #  
  /li
/ul

The corresponding java code:

add(new BookmarkablePageLinkMetaprofileListPage(  

metaprofileList, MetaprofileListPage.class));

 
Based on the above, Wicket correctly replaced # in href=# with real URLs
where the pages are, so the final HTML looks like the following:

ul data-role=listview data-theme=b
  li List
com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage  
  /li
/ul

When the link is clicked , Jetty server sends the following HTTP Request
with the following URL:

GET
http://127.0.0.1:7999/com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage
[HTTP/1.1 404 Not Found 0ms]

This is not a correct URL for the MetaprofileListPage.  As I understand,
with the default bookmarkable mapper in Wicket, the correct URL is: 

http://127.0.0.1:7999/wicket/bookmarkable/com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage

As far as I know, I have no way of changing the way that JQuery Mobile
constructs the URLs from the href=, I am looking for ways in Wicket to
override the default wicket/bookmarkable context path to just /...

 
For your reference, the only JQuery Mobile-related change I did was
switching the headers in the HTML file from:

link rel=stylesheet type=text/css href=../../css/phone.css
media=only screen and (max-width: 480px)/
link rel=stylesheet type=text/css href=../../css/default.css
media=only screen and (min-width: 1025px)/
link rel=stylesheet type=text/css href=../../css/portrait.css
media=all and (max-device-width: 1024px) and (orientation:portrait)/
link rel=stylesheet type=text/css href=../../css/landscape.css
media=all and (max-device-width: 1024px) and (orientation:landscape)/
meta name=viewport content=user-scalable=no, width=device-width/

To the standard boilerplate jquery mobile includes:

meta name=viewport content=width=device-width, initial-scale=1,
maximum-scale=1.0, user-scalable=no
link rel=stylesheet
href=http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css; / 
 
   

I have been struggling with this for 2 weeks now :-(  What do I need to do
to get Wicket and Jquery mobile to work loading the correct urls/pages? 
Please help!!  Many thanks!!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-override-URLs-generated-by-bookmarkable-mapper-tp4654005.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



wicket 1.4.7 - encoding strategy - ajax button

2012-11-19 Thread Daniel Fernandez
Hi,




I'm using wicket 1.4.7 and I'm facing some problem trying to solve some problem 
about URLs:










1) I'm using the classes:
mount(new HybridUrlCodingStrategy(WebPageNaming.ADMIN_PAGE, AdminPage.class, 
false));



mount(new MixedParamHybridUrlCodingStrategy(WebPageNaming.EN + SLASH + 
WebPageNaming.CORPORATIVE_SECTION_EN, SectionPageEN.class, false, new 
String[]{ParameterNaming.URL_SECTION}));

ir order to mount the URLs, but it looks like: 
http://localhost:8080/balune/en/corporativesection/home.16.1 when I hit an AJAX 
button like this:

private class LoginForm extends FormLoginUserView {

private static final long serialVersionUID = 1673801238179569937L;

public LoginForm(String id) {

super(id);

}


@Override

public void onSubmit() {

if (BaluneSession.get().signIn(loginUserView.getEmail(), 
loginUserView.getPassword())) {

if (!continueToOriginalDestination()) {

BaluneApplication.get().getPrepareUtils().prepareReloadByPageAndParams(getRequestCycle(),
 pageParameters);

}

}

else {

this.error(getString(loginError));

}

}


}




previously I was using mountBookmarkablePage and 
MixedParamUrlCodingStrategy but URLs looked uglier.

Is there any solution in this wicket version (I wouldn't like to change the 
version because it's and old app and it would be so much work to resolve the 
incompatibilites) to make the URLs look prettier? I'd like them to not change 
when I hit an AJAX button...








2) in production, the parameter jsessionid is appended to the URL. is there any 
way to avoid that in wicket? or is because Tomcat?



Thanks in advance.



Daniel Fernandez

What replaces Wicket 1.4 AbortException in Wicket 6.x?

2012-11-19 Thread Kees van Dieren
Hi,

We have some code that returns zip output (e.g. downloads a file) in an
onsubmit of a wicket form.

We used to do this (with Wicket 1.4):

Get the WebResponse
Fill it with the ZIP contents

throw new AbortException();

The ZIP contents to be returned depends on the contents filled in by the
user in a wicket form.

However, AbortException does not exists any more.

What is the best way to do it on Wicket 6?


Thanks in advance!

-- 
Best regards / Met vriendelijke groet,

Kees van Dieren
Squins | IT, Honestly
Oranjestraat 23
2983 HL Ridderkerk
The Netherlands
Mobile: +31 (0)6 30413841
www.squins.com
http://twitter.com/keesvandieren
Chamber of commerce Rotterdam: 24435130
Boeken voor school en werk bestel je op studieboekencenter.nl


Re: What replaces Wicket 1.4 AbortException in Wicket 6.x?

2012-11-19 Thread Kees van Dieren
Found something that might help:
org.apache.wicket.markup.html.link.DownloadLink.onClick()

Will look at this, some tips still welcome :)


2012/11/19 Kees van Dieren i...@squins.com

 Hi,

 We have some code that returns zip output (e.g. downloads a file) in an
 onsubmit of a wicket form.

 We used to do this (with Wicket 1.4):

 Get the WebResponse
 Fill it with the ZIP contents

 throw new AbortException();

 The ZIP contents to be returned depends on the contents filled in by the
 user in a wicket form.

 However, AbortException does not exists any more.

 What is the best way to do it on Wicket 6?


 Thanks in advance!

 --
 Best regards / Met vriendelijke groet,

 Kees van Dieren
 Squins | IT, Honestly
 Oranjestraat 23
 2983 HL Ridderkerk
 The Netherlands
 Mobile: +31 (0)6 30413841
 www.squins.com
 http://twitter.com/keesvandieren
 Chamber of commerce Rotterdam: 24435130
 Boeken voor school en werk bestel je op studieboekencenter.nl




-- 
Best regards / Met vriendelijke groet,

Kees van Dieren
Squins | IT, Honestly
Oranjestraat 23
2983 HL Ridderkerk
The Netherlands
Mobile: +31 (0)6 30413841
www.squins.com
http://twitter.com/keesvandieren
Chamber of commerce Rotterdam: 24435130
Boeken voor school en werk bestel je op studieboekencenter.nl


Re: Wicket-Atmosphere complex JS

2012-11-19 Thread Pierre Goupil
Good evening,

So, I've tried what you said. I forgot one JS file in my initial attempt
but, even with this configuration I have now a different symptom. But it
still doesn't work. For now, the problem is that I have an empty
ajax-response!

Here is my code for the filter:

public class ResponseSizeFilter implements PerRequestBroadcastFilter
{
@Override
public BroadcastAction filter(final AtmosphereResource r, final Object
originalMessage,
final Object message)
{
final AtmosphereRequest request = r.getRequest();
if
(true.equalsIgnoreCase(request.getHeader(HeaderConfig.X_ATMOSPHERE_TRACKMESSAGESIZE)))
{
final String msg = message.toString();
return new BroadcastAction(BroadcastAction.ACTION.CONTINUE,
msg.length()
+ \r\n.length() + |);
}
return new BroadcastAction(BroadcastAction.ACTION.CONTINUE,
message);
}

@Override
public BroadcastAction filter(final Object originalMessage, final
Object message)
{
final String msg = message.toString();
return new BroadcastAction(BroadcastAction.ACTION.CONTINUE,
message);
}
}

I can see in my logs that it's called.

But whether I call the server-side by:

Wicket.Ajax.get({u: ${url}, e: click, c : blah})

or by:

jQuery('blah').wicketAtmosphere({url : ${url} });

It fails to update my component because the response is:

?xml version=1.0 encoding=UTF-8?ajax-response/ajax-response



The strange thing being that in my Filter, the message really contains the
right (non-empty) ajax-response!

Here is the Ajax / WebSocket managing code (it's in an
AbstractDefaultAjaxBehavior):

@Override
protected void respond(final AjaxRequestTarget target)
{
final CometChannel chan = new CometChannel(isTapped()));
Application.get().getEventBus().post(chan);
}

@Subscribe
public void rotate(final AjaxRequestTarget target, final CometChannel
event)
{
if (event.isTapped())
{
target.appendJavaScript(jQuery('#card + event.getUuid() +
').rotate(90););
}
else
{
target.appendJavaScript(jQuery('#card + event.getUuid() +
').rotate(0););
}
}

I thought that maybe the empty ajax-response came from the respond()
method not adding anything to the AjaxRequestTarget but in the examples
from Wicket GitHub, it's done like that for the chat message. So I ran out
of solutions.

As a side-note, this not the same code as in the original message, but the
symptom in this Comet channel is the same as here. The only difference
being that in this other channel, the message to broadcast is quite long,
hence the need for the BroadcastFilter.

So, is the idea of filing a Jira issue still valid?

Sorry for that long message. And thanks in advance for any help.

Regards,

Pierre Goupil

--
Le bonheur n'est pas une destination, mais une façon de voyager.

Papa d'une petite Lou-Ann depuis le 30 juin.


how to get the listview's dropdownchoice value

2012-11-19 Thread david.li
the code like this:
ListString selection = Arrays.asList(A, B);
form.add(new ListView(lis, selection) {

@Override
protected void populateItem(ListItem item) {
List list;
if (item.getModelObject().equals(A)) {
list = Arrays.asList(a1, a2);
} else {
list = Arrays.asList(b1, b2);
}
DropDownChoice ddl = new DropDownChoice(ddltest, ddlmodel, 
list);
item.add(ddl);
}

});



-
david
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-get-the-listview-s-dropdownchoice-value-tp4654012.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



Re: how to get the listview's dropdownchoice value

2012-11-19 Thread Thomas Götz
ddlmodel.getObject()?

   -Tom


On 20.11.2012, at 05:24, david.li lxw_fi...@hotmail.com wrote:

 the code like this:
 ListString selection = Arrays.asList(A, B);
 form.add(new ListView(lis, selection) {
 
   @Override
   protected void populateItem(ListItem item) {
   List list;
   if (item.getModelObject().equals(A)) {
   list = Arrays.asList(a1, a2);
   } else {
   list = Arrays.asList(b1, b2);
   }
   DropDownChoice ddl = new DropDownChoice(ddltest, ddlmodel, 
 list);
   item.add(ddl);
   }
 
 });


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