Re: Dirty read/edit problem.

2009-06-23 Thread Maarten Bosteels
Hi,

We have implemented something similar. In our case multiple applications
should be able to request locks, so we have implemented it on the database.
It's based on DBMS_LOCK (Oracle specific).
When an application crashes (or is killed in an unclean manner) Oracle will
roll back any pending transactions, and automagically release the locks.
Works very well (btw, our applications never crash :-)

Since you have only one application, I guess you could do it in the
application layer (keep locks in memory).

Maarten


On Tue, Jun 23, 2009 at 3:07 AM, James Carman
jcar...@carmanconsulting.comwrote:

 If it's fairly unlikely that two people would be editing the same record at
 the same time, then it's probably okay to go with optimistic locking.

 On Mon, Jun 22, 2009 at 8:41 PM, satar starl...@gmail.com wrote:

 
  Yep, that is what I thought from the reading I have done. I think I will
 do
  it the way I have in the past but using an application-level edit table
  instead of having to use a database. This feels more natural to me and I
  have spent an absorbent amount of time learning Hibernate already and
 just
  hoping that I get some return from all of the complexities it has
  eventually. I do believe that will be the case because all you smart
 peeps
  wouldn't be using it if there was nothing to gain. The dirty read problem
  seems like such a normal condition for any application that has multiple
  writers, so I thought I would see what is a typical approach within web
  apps
  -- something I am very new at.
  --
  View this message in context:
  http://www.nabble.com/Dirty-read-edit-problem.-tp24157057p24158076.html
Sent from the Wicket - User 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 + Spring DM + Hibernate

2009-06-23 Thread Daniel Dominik Holúbek
Okay, but I still don't understand the reason of doing this stuff :)I've
already created the Application bean, and implemented
ApplicationContextAware.
Then the setApplicationContext method gets called, so I created
ApplictionContext variable in that class and set it it that method.
But if I try to access it in another bundle via Application.get(), it is
still null.
But even if it wasn't, I think that the DAO bean, declared in other bundle
(database-bundle) would not be there.

Just to make it clear - we've got three bundles. The database bundle has
everything needed to operate with DB. It creates DAO beans and makes OSGi
sevices from them. Then, there is an Application bundle. And the last bundle
is Panel bundle, which is loaded into the App bundle via an extension point.
I need to access the DAO in the Panel bundle, and there comes the problem
mentioned above.

That's why I do not understand why should I change the Application bundle
(except the Panel complaining about Application not being in Spring Extender
thread).

Thanks for your help :)

On Mon, Jun 22, 2009 at 11:38 PM, James Carman jcar...@carmanconsulting.com
 wrote:

 Sorry, that's IWebApplicationFactory, not IWicketApplicationFactory.
 Long day.

 On Mon, Jun 22, 2009 at 5:05 PM, James
 Carmanjcar...@carmanconsulting.com wrote:
  You will probably need to make your application class a singleton
  (with a getInstance() method and stuff) and specify that in the spring
  configuration:
 
  bean id=wicketApplication
  class=com.myco.myapp.MyWicketApplication
  factory-method=getInstance /
 
  Also, you will probably need to implement your own
  IWicketApplicationFactory to return the singleton instance since you
  won't have access to the Spring ApplicationContext to lookup your
  application object.
 
  On Mon, Jun 22, 2009 at 3:57 PM, Igor Vaynbergigor.vaynb...@gmail.com
 wrote:
  you have to create wicketapplication instance as a spring bean in
  order for setapplicationcontext to be called.
 
  -igor
 
  On Mon, Jun 22, 2009 at 12:47 PM, Daniel Dominik
  Holúbekdankodo...@gmail.com wrote:
  I tried implementing the ApplicationContextAware interface, it looked
 like a
  good idea, but the setApplicationContext method is never called.
 
  On Mon, Jun 22, 2009 at 8:25 PM, Daniel Dominik Holúbek 
  dankodo...@gmail.com wrote:
 
  For now, only in eclipse. But when it goes to production (or further
  testing) it will run in equinox bridge.
 
 
  On Mon, Jun 22, 2009 at 5:14 PM, James Carman 
  jcar...@carmanconsulting.com wrote:
 
  That's what I'd try, perhaps.  How are you starting this application?
  Only in eclipse?
 
  On Mon, Jun 22, 2009 at 11:09 AM, Daniel Dominik
  Holúbekdankodo...@gmail.com wrote:
   Well, I don't know :)I
  
   On Mon, Jun 22, 2009 at 12:32 PM, James Carman 
  jcar...@carmanconsulting.com
   wrote:
  
   Can you have your Application object created as a Spring bean and
 make
   it context aware and let the container inject the context into
 it?
  
   On Mon, Jun 22, 2009 at 2:02 AM, Daniel Dominik
   Holúbekdankodo...@gmail.com wrote:
But as far as I understand this, Spring DM is built upon the
 idea
  that I
can't build ApplicationContext, as it is built by Spring DM
 Extender.
  Am
   I
right?
   
On Mon, Jun 22, 2009 at 12:37 AM, James Carman 
   jcar...@carmanconsulting.com
wrote:
   
Try using the other SpringComponentInjector constructor (the
 one
  that
takes an ApplicationContext object).  Construct your
ApplicationContext however you want.
   
On Sun, Jun 21, 2009 at 2:09 PM, Daniel Dominik Holúbek
dankodo...@gmail.com wrote:

 Well, no.I'll explain:
 It's an OSGi app running in equinox-bridge. In my bundles
 there is
  no
 web.xml, and that's why I can't configure
 ContextLoaderListener.
 And because of this, when i add @SpringBean into my code,
 then add
 addComponentInstantiationListener(new
  SpringComponentInjector(this))
into
 WebApplication's init method and then run the application,
 the
  only
   thing
I
 get is this exception:  java.lang.IllegalStateException: No
 WebApplicationContext found: no ContextLoaderListener
 registered?

 But if there is a way how to set up that listener, I would be
  happy :)


 On Sun, Jun 21, 2009 at 7:28 PM, James Carman
 jcar...@carmanconsulting.comwrote:

  You can't use @SpringBean?
 
  On Sun, Jun 21, 2009 at 11:03 AM, Daniel Dominik
  Holúbekdankodo...@gmail.com wrote:
   Hello everyone :)So, I solved the Spring DM problems
   successfully...
but
   there is still one problem left, and this time I am
 absolutely
   sure
that
   it's a Wicket related problem :)
  
   I want to inject my userDao bean into Panel class. To
 do
  that, I
nead
  to
   create a bean from that Panel class - like this:
  
  
   bean name=consumer
class=sk.ziwhat.megaweb.loginpanels.prvy.lPanel
   

Re: redirect to mailto

2009-06-23 Thread Erik van Oosten

Well, then its time to whip up some javascript!

E.g.:

new AjaxLink(..) {
  public void onClick(target) {
 target.addJavascript(document.url = 'mailto:');
  }
}

Completely out of my head so you'll have to find the exact method names
yourself ;)

Regards,
Erik.


On Mon, 22 Jun 2009 15:22:41 -0500, Aaron Dixon atdi...@gmail.com wrote:
 Thanks, Erik. But I need to have this behavior initiated in response
 to an ajax event (say, on an onchange for a select drop down).
 
 On Mon, Jun 22, 2009 at 2:00 PM, Erik van Oostene.vanoos...@grons.nl
 wrote:
 You can use ExternalLink with a mailto: url.

 Regards,
   Erik.


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



Page Expire

2009-06-23 Thread srinivas

Hi,

After how much time will we get the page expire in wicket . Please give 
me the replay if any one know this .

Thanks in advance.

Regards,
Srinivasa Raju CH.


Get your world in your inbox!

Mail, widgets, documents, spreadsheets, organizer and much more with your 
Sifymail WIYI id!
Log on to http://www.sify.com

** DISCLAIMER **
Information contained and transmitted by this E-MAIL is proprietary to 
Sify Limited and is intended for use only by the individual or entity to 
which it is addressed, and may contain information that is privileged, 
confidential or exempt from disclosure under applicable law. If this is a 
forwarded message, the content of this E-MAIL may not have been sent with 
the authority of the Company. If you are not the intended recipient, an 
agent of the intended recipient or a  person responsible for delivering the 
information to the named recipient,  you are notified that any use, 
distribution, transmission, printing, copying or dissemination of this 
information in any way or in any manner is strictly prohibited. If you have 
received this communication in error, please delete this mail  notify us 
immediately at ad...@sifycorp.com


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



Help with Adding a CSS class via AjaxLink

2009-06-23 Thread waarheid08

Hi Wicket users,

I've a ListView in a ListView. The 1st ListVeiw holds categories. The 2nd  
ListView holds links (topics) which I want to be highlighted if the link  
(topic) is clicked. The problem is that the wrapped list (container) is  
getting refreshed, but the CSS class is not set for the corresponding list  
item.

Below my code:

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.Model;
import org.wicketstuff.annotation.mount.MountPath;

@MountPath(path = test)
@SuppressWarnings(serial)
public class TestPage extends WebPage {

public TestPage() {
final WebMarkupContainer container = new WebMarkupContainer(container);
container.setOutputMarkupId(true);

container.add(new ListViewCategory(categories, buildCategories()) {
@Override
protected void populateItem(ListItemCategory item) {
Category category = item.getModelObject();
item.add(new Label(category, category.getName()));
item.add(new ListViewTopic(topics, category.getTopics()) {
@Override
protected void populateItem(final ListItemTopic item) {
Topic topic = item.getModelObject();
AjaxLinkString topicLink = (new AjaxLinkString(topicLink) {
@Override
public void onClick(AjaxRequestTarget target) {
item.add(new AttributeModifier(class, new ModelString(highlight)));
target.addComponent(container);
}
});
topicLink.add(new Label(topic, topic.getName()));
item.add(topicLink);
}
});
}
});
add(container);
}

private class Category implements Serializable {
private String name;
private ListTopic topics;

public Category (String name, ListTopic topics) {
this.name = name;
this.topics = topics;
}

public String getName() {
return name;
}

public ListTopic getTopics() {
return topics;
}
}

private class Topic implements Serializable {
private String name;

public Topic (String name) {
this.name = name;
}

public String getName() {
return name;
}
}

private ListCategory buildCategories() {
ListCategory categories = new ArrayListCategory();
categories.add(new Category(Movies, Arrays.asList(new Topic(Mamma), new  
Topic(USA), new Topic(NL;
categories.add(new Category(Articles, Arrays.asList(new Topic(Test),  
new Topic(Nederland;
categories.add(new Category(Images, Arrays.asList(new Topic(Mag), new  
Topic(Spullen), new Topic(Mamma mia;
categories.add(new Category(Links, Arrays.asList(new Topic(Ana), new  
Topic(Smiti), new Topic(Hbiloo), new Topic(Yeeh;

return categories;
}
}

ul class=menu wicket:id=container
li class=r wicket:id=categories
span class=category wicket:id=categoryCategory A: /span
ul
li wicket:id=topics
a wicket:id=topicLinkspan wicket:id=topicLink/span/a
/li
/ul
/li
/ul


Hbiloo.


Re: Page Expire

2009-06-23 Thread Dipu
isn't it container specific ?

On Tue, Jun 23, 2009 at 10:57 AM, srinivassrinivas.r...@sifycorp.com wrote:
 Hi,

 After how much time will we get the page expire in wicket . Please give me
 the replay if any one know this .
 Thanks in advance.

 Regards,
 Srinivasa Raju CH.


 Get your world in your inbox!

 Mail, widgets, documents, spreadsheets, organizer and much more with your
 Sifymail WIYI id!
 Log on to http://www.sify.com

 ** DISCLAIMER **
 Information contained and transmitted by this E-MAIL is proprietary to Sify
 Limited and is intended for use only by the individual or entity to which it
 is addressed, and may contain information that is privileged, confidential
 or exempt from disclosure under applicable law. If this is a forwarded
 message, the content of this E-MAIL may not have been sent with the
 authority of the Company. If you are not the intended recipient, an agent of
 the intended recipient or a  person responsible for delivering the
 information to the named recipient,  you are notified that any use,
 distribution, transmission, printing, copying or dissemination of this
 information in any way or in any manner is strictly prohibited. If you have
 received this communication in error, please delete this mail  notify us
 immediately at ad...@sifycorp.com

 -
 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: Page Expire

2009-06-23 Thread vineet semwal
You can specify session-timeout in web.xml .

regards,
vineet semwal

On Tue, Jun 23, 2009 at 3:31 PM, Dipu dipu@googlemail.com wrote:

 isn't it container specific ?

 On Tue, Jun 23, 2009 at 10:57 AM, srinivassrinivas.r...@sifycorp.com
 wrote:
  Hi,
 
  After how much time will we get the page expire in wicket . Please give
 me
  the replay if any one know this .
  Thanks in advance.
 
  Regards,
  Srinivasa Raju CH.
 
 
  Get your world in your inbox!
 
  Mail, widgets, documents, spreadsheets, organizer and much more with your
  Sifymail WIYI id!
  Log on to http://www.sify.com
 
  ** DISCLAIMER **
  Information contained and transmitted by this E-MAIL is proprietary to
 Sify
  Limited and is intended for use only by the individual or entity to which
 it
  is addressed, and may contain information that is privileged,
 confidential
  or exempt from disclosure under applicable law. If this is a forwarded
  message, the content of this E-MAIL may not have been sent with the
  authority of the Company. If you are not the intended recipient, an agent
 of
  the intended recipient or a  person responsible for delivering the
  information to the named recipient,  you are notified that any use,
  distribution, transmission, printing, copying or dissemination of this
  information in any way or in any manner is strictly prohibited. If you
 have
  received this communication in error, please delete this mail  notify us
  immediately at ad...@sifycorp.com
 
  -
  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: Page Expire

2009-06-23 Thread srinivas

Hi,

I am not asking about the session-timeout , i have given session-timeout 
as 30 mins in web.xml, But in wicket when i submit a form and
after some time (10 mins) when i try to perform another operation i am 
getting the  *Page Expired*  error.


Regards,
Srinivasa Raju CH.

vineet semwal wrote:

You can specify session-timeout in web.xml .

regards,
vineet semwal

On Tue, Jun 23, 2009 at 3:31 PM, Dipu dipu@googlemail.com wrote:

  

isn't it container specific ?

On Tue, Jun 23, 2009 at 10:57 AM, srinivassrinivas.r...@sifycorp.com
wrote:


Hi,

After how much time will we get the page expire in wicket . Please give
  

me


the replay if any one know this .
Thanks in advance.

Regards,
Srinivasa Raju CH.


Get your world in your inbox!

Mail, widgets, documents, spreadsheets, organizer and much more with your
Sifymail WIYI id!
Log on to http://www.sify.com

** DISCLAIMER **
Information contained and transmitted by this E-MAIL is proprietary to
  

Sify


Limited and is intended for use only by the individual or entity to which
  

it


is addressed, and may contain information that is privileged,
  

confidential


or exempt from disclosure under applicable law. If this is a forwarded
message, the content of this E-MAIL may not have been sent with the
authority of the Company. If you are not the intended recipient, an agent
  

of


the intended recipient or a  person responsible for delivering the
information to the named recipient,  you are notified that any use,
distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you
  

have


received this communication in error, please delete this mail  notify us
immediately at ad...@sifycorp.com

-
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: Trying to add string literal to Javascript for Google Analytics

2009-06-23 Thread Neil Ferguson
Hi.

Thanks for the reply. I did read that blog post previously, but I
don't really want the pageTracker._trackPageview function to be run in
the page header. For Google Analytics (or any other Javascript-based
analytics for that matter) the best practice is to put the tracking
code just before the close of the body tag, to ensure that it's run
only when the page is fully loaded. Perhaps I'm missing something
though, would it be possible to do this with the
TextTemplateHeaderContributor?

Thanks.

Neil.

On Mon, Jun 22, 2009 at 7:08 PM, Juan Carlos Garcia
M.jcgarc...@gmail.com wrote:

 Have you Try using a
 http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/util/template/TextTemplateHeaderContributor.html
 HeaderContribution , factoring out that JavaScript into a separate .js  and
 then do variable Interpolation.

 See the following example at
 http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/
 Eelco Hillenius blog's

 Hope this is what you need.


 Neil Ferguson-2 wrote:

 Thanks for the reply. I'd rather keep the script in my markup if
 possible. Is there any way to do this so that I don't have to output
 the entire Javascript block from my Java code?

 Thanks.

 Neil.

 On Mon, Jun 22, 2009 at 6:24 AM, Igor Vaynbergigor.vaynb...@gmail.com
 wrote:
 output the entire javascript block as a string using new
 label().setescapemodelstrings(false)

 -igor

 On Sun, Jun 21, 2009 at 11:18 AM, Neil Fergusonnfergu...@gmail.com
 wrote:
 Hi all.

 I'm trying to set a string literal in some Javascript, in order to try
 and pass a page URL to Google Analytics. I've tried creating a panel
 with the following markup, and putting it just before the end of my
 body tag:

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;

        body
            wicket:panel
                script type=text/javascript
                                var gaJsHost = ((https: ==
 document.location.protocol) ?
 https://ssl.; : http://www.;);
                                document.write(unescape(%3Cscript src='
 + gaJsHost +
 google-analytics.com/ga.js'
 type='text/javascript'%3E%3C/script%3E));
                    /script
                script type=text/javascript
                                try {
                                var pageTracker =
 _gat._getTracker(TRACKINGID);
                                pageTracker._trackPageview('');
                                } catch(err) {}
                    /script
                /wicket:panel
        /body
 /html

 As you can see, I'm trying to set the parameter of the _trackPageview
 method (or function, whatever it's called in Javascript). I've tried
 doing this using a span tag, as you can see, but it doesn't work, and
 I get the following message:

 WicketMessage: The component(s) below failed to render. A common
 problem is that you have added a component in code but forgot to
 reference it in the markup (thus the component will never be
 rendered).

 The Java code for my panel looks like the following:

 public class FooterPanel extends Panel {

        private static final long serialVersionUID =
 9196070061210793618L;

        public FooterPanel(String id, String analyticsPagename) {
                super(id);
                Label label = new Label(analyticspagename,
 analyticsPagename);
                label.setRenderBodyOnly(true);
                add(label);
        }

 }

 I didn't really expect this to work, but I can't think of a better
 way. I'm sure that I'm missing something really obvious here, so can
 anyone help?

 BTW, I'm really enjoying using Wicket. I have a severe allergy to XML,
 so it's brilliant.

 Thanks.

 Neil.

 -
 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




 --
 View this message in context: 
 http://www.nabble.com/Trying-to-add-string-literal-to-Javascript-for-Google-Analytics-tp24137280p24152508.html
 Sent from the Wicket - User 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



-
To unsubscribe, e-mail: 

Re: Oli's Presentation - Learn More About Wicket and, Contribute

2009-06-23 Thread OliZilla

Glad you liked it!

I think the wiki link should read:

http://cwiki.apache.org/WICKET/contributing-to-wicket.html

If any one has any advice on contributing back to wicket, please do add it.

Oli


jWeekend wrote:
 
 Check out the Wiki entry too at http://code.google.com/p/londonwicket/ . 
 

-- 
View this message in context: 
http://www.nabble.com/Oli%27s-Presentation---Learn-More-About-Wicket-and%2C-Contribute-tp24155774p24164098.html
Sent from the Wicket - User 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



Call to action: find and fix errata in 1.4 JavaDoc

2009-06-23 Thread Martijn Dashorst
Many of our JavaDoc examples are still Wicket 1.3 based. For example,
just yesterday I found the JavaDoc for Link to contain an unnecessary
cast. Before we finalize 1.4, we should try to fix all javadoc
examples (mostly in components) to ensure they are up to par with 1.4.

As the core team we can only do so much in so little time.  With the
help of our community we will be able to clean up our documentation in
no time...

I hereby send out a call for action to the grander community: please
read the javadocs of 1.4 and see if you can find an old example that
doesn't fit with 1.4 syntax and semantics. Send in a patch with the
improved javadoc!

I've created issue 2338 to track these errata. Please work with us!

http://issues.apache.org/jira/browse/WICKET-2338

You can view the JavaDoc online here: http://wicket.apache.org/docs/1.4/

Martijn

--
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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



Re: Wicket + Spring DM + Hibernate

2009-06-23 Thread Daniel Dominik Holúbek
I appreciate your help, of course :)You know, I'm trying to create a web app
consisting of independent modules. Then if I change something in one module,
I don't have to redeploy whole application.
This can be achieved of course, the only problem is this thing we are
currently speaking of. :)

But if there is no way to do it, I think that putting the whole database
stuff into application bundle and then treating it normally would be okay,
even if I will have to redeploy the application bundle if I change something
in database.

Thanks! :)

On Tue, Jun 23, 2009 at 12:41 PM, James Carman jcar...@carmanconsulting.com
 wrote:

 On Tue, Jun 23, 2009 at 4:05 AM, Daniel Dominik Holúbek
 dankodo...@gmail.com wrote:
 
  Okay, but I still don't understand the reason of doing this stuff :)I've
  already created the Application bean, and implemented
  ApplicationContextAware.
  Then the setApplicationContext method gets called, so I created
  ApplictionContext variable in that class and set it it that method.
  But if I try to access it in another bundle via Application.get(), it is
  still null.
  But even if it wasn't, I think that the DAO bean, declared in other
 bundle
  (database-bundle) would not be there.
 

 None of us have experience with this environment, so we're trying to
 help as best we can.  This stuff wasn't designed for this environment.
  Why, exactly, do you feel it's necessary to architect your
 application this way, if you don't mind me asking?

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




-- 
-danoh-


Re: Wicket + Spring DM + Hibernate

2009-06-23 Thread Daniel Stoch
Hi,

I think your problem is that in Wicket the whole Spring injection
mechanism is prepared for applications where there is only one
ApplicationContext (AC). This AC is hold in the Wicket application
instance. So when you are trying to use @SpringBean annotation Wicket
tries to inject a bean from this AC.
Inside OSGi there are many AC (each bundle has its own AC), so the
base Wicket injection mechanism does not work here for all ACs, only
for one which you are save in Wicket application instance. The best
solution here is to make adaptation of Wicket injection mechanism to
OSGi environment (as we did in our application platform). It is not so
easy, but it can be done :).

It can work as follows (short draft):
When you are using @SpringBean to inject bean inside a class PanelA
then injection mechanism should injects a bean from ApplicationContext
of bundle where class PanelA is defined. So you must store somewhere
information about ApplicationContext in context of bundle class
loader. Then when you injecting a bean to PanelA: get a class PanelA
classloader find a proper AC for it and then inject a bean from this
AC.

--
Daniel

On Tue, Jun 23, 2009 at 10:05 AM, Daniel Dominik
Holúbekdankodo...@gmail.com wrote:
 Okay, but I still don't understand the reason of doing this stuff :)I've
 already created the Application bean, and implemented
 ApplicationContextAware.
 Then the setApplicationContext method gets called, so I created
 ApplictionContext variable in that class and set it it that method.
 But if I try to access it in another bundle via Application.get(), it is
 still null.
 But even if it wasn't, I think that the DAO bean, declared in other bundle
 (database-bundle) would not be there.

 Just to make it clear - we've got three bundles. The database bundle has
 everything needed to operate with DB. It creates DAO beans and makes OSGi
 sevices from them. Then, there is an Application bundle. And the last bundle
 is Panel bundle, which is loaded into the App bundle via an extension point.
 I need to access the DAO in the Panel bundle, and there comes the problem
 mentioned above.

 That's why I do not understand why should I change the Application bundle
 (except the Panel complaining about Application not being in Spring Extender
 thread).

 Thanks for your help :)


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



jazzyplugin dependency in tinymce wicketstuff cannot be resolved

2009-06-23 Thread Daniele Dellafiore
Hi everyone.

I am trying to build tinymce wicketstuff but it cannot resolve the
jazzyplugin dependency. Without that, it works but I cannot use the
spellchecker feature.

I have searched and cannot find any artifact of jazzyplugin or
jwarehouse, or com.swabunga anywhere on the web.

any hint?

-- 
Daniele Dellafiore
http://blog.ildella.net
http://twitter.com/ildella

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



Re: Call to action: find and fix errata in 1.4 JavaDoc

2009-06-23 Thread Vasu Srinivasan
I'm willing to help in my spare time. I have been using wicket only for the
last two months, and I have been very impressed. How do I go about fixing it
and not overlapping on others work at the same time ? Any specific areas to
look at as a priority ?


On Tue, Jun 23, 2009 at 6:45 AM, Martijn Dashorst 
martijn.dasho...@gmail.com wrote:

 Many of our JavaDoc examples are still Wicket 1.3 based. For example,
 just yesterday I found the JavaDoc for Link to contain an unnecessary
 cast. Before we finalize 1.4, we should try to fix all javadoc
 examples (mostly in components) to ensure they are up to par with 1.4.

 As the core team we can only do so much in so little time.  With the
 help of our community we will be able to clean up our documentation in
 no time...

 I hereby send out a call for action to the grander community: please
 read the javadocs of 1.4 and see if you can find an old example that
 doesn't fit with 1.4 syntax and semantics. Send in a patch with the
 improved javadoc!

 I've created issue 2338 to track these errata. Please work with us!

 http://issues.apache.org/jira/browse/WICKET-2338

 You can view the JavaDoc online here: http://wicket.apache.org/docs/1.4/

 Martijn

 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.5 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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




-- 
Regards,
Vasu Srinivasan


RE: Page Expire

2009-06-23 Thread Ames, Tim
From what I have read on this forum, page expires and session expires can be 
two different things.

Search in this forum for the message What does page expired mean?. The 
discussion talks about several issues not just session expiration.

-Original Message-
From: Dipu [mailto:dipu@googlemail.com]
Sent: Tuesday, June 23, 2009 6:12 AM
To: users@wicket.apache.org
Subject: Re: Page Expire

show your code or quickstart  would be helpful

On Tue, Jun 23, 2009 at 11:09 AM, srinivassrinivas.r...@sifycorp.com wrote:
 Hi,

 I am not asking about the session-timeout , i have given session-timeout as
 30 mins in web.xml, But in wicket when i submit a form and
 after some time (10 mins) when i try to perform another operation i am
 getting the  *Page Expired*  error.

 Regards,
 Srinivasa Raju CH.

 vineet semwal wrote:

 You can specify session-timeout in web.xml .

 regards,
 vineet semwal

 On Tue, Jun 23, 2009 at 3:31 PM, Dipu dipu@googlemail.com wrote:



 isn't it container specific ?

 On Tue, Jun 23, 2009 at 10:57 AM, srinivassrinivas.r...@sifycorp.com
 wrote:


 Hi,

 After how much time will we get the page expire in wicket . Please give


 me


 the replay if any one know this .
 Thanks in advance.

 Regards,
 Srinivasa Raju CH.


 Get your world in your inbox!

 Mail, widgets, documents, spreadsheets, organizer and much more with
 your
 Sifymail WIYI id!
 Log on to http://www.sify.com

 ** DISCLAIMER **
 Information contained and transmitted by this E-MAIL is proprietary to


 Sify


 Limited and is intended for use only by the individual or entity to
 which


 it


 is addressed, and may contain information that is privileged,


 confidential


 or exempt from disclosure under applicable law. If this is a forwarded
 message, the content of this E-MAIL may not have been sent with the
 authority of the Company. If you are not the intended recipient, an
 agent


 of


 the intended recipient or a  person responsible for delivering the
 information to the named recipient,  you are notified that any use,
 distribution, transmission, printing, copying or dissemination of this
 information in any way or in any manner is strictly prohibited. If you


 have


 received this communication in error, please delete this mail  notify
 us
 immediately at ad...@sifycorp.com

 -
 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



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

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

EMAIL CONFIDENTIALITY NOTICE 

This Email message, and any attachments, may contain confidential 
patient health information that is legally protected. This information 
is intended only for the use of the individual or entity named above. 
The authorized recipient of this information is prohibited from disclosing 
this information to any other party unless required to do so by law 
or regulation and is required to destroy the information after its stated 
need has been fulfilled. If you are not the intended recipient, you are 
hereby notified that any disclosure, copying, distribution, or action 
taken in reliance on the contents of this message is strictly prohibited. 

If you have received this information in error, please notify 
the sender immediately by replying to this message and delete the 
message from your system.


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



UploadProgressBar in firefox and ie6

2009-06-23 Thread Mathias Nilsson
Hi!

I'm trying to use the UploadProgressBar and it works in ie7 but not in
firefox 2.0.0.2 or ie 6.0.2900.2180
In firefox the progressbar is not updated and in ie 6 I get the following
exception

java.lang.IllegalStateException: ServletRequest does not contain mulipart
content.

I have setup my appication class by overriding the newWebRequest
@Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest){
return new UploadWebRequest(servletRequest);
}

I can see that the newWebRequest is accessed when using firefox but as I
said before, no update on the progress bar.

public class Test extends WebPage{
 FileUploadField upload;
 public Test(){
  UploadForm uploadForm = new UploadForm( uploadForm ){
   @Override
 protected void onSubmit()
 {
 final FileUpload up = upload.getFileUpload();
 if (up != null){
 System.out.println( up.getClientFileName() );
 File newFile = new File( d:/, up.getClientFileName());
 try{
 newFile.createNewFile();
 up.writeTo(newFile);
 }catch (Exception e){
 throw new IllegalStateException(Unable to write
file);
 }
 }
 }
  };
  uploadForm.add( new UploadProgressBar(progress, uploadForm));
  upload = new FileUploadField( upload );
  uploadForm.add( upload );
  add( uploadForm );

 }

 class UploadForm extends FormVoid{
  public UploadForm( String id ){
   super( id );
   setOutputMarkupId(true);
   setMultiPart( true );
  }
 }
}


how to get some data from servlet

2009-06-23 Thread danisevsky
hello, I am using MyMultiFileUploadServlet for uploading files and in some
wicket component I need find out how many files was uploaded.
I was trying to set this number to the HttpSession in
MyMultiFileUploadServlet and get it in the component:

HttpSession httpSession = ((WebRequest)
getRequest()).getHttpServletRequest()
.getSession();
String count = httpSession
.getAttribute(filesCount);

but count is always null. Is there any way how to get some data from
servlet? Thanks


Re: Page Expire

2009-06-23 Thread Jeremy Thomerson
Have you checked your logs to see if there are serialization errors?

--
Jeremy Thomerson
http://www.wickettraining.com




On Tue, Jun 23, 2009 at 5:09 AM, srinivassrinivas.r...@sifycorp.com wrote:
 Hi,

 I am not asking about the session-timeout , i have given session-timeout as
 30 mins in web.xml, But in wicket when i submit a form and
 after some time (10 mins) when i try to perform another operation i am
 getting the  *Page Expired*  error.

 Regards,
 Srinivasa Raju CH.

 vineet semwal wrote:

 You can specify session-timeout in web.xml .

 regards,
 vineet semwal

 On Tue, Jun 23, 2009 at 3:31 PM, Dipu dipu@googlemail.com wrote:



 isn't it container specific ?

 On Tue, Jun 23, 2009 at 10:57 AM, srinivassrinivas.r...@sifycorp.com
 wrote:


 Hi,

 After how much time will we get the page expire in wicket . Please give


 me


 the replay if any one know this .
 Thanks in advance.

 Regards,
 Srinivasa Raju CH.


 Get your world in your inbox!

 Mail, widgets, documents, spreadsheets, organizer and much more with
 your
 Sifymail WIYI id!
 Log on to http://www.sify.com

 ** DISCLAIMER **
 Information contained and transmitted by this E-MAIL is proprietary to


 Sify


 Limited and is intended for use only by the individual or entity to
 which


 it


 is addressed, and may contain information that is privileged,


 confidential


 or exempt from disclosure under applicable law. If this is a forwarded
 message, the content of this E-MAIL may not have been sent with the
 authority of the Company. If you are not the intended recipient, an
 agent


 of


 the intended recipient or a  person responsible for delivering the
 information to the named recipient,  you are notified that any use,
 distribution, transmission, printing, copying or dissemination of this
 information in any way or in any manner is strictly prohibited. If you


 have


 received this communication in error, please delete this mail  notify
 us
 immediately at ad...@sifycorp.com

 -
 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



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



Re: Call to action: find and fix errata in 1.4 JavaDoc

2009-06-23 Thread Jeremy Thomerson
Just add comments (and / or patches) to that JIRA issue.
All of the most common components would be the biggest area where
there are likely changes.

--
Jeremy Thomerson
http://www.wickettraining.com




On Tue, Jun 23, 2009 at 8:40 AM, Vasu Srinivasanvasy...@gmail.com wrote:
 I'm willing to help in my spare time. I have been using wicket only for the
 last two months, and I have been very impressed. How do I go about fixing it
 and not overlapping on others work at the same time ? Any specific areas to
 look at as a priority ?


 On Tue, Jun 23, 2009 at 6:45 AM, Martijn Dashorst 
 martijn.dasho...@gmail.com wrote:

 Many of our JavaDoc examples are still Wicket 1.3 based. For example,
 just yesterday I found the JavaDoc for Link to contain an unnecessary
 cast. Before we finalize 1.4, we should try to fix all javadoc
 examples (mostly in components) to ensure they are up to par with 1.4.

 As the core team we can only do so much in so little time.  With the
 help of our community we will be able to clean up our documentation in
 no time...

 I hereby send out a call for action to the grander community: please
 read the javadocs of 1.4 and see if you can find an old example that
 doesn't fit with 1.4 syntax and semantics. Send in a patch with the
 improved javadoc!

 I've created issue 2338 to track these errata. Please work with us!

 http://issues.apache.org/jira/browse/WICKET-2338

 You can view the JavaDoc online here: http://wicket.apache.org/docs/1.4/

 Martijn

 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.5 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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




 --
 Regards,
 Vasu Srinivasan


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



Getting a JS confirmation when uploading via Ajax

2009-06-23 Thread HHB
Hey,
I'm uploading a file via Ajax, I literally copied the 
Wicket sample application.
The uploading form is included in a modal window.
Upon clicking on the upload button, I got a JavaScript dialog:
++
Are you sure you want to navigate from this page?
Reloading this page will cause the modal window to disappear.
Press Ok to continue, or Cancel to stay on the current page.
++
Why I'm getting this JavaScript confirmation dialog?
Is there a way to get ride of it?
Thanks.


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



Mutiple select DropDownChoice component

2009-06-23 Thread mark
Hi all,

I am looking for info on how to handle a multi-select dropdownchoice
component. Does the ModelObject need to be a List and will it get past a
collection of selected items?

How do I iterate over all the selected items if it is not provided in a
list format? I have a AjaxFormComponentUpdatingBehavior attached to the
control and it seems that the onchange event is fired each time the
selected items are increased or decreased but I only get one item at a
time passed through. i.e I don't get the entire collection of selected
items.

I would like to be able to detect if a single item has been selected,
which I could do with a call to size() if the model object was a
collection. I couldn't find much on google witht he words wicket mutiple
select :(

thanks


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



Re: Mutiple select DropDownChoice component

2009-06-23 Thread Jeremy Thomerson
I think you need to look at the select component rather than DDC.

--
Jeremy Thomerson
http://www.wickettraining.com




On Tue, Jun 23, 2009 at 9:49 AM, m...@jumpingbean.co.za wrote:
 Hi all,

 I am looking for info on how to handle a multi-select dropdownchoice
 component. Does the ModelObject need to be a List and will it get past a
 collection of selected items?

 How do I iterate over all the selected items if it is not provided in a
 list format? I have a AjaxFormComponentUpdatingBehavior attached to the
 control and it seems that the onchange event is fired each time the
 selected items are increased or decreased but I only get one item at a
 time passed through. i.e I don't get the entire collection of selected
 items.

 I would like to be able to detect if a single item has been selected,
 which I could do with a call to size() if the model object was a
 collection. I couldn't find much on google witht he words wicket mutiple
 select :(

 thanks


 -
 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: Turning off ModificationWatcher

2009-06-23 Thread cretzel

Posted  https://issues.apache.org/jira/browse/WICKET-2340
https://issues.apache.org/jira/browse/WICKET-2340 


igor.vaynberg wrote:
 
 or you can add an rfe into jira to make it more open...
 
 -igor
 

-- 
View this message in context: 
http://www.nabble.com/Turning-off-ModificationWatcher-tp22963478p24167315.html
Sent from the Wicket - User 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 + Spring DM + Hibernate

2009-06-23 Thread Daniel Dominik Holúbek
Yes, that's the way it's meant to work :)

On Tue, Jun 23, 2009 at 3:25 PM, James Carman
jcar...@carmanconsulting.comwrote:

 On Tue, Jun 23, 2009 at 8:26 AM, Daniel Dominik Holúbek
 dankodo...@gmail.com wrote:
 
  I appreciate your help, of course :)You know, I'm trying to create a web
 app
  consisting of independent modules. Then if I change something in one
 module,
  I don't have to redeploy whole application.
  This can be achieved of course, the only problem is this thing we are
  currently speaking of. :)

 So, you are going to redeploy the individual modules live, while the
 application is running, in production?

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




-- 
-danoh-


Re: Wicket + Spring DM + Hibernate

2009-06-23 Thread James Carman
How many modules do you have?  Do you really need to be able to do this with
your live production server?  I'm just trying to get an idea behind the
decision behind going with this sort of an architecture.  Perhaps we can
offer up an alternative that would work with the existing Wicket stuff so
that we can avoid some headaches for you. :)

On Tue, Jun 23, 2009 at 11:21 AM, Daniel Dominik Holúbek 
dankodo...@gmail.com wrote:

 Yes, that's the way it's meant to work :)

 On Tue, Jun 23, 2009 at 3:25 PM, James Carman
 jcar...@carmanconsulting.comwrote:

  On Tue, Jun 23, 2009 at 8:26 AM, Daniel Dominik Holúbek
  dankodo...@gmail.com wrote:
  
   I appreciate your help, of course :)You know, I'm trying to create a
 web
  app
   consisting of independent modules. Then if I change something in one
  module,
   I don't have to redeploy whole application.
   This can be achieved of course, the only problem is this thing we are
   currently speaking of. :)
 
  So, you are going to redeploy the individual modules live, while the
  application is running, in production?
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


 --
 -danoh-



Re: Wicket + Spring DM + Hibernate

2009-06-23 Thread Igor Vaynberg
isnt a big point of osgi to manage cross-bundle-dependencies?

so if you inject panel A using panel A's context how does panel A ever
see beans that are defined in module B?

eg if panel A needs a sessionfactory which is defined in module B?

-igor

On Tue, Jun 23, 2009 at 5:36 AM, Daniel Stochdaniel.st...@gmail.com wrote:
 Hi,

 I think your problem is that in Wicket the whole Spring injection
 mechanism is prepared for applications where there is only one
 ApplicationContext (AC). This AC is hold in the Wicket application
 instance. So when you are trying to use @SpringBean annotation Wicket
 tries to inject a bean from this AC.
 Inside OSGi there are many AC (each bundle has its own AC), so the
 base Wicket injection mechanism does not work here for all ACs, only
 for one which you are save in Wicket application instance. The best
 solution here is to make adaptation of Wicket injection mechanism to
 OSGi environment (as we did in our application platform). It is not so
 easy, but it can be done :).

 It can work as follows (short draft):
 When you are using @SpringBean to inject bean inside a class PanelA
 then injection mechanism should injects a bean from ApplicationContext
 of bundle where class PanelA is defined. So you must store somewhere
 information about ApplicationContext in context of bundle class
 loader. Then when you injecting a bean to PanelA: get a class PanelA
 classloader find a proper AC for it and then inject a bean from this
 AC.

 --
 Daniel

 On Tue, Jun 23, 2009 at 10:05 AM, Daniel Dominik
 Holúbekdankodo...@gmail.com wrote:
 Okay, but I still don't understand the reason of doing this stuff :)I've
 already created the Application bean, and implemented
 ApplicationContextAware.
 Then the setApplicationContext method gets called, so I created
 ApplictionContext variable in that class and set it it that method.
 But if I try to access it in another bundle via Application.get(), it is
 still null.
 But even if it wasn't, I think that the DAO bean, declared in other bundle
 (database-bundle) would not be there.

 Just to make it clear - we've got three bundles. The database bundle has
 everything needed to operate with DB. It creates DAO beans and makes OSGi
 sevices from them. Then, there is an Application bundle. And the last bundle
 is Panel bundle, which is loaded into the App bundle via an extension point.
 I need to access the DAO in the Panel bundle, and there comes the problem
 mentioned above.

 That's why I do not understand why should I change the Application bundle
 (except the Panel complaining about Application not being in Spring Extender
 thread).

 Thanks for your help :)


 -
 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: Wicket + Spring DM + Hibernate

2009-06-23 Thread Daniel Stoch
Ok, at least two scenarios are possible:
1. You have a module A with PanelA and you want to inject someDAO bean,
which is defined inside module A (in the same module where class PanelA is
defined). Then you can use classic @SpringBean annotation, as I wrote in my
previous post.
2. You want to use PanelA class in another bundle B and injects someDAO2
bean which is defined inside module B. In such situation we are using a
diffrent annotation (similar to @SpringBean) which injects bean from current
bundle (bundle where class which uses PanelA is declared - in this example:
bundle B).

Of course a default behavior of @SpringBean annotation is up to your
implementation, it was only an example (in my previous post).
So you should decide if you want to inject a bean from AC where class is
defined or from AC where this class instance is used. Probably when you are
creating a reusable components (panels) then the second situation is more
often.

--
Daniel

On Tue, Jun 23, 2009 at 5:38 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 isnt a big point of osgi to manage cross-bundle-dependencies?

 so if you inject panel A using panel A's context how does panel A ever
 see beans that are defined in module B?

 eg if panel A needs a sessionfactory which is defined in module B?

 -igor

 On Tue, Jun 23, 2009 at 5:36 AM, Daniel Stochdaniel.st...@gmail.com
 wrote:
  Hi,
 
  I think your problem is that in Wicket the whole Spring injection
  mechanism is prepared for applications where there is only one
  ApplicationContext (AC). This AC is hold in the Wicket application
  instance. So when you are trying to use @SpringBean annotation Wicket
  tries to inject a bean from this AC.
  Inside OSGi there are many AC (each bundle has its own AC), so the
  base Wicket injection mechanism does not work here for all ACs, only
  for one which you are save in Wicket application instance. The best
  solution here is to make adaptation of Wicket injection mechanism to
  OSGi environment (as we did in our application platform). It is not so
  easy, but it can be done :).
 
  It can work as follows (short draft):
  When you are using @SpringBean to inject bean inside a class PanelA
  then injection mechanism should injects a bean from ApplicationContext
  of bundle where class PanelA is defined. So you must store somewhere
  information about ApplicationContext in context of bundle class
  loader. Then when you injecting a bean to PanelA: get a class PanelA
  classloader find a proper AC for it and then inject a bean from this
  AC.
 
  --
  Daniel



Re: Dirty read/edit problem.

2009-06-23 Thread Scott Swank
On-line docs
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lock.htm

DA Morgan's docs
http://www.psoug.org/reference/dbms_lock.html

On Tue, Jun 23, 2009 at 12:58 AM, Maarten
Bosteelsmbosteels@gmail.com wrote:
 Hi,

 We have implemented something similar. In our case multiple applications
 should be able to request locks, so we have implemented it on the database.
 It's based on DBMS_LOCK (Oracle specific).
 When an application crashes (or is killed in an unclean manner) Oracle will
 roll back any pending transactions, and automagically release the locks.
 Works very well (btw, our applications never crash :-)

 Since you have only one application, I guess you could do it in the
 application layer (keep locks in memory).

 Maarten


 On Tue, Jun 23, 2009 at 3:07 AM, James Carman
 jcar...@carmanconsulting.comwrote:

 If it's fairly unlikely that two people would be editing the same record at
 the same time, then it's probably okay to go with optimistic locking.

 On Mon, Jun 22, 2009 at 8:41 PM, satar starl...@gmail.com wrote:

 
  Yep, that is what I thought from the reading I have done. I think I will
 do
  it the way I have in the past but using an application-level edit table
  instead of having to use a database. This feels more natural to me and I
  have spent an absorbent amount of time learning Hibernate already and
 just
  hoping that I get some return from all of the complexities it has
  eventually. I do believe that will be the case because all you smart
 peeps
  wouldn't be using it if there was nothing to gain. The dirty read problem
  seems like such a normal condition for any application that has multiple
  writers, so I thought I would see what is a typical approach within web
  apps
  -- something I am very new at.
  --
  View this message in context:
  http://www.nabble.com/Dirty-read-edit-problem.-tp24157057p24158076.html
    Sent from the Wicket - User 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
 
 



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



Re: Dirty read/edit problem.

2009-06-23 Thread satar

Thanks for the responses. I feel a little more confident that there isn't
something magical already out there to handle this particular problem
domain. I do want pessimistic locking as I want to inform the user that
someone else is already thinking and in progress of changing something
BEFORE they try to change it themselves, and it is very possible for two
peeps to attempt edit on the same item. I am also using mySQL not Oracle and
wouldn't probably want to rely on a database specific implementation if I
could avoid it. As of now, I have created a lock table in memory at the app
layer and it sounds like a reasonable approach based on my query from fellow
colleges on this forum -- Steve
-- 
View this message in context: 
http://www.nabble.com/Dirty-read-edit-problem.-tp24157057p24167367.html
Sent from the Wicket - User 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 add filter to palette component?

2009-06-23 Thread Rangel Preis
Thanks Fernando and Eyal.
But it's not work.

I try the code below, when I change the value of avaliable itens the
itens in the screen became blank , and don't show the new value.



Custem Palette

class MyPalette extends Palette {

private Component externalizedChoiceComponent;

@Override
protected Component newChoicesComponent() {
final Component result = super.newChoicesComponent();
this.externalizedChoiceComponent = result;
this.externalizedChoiceComponent.setOutputMarkupId(true);
return result;
}

public Component getExternalizedChoiceComponent() {
return this.externalizedChoiceComponent;
}
}


final IModel avaliableModel = new AbstractReadOnlyModel() {
@Override
public Object getObject() {
return this.avaliableList;
}
};

Palette creation

final MyPalette palette = new MyPalette(palette, inUseModel,
avaliableModel, renderer, 10, true);

this.form.add(new AjaxLink(btFind) {

@Override
public void onClick(final AjaxRequestTarget target) {
try {
  avaliableList = getNewList();
} catch (final Exception e) {
log.error(e);
}

target.addComponent(palette.getExternalizedChoiceComponent());
}

});

Anyone have another tip?

Thanks.


2009/6/23 Eyal Golan egola...@gmail.com:
 Here what I did:
 choiceComponent in the original Palette is private, so in my custom palette
 I externalized it:

 private Component externalizedChoiceComponent;

 Then, I overridden the method newChoicesComponent :
   �...@override
    protected Component newChoicesComponent() {
        final Component result = super.newChoicesComponent();
        externalizedChoiceComponent = result;
        externalizedChoiceComponent.setOutputMarkupId(true);
        return result;
    }

    public Component getExternalizedChoiceComponent() {
        return this.externalizedChoiceComponent;
    }

 My situation was that I wanted to change the choices with a DropDown
 component.
 We have a custom DropDown that is ajaxified:
        final DropDownChoice configurationChoice = new
 DropDownChoiceWithAjaxIndicator(mainConfiguration,
                getConfigurationsModel(), new
 ChoiceRenderer(configurationName, configurationName)) {
            private static final long serialVersionUID = 1L;

           �...@override
            public void updateOnChange(AjaxRequestTarget target) {

 target.addComponent(palette.getExternalizedChoiceComponent());
            }
        };

 Below is the IModel for the palette that needs to be changed:
        final IModel allConfigurationsModel = new AbstractReadOnlyModel() {
            private static final long serialVersionUID = 1L;

           �...@override
            public Object getObject() {
               // Do whatever you want to get the correct choices
            }
        };
 And this is the Palette creation:
        final CustomPalette palette = new CustomPalette(palette, new
 PropertyModel(rolesCoverageDasboard,
                comparedConfigurations), allConfigurationsModel,
 choiceRenderer, 10, true);

 Is this what you need?

 BTW,
 I think I'll have a look at the Recorder, though I'm not sure I can use it.

 Maybe we should open a JIRA to have getChoicesComponent() in the Palette?
 (we use 1.3.6)

 Eyal Golan
 egola...@gmail.com

 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


 On Mon, Jun 22, 2009 at 11:57 PM, Rangel Preis rangel...@gmail.com wrote:

 Sorry Fernando but it's not helpful.

 When i click in my search button (a button out of palette)  i want to
 change all data from the left side of palette (Available itens).
 I don't want to interact with the palette buttons i want to use a
 button out of the component.

 Using
 PropertyModel availableItens = new PropertyModel(this, listDirector);
 or
 Model availableItens = new ModelSerializable((Serializable)
 this.listDirector);

 ..

 form.add(new Palette(palette, selectedItens, availableItens,
 renderer, 10, true));

 form.add(new(AjaxLink btFilterPaletteContent = new
 AjaxLink(btFilterPaletteContent){

   @Override
   public void onClick(AjaxRequestTarget target) {
        What i can put here to change my avaliable itens (the palette left
 list)?
       target.addComponent(this.form);
   }
 };)




 2009/6/22 Fernando Wermus fernando.wer...@gmail.com:
  If I understood correctly you would want to do this (which It can be
 found
  at Palette comments at the begining)
 
   strongAjaxifying the palette/strong: The palette itself cannot be
  ajaxified because it is a
   panel and therefore does not receive any javascript events. Instead ajax
  behaviors can be
   attached to the recorder 

Re: How to add filter to palette component?

2009-06-23 Thread Eyal Golan
It looks just like what I did.
Did you break-point at
public Object getObject() {
   return this.avaliableList;
   }

?

or at avaliableList = getNewList();

Is the list full?

Maybe you should try AjaxSubmitLink (Just a thought. I don't use it that
often)?


Eyal Golan
egola...@gmail.com

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






Re: How to add filter to palette component?

2009-06-23 Thread Rangel Preis
Golan... the object have the correct value in code, but in the page it's blank.

2009/6/23 Eyal Golan egola...@gmail.com:
 It looks just like what I did.
 Did you break-point at
 public Object getObject() {
               return this.avaliableList;
           }

 ?

 or at avaliableList = getNewList();

 Is the list full?

 Maybe you should try AjaxSubmitLink (Just a thought. I don't use it that
 often)?


 Eyal Golan
 egola...@gmail.com

 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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to add filter to palette component?

2009-06-23 Thread Eyal Golan
BTW, here the whole code of the palette creationg:
private CustomPalette newSelectedSection(final Form form) {
final RolesCoverageDasboard rolesCoverageDasboard =
(RolesCoverageDasboard) getModelObject();
final IChoiceRenderer choiceRenderer = new
ChoiceRenderer(getConfigurationName, getConfigurationName);
final IModel allConfigurationsModel = new AbstractReadOnlyModel() {
// Model for choices
private static final long serialVersionUID = 1L;

@Override
public Object getObject() {
final ListConfiguration allConfigsFromMap;
if (rolesCoverageDasboard.getUniverse() == null) {
allConfigsFromMap = Collections.emptyList();
return allConfigsFromMap;
}
allConfigsFromMap =
universesConfigurationsMap.get(rolesCoverageDasboard.getUniverse());
final ListConfiguration configsForPalette = new
ArrayListConfiguration(allConfigsFromMap);

configsForPalette.remove(rolesCoverageDasboard.getMainConfiguration());
return configsForPalette;
}
};
final CustomPalette palette = new CustomPalette(palette, new
PropertyModel(rolesCoverageDasboard,
comparedConfigurations), allConfigurationsModel,
choiceRenderer, 10, true);
palette.setOutputMarkupId(true);
form.add(palette);
return palette;
}

It is very similar to yours. (list etc.)

Eyal Golan
egola...@gmail.com

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


Re: ModalWindow and IE8 question

2009-06-23 Thread Matej Knopp
couldn't it be old javascript file in your browser cache?

-Matej

On Tue, Jun 23, 2009 at 8:25 PM, Per Lundholmper.lundh...@gmail.com wrote:
 I don't know if it helps, but it works with IE8 on XP so there is
 something nasty about Vista

 /Per

 On Tue, Jun 23, 2009 at 8:17 PM, Flaviusflav...@silverlion.com wrote:

 I'm starting to get users running Vista with IE8 (8.0.6001.18783)
 report that they can't open modal dialog boxes.

 I searched through nabble and jira.  I found issue 2207 which I
 understood to correct this:

 https://issues.apache.org/jira/browse/WICKET-2207

 However, I'm testing with Wicket 1.3.6 (and extensions and datetime
 1.3.6 as well) and the modal dialog is not opening.

 I also tested this with 1.4-rc4 and it's not working there either.

 I put the examples up here:

 http://68.15.93.72/wicket-examples-1.3.6/ajax/modal-window
 http://68.15.93.72/wicket-examples-1.4-rc4/ajax/modal-window

 If I go here and try to open these with IE8 on Vista, they don't
 open.  It works with other browsers I've tested with (ff, safari 3/4,
 IE6/7).

 Can anybody give me any insight to this?
 Thanks very much.


 -
 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: Apply Decorator Pattern to Panels

2009-06-23 Thread ptrash

Isn't there a way to use the decorator pattern (see 
http://en.wikipedia.org/wiki/Decorator_pattern Decorator Pattern )?




igor.vaynberg wrote:
 
 thats what borders do.
 
 -igor
 
 On Mon, Jun 22, 2009 at 1:20 PM, Pi Trashptr...@web.de wrote:
 Hi,

 is there a way to decorate a panel? with inheritance it doesn't work,
 because you have to say explicitly in the super html where the child
 content will be put into.
 __
 GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
 Jetzt freischalten unter http://movieflat.web.de


 -
 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
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Apply-Decorator-Pattern-to-Panels-tp24154678p24171350.html
Sent from the Wicket - User 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: Apply Decorator Pattern to Panels

2009-06-23 Thread Jeremy Thomerson
I suppose since the original answer was not adequate for your needs,
you need to explain your needs to a greater level of detail rather
than assuming that Igor (or other core devs) don't know what a
commonly-used programming pattern is.  More detail please?

According to the definition of decorator pattern within your article:

In object-oriented programming, the decorator pattern is a design
pattern that allows new/additional behaviour to be added to an
existing class dynamically.

In this case, any Wicket Behavior class would fit this definition.
Borders also fit the definition, although they typically deal more
with markup than behavior.  Of course, in your original email, you
alluded to wanting to decorate markup, not behavior.

So, please explain your needs.  There are indeed quite a few ways to
apply this pattern within Wicket.

--
Jeremy Thomerson
http://www.wickettraining.com




On Tue, Jun 23, 2009 at 2:09 PM, ptrashptr...@web.de wrote:

 Isn't there a way to use the decorator pattern (see
 http://en.wikipedia.org/wiki/Decorator_pattern Decorator Pattern )?




 igor.vaynberg wrote:

 thats what borders do.

 -igor

 On Mon, Jun 22, 2009 at 1:20 PM, Pi Trashptr...@web.de wrote:
 Hi,

 is there a way to decorate a panel? with inheritance it doesn't work,
 because you have to say explicitly in the super html where the child
 content will be put into.
 __
 GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
 Jetzt freischalten unter http://movieflat.web.de


 -
 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




 --
 View this message in context: 
 http://www.nabble.com/Apply-Decorator-Pattern-to-Panels-tp24154678p24171350.html
 Sent from the Wicket - User 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



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



Re: Page Expire

2009-06-23 Thread Erik van Oosten

Hello Srinivasa,

You control the amount of storage that is available. Please look at the 
javadoc of DiskPageStore.


Override the defaults by overriding WebApplication#newSessionStore().

Regards,
Erik.


srinivas wrote:

Hi,

After how much time will we get the page expire in wicket . Please 
give me the replay if any one know this .

Thanks in advance.

Regards,
Srinivasa Raju CH.





--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Any examples of a multiselect box in Wicket

2009-06-23 Thread mark
Hi all,

Ok done some test and it looks like wicket can't handle this use case. I
have tried the extensions select class and SelectOptions but it seems to
work the same as dropdownchoice.

There appears to be no example of a multi select for wicket on the net. I
am beginning to think I should abandon the attempt to use multi-select.
Any last minute pointers?

thanks


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



Re: ModalWindow and IE8 question

2009-06-23 Thread Flavius


I cleared all cache and it still wasn't prompting the modal window.
What I did do was go and reset IE8 by going to tools - Internet Options
- Advanced tab and pressing the Reset button.  Apparently this
makes it just like a fresh install and that fixed it!

Don't ask me why clearing the cache didn't do it but that did, unless
clearing the cache and closing the browser really doesn't clear
the cache completely.  I did uncheck the Preserve Favorites website data
in the Delete Browsing History dialog.

Anyway, thanks Matej!  I appreciate your help.  




Matej Knopp-2 wrote:
 
 couldn't it be old javascript file in your browser cache?
 
 -Matej
 
 On Tue, Jun 23, 2009 at 8:25 PM, Per Lundholmper.lundh...@gmail.com
 wrote:
 I don't know if it helps, but it works with IE8 on XP so there is
 something nasty about Vista

 /Per

 On Tue, Jun 23, 2009 at 8:17 PM, Flaviusflav...@silverlion.com wrote:

 I'm starting to get users running Vista with IE8 (8.0.6001.18783)
 report that they can't open modal dialog boxes.

 I searched through nabble and jira.  I found issue 2207 which I
 understood to correct this:

 https://issues.apache.org/jira/browse/WICKET-2207

 However, I'm testing with Wicket 1.3.6 (and extensions and datetime
 1.3.6 as well) and the modal dialog is not opening.

 I also tested this with 1.4-rc4 and it's not working there either.

 I put the examples up here:

 http://68.15.93.72/wicket-examples-1.3.6/ajax/modal-window
 http://68.15.93.72/wicket-examples-1.4-rc4/ajax/modal-window

 If I go here and try to open these with IE8 on Vista, they don't
 open.  It works with other browsers I've tested with (ff, safari 3/4,
 IE6/7).

 Can anybody give me any insight to this?
 Thanks very much.


 -
 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
 
 
 

-- 
View this message in context: 
http://www.nabble.com/ModalWindow-and-IE8-question-tp24171801p24173623.html
Sent from the Wicket - User 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: Help with design of application layout

2009-06-23 Thread Petr Fejfar
On Mon, Jun 22, 2009 at 3:52 PM, Igor Vaynbergigor.vaynb...@gmail.com wrote:

 if i were you i would create something like this:

 class zonepage extends webpage {
  private final repatingview zones;
[...]
   public zonepage() {
        add(zones=new repeatingview(zones));
   }

Hi Igor,

thanks for your help. I followed your recommendation and I've achieved
the goal. Great!

FYI,

- I've merged two first layers into AbstractPage with wicket:child as
  placeholder of zones c (z.a excluded)
- The extended page contains three RepeatingViews for zones c.b, c.c and c.d
- A chain of descendants relaying on POJO inheritance populates
  those RepeatingViews by panels.

Thx, Petr

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



AttributeModifier not added to a ListView item via an AjaxLink

2009-06-23 Thread Azzeddine Daddah
Hi Wicket users,

I've a ListView in a ListView. The 1st ListVeiw holds categories.
The 2nd ListView holds links (topics) which I want to be highlighted
if the link (topic) is clicked. The problem is that the wrapped list
(container) is getting refreshed, but the CSS class is not set for the
corresponding list item.
Below my code:

TestPage.java

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.Model;
import org.wicketstuff.annotation.mount.MountPath;

import com.hbiloo.receptino.web.page.template.PageWithoutSideBar;

@MountPath(path = test)
public class TestPage extends PageWithoutSideBar {

@SuppressWarnings(serial)
public TestPage() {
final WebMarkupContainer container = new 
WebMarkupContainer(container);
container.setOutputMarkupId(true);

container.add(new ListViewCategory(categories, 
buildCategories()) {
@Override
protected void populateItem(ListItemCategory item) {
Category category = item.getModelObject();
item.add(new Label(category, 
category.getName()));
item.add(new ListViewTopic(topics, 
category.getTopics()) {
@Override
protected void populateItem(final 
ListItemTopic item) {
Topic topic = 
item.getModelObject();
AjaxLinkString topicLink = 
(new AjaxLinkString(topicLink) {
@Override
public void 
onClick(AjaxRequestTarget target) {

target.addComponent(container);
item.add(new 
AttributeModifier(class, true, new
ModelString(highlight)));
}
});
topicLink.add(new 
Label(topic, topic.getName()));
item.add(topicLink);
}
});
}
});
add(container);
}

@SuppressWarnings(serial)
private class Category implements Serializable {
private String name;
private ListTopic topics;

public Category(String name, ListTopic topics) {
this.name = name;
this.topics = topics;
}

public String getName() {
return name;
}

public ListTopic getTopics() {
return topics;
}
}

@SuppressWarnings(serial)
private class Topic implements Serializable {
private String name;

public Topic(String name) {
this.name = name;
}

public String getName() {
return name;
}
}

private ListCategory buildCategories() {
ListCategory categories = new ArrayListCategory();
categories.add(new Category(Movies, Arrays.asList(new 
Topic(Mamma),
new Topic(USA), new Topic(NL;
categories.add(new Category(Articles, Arrays.asList(
new Topic(Test), new Topic(Nederland;
categories.add(new Category(Images, Arrays.asList(new 
Topic(Mag),
new Topic(Spullen), new Topic(Mamma mia;
categories.add(new Category(Links, Arrays.asList(new 
Topic(Ana),
new Topic(Smiti), new Topic(Hbiloo), new 
Topic(Yeeh;
return categories;
}
}

TestPage.html

html xmlns:wicket
wicket:extend
ul class=menu wicket:id=container
li class=r wicket:id=categoriesspan class=category
wicket:id=categoryCategory A: /span
ul
li wicket:id=topicsa wicket:id=topicLinkspan
wicket:id=topicLink/span/a/li
/ul
/li
/ul

wicketAjaxGet and PageExpiredException?

2009-06-23 Thread Ryan McKinley
Is there anyway for an ajax call to catch the PageExpiredException?

I am using the jquery history plugin to load pages in wicket
(http://www.mikage.to/jquery/jquery_history.html) -- this lets me do
ajax updates with bookmarkable urls.  The one issue I am having is
that if the session has expired it gives a big error when I could
easily recover by simply refreshing the whole page.

I figured the failure callback on wicketAjaxGet would let me do this.
I have tried:

function pageload(hash) {
  var cburl = 
../?wicket:interface=:0::IActivePageBehaviorListener:1:1wicket:ignoreIfNotActive=true
+ hash=+hash;
  wicketAjaxGet( cburl, function(){}, function(){
// on failure... reload the whole page...
alert( Dooh  + document.location  );
window.location.reload();
  } );
}

This works fine if the server is turned off, but for the
PageExpiredException - it redirects to:
http://localhost:8080/?wicket:bookmarkablePage=:org.apache.wicket.markup.html.pages.InternalErrorPage

anyway to avoid that?

Perhaps override WebApplication:
  protected Page onDeploymentRuntimeException(Page cause, RuntimeException ex) {
 // 
  }

but not sure what is the wicket way...

thanks for any pointers!

ryan

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



Re: wicketAjaxGet and PageExpiredException?

2009-06-23 Thread Igor Vaynberg
have you tried

class myrequestcycle extends webrequestcycle {
  onruntimeexception(e) {
 if (e instanceof pageexpiredexeption) {
  if (getrequst().isajax()) {
  // this is an ajax request that caused pep exception
  throw new abortwithhttpstatusexception(400);


-igor

On Tue, Jun 23, 2009 at 6:13 PM, Ryan McKinleyryan...@gmail.com wrote:
 Is there anyway for an ajax call to catch the PageExpiredException?

 I am using the jquery history plugin to load pages in wicket
 (http://www.mikage.to/jquery/jquery_history.html) -- this lets me do
 ajax updates with bookmarkable urls.  The one issue I am having is
 that if the session has expired it gives a big error when I could
 easily recover by simply refreshing the whole page.

 I figured the failure callback on wicketAjaxGet would let me do this.
 I have tried:

 function pageload(hash) {
  var cburl = 
 ../?wicket:interface=:0::IActivePageBehaviorListener:1:1wicket:ignoreIfNotActive=true
 + hash=+hash;
  wicketAjaxGet( cburl, function(){}, function(){
    // on failure... reload the whole page...
    alert( Dooh  + document.location  );
    window.location.reload();
  } );
 }

 This works fine if the server is turned off, but for the
 PageExpiredException - it redirects to:
 http://localhost:8080/?wicket:bookmarkablePage=:org.apache.wicket.markup.html.pages.InternalErrorPage

 anyway to avoid that?

 Perhaps override WebApplication:
  protected Page onDeploymentRuntimeException(Page cause, RuntimeException ex) 
 {
     // 
  }

 but not sure what is the wicket way...

 thanks for any pointers!

 ryan

 -
 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



Adding attribute to body tag

2009-06-23 Thread John

Hi,

I need to add a class attribute to the body tag but this:

component.add(new AttributeAppender(class, true, Model.of(yui-skin- 
sam),  ));


... and this ...

component.add(new BodyTagAttributeModifier(class, true,  
Model.of(yui-skin-sam), component));


are not working.  Is there a new way to do this?

Thanks,

John