Re: WebSockets / Atmosphere with Glassfish 4.0?

2013-08-30 Thread Phill Ashworth

Thanks Martin, that saves me some pain.
I'd be all for a bit of extra Wicket configuration rather than hope the 
GF team acts on your request.


On 30 Aug 2013, at 10:46, Martin Grigorov wrote:


Hi,

I've tried to make a module for GF 3 for Native WebSockets when Native 
WS

module has been introduced -
https://github.com/apache/wicket/tree/sandbox/wicket-native-websocket-glassfish
But it didn't work well because of: bugs in GF 3, lack of demo apps, 
lack

of interest.

Recently I've added JSR356 based implementation to Wicket 7 -
https://github.com/apache/wicket/tree/master/wicket-experimental/wicket-native-websocket/wicket-native-websocket-javax
But again this doesn't work on GF 4 :-/ due to
https://java.net/jira/browse/WEBSOCKET_SPEC-181. The impl works with 
Tomcat
8, and Tomcat 7 (next release will have the JSR based impl 
backported).
This can be improved by moving the WebSocket Endpoint creation logic 
to a
ServletContextListener instead of a Filter but this will require 
additional

setup steps that I'd like to avoid.




Has anyone managed to use Wicket + native WebSockets or Atmosphere on
Glassfish 4.0?
Neither of the current modules work out of the box on Glassfish 4.0, 
just
wondering if anyone has had any success with this combination or can 
give

me any time saving pointers.
-Phill

--**--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apache.org

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




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



Re: Is there a "Wicket for Client-side Javascript Apps"?

2013-08-30 Thread Ashley Aitken

Very interesting.  

Thanks Martin.

Cheers,
Ashley.


On 30/08/2013, at 4:01 PM, Martin Grigorov  wrote:

> Hi,
> 
> Check Cajeta.js.
> Demo app at:
> https://github.com/jklappenbach/cajeta.js/tree/master/quickstart/site
> 
> 
> 
> On Fri, Aug 30, 2013 at 9:17 AM, Ashley Aitken  wrote:
> 
>> 
>> Sorry, this may be a bit off-topic but I can't think of a better group to
>> ask.
>> 
>> Does anyone know of a client-side Javascript framework that has the
>> complete separation of Java(script) and HTML/CSS that Wicket has?  I'm not
>> a fan of loops and conditionals in the HTML.
>> 
>> I'm thinking of a client-side Javascript framework that would do similar
>> to what Wicket does with the wicketid.  Of course, not being a server-side
>> Web application it would be very different in other regards to Wicket.
>> 
>> I would like it to be component-based and event-driven (like Wicket but in
>> Javascript).  Perhaps allowing components to be as easily defined by
>> inheritance in Javascript as they are in Wicket, for example.
>> 
>> I don't wish to hide the HTML/CSS.  I would like to be able to design the
>> client page(s) in HTML and CSS like Wicket allows, with almost complete
>> separation between developer and designer.
>> 
>> Does it even make sense what I am asking for / suggesting? ;-)
>> 
>> Thanks for any pointers or suggestions.
>> 
>> Cheers,
>> Ashley.
>> 
>> PS I know of Ember.js (uses templating system), Sproutcore, Cappuccino
>> (abstracts HTML/CSS) and Flight.
>> 
>> --
>> Ashley Aitken
>> Perth, Western Australia
>> mrhatken at mac dot com
>> Social (Facebook, Twitter, Skype etc.): MrHatken
>> Professional (LinkedIn, Twitter, Skype etc.): AshleyAitken
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 

--
Ashley Aitken
Perth, Western Australia (GMT + 8hrs!)
Social (Facebook, Twitter, Skype etc.): MrHatken 
Professional (LinkedIn, Twitter, Skype etc.): AshleyAitken

"[Apple] can't innovate any more, my a**!" Phil Schiller



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



jQuery reference with context relative path

2013-08-30 Thread divad91
Hi, I am using wicket 6.8.0.

I need to use a custom jquery reference. My custom js file is in my
webapp/scripts/lib folder.
I cannot figure out how to create a ResourceReference base on a url  like
HeaderItem.

*Application.init:*
getJavaScriptLibrarySettings().setJQueryReference(SwtuJqueryResourceReference.get());

*HeaderItem base on a url:*
JavaScriptHeaderItem.forUrl("scripts/libs/jquery-1.8.3/jquery-1.8.3.custom.min.js);

If I use a UrlResourceReference, every time my page is accessed with an
optional parameter, my reference to my js file don't work.

Thanks
Dav



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/jQuery-reference-with-context-relative-path-tp4661155.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: AjaxSubmitLink and AjaxRequestTarget.appendJavaScript

2013-08-30 Thread Martin Grigorov
Hi,


On Tue, Aug 27, 2013 at 5:21 PM, podmak  wrote:

> hi,
> I need add some js in my AjaxSubmitLink.onSubmit(AjaxRequestTarget target,
> Form form) but it is not working. example on my onSubmit function:
> @Override
> protected void onSubmit (AjaxRequestTarget target, Form form)
> {
> super.onSubmit(target, form);
> target.appendJavaScript("myJS");
> }
>
> Is appendJavaScript working only in AjaxLink or?
>

No.
It should work in this case too.
Check the http response body with Firebug or similar tool.


>
> thanks
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-and-AjaxRequestTarget-appendJavaScript-tp4661101.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 and microdata

2013-08-30 Thread Dirk Forchel
Martin Grigorov-4 wrote
> Hi,
> 
> 
> On Thu, Aug 29, 2013 at 3:29 PM, Dirk Forchel <

> dirk.forchel@

> >wrote:
> 
>> I'm currently try to add some kind of microdata
>> (http://en.wikipedia.org/wiki/Microdata_%28HTML%29) to our project.
>> Exists a
>> wicketstuff project dealing with this problem?
>>
> 
> I'm not aware of such.
> 
> 
>> What is the preferred way to add "valueless" attributes to HTML tags?
>> E.g.
>> I
>> have to add the following attributes to the body tag:
>>
>> 
> http://scheme.org/WebPage";>
>>
>> 
> 
>>
>> At the base page class I've added a TransparentMarkupContainer the
>> following
>> way:
>>
>> this.body = new TransparentWebMarkupContainer("body");
>> this.body.setOutputMarkupId(true);
>>
>> HTML:
>>
>> 
> 
>>
> 
>> 
> 
>>
>> At a subclass I did:
>>
>> getBody().setMarkupId("foo").add( AttributeModifier.append("itemscope",
>> AttributeModifier.VALUELESS_ATTRIBUTE_ADD ) ).add(
>> AttributeModifier.append(
>> "itemtype", Model.of( "http://scheme.org/WebPage"; ) ) );
>>
>> Is this the preferred way to add "valueless" attributes to a tag (I've
>> never
>>
> 
> Yes. This is the way to tell Wicket to not add a value for the attribute.

Okay. I've never seen this before. That's why I was asking.


Martin Grigorov-4 wrote
> Another way is to add these attributes directly in the markup. No need to
> add Behavior to the components for something that is always true.

Yes, but I prefer the "dynamic" way. A Component/Page provides some kind of
"microdata" and implements an interface. The AttributeAppender takes the
information and writes the appropriate attribute at the tag.


Martin Grigorov-4 wrote
>> seen this before)? Or is this marker value for internal use only? At
>> least
>> the generated HTML code looks like intended.
>> I would like to know whether there is a kind of general solution to deal
>> with "microdata", say a bunch of Behavior-classes to add this kind of
>> data.
>>
> 
> AttributeModifier is a Behavior itself.
> There is no special code in Wicket for microdata. This specification is
> not
> broadly used.

I thought someone has had the same requirements within his project and came
with a general solution for this specification. Okay, fair enough. 




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-and-microdata-tp4661135p4661153.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: Directory Listings

2013-08-30 Thread Martin Grigorov
Hi,


On Thu, Aug 29, 2013 at 11:56 AM, alessio  wrote:

> I believe I found the problem.
>
> It appears Wicket does not really pass non-Wicket requests back to a
> default handler, but handles them by itself in fallback() by using
>

This is how a Servlet works.
If there is a mapping that matches the request url then the web container
will use this servlet. If there is no such then the default servlet/handler
is used.

With Filter you can have several on the same mapping and they *may* use the
filter chain to let the next one to try to handle a request.


> getResourceAsStream() and in this case, for directories, WebSphere
> returns a listing regardless of its own directoryBrowsingEnabled
> setting.
>

So, try to use WicketFilter instead of WicketServlet if possible. I know
there are issues with WebSphere and Filters, but I think there is some
system setting that allows their usage.


>
> On Wed, Aug 28, 2013 at 7:23 PM, Sven Meier  wrote:
> > Wicket expects the path to end in a wildcard.
> >
> > Note that using WicketFilter instead of WicketServlet is recommended.
> >
> > Sven
> >
> >
> > On 08/28/2013 05:07 PM, alessio wrote:
> >>
> >> Thanks, so basically the /* mapping should not interfere with
> >> non-Wicket requests?
> >>
> >> In other words, static content as well as potential directory listings
> >> (respectively related error messages if disabled) will always be
> >> passed on and served by the underlying application server (be it
> >> WebSphere or Tomcat or .), correct?
> >>
> >>
> >> Would you know why the StringIndexOutOfBoundsException occurs when I
> >> map the servlet to / without the wildcard/asterisk?
> >>
> >> I tried upgrading from 1.5.3 to 1.5.10 but still get the same exception
> >>
> >> java.lang.StringIndexOutOfBoundsException
> >> java.lang.String.substring(String.java:1238)
> >>
> org.apache.wicket.util.file.WebXmlFile.getFilterPath(WebXmlFile.java:249)
> >> org.apache.wicket.util.file.WebXmlFile.getFilterPath(WebXmlFile.java:88)
> >>
> >>
> org.apache.wicket.util.file.WebXmlFile.getUniqueFilterPath(WebXmlFile.java:67)
> >>
> >>
> org.apache.wicket.protocol.http.WicketFilter.getFilterPathFromWebXml(WicketFilter.java:452)
> >> org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:360)
> >>
> org.apache.wicket.protocol.http.WicketServlet.init(WicketServlet.java:271)
> >> javax.servlet.GenericServlet.init(GenericServlet.java:160)
> >>
> >>
> >>
> >>
> >>
> >> On Wed, Aug 28, 2013 at 3:53 PM, Sven Meier  wrote:
> 
>  Wicket passes such requests back to the default handler
> >>>
> >>>
> >>> Yes, see WicketServlet#fallback()
> >>>
> >>>
>  whether Wicket actually returns directory listings at all?
> >>>
> >>>
> >>> No, it doesn't.
> >>>
> >>> Regards
> >>> Sven
> >>>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: AjaxChannel usage

2013-08-30 Thread Martin Grigorov
On Thu, Aug 29, 2013 at 2:28 PM, Sven Meier  wrote:

> Hi Steve,
>
> Wicket serializes requests to pages, so Ajax channels won't help you for
> long running processes.
>
> You'll have to upload the file to a resource, so the user can continue to
> work on the page. You'll probably need an iframe for that, see:
>
> http://stackoverflow.com/**questions/166221/how-can-i-**
> upload-files-asynchronously-**with-jquery


http://wicketinaction.com/2012/11/uploading-files-to-wicket-iresource/ may
be useful too.


>
>
> Regards
> Sven
>
>
>
> On 08/28/2013 11:53 PM, Steve Lowery wrote:
>
>> I would like to have my file upload requests on my site, which take much
>> longer than a normal request, go through a different mechanism.  I'd like
>> the user to still be able to click around the site and work while the file
>> is uploading and then when it finishes, I can pop up an "All Done" type
>> dialog.  AjaxChannel seems to me to be the mechanism to do this, but
>> either
>> I am doing it wrong or it doesn't work as I'd expect.
>>
>> My links I'm testing the concept with looks like (I'm using wicket
>> 6.10.0):
>> add(new AjaxLink("slow") { @Override public void
>> onClick(AjaxRequestTarget target) { System.out.println("Slow Link
>> Clicked"); try { Thread.sleep(Integer.valueOf("**1")); } catch
>> (InterruptedException ie) {} target.appendJavaScript("**alert('Done with
>> slow
>> running request');"); System.out.println("Done Processing Slow Link."); }
>> @Override protected void updateAjaxAttributes(**AjaxRequestAttributes
>> attributes) { super.updateAjaxAttributes(**attributes);
>> attributes.setChannel(new AjaxChannel("upl", AjaxChannel.Type.QUEUE)); }
>> }); add(new AjaxLink("fast") { @Override public void
>> onClick(AjaxRequestTarget target) { System.out.println("Fast Link
>> Clicked"); target.appendJavaScript("**alert('Done with fast running
>> request');"); System.out.println("Done Processing Fast Link."); } });
>>
>> I would expect that if I click Slow, then click Fast that the fast would
>> return to the user before the slow, but that's not happening.
>>
>> I can attach a quickstart and create an issue in JIRA if that is the route
>> to go if I am doing it right.  If I'm doing it wrong, can someone let me
>> know how I can accomplish what I'm looking to do?
>>
>> Thanks,
>> Steve
>>
>>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Wicket and microdata

2013-08-30 Thread Martin Grigorov
Hi,


On Thu, Aug 29, 2013 at 3:29 PM, Dirk Forchel wrote:

> I'm currently try to add some kind of microdata
> (http://en.wikipedia.org/wiki/Microdata_%28HTML%29) to our project.
> Exists a
> wicketstuff project dealing with this problem?
>

I'm not aware of such.


> What is the preferred way to add "valueless" attributes to HTML tags? E.g.
> I
> have to add the following attributes to the body tag:
>
> http://scheme.org/WebPage";>
>
> 
>
> At the base page class I've added a TransparentMarkupContainer the
> following
> way:
>
> this.body = new TransparentWebMarkupContainer("body");
> this.body.setOutputMarkupId(true);
>
> HTML:
>
> 
>
> 
>
> At a subclass I did:
>
> getBody().setMarkupId("foo").add( AttributeModifier.append("itemscope",
> AttributeModifier.VALUELESS_ATTRIBUTE_ADD ) ).add(
> AttributeModifier.append(
> "itemtype", Model.of( "http://scheme.org/WebPage"; ) ) );
>
> Is this the preferred way to add "valueless" attributes to a tag (I've
> never
>

Yes. This is the way to tell Wicket to not add a value for the attribute.

Another way is to add these attributes directly in the markup. No need to
add Behavior to the components for something that is always true.


> seen this before)? Or is this marker value for internal use only? At least
> the generated HTML code looks like intended.
> I would like to know whether there is a kind of general solution to deal
> with "microdata", say a bunch of Behavior-classes to add this kind of data.
>

AttributeModifier is a Behavior itself.
There is no special code in Wicket for microdata. This specification is not
broadly used.


>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-and-microdata-tp4661135.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: Styling tags

2013-08-30 Thread Martin Grigorov
Hi Lucio,

The suggested solution should work.
Did you try it ?
What kind of issues you faced ?

Give us more details and some code and we will tell you where is the
problem.


On Fri, Aug 30, 2013 at 11:36 AM, Lucio Crusca  wrote:

> In data mercoledì 28 agosto 2013 08:59:56, Lucio Crusca ha scritto:
> > Maybe that would work to some extent, but it would have at least the
> > following issues: [...]
>
> No more replies. Should I deduce there's no known solution?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: WebSockets / Atmosphere with Glassfish 4.0?

2013-08-30 Thread Martin Grigorov
Hi,

I've tried to make a module for GF 3 for Native WebSockets when Native WS
module has been introduced -
https://github.com/apache/wicket/tree/sandbox/wicket-native-websocket-glassfish
But it didn't work well because of: bugs in GF 3, lack of demo apps, lack
of interest.

Recently I've added JSR356 based implementation to Wicket 7 -
https://github.com/apache/wicket/tree/master/wicket-experimental/wicket-native-websocket/wicket-native-websocket-javax
But again this doesn't work on GF 4 :-/ due to
https://java.net/jira/browse/WEBSOCKET_SPEC-181. The impl works with Tomcat
8, and Tomcat 7 (next release will have the JSR based impl backported).
This can be improved by moving the WebSocket Endpoint creation logic to a
ServletContextListener instead of a Filter but this will require additional
setup steps that I'd like to avoid.


On Thu, Aug 29, 2013 at 6:12 PM, Phill Ashworth wrote:

> Has anyone managed to use Wicket + native WebSockets or Atmosphere on
> Glassfish 4.0?
> Neither of the current modules work out of the box on Glassfish 4.0, just
> wondering if anyone has had any success with this combination or can give
> me any time saving pointers.
> -Phill
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Styling tags

2013-08-30 Thread Lucio Crusca
In data mercoledì 28 agosto 2013 08:59:56, Lucio Crusca ha scritto:
> Maybe that would work to some extent, but it would have at least the
> following issues: [...]

No more replies. Should I deduce there's no known solution?

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



Re: Custom FormComponent and model update

2013-08-30 Thread Martin Grigorov
Hi,

There is a special handling for Ajax requests - the page is marked as dirty
and stored, but its pageId is not incremented. So the new state completely
overrides the old in the store.

By "the object is not attached to a Form" I understand that you try to
update the model of a Component which is not in the page's component tree.
Since this component is not visible/reachable by the page then its stateful
behavior is not reachable too. So at the end the page may be still
stateless and thus never stored.
Try with: page.setStatelessHint(false)


On Fri, Aug 30, 2013 at 8:22 AM, Edgar Merino  wrote:

> I'm completely lost here, I've been debugging AjaxCheckBox just to see how
> it manages to not make the page dirty, but something strange happens when
> calling Component#dirty(boolean) on Component#modelChanging(), I set a
> breakpoint in the beginning of the Component#dirty(boolean) method but it
> never gets there... although it is being called by Component#dirty().
> However, when using my custom FormComponent, it will always mark the page
> as dirty (it will enter the method) making my changes to be visible only on
> the next version of the page, which is not what I want, any idea how to
> solve this?
>
>
>
>
> On 29/08/13 23:05, Edgar Merino wrote:
>
>> Found the problem, it has to do with versioning of pages... my callback
>> is not changing the version number in the URL so everytime I refresh the
>> web page I'm retrieving the older version of the page. I'm gonna have to
>> work with AjaxRequestTarget in order to avoid this I guess.
>>
>>
>> On 29/08/13 22:52, Edgar Merino wrote:
>>
>>> I have track this down to the Component#modelChanging() method, it seems
>>> that the actual modified page is not being stored in the session (perhaps
>>> it has something to do with dirty pages?). I'm a bit lost here, any clue
>>> would be appreciated.
>>>
>>> Thank you.
>>>
>>> On 29/08/13 14:33, Edgar Merino wrote:
>>>
 Hello, I'm having a problem with a FormComponent I'm implementing, I'm
 manually calling FormComponent#validate(), FormComponent#valid() and
 FormComponent#updateModel() inside MyBehavior#onRequest() since the object
 is not attached to a Form, I'm using a custom Behavior (MyBehavior, which
 extends AbstractAjaxBehavior, I don't need any of the functionality
 provided by AjaxDefaultAbstractBehavior), the model changes for this
 request but every time a new request is handled I see the component still
 uses the old model that was supposed to be replaced in the previous 
 request.

 By debugging the application I can see that everytime a new request is
 handled, the FormComponent will look for the model in the Component#data
 attribute array, which holds the initially set IModel and is never
 changed... I don't have a clue on how to change this, I bet this is the key
 to solve this, does anyone have a clue on how to do this?


 Thanks in advance,
 Edgar Merino.

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


Re: Is there a "Wicket for Client-side Javascript Apps"?

2013-08-30 Thread Martin Grigorov
Hi,

Check Cajeta.js.
Demo app at:
https://github.com/jklappenbach/cajeta.js/tree/master/quickstart/site



On Fri, Aug 30, 2013 at 9:17 AM, Ashley Aitken  wrote:

>
> Sorry, this may be a bit off-topic but I can't think of a better group to
> ask.
>
> Does anyone know of a client-side Javascript framework that has the
> complete separation of Java(script) and HTML/CSS that Wicket has?  I'm not
> a fan of loops and conditionals in the HTML.
>
> I'm thinking of a client-side Javascript framework that would do similar
> to what Wicket does with the wicketid.  Of course, not being a server-side
> Web application it would be very different in other regards to Wicket.
>
> I would like it to be component-based and event-driven (like Wicket but in
> Javascript).  Perhaps allowing components to be as easily defined by
> inheritance in Javascript as they are in Wicket, for example.
>
> I don't wish to hide the HTML/CSS.  I would like to be able to design the
> client page(s) in HTML and CSS like Wicket allows, with almost complete
> separation between developer and designer.
>
> Does it even make sense what I am asking for / suggesting? ;-)
>
> Thanks for any pointers or suggestions.
>
> Cheers,
> Ashley.
>
> PS I know of Ember.js (uses templating system), Sproutcore, Cappuccino
> (abstracts HTML/CSS) and Flight.
>
> --
> Ashley Aitken
> Perth, Western Australia
> mrhatken at mac dot com
> Social (Facebook, Twitter, Skype etc.): MrHatken
> Professional (LinkedIn, Twitter, Skype etc.): AshleyAitken
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>