Re: onmouseover image

2008-09-23 Thread Al Maw
Have a look at AjaxEventBehavior. You can either combine this with an Image
component or add an AttributeModifier and manually tweak the img's src
attribute.

Alastair

2008/9/19 Tim Squires [EMAIL PROTECTED]

 Hi All,

 Before I go and write my own component to change the src of an img
 onouseover, I just wanted to make sure that there is no standard
 component.  I don't want to re-invent the wheel.

 Is there a standard component for changing the Image or ImageButton image
 onmouseover?

 Thanks,
 Tim


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Discussion on Wicket Interface Speed-Up

2008-09-03 Thread Al Maw
Hmmm. As you say, there's no easy one-size-fits-all.
There is an obvious improvement you could make, though. All JS/CSS
contributions initially rendered on the home page could be batched up. This
will typically provide the biggest improvement anyway. You could then keep a
reference to this batch, and use it instead of individually including any of
these constituent contributions elsewhere.

This would also give fairly intuitive behaviour - if you want to pre-load
your JS/CSS in a single batch, just add the headercontributors to your home
page, and Wicket will figure it out.

I've long hated having to specify the component class in header
contributors, as 99% of the time the resources live in the same package (or
in a subpackage) as the component they belong to.

I'd even go so far as to remove the need for HeaderContributor code entirely
in 80% of the cases.
Wicket could automatically pick up css and js files that are named the same
as your component.
  MyComponent.java
  MyComponent.html
  MyComponent.properties
So why not:
  MyComponent.css
  MyComponent.js
?

Heck, you could even include i18n for dealing with language-specific layout
issues:
  MyComponent_jp.css

Regards,

Al

2008/9/3 richardwilko [EMAIL PROTECTED]


 I see your point, essentially we have 1 (relativity large) bundle file per
 page, and if you have 5 pages which use jquery, tinymce and ajax then you
 are worse off, since the normal way you would have already cached the 3
 individual files (this is what you meant right?)

 Maybe there is some way to automatically work out the best bundles to
 create
 depending on usage, so dont create bundles based on page, but based on
 contents?

 I think the real answer is that everyones usage is different and what is
 good for one system isn't good for another.


 igor.vaynberg wrote:
 
  It's not the pages that have these files. Let's say I have a page that
  uses jquery and a textfield with a button that toggles tinymce.
 
  If we do what you say then there are two possible files: jquery and
  jquery+tinymce.
 
  Than let's say I add Ajax to the page, now there are 6 possibilities
  depending on which components are currently on the page.
 
  IMHO much cheaper to just cache jquery, tinymce, wicket-Ajax
 individually.
 
  -Igor
  On 9/3/08, richardwilko [EMAIL PROTECTED] wrote:
 
  im not sure we could help in the cases where you have dynamic header
  contributors, like you say you would either have to specify them up
 front
  (ie add them into the page not the panel, breaking encapsulation) or
 just
  serve via the normal header contributor.
 
  But i dont see how this would result in many many large files.  you
 would
  have a single file for the static stuff, and then each dynamic one would
  have its own file (assuming not specified up front).  This would still
  bring
  down the total number.
 
  eg a page has 6 static js and 2 dynamic js which would get turned into 1
  static js and the same 2 dynamic js.
 
  cases where a component and resulting header contributers are added via
  ajax
  wouldnt be important for the initial page load speed anyway, as they are
  added after the page has loaded.
 
  Richard
 
 
  igor.vaynberg wrote:
 
  problem with this is that pages can have dynamic components which
  dynamic header contributions.
 
  so either you have to somehow collect all possible header
  contributions from all possible component combinations - breaking
  encapsulation in the process, or you have to do what you do - ending
  up with many many possible and big javascript files to serve to the
  user.
 
  -igor
 
  On Tue, Sep 2, 2008 at 2:57 PM, richardwilko
  [EMAIL PROTECTED] wrote:
 
  The problem of breaking encapsulation:
 
  I did some work on this problem on my own a few months ago, my
 solution
  was
  to use a header contrib manager, and instead of adding files with a
  header
  contributer i add them to the manager, then get a single contributer
  per
  page from the manger.
 
  for example in a panel you would do
 
  @Override
 protected void onBeforeRender() {
 super.onBeforeRender();
 ResourceReference rr = new
 ResourceReference(getClass(),
  test.js);
 WicketApplication.get().getHcm().add(rr,
  getPage().getClass());
 }
 
  See how it uses getPage().getClass(), so the manager knows which class
  the
  panel is being added into
 
  then in the main page class
 
  @Override
 protected void onBeforeRender() {
 super.onBeforeRender();
 
 
 
 add(WicketApplication.get().getHcm().getHeaderContributor(getClass()));
 }
 
  since the manager knows all of the resources added for the page at
 this
  point, it is easy to compress them all together and serve a single
  file,
  and
  you dont have to list the files up front.
 
  What do you think of this idea?
 
  My code is here:
  http://www.nabble.com/file/p19279269/HeaderContribManagerTest.zip
  HeaderContribManagerTest.zip
 
  It still has bugs etc 

Re: Implement LabeledLink and ImageLink components - what is the most elegant way?

2008-08-26 Thread Al Maw
For something like this, you probably want to avoid having markup files at all.

Seeing as you want something that is both a Link and a Label, a good
starting point might be to look at the source code for both.

You should be able to extend the Link class, and override
onComponentTagBody() in much the same way that Label does.

Alastair

2008/8/26 Michael Sparer [EMAIL PROTECTED]:

 yes, you're right, that's a very common scenario :-)
 we use an AbstractLinkPanel as base-class, markup goes like this:
 [wicket:panel]
  [a href=# wicket:id=link][span wicket:id=linkTitle]Label[/span][/a]
 [/wicket:panel]

 and then in java pass the label via constructor. and provide an abstract
 method to return the link ... and add the link in the onbeforerender method
 ... e.g.

 new AbstractLinkPanel(id, new ResourceModel(label)) {
   protected AbstractLink getLink(id) {
  return new Link(id) {
  // snip
  }
  }
 }

 for bookmarkablepagelinks with labels we just subclass AbstractLinkPanel,
 return a BookmarkablePageLink there and pass the params _and_ the title in
 the constructor. e.g.

 new BookmarkablePageLinkPanel(id, new ResourceModel(label),
 FooPage.class, FooPage.getParams(pojo));

 well that's our approach, works pretty well ... but, as you said, would be
 great to have out-of-the box. but maybe that's already too specific to be in
 the wicket-core, as we as wicket-users are expected to implement exactly
 such components that fit our needs ... would be interesting to hear a
 developer's opinion about that.

 regards,
 Michael

 PS: I'd be happy to share the above mentioned code with anybody interested,
 just mail me

 AbstractLink


 pixologe wrote:

 Hi everybody,

 Perhaps I am just temporarily dumb, but I do not seem to be able to find
 an elegant solution for the following use case.

 I constantly create Links with just a single Label or a single Image in
 it. It would be convenient for me to create a LabeledLink or ImageLink,
 taking a content string/model or URL as param. (btw: I would LOVE to see
 something like this by default in wicket)

 My first idea was to inherit from BookmarkablePageLink and use
 wicket:extend to add markup - this does not work because markup file is
 ignored. This is understandable because wicket probably would not know
 where exactly to place the additional markup, because BPL does not have a
 wicket:child tag.

 So what is the best way to do this? I thought about inheriting from Panel,
 adding link and label, setting the panel's setRenderBodyOnly to true (to
 avoid useless markup) and override both the panel's and the link's
 onComponentTag method in order to adopt the original tag's attributes
 nevertheless... would work, but is definitely far away from being
 elegant...

 There is no way to inherit from a component and add markup when there's no
 wicket:child, right?

 Thanks for inspiration :)



 -
 Michael Sparer
 http://talk-on-tech.blogspot.com
 --
 View this message in context: 
 http://www.nabble.com/Implement-LabeledLink-and-ImageLink-components---what-is-the-most-elegant-way--tp19147651p19158566.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket Image - Java Image

2008-08-26 Thread Al Maw
Sounds to me like you're somewhat confused. ;-)
Load the image from the classpath into a bufferedimage as you would
outside of Wicket (Foo.class.getResourceAsStream() or whatever it is).
Draw text, etc. on it as you see fit.
Display it with Wicket if you want to via a BufferedDynamicImageResource.

If you don't want the overhead of storing the image in the session,
use a RenderedDynamicImageResource and load the classpath resource
image in the render method.

These things are always a trade-off between having to do the graphics
drawing operations every time you render the page, and keeping the
image hanging around which takes up space. Your choice.

Regards,

Al

2008/8/22 insom [EMAIL PROTECTED]:

 Sorry, it took me a bit to get back to this problem. Do you mean I can do
 this:

org.apache.wicket.markup.html.image.Image wicketImage;
wicketImage = new Image(img, new ResourceReference(ImageAnchor.class,
 image.png));

RenderedDynamicImageResource wicketImageResource;
wicketImageResource = new RenderedDynamicImageResource(1013,1276, png)
 {
protected boolean render(Graphics2D graphics) {
graphics.drawString(user.getName(), 443, 215);
return true;
}
};
wicketImageResource.render(/* Somehow get wicketImage's Graphics
 attribute in here */);

add(new Image(theImage, wicketImageResource));

 As you can tell, my difficulty is still in how I can grab the Image using
 the ResourceReference and then draw a String onto it. I hope this clarifies
 where I'm having trouble. Thanks again for your help.


 jwcarman wrote:

 You can use Graphics2D's drawImage() method can't you?


 --
 View this message in context: 
 http://www.nabble.com/Wicket-Image--%3E-Java-Image-tp19034138p19099200.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: color code options in drop down choice

2008-08-09 Thread Al Maw
Note that you can style option tags in Firefox, but it probably
won't work in Internet Explorer, so it may not be worth even bothering
with this...

Alastair

2008/8/9 Martin Makundi [EMAIL PROTECTED]:
 Using Select/SelectOption/SelectOptions I loose all the other
 encapsulated benfits of DropDownChoice or ListChoice.

 Wouldn't it be a good idea to have IChoiceRenderer or a similar
 interface with a method getDispayStyle for each option?

 **
 Martin

 2008/4/29 Igor Vaynberg [EMAIL PROTECTED]:
 see Select/SelectOption/SelectOptions in wicket-extensions

 -igor


 On Tue, Apr 29, 2008 at 9:43 AM, Full-toos Geek [EMAIL PROTECTED] wrote:
 hi
  I want to have a dropdown choice in which some of the choices are of
  different color based on the model.
  is there any existing implementation which i can use.
  OR how should i go about it
  please suggset.

  full toos
  ==


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Comparing JSF and Wicket

2008-08-07 Thread Al Maw
2008/8/7 nlif [EMAIL PROTECTED]:
 While it is very good to know that it's relatively easy to develop Wicket
 components, bear in mind that management (at least mine) is more easily
 convinced when presented with a wide selection of 3rd party component
 libraries, since that provides an alternative to allocating time and
 resources of our own developers. Thus, for them, the issue is decided more
 an economical merits, then on its design/architectural ones.

Your company should concentrate on what it does as its core competency
as that will bring you the most value for time invested.

Based on past experience with many companies, I can most glibly and
universally sum this up as: Don't write a ticketing system unless you
sell ticketing systems.

You are presumably building web apps because you think you're quite
good at it (or perhaps will be), and you're worried about working at
the right level of abstraction to achieve good productivity.

You're concerned that Wicket might be at too low a level of
abstraction compared to JSF, because JSF has a plentiful array of
off-the-shelf components that you think will let you work at a higher
level of abstraction, and therefore you'll be more productive with it.
It's a nice idea. It certainly looks tempting. Unfortunately, it just
isn't the case.

Why is that? Go and read Joel Spolsky's article on leaky
abstractions[1]. Right now:

http://www.joelonsoftware.com/articles/LeakyAbstractions.html



Good to have you back.

Here are just a few reasons why pre-built components in JSF are not the answer.

At some point, normally just after you've completely wedded yourself
to a component, someone important will want you to change something
that on the surface should be trivial. At this point, you will need to
unpick the entire component and figure out how it works, and change
it. This will be hard. You will probably introduce bugs. Unless it's a
component with a lot of distinct regions of complexity, it will
probably be so hard that you may as well have developed the code
yourself from scratch (in either JSF or Wicket). Reading code is
harder than writing it.

Anything remotely complex will need to you restyle it all to make it
fit in with the rest of your web pages. This will likely be painful
unless the component developer has a clue.

Nine times out of ten, it will take you so long to find the component
you need, test it works in your environment, make sure it does what
you need, make sure it probably does what you might need, discover it
doesn't, find another component that does, sort out the licensing,
file a purchase order for it, etc. etc. that you could have developed
something in Wicket that did exactly what you wanted in half the time.

It seems to be the case that if the component is sufficiently complex
that you think you will save time/money by buying it in rather than
building it, it doesn't do what you want. There are only about five or
six truly universal components that are applicable to almost everyone.
These are: tree, tree but in a table, sortable  paginated data-driven
list, date picker, modal pop-up window, AJAX auto-complete drop-down.
I can't think of any others, but there might be a couple.

Wicket has all of these. Which you'd know if you'd bothered to look at
the examples, which are live and prominently linked from the site.

Sorry to sound harsh, but how much web development are you going to do? Hmmm?
Eight hours' worth? Go use PHP or JSP or DHTML or whatever. Your use
case isn't complex enough to be having this discussion.
Eight months' worth? What? You're going to make a decision without
investing a day in each option at least? Are you crazy?


 How many Wicket components are there, and how mature are there? Are there
 tables with sorting, filtering, scrolling, paging etc.? Are there
 tree-controls with all the typical tree-functions? Is there Ajax support, as
 well automatic fallback for non-javascript browsers (and what about comet)?

Come back here when you have real questions that you can't answer for
yourself in ten minutes.
http://www.justfuckinggoogleit.com/search.pl?query=wicket+tree
http://www.justfuckinggoogleit.com/search.pl?query=wicket+ajax
http://londonwicket.org/content/LondonWicket-ListEditor.pdf
etc. etc. etc.

Alastair

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 7th August London Wicket Event

2008-08-07 Thread Al Maw
Thanks for the kind words. I really liked Carl's Terracotta stuff -
very cool. Wille's presentation on his WicketRAD framework was also
great. It's really cool to see people getting inspired by and building
on people's code from previous meet-ups! I can't begin to tell you how
rewarding that is. ;-)

Thanks very much to everyone who came along, asked such good questions
and gave the event such a nice feel. I'm definitely thinking about
increasing the frequency if people are keen (even if it's a less
formal gathering in a pub somewhere or something). It's somewhat
dependent on the number of people who'd like to give talks and things.
Who'd be up for a monthly event?

While we're on the subject, who might be up for doing a quick talk at
the next one? I was really impressed by the scope and preparation that
went into the talks this time around, but if you just want to do a
quick demo of your Wicket-based site, or give a five minute talk with
no slides and must arm-waving, that would be cool too.

Thanks again,

Alastair

P.S. Apologies for the slightly warm beer! It was cold at 6:15pm, but
the usual rooms next to a kitchen (with a fridge) weren't available
this time around. I promise we'll fix that for next time!

2008/8/7 Chris Miller [EMAIL PROTECTED]:

 I'd also like to pass on my thanks, I enjoyed meeting and chatting to you all
 and I learnt a lot in the course of the evening both through the
 presentations and just chatting informally. It's great to see such friendly
 and talented people involved in this project.

 If anyone reading this happens to be in/near London when one of these events
 is on, I can say it's well worth heading along to regardless of your level
 of experience with Wicket.

 Cheers,
 Chris


 Yiannis Mavroukakis-3 wrote:

 Hi everyone,

 Just wanted to say a quick thank you to Cemal, Al et al for organizing
 this event, last night was very informative,
 especially the Terracotta presentation.
 The only gripe I've got (besides warm beer :-P ) is the frequency of the
 event..I think bi-monthly is far too far apart for
 such a fast paced framework as Wicket..Any chance this can be done on a
 monthly basis?

 Thanks!

 Ioannis


 --
 View this message in context: 
 http://www.nabble.com/7th-August-London-Wicket-Event-tp18866803p18867440.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AjaxButton does not work

2008-08-07 Thread Al Maw
This may be a client tag interpretation problem? Try using gt;gt;
instead of . I don't think  inside HTML attributes is valid HTML.

Use firebug and/or the wicket ajax debug window (link bottom right on
your page) to see what's going on.

Alastair

2008/8/5 Daniel Freitas [EMAIL PROTECTED]:
 Do you have any form validation going on? If yes implement the onError
 method on the ajax button. Example:

 form.add(new AjaxButton(order) {
@Override
protected void onError(AjaxRequestTarget target, Form form) {
//Ops we got some errors, show them in a feedback panel
target.addComponent(feedbackPanel);
}

@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
//Do whatever you need here :)
setResponsePage(Index.class);
}
}.setOutputMarkupId(true));


 Hope that helps.
 2008/8/5 Bertrand DATAS [EMAIL PROTECTED]

 Hello All,

 I encounter a problem while I am using an AjaxButton.

 In my form page i create an Ajaxbutton that I attach to a markupContainer
 and in my HTML I add the folowwing HTML code :
 input type=button value= wicket:id=selection /

 The button is set default form processing to false.

 The problem is that when i click on this button nothing happens !!
 I have the same problem with ana AjaxSubmitLink.

 I use the Wicket framework 1.3.4.


 Can someone help me to see what is wrong with that button ??

 Thanks

 Bertrand



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help!! TextField in ListView = NULL

2008-08-07 Thread Al Maw
Have you done any web development before using Wicket?

If so, you should be able to solve this problem by asking yourself the
following questions:

What happens if you click a link on a web page?
Do you think the browser sends the data in a text field on the page to
the server if you click a link?
What about if you put the input tag in a form and click a link?
What about if you put the input tag in a form and click a submit button?

In short, I'd suggest thinking a little more about the fundamentals
before playing around with user input in listviews. Have a look at the
examples.

Alastair

P.S.  There are ways to do what you're trying to do without needing to
put things in a form, etc., but they involve AJAX and therefore
probably aren't the best solution for whatever it is you're trying to
do.


2008/8/7 Alvin_my [EMAIL PROTECTED]:


 I have add testsListView.setReuseItems(true), but still doesn't work.
 :confused: Hope anyone able to give me hints and guide me to the correct
 implementation... thanks

 Refer to HERE below:


ListView testsListView = new ListView(tests, tests) {
  public void populateItem(final ListItem listItem) {
  final Test myTest = (Test) listItem.getModelObject();


  final Link editLink1;
  listItem.add(editLink1 = new Link(editLink) {
  public void onClick() {
  Long test_id = myTest.getTest_id();
  TestCanvas testCanvasPage = new TestCanvas(test_id);
  setResponsePage(testCanvasPage);
  }
  });


  editLink1.add(new Label(title, myTest.getTitle()));
  String test_dateNow = df.format(myTest.getTest_date());
  listItem.add(new Label(date, test_dateNow));
  listItem.add(new Label(time, myTest.getTest_time()));
  listItem.add(new Label(duration,
 myTest.getTest_duration()));
  listItem.add(new Label(status, myTest.getStatus()));

 HERE --testMeModel = new Model();
   testMeField = new TextField(testMe,testMeModel);
   listItem.add(testMeField);

  Lecturer lecturer =
 getQuestionnaireService().getLecturer(myTest.getLecturer().getLecturer_id());
  String lecturerName = lecturer.getPrintableName();
  listItem.add(new Label(creator,lecturerName));

  final Link removeLink = new Link(remove){
  public void onClick() {
  getQuestionnaireService().removeTest(myTest);
  TestManager testManagerPage = new TestManager();
  setResponsePage(testManagerPage);
  }
  };
  listItem.add(removeLink);
  removeLink.add(
  new JavascriptEventConfirmation(
  onclick,
  Delete test of  +
  myTest.getTitle() +
   on  +
  myTest.getTest_date()+
  , time  +
  myTest.getTest_time()+
   ? 
  )
  );


  final Link testMeLink;
  listItem.add(testMeLink = new Link(testMeLink) {
  public void onClick() {
 HERE --String test_Me2 = (String) testMeField.getModelObject();

  System.out.println(#);
  System.out.println(###  test_Me  = +test_Me2);
  System.out.println(#);
  info(###  test_Me  = +test_Me2);
  }
  });
  }
  };
 HERE --   testsListView.setReuseItems(true);
  border.add(testsListView);



 Martijn Dashorst wrote:

 2 days without using google [1,2]?

 listview.setreuseitems(true);

 Martijn

 [1] http://www.google.com/search?q=wicket+form+component+listview
 [2]
 http://cwiki.apache.org/WICKET/listview-and-other-repeaters.html#ListViewandotherrepeaters-Usingformcomponentsinarepeater

 On Thu, Aug 7, 2008 at 10:09 PM, Alvin_my [EMAIL PROTECTED] wrote:


 Hi,
 I am very new with wicket and I have a problem with TextField within
 ListView , I try to getModelObject from the Textfield but return NULL ?

 I am trying my best to find the solution, unfortunately I am running out
 of
 time with my final project. Already spent 2 days dealing with this small
 problem :,(

 Hope you guys can help. Below is the some part of the codes:


textfieldModel = new Model();
textField = new TextField(textfield,textfieldModel );
listItem.add(textField);

listItem.add(saveLink = new Link(saveLink) {
public void onClick() {
String myText = (String)
 textField.getModelObject();
info(###  myText  = +myText );

Re: RelativePathPrefixHandler and form action attributes

2008-07-18 Thread Al Maw
2008/7/18 Brad Fritz [EMAIL PROTECTED]:

 I am trying to rewrite an HTML form action attribute (for a
 non-Wicket form) inside a Wicket Panel and could use some help.

 While converting a large webapp to Wicket, I created a Panel to wrap a
 search form.  The form processing is not handled by Wicket yet.  So in
 my SearchPanel.html, I have something like this:

  wicket:panel
form method=get action=search.do
  [..]
/form
a href=search.doAdvanced Search/a
  /wicket:panel

 The Advanced Search href is automatically prefixed with the correct
 number of ../ strings by RelativePathPrefixHandler, but the form
 action is not rewritten.

 Is adding a new IMarkupFilter (based on RelativePathPrefixHandler) to
 handle the action attribute rewriting a good option?  Or is there a
 better way?

You could make the form into a wicket component (use a
WebMarkupContainer), and then add an AttributeModifier which does what
you want from code.

 Any ideas on how to best handle this scenario would be much
 appreciated.  Thanks!

However, this seems like a bug to me. Obviously non-Wicket form tags
should have their action attributes rewritten like everything else
does. Feel free to open a JIRA issue and assign it to me and I'll get
it fixed for the next 1.3.x release.

Alastair

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Reading files

2008-07-12 Thread Al Maw
2008/7/11 David Nedrow [EMAIL PROTECTED]:

 Here's what I've have...

 IResourceStream resStream = new
 PackageResourceStream(WicketApplication.class, protocols.csv);
 InputStream inStream = resStream.getInputStream();
 InputStreamReader isr = new InputStreamReader(inStream);
 ListString[] protocolList = new CSVReader(isr).readAll();
 inStream.close();


You don't need to involve Wicket in this.

Reader reader = new
InputStreamReader(WicketApplication.class.getResourceAsStream(protocols.csv));
ListString[] protocolList = new CSVReader(reader).readAll();
reader.close();

Regards,

Al


London-based jWeekend Apache Wicket course, July 12 13th

2008-06-26 Thread Al Maw
Hi folks,

Bit of shameless self-promotion here, but it's right on-topic so I hope no
one minds...

Just a quick heads-up that Cemal and I are running a rather comprehensive
Apache Wicket course in a couple of weeks' time, on July 12th and 13th.

The course is mature, well proven, and nicely polished, covering an awful
lot of ground. It includes some excellent lab sessions where you can ask all
sorts of questions and really get the most out of it. The labs will take you
all the way from Hello World up to an JPA-backed enterprise-style
application.

Check out the jWeekend site http://jweekend.co.uk/dev/JW703/ for a
detailed breakdown of what's covered, some testimonials from previous
attendees and all the other relevant information.

Hope to see some of you there!

Best regards,

Al
-- 
jweekend.co.uk
londonwicket.org
herebebeasties.com


Re: Multiple Layouts using Inheritance

2008-06-11 Thread Al Maw
It doesn't sound like you're trying to inherit anything, not in the
object-oriented sense of the term. Instead you just want to use different
markup for a page dependent on some criteria.

Wicket already does this for localised versions of a page.
HomePage.html
HomePage_de.html
HomePage_fr.html
etc.

Wicket will select the variation here by default based on the locale of your
session (picked up from the browser's language headers). However, you can
trivially override how this works by overriding the getVariation() method in
your WebPage subclass and returning something else.

Best regards,

Alastair



2008/6/11 Kram.V [EMAIL PROTECTED]:


 In Wicket is it possible to inherit from multiple layouts?

 What we are trying to do is introduce different skins for the same
 application (We could control all of this in CSS and forget about it, but
 want to try this first)

 Each skin is a different Layout Page/Class in Wicket, how can we switch the
 inheriting Page/Class's layout.

 For instance:

 Class Skin1 extends WebPage
 Class Skin2 extends WebPage

 abstract BasePage() - Don't know how to design this one yet!

 MyPage extends BasePage

 and MyPage should use either Skin1 or Skin2 based on some criteria inside
 of
 BasePage.

 Is this even doable ?

 Thanks




 --
 View this message in context:
 http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786400.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: ListViews in a form question

2008-06-11 Thread Al Maw
This sort of stuff is definitely possible - people certainly have it working
elsewhere.

If you use setReuseItems(true) you need to call removeAll() if you change
the backing model object.

Timo is probably right that a RepeatingView may be easier to use in this
kind of situation.

Alastair

2008/6/11 Martin Makundi [EMAIL PROTECTED]:

 Hi!

 I have nested listviews which draw a complex tabular form having
 variable colspans and rowspans depending on the state of the form.

 I have an Add button to add elements into one of the inner listviews.

 Problem:
 1. If I have setReuseItems true, the HTML table is not rendered
 properly (somehow the old table structure remains which should be
 restructured).
 2. If I have setReuseItems false, the form components loose their
 state (unsubmitted entries) whenever I press the button.

 So. In my understanding, I need to both a) redraw the html table (at
 least update the colspan and rowspan attributes) and still b) preserve
 the form component state :) Is there an out-of-the-box solution for
 this?

 **
 Martin

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Multiple Layouts using Inheritance

2008-06-11 Thread Al Maw
Note that you can also override the style in your Component class (e.g. your
WebPage subclass). The default implementation for getStyle() calls
getVariation(), etc. Best to look at the source to see exactly how it works.

Regards,

Alastair

2008/6/11 Gwyn Evans [EMAIL PROTECTED]:


 http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/Session.html#setStyle(java.lang.String)http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/Session.html#setStyle%28java.lang.String%29

 On Wed, Jun 11, 2008 at 9:33 PM, Kram.V [EMAIL PROTECTED] wrote:

 
  No, I have not. I am going to start looking. If you have any
  links/documentation do let me know.
  Thank you for your help.
 
 
 
  jwcarman wrote:
  
   Have you looked at using styles?
  
   On Wed, Jun 11, 2008 at 4:21 PM, Kram.V [EMAIL PROTECTED] wrote:
  
   In Wicket is it possible to inherit from multiple layouts?
  
   What we are trying to do is introduce different skins for the same
   application (We could control all of this in CSS and forget about it,
  but
   want to try this first)
  
   Each skin is a different Layout Page/Class in Wicket, how can we
 switch
   the
   inheriting Page/Class's layout.
  
   For instance:
  
   Class Skin1 extends WebPage
   Class Skin2 extends WebPage
  
   abstract BasePage() - Don't know how to design this one yet!
  
   MyPage extends BasePage
  
   and MyPage should use either Skin1 or Skin2 based on some criteria
  inside
   of
   BasePage.
  
   Is this even doable ?
  
   Thanks
  
  
  
  
   --
   View this message in context:
  
 
 http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786400.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/Multiple-Layouts-using-Inheritance-tp17786400p17786644.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Reminder: London Wicket event at Google UK on Wednesday

2008-06-02 Thread Al Maw
Hi folks,

Quick reminder that we're hosting another London Wicket event *this
Wednesday* at Google's London office.

It's looking like it might well be the best one to date, with a bunch of
really interesting stuff and some cracking talks.

Lots of cool stuff is lined up:
 - *Richard Wilkinson http://www.richard-wilkinson.co.uk/* on Wicket
Google Maps controls and mash-ups.
 - *Wille Faler http://faler.wordpress.com/* talking how to get the
OpenSessionInView enterprise pattern working in your Wicket app.
 - *Cemal Bayramoglu http://jweekend.co.uk* demonstrating how to tame your
drop downs and make them behave just so.
 - *Al Maw http://herebebeasties.com* walking you through an entire
crazy-cool AJAX-heavy app, using some of the components previously created
for past London Wicket talks.

As usual there will be:
 - Lots of pizza.
 - A visit to the pub afterwards.
 - People to help you out with any thorny Wicket issues you may be having
(bring your code!).

In short, it's shaping up to be rather ace.

You should come.

*You'll need to sign up, which you can do here: *
http://jweekend.co.uk/dev/LWUGReg/

A reminder: talks and code from previous events available here:
http://londonwicket.org

Hope to see you there!


Best regards,

Al  Cemal


Re: users, please give us your opinion: what is your take on generics with Wicket

2008-06-02 Thread Al Maw
I think you miss John's point, which is that when you use a
CompoundPropertyModel for a component, all its children typically do not
reference models explicitly.

Thus you typically use an explicit model on  30% of your components if you
have a form-heavy web-app; the other components use the implicit model
provided by the parent's CompoundPropertyModel.

Regards,

Al

On Mon, Jun 2, 2008 at 6:42 PM, Hoover, William [EMAIL PROTECTED] wrote:

 Wow, last time I checked CompoundPropertyModel is a model ;o)

 -Original Message-
 From: John Krasnay [mailto:[EMAIL PROTECTED]
 Sent: Monday, June 02, 2008 1:22 PM
 To: users@wicket.apache.org
 Subject: Re: users, please give us your opinion: what is your take on
 generics with Wicket

 On Mon, Jun 02, 2008 at 11:59:09AM -0400, Hoover, William  wrote:
  I read it, but I think most people will be using models more
  frequently than 30% of the time. Personally, I use them 99% of the
 time.

 Really? Haven't you heard of CompoundPropertyModel?

 jk

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Integer only NumberValidator?

2008-04-27 Thread Al Maw
You can find the default messages (and keys, obviously) in the
org.apache.wicket.Application.properties file.

Regards,

Al

On Fri, Apr 25, 2008 at 1:20 AM, Michael Mehrle [EMAIL PROTECTED]
wrote:

 Man, of course - I was so focused on NumberValidator that I completely
 forgot about the Integer.class setting which I already have!

 Q: what is the validator I need to refer to when defining my custom
 error message in my properties file?

 Michael

 -Original Message-
 From: Martijn Dashorst [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, April 23, 2008 11:46 PM
 To: users@wicket.apache.org
 Subject: Re: Integer only NumberValidator?

 new TextField(number, ..., Integer.class);

 Integer-ness is checked at conversion level before validation.

 Martijn

 On 4/24/08, Michael Mehrle [EMAIL PROTECTED] wrote:
  Javadoc keeps talking about a factory method to create an Integer
 based
   NumberValidator, but I don't see it. How do I create a
 NumberValidator
   that only permits Integer values?
 
 
 
   Thanks,
 
 
 
 
   Michael
 
 


 --
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.2 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: I cannot understand why would a panel have the getparent null

2008-04-03 Thread Al Maw
 ajaxTable.setCurrentPage(ajaxTable.getUserRow(user.getUsername(), new
Date(((HomePage)getParent()).getClientCalendar().getTimeInMillis())) /
ROWS_PER_PAGE);

Eeek. Not to be rude, but I really can't read that at all.
Some well-named intermediate variables and a comment might not go amiss.

Your panel is relying on being added to the home page.
This is bad and wrong.

Why don't you pass the calendar into the constructor of the panel?
That would be an awful lot simpler and result in nice readable, correct
code.

I dunno. Give a man a hammer, and everything looks like a thumb...

Regards,

Alastair



On Thu, Apr 3, 2008 at 5:44 PM, Matthew Young [EMAIL PROTECTED] wrote:

 During construction of TodayPanel, it hasn't been added to the page yet so
 getParent() is null.  Maybe you should do the 'if(user != null) {...'
 stuff
 in @Override ...onBeforeRender() {...}.  The first time you're okay
 because
 if (user!=null) fails and getParent() is not executed.  The second time it
 gets executes.

 On Thu, Apr 3, 2008 at 7:19 AM, Cristi Manole [EMAIL PROTECTED]
 wrote:

  Hello,
 
  I have a HomePage where, in constructor, i add a Panel :
 
 public HomePage(final PageParameters parameters) {
 Date clientDate = getClientCalendar().getTime();
 Label label = new Label(today, Today's Status [ +
  DateFormat.getDateInstance(DateFormat.SHORT).format(clientDate) + ]);
 add(label);
 add(reportModalWindow = createReportModalWindow());
 add(countButtonsPanel = new CountButtonsPanel(countButtonsDiv,
  ((WebSession)getSession()).isSignedIn(), this));
 add(iSmokedModalWindow = createISmokedModalWindow());
  *add(todayPanel = new TodayPanel(todayPanel, new
  java.sql.Date(clientDate.getTime(;
  *}
 
  in TodayPanel's constructor, i check if the user is logged, and if he
 is,
  update an ajax table (current page)
 
 if(user != null) {
 
  ajaxTable.setCurrentPage(ajaxTable.getUserRow(user.getUsername(), new
  Date(((HomePage)getParent()).getClientCalendar().getTimeInMillis())) /
  ROWS_PER_PAGE);
 }
 
 
  When first running the application (no user logged in), today panel is
  cool.
  I log in and today panel is correctly updated.
 
  Now, when i start *another* browser page and point to the application's
  url,
  i get a org.apache.wicket.WicketRuntimeException
   because TodayPanel's getParent() returns null.
 
  Question is: why?... i could understand it if it were consistent...
  meaning
  it will get me null on the first login too.
 
  I tested in Firefox tabs.
 
  Tks in advance,
  Cristi Manole
 



Re: Render body only

2008-04-03 Thread Al Maw
Yeah. It's a bit nasty, but there's not really any other way to have both
the flexibility and the convenience, unless you have some brilliant other
idea?

It's like jk says, normally you would use the setter, unless you need
on-demand evaluation per page-view.

Regards,

Alastair

On Thu, Apr 3, 2008 at 4:49 PM, John Krasnay [EMAIL PROTECTED] wrote:

 On Thu, Apr 03, 2008 at 03:50:42PM +0100, Charlie Dobbie wrote:
  Off Topic, but does anyone else apart from Scott and me get confused by
 this
  duality?
 
  Should I setProperty, or override getProperty?  And the equally annoying
  Does getComponentX give me a reference to an already-created ComponentX,
 or
  do I override it to supply my own ComponentX?
 
  Charlie.
 

 Overriding the getter has the advantage that it allows the property
 value to be lazily evaluated. This is good when the value of the
 property can change over the lifetime of the component, or when the
 value of the property is not known until the component is attached to
 its parent. Calling the setter is simpler, but you must know the value
 of the property ahead of time.

 jk

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Tomcat dying with Wicket 1.3.2 (Windows / JDK 1.5.0_10)

2008-04-03 Thread Al Maw
You can use as many anonymous inner classes as you like. I have them coming
out of my ears, personally.

It's very odd for tomcat to die with no output. There will be output
somewhere. Check logs/catalina.out and also logs/localhost*. If the JVM
dies, it will hotspot or even segfault and log that, at least. If you have
gradually increasing memory footprint then this should be pretty easy to
track down with a profiler.

Make sure you run Tomcat with a sensible amount of permanent generation
space (128M+).

Regards,

Alastair



On Thu, Apr 3, 2008 at 6:43 AM, Martijn Dashorst [EMAIL PROTECTED]
wrote:

 There are commandline options for the jvm to dump on OOM.

 Anyway, doesn't the log file give any insight into what is happening
 in your application? Did you (or your sysadmin) disable logging for
 Wicket?

 You can also run external tools to see what is happening inside your
 JVM without blocking the app. e.g. use jmap -histo to see how many
 objects are alive at a particular moment. The top 10 is always
 interesting. In my case I found a memory leak in the diskpagestore
 when exceptions occurred during writing to disk. This is solved in
 1.3.3 (which is just days away from an official release, try it!)

 jstat -gc -h50 pid 1000 will log the garbage collector statistics
 every second.

 Martijn

 On 4/3/08, Jeremy Thomerson [EMAIL PROTECTED] wrote:
  I upgraded my biggest production app from 1.2.6 to 1.3 last week.  I
 have
   had several apps running on 1.3 since it was in beta with no problems -
   running for months without restarting.
 
   This app receives more traffic than any of the rest.  We have a decent
   server, and I had always allowed Tomcat 1.5GB of RAM to operate with.
  It
   never had a problem doing so, and I didn't have OutOfMemory errors.
  Now,
   after the upgrade to 1.3.2, I am having all sorts of trouble.  It ran
 for
   several days without a problem, but then started dying a couple times a
   day.  Today it has died four times.  Here are a couple odd things about
   this:
 
 - On 1.2.6, I never had a problem with stability - the app would run
 weeks between restarts (I restart once per deployment, anywhere from
 once a
 week to at the longest about two months between deploy / restart).
 - Tomcat DIES instead of hanging when there is a problem.  Always
 before, if I had an issue, Tomcat would hang, and there would be OOM
 in the
 logs.  Now, when it crashes, and I sign in to the server, Tomcat is
 not
 running at all.  There is nothing in the Tomcat logs that says
 anything, or
 in eventvwr.
 - I do not get OutOfMemory error in any logs, whereas I have always
 seen it in the logs before when I had an issue with other apps.  I am
 running Tomcat as a service on Windows, but it writes stdout / stderr
 to
 logs, and I write my logging out to logs, and none of these logs
 include ANY
 errors - they all just suddenly stop at the time of the crash.
 
   My money is that it is an OOM error caused by somewhere that I am doing
   something I shouldn't be with Wicket.  There's no logs that even say it
 is
   an OOM, but the memory continues to increase linearly over time as the
 app
   runs now (it didn't do that before).  My first guess is my previous
   proliferate use of anonymous inner classes.  I have seen in the email
   threads that this shouldn't be done in 1.3.
 
   Of course, the real answer is that I'm going to be digging through
 profilers
   and lines of code until I get this fixed.
 
   My question, though, is from the Wicket devs / experienced users -
 where
   should I look first?  Is there something that changed between 1.2.6 and
 1.3
   that might have caused me problems where 1.2.6 was more forgiving?
 
   I'm running the app with JProbe right now so that I can get a snapshot
 of
   memory when it gets really high.
 
   Thank you,
 
  Jeremy Thomerson
 


 --
 Buy Wicket in Action: http://manning.com/dashorst
 Apache Wicket 1.3.2 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Reg: issue in using ListView component

2008-04-02 Thread Al Maw
Or search this list for a thread called refreshing page.

On Wed, Apr 2, 2008 at 4:44 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 new model(listdata) is the same as a static reference. like i said,
 read the models page because without understanding them you wont get
 far.

 basically you would have a loadabledetachablemodel that in its load
 performs the search query based on user's criteria.

 -igor


 On Wed, Apr 2, 2008 at 1:06 AM, Sathish Gopal [EMAIL PROTECTED]
 wrote:
 
   Hi,
 
   How do i wrap list to this model.
   As i construct this ListView component, pass the DTO list wrapped in a
   model
 
   add(new ListView(id, new Model(listData))){
   ..
   }
 
   This is not helping as the component is rendered nothing shows up. I
 think
   i'm missing something.
 
   Do i need to use some other Model (A Dynamic model). Do i need to
 override
   initModel()...
 
   Am i doing it the right way?
 
 
 
 
   igor.vaynberg wrote:
   
read models wiki page
   
-igor
   
   
On Tue, Apr 1, 2008 at 9:59 PM, Sathish Gopal 
 [EMAIL PROTECTED]
wrote:
   
 Hi all,
   
 I'm trying to create a table using wickets repeater component
 ListView.
The
 problem that i face now is i have search panel where search query
 will
be
 entered. When the form is submitted the table needs to be populated
 with
 data received from the Database. The data received from the
 database is
a
 list of DataTransferObjects. I need to pass this List of
 transferObjects
to
 the ListView. But the listview expects that this object should be
 passed
at
 the time of creation. i.e
   
 add(new ListView(quot;rowsquot;, listData){
  public void populateItem(final ListItem item)
{
final UserDetails user =
(UserDetails)item.getModelObject();
item.add(new Label(id, user.getId()));
}
  });
   
 I cannot pass the list of DataTransferObject until the user enters
search
 criteria and submits the form.
 Is there any better way to do this?
 --
 View this message in context:
   
 http://www.nabble.com/Reg%3A-issue-in-using-ListView-component-tp16442209p16442209.html
 Sent from the Wicket - User mailing list archive at Nabble.com.
   
   
   
  -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
   
   
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
   
 
   --
   View this message in context:
 http://www.nabble.com/Reg%3A-issue-in-using-ListView-component-tp16442209p1680.html
 
 
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: ListView with a Set instead of a List

2008-04-01 Thread Al Maw
// Simply:
IModel listModel = new AbstractReadOnlyModel() {
public Object getObject() {
return new ArrayList(mySet);
}
};

// Or if you want to wrap a property model (not that this is as nice):
IModel listModel = new PropertyModel(bean, mySetHere) {
public Object getObject() {
return new ArrayList((Set)super.getObject());
}
};

// Then just:
new ListView(foo, listModel) {
public void populateItem(ListItem item) {
// ...
}
};



In your original code you go:
return Collections.unmodifiableSet(new
LinkedHashSetFunctionSetting(m_functionSettings))

Which seems rather complex. If you're going to give the user a copy, why do
you care if they modify it? If you're building this all just for Wicket,
then you're quite mad and should figure out a way to make this much simpler.

You ought to think about your API contracts. If you're relying on your Set
being sorted in order to have it make sense in Wicket (which it seems you
are, given you've implemented this using a LinkedHashSet internally) then
you should expose it as a SortedSet through the API.

You could then either use a RepeatingView to display the items (which would
be trivial) or write a little model wrapping class that converts a List to a
SortedSet and back again. If you're only going to use the set as a read-only
data source for Wicket, and you're going to update the underlying set object
in your other code (e.g. onClick handlers) then you can get away with just
wrapping it as in my provided code.

Regards,

Alastair

On Tue, Apr 1, 2008 at 6:03 PM, reikje [EMAIL PROTECTED] wrote:


 1 True, but why is it important that is has to be the same collection? I
 only care about changes being propagated to the ListItems, I don't care if
 they are contained in a Set within the Model or in a List given to the
 ListView. In other words, if you are saying, that you have to give the
 same
 List from the Model to the ListView, means you cannot render a Model
 object
 with a Set using a ListView. This is quite a restriction you have to be
 aware of then I think. We choosed the Set on purpose to avoid duplicates,
 there must be a way to render the contents of a Set using any Repeater
 component.

 2 Yes, in my code snippet where it says // getModelObject and save this
 is very I call getModelObject().



 Johan Compagner wrote:
 
  1 because you dont have that detacheable list in the listview?? You
  are just giving a ArrayList directly to the listview
 
  2 i dont see exactly where you call getModelObject on in onsubmit but
  i guess thats on page? Then it is loaded yes, this has nothing to do
  with the listview model.
 
  On 3/28/08, reikje [EMAIL PROTECTED] wrote:
 
  I have a rather specific question about a problem I am having. We have
 a
  domain object (OperatorSyncConfig) that we need to diplay in a page.
 That
  object contain a Set of FunctionSetting objects which I want to render
 in
  a
  ListView. For each ListItem (FunctionSetting) it should be possible to
  change the timeout value and then with one Form submit save the whole
  OperatorSyncConfig objects. Here is a snippet of the objects:
 
  public class OperatorSyncConfig implements Serializable
  {
  private SetFunctionSetting m_functionSettings = new
  LinkedHashSetFunctionSetting();
 
  public SetFunctionSetting getFunctionSettings()
  {
  return Collections.unmodifiableSet(new
  LinkedHashSetFunctionSetting(m_functionSettings));
  }
 
  .. no setter method for the set, just single add and remove
 accessors
  }
 
  public class FunctionSetting implements Serializable
  {
  private Long m_timeoutInMilliseconds;
  .. get and set for that
  }
 
 
  The WebPage looks in short like that:
 
  public class EditOperatorPage extends WebPage
  {
   LoadableDetachableModel model = new LoadableDetachableModel() {
 ...
  }
  // load the OperatorSyncConfig
   setModel(model);
 
   Form updateDeleteForm = new Form(updateForm) {
  @Override
  protected void onSubmit() {
 // getModelObject and save
  }
   };
 
   OperatorSyncConfig operatorSyncConfig = (OperatorSyncConfig)
  getModelObject();
   SetFunctionSetting settingsAsSet =
  operatorSyncConfig.getFunctionSettings();
   ListFunctionSetting settings = new
  ArrayListFunctionSetting(settingsAsSet);
 
   updateDeleteForm.add(new ListView(operatorFunctionsList,
 settings)
  {
  @Override
  protected void populateItem(ListItem item)
  {
  FunctionSetting functionSetting = (FunctionSetting)
  item.getModelObject();
 
  item.add(new TextField(Timeout, new
  PropertyModel(functionSetting, timeoutInMilliseconds)));
  }
  });
 
 
  }
 
  The problem is that in the onSubmit of the Form I will always get the
  old
  version of the OperatorSyncConfig since getPage().getModelObject() in
  there
  

Re: Changing Wickets default styles

2008-04-01 Thread Al Maw
If you are having CSS issues in firefox, use firebug to debug it. It will
tell you which rules are being overridden and by what. You might be
including the CSS in the wrong order on the page, for example.

Regards,

Al

On Tue, Apr 1, 2008 at 6:06 PM, Matthew Young [EMAIL PROTECTED] wrote:

 and is indented as in the original

 I think some browser use padding, others use margin to shift li.  You need
 to set both padding-left and margin-left to have them look the same on all
 browsers.

 On Tue, Apr 1, 2008 at 6:33 AM, Steen Larsen [EMAIL PROTECTED] wrote:

  Hi,
 
  I have made a stylesheet to change the default look of the
 FeedbackPanel,
  and loaded it with response.renderCSSReference(new ResourceReference(
  Style.class,yousee.css), screen), where the class Style and the css
 is
  in the same package. The css looks like this:
 
  li.feedbackPanelERROR {
 background-image: none;
 color: red;
 padding-left: 0px;
 background-repeat: no-repeat;
 background-position: 0px;
 list-style-type: none;
  }
 
  li.feedbackPanelINFO {
 background-image: none;
 color: red;
 padding-left: 0px;
 background-repeat: no-repeat;
 background-position: 0px;
 list-style-type: none;
  }
 
  This works fine in IE7, but for some reason only works partly in
 Firefox.
  The green background-image is removed but the text is not red, and is
  indented as in the original. Looking at the styles with Firefoxs
  WebDeveloper shows the correct styles. Anybody experienced this and
 found
  a
  solution ?.
 
  /Steen
 



Re: continueToOriginalDestination resolves to wrong URL

2008-04-01 Thread Al Maw
My quickstart is not the quickstart you were looking at. See the one called
WICKET-1205.zip

Regardless, I have worked out what the underlying cause is.

You can fix this with a workaround: remove the index.html or index.jsp page
from your web context root directory, as noted on the bug.

Regards,

Al

On Tue, Apr 1, 2008 at 7:55 PM, Zheng, Xiahong [EMAIL PROTECTED]
wrote:



 -Original Message-
 From: Zheng, Xiahong
 Sent: Tuesday, April 01, 2008 12:50 PM
 To: 'users@wicket.apache.org'
 Subject: RE: continueToOriginalDestination resolves to wrong URL

 Yes, I was able to reproduce the bug with your example in eclipse 3.3
 and Tomcat 6.0.14 environment (WTP2.0). The color is gone on the second
 page (PageOne.html) after clicking the link on the first page
 (NoAuthHome.html). Changing hostname and port doesn't make a difference.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
 Of Al Maw
 Sent: Monday, March 31, 2008 7:54 PM
 To: users@wicket.apache.org
 Subject: Re: continueToOriginalDestination resolves to wrong URL

 I've just spent two hours trying to reproduce this and failing to (see
 the
 bug). If anyone can give me a reproduceable test-case for this wrapped
 up in
 a nice Maven 2-backed project that I can just unzip and work with, then
 I
 will very keenly fix this. As it is, I just can't reproduce it.

 I guess it would be useful if you could see if the zip I've attached to
 the
 issue can reproduce the problem on your local machine. If it does,
 please be
 as specific as possible about your set-up as possible (OS, JDK version,
 browser version, Tomcat minor revision, etc.) and I'll try to get a
 mirror
 environment set up so we can work out what the heck the problem could
 be.

 Are people running this behind a mod_proxy or something? Or are you
 seeing
 this issue when pointed at localhost:8080?

 Regards,

 Alastair

 On Mon, Mar 31, 2008 at 10:23 PM, Al Maw [EMAIL PROTECTED] wrote:

  Yep, this is probably
 https://issues.apache.org/jira/browse/WICKET-1205
 
  Am off to see if I can fix it right now.
 
  Regards,
 
  Alastair
 
 
  On Mon, Mar 31, 2008 at 5:54 PM, Zheng, Xiahong
 [EMAIL PROTECTED]
  wrote:
 
   My environment:
  
   Wicket version: 1.3.2
   Servlet Container: tomcat 6.0.14
  
   The problem is definitely still there if I map wicketfilter at /*.
   However, I just found if I add an extra path such as /abc/* in the
   mapping it starts to work. This workaround requires my application
 to
   add an extra path to the url which I want to avoid.
  
   Interestingly, this workaround also solves the relative stylesheet
   loading problem that I was facing at the same time.
  
  
  
  
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
 Behalf
   Of Al Maw
   Sent: Monday, March 31, 2008 10:15 AM
   To: users@wicket.apache.org
   Subject: Re: continueToOriginalDestination resolves to wrong URL
  
   That bug was closed for rc 1, so you shouldn't be having this issue
   unless
   you're on a beta version.
  
   Please could you provide some more details?
   Which Wicket version?
   Which servlet container?
  
   Regards,
  
   Alastair
  
   On Mon, Mar 31, 2008 at 3:32 AM, Zheng, Xiahong
 [EMAIL PROTECTED]
   wrote:
  
Just realized this was reported in WICKET-588. Was the fix
 included in
1.3.2 release?
   
-Original Message-
From: Zheng, Xiahong
Sent: Sunday, March 30, 2008 9:28 PM
To: users@wicket.apache.org
Subject: continueToOriginalDestination resolves to wrong URL
   
Scenario,
   
1) request http://myapp/pages/watchlist
2) throws throw new
RestartResponseAtInterceptPageException(Login.class);
3) Use sign in
4) user redirected to http://pages/watchlist note: path /myapp is
dropped
   
Any idea?
   
   
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
   
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
  
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: OOM in PermGen after several deploy/undeploy

2008-04-01 Thread Al Maw
The following two blog entries are very useful in understanding and
debugging this issue:
http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java
http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded

We think we've fixed the instances in Wicket where this is a problem, but
there is an outstanding open bug for that because I've yet to verify it:
https://issues.apache.org/jira/browse/WICKET-625

If you do come across a concrete reference chain in your debugging travels
that involves Wicket then please update the JIRA issue and we'll fix it for
you.

Regards,

Al

On Tue, Apr 1, 2008 at 4:54 PM, Martijn Dashorst [EMAIL PROTECTED]
wrote:

 There is a solution: not to deploy your application more than 2-3 times...

 Martijn

 On 4/1/08, Piller SĂ©bastien [EMAIL PROTECTED] wrote:
 
   Thanks... but it's impossible to find a clear solution to this problem
 over
  the internet... Each things I try fails miserably... Nobody can provide
  something that works... Setting the
  hibernate.bytecode.use_reflection_optimizer property has
  no effect. And others solutions are bad: monitor the application and
  manually restitue the memory of useless objects, etc...
 
   Am I sentenced to restart Tomcat each time I redeploy the app? I am
 under a
  shared server, I can't restart it myself! What do you do, you, when you
 are
  deploying your applications? Do you phone to your provider to ask him to
  restart the server himself? Or did you find a workaround?
 
   It's so annoying... That's a problem everybody has when using tomcat,
 but
  nobody can give a solution...
 
 
 
   Martijn Dashorst a Ă©crit :
   http://www.google.com/search?q=permgen+outofmemory+tomcat
 
  On 4/1/08, Piller SĂ©bastien [EMAIL PROTECTED] wrote:
 
 
   Hello everybody,
 
   I found some problem with my app, when I deploy it/undeploy it several
  times under Tomcat (5.5) (Unix and Windows). I copied my app war file in
 the
  webapp dir, and when it has been fully deployed, I surf on some pages.
 After
  that, I delete that war, wait for the end of undeployment, and did it
 again.
  The memory used by tomcat grows on each cycle. I did it about ten times,
 and
  after that I got the message below:
 
 
  java.lang.OutOfMemoryError: PermGen space
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(Unknown Source)
   at java.security.SecureClassLoader.defineClass(Unknown
  Source)
   at
  org.apache.catalina.loader.WebappClassLoader.findClassInternal(
 WebappClassLoader.java:1853)
   at
  org.apache.catalina.loader.WebappClassLoader.findClass(
 WebappClassLoader.java:875)
   at
  org.apache.catalina.loader.WebappClassLoader.loadClass(
 WebappClassLoader.java:1330)
   at
  org.apache.catalina.loader.WebappClassLoader.loadClass(
 WebappClassLoader.java:1209)
   at java.lang.ClassLoader.loadClassInternal(Unknown
  Source)
   at java.lang.Class.getDeclaredMethods0(Native Method)
   at java.lang.Class.privateGetDeclaredMethods(Unknown
  Source)
   at java.lang.Class.getMethod0(Unknown Source)
   at java.lang.Class.getMethod0(Unknown Source)
   at java.lang.Class.getMethod0(Unknown Source)
   at java.lang.Class.getMethod0(Unknown Source)
   at java.lang.Class.getMethod0(Unknown Source)
   at java.lang.Class.getMethod(Unknown Source)
   at
  org.apache.wicket.util.lang.PropertyResolver.findGetter(
 PropertyResolver.java:506)
   at
  org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(
 PropertyResolver.java:331)
   at
  org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(
 PropertyResolver.java:275)
   at
  org.apache.wicket.util.lang.PropertyResolver.getValue(
 PropertyResolver.java:84)
   at
  org.apache.wicket.model.AbstractPropertyModel.getObject(
 AbstractPropertyModel.java:113)
   at
  org.apache.wicket.Component.getModelObject(Component.java:1539)
   at
 
 org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue
 (AbstractSingleSelectChoice.java:140)
   at
  org.apache.wicket.markup.html.form.FormComponent.getValue(
 FormComponent.java:744)
   at
  org.apache.wicket.markup.html.form.AbstractChoice.onComponentTagBody(
 AbstractChoice.java:344)
   at
  org.apache.wicket.Component.renderComponent(Component.java:2459)
   at
  org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
   at
  org.apache.wicket.Component.render(Component.java:2296)
   at
  org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)
   at
  org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1370)
   at org.apache.wicket.Page.onRender(Page.java:1446)
   at
  org.apache.wicket.Component.render(Component.java:2296)
 
   As you can see, it talks about Wicket, but I don't know if it is really
  related to it. I tried on Tomcat5.5/Linux too, and the message is not
  exactly the same, but it stills speak of PermGen.
 
   PS: I use Hibernate 3.2.6ga and several other things in my app, like
  Jasper, JFreeChart and C3P0 .
 
   Does anybody know how 

Re: Calling a JS function from onNodeLinkClicked in a Tree?

2008-04-01 Thread Al Maw
This isn't as easy to tweak as it could be, I'm afraid. :-(

You're better off using target on the href than doing this with JavaScript,
I'd have thought.

That said, most people think that choosing to open a new window or not is
pretty evil - the user has the option to do this if they want to, it breaks
the expected functionality of the back button, etc. etc.

I'd probably extend BaseTree in core and write my own little Panel which
just displays a link, which obviously you can tweak as you like. If you want
to pop things up using JavaScript, you can use Link#setPopupSettings(...) to
achieve this nicely.

Regards,

Al

On Tue, Apr 1, 2008 at 7:15 PM, webchick [EMAIL PROTECTED] wrote:


 Hi all,
 I'm using a Tree for navigation and I have a need to load an external page
 in a new window when a link is clicked in the tree.  I was hoping to put
 something in the onNodeLinkClicked function for my tree that could
 create/call a JS function to load the URL in a new window as required.
  This
 does not need to be done for the entire tree structure, so I need to be
 able
 to set up this functionality for specified nodes only.  Is there a way to
 do
 this?

 I have read the JS related article on the wiki (

 http://cwiki.apache.org/WICKET/calling-javascript-function-on-wicket-components-onclick.html

 http://cwiki.apache.org/WICKET/calling-javascript-function-on-wicket-components-onclick.html
 ), but I don't see how to add this to only a few nodes in a tree.

 Here's my tree definition:

 private Tree getTree()
 {
  final Tree linkTree = new Tree(navTree, createNavigationTreeModel())
  {
private static final long serialVersionUID = -4646756742893751770L;

@Override
protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode
 node)
{
  // If this is a MenuItem, reload content.
  if (((DefaultMutableTreeNode) node).getUserObject() instanceof
 MenuItem)
  {
MenuItem menuItem = (MenuItem) ((DefaultMutableTreeNode)
 node).getUserObject();
Panel contentPanel = menuItem.getContent();
contentPanel.setOutputMarkupId(true);

MenuPanel.this.getParent().replace(contentPanel);
target.addComponent(contentPanel);
  }
  else if (((DefaultMutableTreeNode) node).getUserObject() instanceof
 Menu)
  {
Menu menu = (Menu) ((DefaultMutableTreeNode) node).getUserObject();

// Use Javascript to open new window?  Get URL from menu object.
  }

  getTreeState().selectNode(node, true);
  super.onNodeLinkClicked(target, node);
}
  };

  linkTree.setRootLess(true);
  linkTree.setOutputMarkupId(true);
  return linkTree;
 }

 The if(MenuItem) replace portion works great, it's the else if(Menu) part
 that has me stuck.  Thanks in advance for any suggestions or comments.
 -- Amanda
 --
 View this message in context:
 http://www.nabble.com/Calling-a-JS-function-from-onNodeLinkClicked-in-a-Tree--tp16420093p16420093.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: export excel file via an OutputStream

2008-04-01 Thread Al Maw
I think he makes a valid point, personally. People do want to do this sort
of thing quite frequently. It wouldn't kill us to implement an
OutputStreamLink that looked like this:

add(new StreamingLink(link) {
public String getFileName() {
return download.xls;
}
public String getMimeType() {
return application/vnd.excel; // Or whatever it is.
}
public void writeToOutputStream(OutputStream outputStream) {
excelGenerator.writeOutput(outputStream);
}
});

I don't think the current API here is very pleasant or obvious to use.

Regards,

Al

On Tue, Apr 1, 2008 at 1:15 PM, Peter Ertl [EMAIL PROTECTED] wrote:

 use AbstractResourceStreamWriter

   Wicket got to have a more structured api for this common task.
 usually it's not wicket but you when something is not working the way
 you expect it





 Am 01.04.2008 um 09:31 schrieb [EMAIL PROTECTED]:

  Hello:
  I am trying to export dynamically generated excel file.
  The generator would send the file.xls to an OutputStream.
 
  In wicket, I am trying to use example as below but
   how can I connect the OutputStream to the inputstream
  ins.  Pipedoutputstream would block. Using a separate thread
  is not desirable.
 
  public void onClick() {
 
IResourceStream stream = new AbstractResourceStream() {
 
  public InputStream getInputStream() throws
  ResourceStreamNotFoundException {
 
 
  return ins;
  }
 
  public void close() throws IOException {
  ins.close();
  }
  };
 
  getRequestCycle().setRequestTarget(
  new
  ResourceStreamRequestTarget(stream).setFileName(file.xls));


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Advance RadioChoice Examples

2008-04-01 Thread Al Maw
You have to use the constructor that takes an IChoiceRenderer, same as any
other AbstractChoice component like a DropDownChoice. You should be able to
figure the rest out from the JavaDocs and examples for that.

Regards,

Al


On Tue, Apr 1, 2008 at 9:29 PM, Shelli D. Orton [EMAIL PROTECTED]
wrote:

 I'm trying to figure out how to have a RadioChoice's display value be
 different from the option value.  For example, I want to display:

 (x) Display Options on Single Page
 ( ) Display Options on Mulitple Pages

 But I want the value saved to the model to be either single or
 multiple.  I'm guessing it has to do with using a RadioChoice constructor
 that takes a IChoiceRenderer that has overridden methods that do what I
 want.  But I can't find any but the simplest of of RadioChoice examples.

 Can someone point me to web resource or show me how this is done?

 Thanks in advance!


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: refreshing page

2008-04-01 Thread Al Maw
Really need some code to see exactly what you're doing wrong here.

Wicket uses models to bind your view components to your actual data.

Assuming you're using a ListView, you'll need something like:

IModel model = new AbstractReadOnlyModel() {
public Object getObject() {
// Database query here, e.g:
ListProduct products = productDao.findByStatus(Status.LIVE);
return products;
}
};
add(new ListView(foo, model) {
void populateItem(ListItem item) {
Product product = (Product)item.getModelObject();
item.add(new Label(name, product.getName()));
}
});

This model lets you pull stuff on-demand out of your database every time the
page is rendered. The ListView by default will recreate its entire set of
items every page render. You can change this behaviour with
#setReuseItems(true), but you probably don't want to for this. ;-)

Make sense?

Regards,

Al

On Tue, Apr 1, 2008 at 9:39 PM, Andrew Broderick [EMAIL PROTECTED]
wrote:

 Hi,

 I'm sure this is a basic newbie lack of knowledge showing here, but when I
 save some data to my DB from my wicket page (adding an object), my master
 (list) page is not updated. Okay, I thought, maybe I just need to modify the
 model at the same time as saving it. So I did that, and the new row still
 does not appear. How do I tell Wicket to do a deep refresh of the page,
 and not just redisplay the existing contents?

 Thanks

 ___

 The  information in this email or in any file attached
 hereto is intended only for the personal and confiden-
 tial  use  of  the individual or entity to which it is
 addressed and may contain information that is  propri-
 etary  and  confidential.  If you are not the intended
 recipient of this message you are hereby notified that
 any  review, dissemination, distribution or copying of
 this message is strictly prohibited.  This  communica-
 tion  is  for information purposes only and should not
 be regarded as an offer to sell or as  a  solicitation
 of an offer to buy any financial product. Email trans-
 mission cannot be guaranteed to be  secure  or  error-
 free. P6070214



Re: RequestCycle exception explanation

2008-04-01 Thread Al Maw
OK, but the reason is always the same - the user will be trying to click on
something that doesn't exist any more.

I can't quite remember how our page versioning works for this (Eelco? Igor?)
but it might be possible that users are clicking the same link twice and
that the first click removes the component they've clicked on from the
hierarchy, causing the second click to fail?

Regards,

Al

On Tue, Apr 1, 2008 at 9:44 PM, Jeremy Levy [EMAIL PROTECTED] wrote:

 On this site we aren't using any Ajax components. :(

 J

 On Tue, Apr 1, 2008 at 4:39 PM, Al Maw [EMAIL PROTECTED] wrote:

  What seems to be happening is that you're trying to click a link for a
  component that no longer exists. Did you maybe remove it with AJAX or
  something but not update the page? I think you sometimes can get this
  issue
  in a ListView if you don't think about how stuff is added and removed,
 and
  interactions with setReuseItems(true).
 
  Al
 
  On Tue, Apr 1, 2008 at 9:12 PM, Jeremy Levy [EMAIL PROTECTED] wrote:
 
   I've started seeing exceptions like the onces below more frequently
 can
   someone explain what is actually going on?  We've been making a lot of
   changes, but I can't say exactly what may have set this off...
  
  
  
   2008-04-01 16:07:12,514 ERROR Wap [RequestCycle] : component myLink
 not
   found on page com.foo.bar.SomePage [id = 459], listener interface = [R
   equestListenerInterface name=ILinkListener, method=public abstract
 void
   org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
   org.apache.wicket.WicketRuntimeException: component myLink not found
 on
   page
   com.foo.bar.SomePage [id = 459], listener interface = [RequestLis
   tenerInterface name=ILinkListener, method=public abstract void
   org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
  
  
   j
  
 



Re: Resources relative to application context

2008-03-31 Thread Al Maw
Actually, this should Just Work (tm). Are you running on Tomcat?

Regards,

Alastair

On Mon, Mar 31, 2008 at 4:34 AM, [EMAIL PROTECTED] wrote:

 You got it

 -igor


 On 3/30/08, Zheng, Xiahong [EMAIL PROTECTED] wrote:
  Thanks Igor. But my resource in this case is style sheet not image. Does
  that mean I need to write a similar component to accomplish that?
 
  -Original Message-
  From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
  Sent: Sunday, March 30, 2008 3:48 PM
  To: users@wicket.apache.org
  Subject: Re: Resources relative to application context
 
  see source of ContextImage for details
 
  -igor
 
 
  On Sun, Mar 30, 2008 at 11:50 AM, Zheng, Xiahong [EMAIL PROTECTED]
  wrote:
   How does wicket find such resource, e.g. as follows?
  
   link href=style/my.css type=text/css rel=stylesheet /
  
   I found this only works if I mount my pages with
  
   mount(/pages, PackageName.forClass(Home.class));
  
   Otherwise, I need to specify absolute URL. This is fine. However, the
   subsequent problem I ran into is wicket failed to load resources
  after a
   form submit which is probably caused by the resulting URL not being
   mounted. So my question is,
  
   How do I mount the resulting URL after a form submit or other event?
  Is
   HybridUrlCodingStrategy designed for this purpose?
  
  
   Thanks,
   Xiaohong
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: continueToOriginalDestination resolves to wrong URL

2008-03-31 Thread Al Maw
That bug was closed for rc 1, so you shouldn't be having this issue unless
you're on a beta version.

Please could you provide some more details?
Which Wicket version?
Which servlet container?

Regards,

Alastair

On Mon, Mar 31, 2008 at 3:32 AM, Zheng, Xiahong [EMAIL PROTECTED]
wrote:

 Just realized this was reported in WICKET-588. Was the fix included in
 1.3.2 release?

 -Original Message-
 From: Zheng, Xiahong
 Sent: Sunday, March 30, 2008 9:28 PM
 To: users@wicket.apache.org
 Subject: continueToOriginalDestination resolves to wrong URL

 Scenario,

 1) request http://myapp/pages/watchlist
 2) throws throw new
 RestartResponseAtInterceptPageException(Login.class);
 3) Use sign in
 4) user redirected to http://pages/watchlist note: path /myapp is
 dropped

 Any idea?

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: London Wicket Event - Wednesday evening at Google

2008-03-31 Thread Al Maw
Further to this, we'd really like to hear some user stories about what
you're up to with Wicket.

If you'd like to do a two-minute demo pimping your site and telling us what
you've found good/bad about developing with Wicket, that would be great. If
you can't or don't want to do a demo, but have a screenshot or two you'd
like me to put up while you talk for 30 seconds, that's also fine - please
e-mail me with PNGs.

I'm looking forward to seeing you all there.

Best regards,

Alastair


On Mon, Mar 31, 2008 at 1:56 PM, jweekend [EMAIL PROTECTED]
wrote:


 Just a reminder that our next event is on Wednesday evening at Google's
 offices.
 You can register and keep an eye on full details
 http://jweekend.com/dev/LWUGReg/ here  (some of you have not confirmed or
 cancelled yet - please do so as we need to fix security and manage the
 space
 available).

 Also let us know if you'd like to give a short presentation (anything
 between 5 - 30 minutes is OK) this time or in the future.

 Regards - Cemal
 http://jWeekend.co.uk http://jWeekend.co.uk

 PS To those that have asked and others that are worried, we'll probably be
 able to catch all of the 2nd half of Arsenal - Liverpool (quarter final of
 the UEFA Champions League) at the pub.

 --
 View this message in context:
 http://www.nabble.com/London-Wicket-Event---Wednesday-evening-at-Google-tp16396048p16396048.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to make img src in a component's template resolve to the image files in the package?

2008-03-31 Thread Al Maw
Errr, or you could use the Image component, with a standard package
resource?

Regards,

Alastair


On Mon, Mar 31, 2008 at 8:26 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 On Mon, Mar 31, 2008 at 11:44 AM, Matthew Young [EMAIL PROTECTED] wrote:
 
   src=resources/com.mycompany.component.MyComponent/open.png

 or just wicket:linkimg src=open.png//wicket:link

   so i would say, no, it takes 10 minutes to write one
 
   I completely agree it's very trivial to create after getting help
 here
   :)   Still I commit error by holding on to Class reference (thanks for
   pointing out).  If there is such class built-in, then no chance for
 such
   error and this use case is taken care of.

 so you make the same error in some other component you write. this is
 just something you have to be aware of.

   Well, this is the thing: you know Wicket inside out. Stuffs that are
 trivial
   for you may not be so trivial to regular Wicket user.  But I totally
   understand your reluctance to add stuff to Wicket.  It's like adding
 key
   words to Java, the answer is almost always no.  So if not adding
 these
   little trivial stuff, a wiki showing all the little image use cases
   would be great.

 what you have done you could have done after reading wicket in action,
 or some other book. resource handling is something framework specific,
 so you have to invest a little learning time.

   Anyway, I am not happy with my little PackageImage class.  I want to
 allow
   application to override the image files to have different look and only
   fallback to the built-in images, just like localization. How can this
 be
   done?

 src=getstring(somekey,null,defaultvalue);

 -igor

 
   On Mon, Mar 31, 2008 at 4:35 AM, James Carman 
 [EMAIL PROTECTED]
   wrote:
 
 
 
On Mon, Mar 31, 2008 at 12:28 AM, Matthew Young [EMAIL PROTECTED]
 wrote:
 wicket:link doesnt touch components afaik

  :(  I need it to be a component.  My code is basically this:

 add(new WebMarkupContainer(img));
   
Why do you need it to be a component?  Are you controlling the
visibility of it via code?
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: continueToOriginalDestination resolves to wrong URL

2008-03-31 Thread Al Maw
Yep, this is probably https://issues.apache.org/jira/browse/WICKET-1205

Am off to see if I can fix it right now.

Regards,

Alastair

On Mon, Mar 31, 2008 at 5:54 PM, Zheng, Xiahong [EMAIL PROTECTED]
wrote:

 My environment:

 Wicket version: 1.3.2
 Servlet Container: tomcat 6.0.14

 The problem is definitely still there if I map wicketfilter at /*.
 However, I just found if I add an extra path such as /abc/* in the
 mapping it starts to work. This workaround requires my application to
 add an extra path to the url which I want to avoid.

 Interestingly, this workaround also solves the relative stylesheet
 loading problem that I was facing at the same time.




 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
 Of Al Maw
 Sent: Monday, March 31, 2008 10:15 AM
 To: users@wicket.apache.org
 Subject: Re: continueToOriginalDestination resolves to wrong URL

 That bug was closed for rc 1, so you shouldn't be having this issue
 unless
 you're on a beta version.

 Please could you provide some more details?
 Which Wicket version?
 Which servlet container?

 Regards,

 Alastair

 On Mon, Mar 31, 2008 at 3:32 AM, Zheng, Xiahong [EMAIL PROTECTED]
 wrote:

  Just realized this was reported in WICKET-588. Was the fix included in
  1.3.2 release?
 
  -Original Message-
  From: Zheng, Xiahong
  Sent: Sunday, March 30, 2008 9:28 PM
  To: users@wicket.apache.org
  Subject: continueToOriginalDestination resolves to wrong URL
 
  Scenario,
 
  1) request http://myapp/pages/watchlist
  2) throws throw new
  RestartResponseAtInterceptPageException(Login.class);
  3) Use sign in
  4) user redirected to http://pages/watchlist note: path /myapp is
  dropped
 
  Any idea?
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: continueToOriginalDestination resolves to wrong URL

2008-03-31 Thread Al Maw
I've just spent two hours trying to reproduce this and failing to (see the
bug). If anyone can give me a reproduceable test-case for this wrapped up in
a nice Maven 2-backed project that I can just unzip and work with, then I
will very keenly fix this. As it is, I just can't reproduce it.

I guess it would be useful if you could see if the zip I've attached to the
issue can reproduce the problem on your local machine. If it does, please be
as specific as possible about your set-up as possible (OS, JDK version,
browser version, Tomcat minor revision, etc.) and I'll try to get a mirror
environment set up so we can work out what the heck the problem could be.

Are people running this behind a mod_proxy or something? Or are you seeing
this issue when pointed at localhost:8080?

Regards,

Alastair

On Mon, Mar 31, 2008 at 10:23 PM, Al Maw [EMAIL PROTECTED] wrote:

 Yep, this is probably https://issues.apache.org/jira/browse/WICKET-1205

 Am off to see if I can fix it right now.

 Regards,

 Alastair


 On Mon, Mar 31, 2008 at 5:54 PM, Zheng, Xiahong [EMAIL PROTECTED]
 wrote:

  My environment:
 
  Wicket version: 1.3.2
  Servlet Container: tomcat 6.0.14
 
  The problem is definitely still there if I map wicketfilter at /*.
  However, I just found if I add an extra path such as /abc/* in the
  mapping it starts to work. This workaround requires my application to
  add an extra path to the url which I want to avoid.
 
  Interestingly, this workaround also solves the relative stylesheet
  loading problem that I was facing at the same time.
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
  Of Al Maw
  Sent: Monday, March 31, 2008 10:15 AM
  To: users@wicket.apache.org
  Subject: Re: continueToOriginalDestination resolves to wrong URL
 
  That bug was closed for rc 1, so you shouldn't be having this issue
  unless
  you're on a beta version.
 
  Please could you provide some more details?
  Which Wicket version?
  Which servlet container?
 
  Regards,
 
  Alastair
 
  On Mon, Mar 31, 2008 at 3:32 AM, Zheng, Xiahong [EMAIL PROTECTED]
  wrote:
 
   Just realized this was reported in WICKET-588. Was the fix included in
   1.3.2 release?
  
   -Original Message-
   From: Zheng, Xiahong
   Sent: Sunday, March 30, 2008 9:28 PM
   To: users@wicket.apache.org
   Subject: continueToOriginalDestination resolves to wrong URL
  
   Scenario,
  
   1) request http://myapp/pages/watchlist
   2) throws throw new
   RestartResponseAtInterceptPageException(Login.class);
   3) Use sign in
   4) user redirected to http://pages/watchlist note: path /myapp is
   dropped
  
   Any idea?
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Google hosting next London Apache Wicket User Group meet on Wednesday April 2nd.

2008-03-06 Thread Al Maw
Hi folks,

Building on the success of the previous Apache Wicket User Group meet last
month, Google UK has generously decided to host the next one.

This time, the fun and games will happen on *April 2nd*, starting at *6:30pm
*.

To sign up and for more details (links to a map, etc.) please go to: *
http://jweekend.co.uk/dev/LWUGReg/*

We'd love to get more of you involved in this event, so here are some ideas
to get you started:

   - We'd love to have some short talks or stories about how you're using
   Wicket. One minute or twenty, it's up to you.
   - Similar to last time, we will have a couple of 20 minutes
   presentations covering topics of interest in a fairly in-depth manner. If
   you'd like to present something like this, please shout. (Last time I talked
   about creating a really generic reusable AJAX drag-and-drop list editor and
   Ian Godman talked about his security framework.)
   - Bring your coding problems! There will be quite a few knowledgeable
   Wicket folk there, so you can get them to help you debug things for free (or
   the promise of a pint afterwards).
   - Based on the feedback we've had, there will be more breaks and time
   for networking than last time.

Come! Bring your laptop! We have wi-fi, projectors, and all the other things
you might need and expect, like beach balls and a plentiful supply of pizza.

Hope to see many of you there!

Best regards,

Alastair


Re: n^2 loop in MarkupContainer?

2008-02-11 Thread Al Maw
The children field is private to Component, so I figure we could make
children transient, double the array size each time each time we add
components if it's not big enough (like ArrayList does), and then in
detach() we could copy the children over to a non-transient variable
and null out the transient field. We should do some cleverness to
avoid the copy if things haven't changed between attach()/detach().

Al

On 11/02/2008, Nino Saturnino Martinez Vazquez Wael
[EMAIL PROTECTED] wrote:
 Sorry for previous post.. It was a listview.. not dataview

 Meetesh Karia wrote:
  It appeared to be that way after stepping through the code many times
  in a debugger but that's definitely not conclusive evidence.  I'll try
  and come up with a better measure of what's going on.
 
  Thanks,
  Meetesh
 
  Matej Knopp wrote:
  Indeed, the reason for it is to reduce memory consumption. Right now,
  I don't see any easy way around, are you absolutely sure that it
  causes you performance problems?
 
  -Matej
 
  On Feb 11, 2008 2:15 PM, Meetesh Karia [EMAIL PROTECTED] wrote:
 
  Hi all, I'm using DataView in wicket 1.3 and we have ~400 items that
  are
  returned by a data provider.  I'd expect the adding of the items to be
  rather quick but it turns out that it's not and it looks like the
  culprit might be MarkupContainer.put.  That method expands the children
  array 1 entry at a time which makes the loop of adding the items n^2.
 
  Is there a good reason for this loop to be n^2 (memory conservation
  perhaps)?  Is there any easy way around it?
 
  Thanks,
  Meetesh
 
 
 
 
 
 
 

 --
 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: HTML files location

2008-02-10 Thread Al Maw
The easiest thing to do is to keep src/main/webapp as-is and put your
stuff in a parallel directory structure in src/main/resources.

E.g. more src/main/java/com/yourcompany/foo.css to
src/main/resource/com/yourcompany/foo.css

On 10/02/2008, Andy Czerwonka [EMAIL PROTECTED] wrote:
 I used the maven quickstart.  I want move my HTML, images, javascript, etc., 
 to some other location so that it's not mixed up with the source as I'd like 
 to expose ONLY that code to the creative folks.  I followed these 
 instructions:

 http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html#ControlwhereHTMLfilesareloadedfrom-InWicket1.3

 It says src/main/webapp should be changed, so I changed it to src/main/html.  
 I'm not sure I understand what's happening here as it seams to serve up my 
 pages, but my test break using WicketTester.  Also, when I drop in images 
 (src/main/html/images) they don't get picked up.  Is there a best-practice 
 for this?  Clearly I'm doing something wrong - just not sure how do deal with 
 it.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Jetty, images and 404 http

2008-01-07 Thread Al Maw
Wicket special-cases URLs that start with /resources/*. You therefore
can't use that as a directory for your images.

Regards,

Al

On 04/01/2008, Fernando Wermus [EMAIL PROTECTED] wrote:
 Michael,
   I have changed the images to another directory and it is working
 right now. I don't know the reason of this behavior but It is solved.

 Thanks a lot.

 On Jan 4, 2008 4:43 PM, Fernando Wermus [EMAIL PROTECTED] wrote:

  I don't have any code. The css files are pointing to some images. If I
  perform a
 
   GET http://localhost:8081/misPartidos/resources
 
  I got the file list in the directory,
 
  .svn
  bg-ad-top.png
  bg-body.png
  bg-feed.gif
  bg-footer.jpg
  bg-header.jpg
  bg-menu.png
  bg-menu-hover.png
  bg-sidebar-bottom.gif
  bg-sidebar-top.gif
  button-feed.png
  icon-comment.png
  images
 
  But when I try to perform a
 
   GET http://localhost:8081/misPartidos/resources/bg-menu-hover.png
 
  I got nothing. Beside, the console throws a
 
  838661 [btpool0-2 - /misPartidos/resources/bg-menu-hover.png] DEBUG
  org.mortbay.log  - RESPONSE /misPartidos/resources/bg-menu-hover.png  404
 
  If I move up all that ima ges,  I have access to all of them.
 
 
  On Jan 4, 2008 9:41 AM, Michael Sparer  [EMAIL PROTECTED]  wrote:
 
  
   that's not a permission problem, jetty just can't find the stuff, please
  
   provide some code that generates the 404 error
  
  
  
   Fernando Wermus-2 wrote:
   
Jetty is not allowing to download the resources of my pages. It dumps
   this
into the log,
   
42150 [btpool0-1 - /misPartidos/resources/bg-header.jpg] DEBUG
org.mortbay.log  - RESPONSE /misPartidos/resources/bg-header.jpg  404
42150 [btpool0-1 - /misPartidos/resources/bg- header.jpg] DEBUG
org.mortbay.log  - RESPONSE /misPartidos/resources/bg-header.jpg  404
42150 [btpool0-1 - /misPartidos/resources/bg-header.jpg] DEBUG
org.mortbay.log  - RESPONSE /misPartidos/resources/bg- header.jpg  404
   
I was trying to figure it out if it is a linux permission problem or a
problem from jetty itself.
   
Thanks a lot!
   
--
Fernando Wermus.
   
   
  
  
   -
   Michael Sparer
   http://talk-on-tech.blogspot.com
   --
   View this message in context:
   http://www.nabble.com/Jetty%2C-images-and-404-http-tp14605929p14614654.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  --
  Fernando Wermus.




 --
 Fernando Wermus.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket meetup in San Francisco

2007-12-06 Thread Al Maw

Great. See you at 7pm.

Best regards,

Al

Orion Letizi wrote:

Al,

No worries.  Since this is the first wicket meetup in San Francisco, I'd 
like to do it anyway to get the ball rolling.  If you can make it, that 
would be awesome, even if you don't want to do a formal presentation.  A 
number of people have expressed interest in just talking to a Wicket 
expert.  Eelco has kindly offered to step in via videoconference if you 
can't make it, but having someone physically here would be great.


There have actually been a few more people who have replied to me 
personally that haven't put themselves on the wiki.  There should also 
be some folks from Terracotta there who would like to learn more about 
Wicket.


I expect the next meetup to be more organized with an agenda of 
scheduled speakers, but I want to get something happening now before the 
initial local interest wanes.  We've had interest from as far away as 
San Diego, so I think it's an important step just to get the first one 
started.


Cheers,
Orion

Al Maw-2 wrote:
 
 
  Sorry, I've been pretty busy lately - I've not been checking the
  wicket-users list every day. If you want to get hold of me in a hurry,
  personal e-mail is a lot better. ;-)
 
  This is all rather last minute - it looks like we'd only be perhaps four
  people at best. I won't be very well prepared for a talk. Also, I'll be
  back out here fairly soon, I'm sure. With at least nine people
  potentially interested, maybe we should postpone this to a later date,
  with a bit more planning and notice for everyone concerned?
 
  If people are keen on pushing on with tomorrow regardless, I can make
  it, but I'll need to know by 2pm.
 
  Kind regards,
 
  Al
 
  Orion Letizi wrote:
  It looks like this Thursday, Dec. 6 is the leading contender, 
especially

  if
  Al Maw can give a presentation (haven't heard back from him yet, 
though).
  Otherwise, Eelco Hillenius has agreed to be there via 
teleconference, so

  there will be at least one Wicket expert available to answer the hard
  questions.
 
  Unless there are any objections, let's say Dec. 6th at 7:00 PM at the
  Terracotta offices:
 
  Terracotta
  650 Townsend St., Suite 325
  San Francisco, CA 94107
 
  Cheers,
  Orion
 
 
  Orion Letizi wrote:
  For anyone interested in a meetup in San Francisco, it looks like this
  week might be best for two people and next week would be better for
  one person.
 
  I suppose we should vote.  I'll propose two dates:
 
  Thurs. Dec. 6
  Fri. Dec 14
 
  Vote away...
 
  --Orion
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
Quoted from:
http://www.nabble.com/Wicket-meetup-in-San-Francisco-tf4937692.html#a14187737 






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket meetup in San Francisco

2007-12-05 Thread Al Maw


Sorry, I've been pretty busy lately - I've not been checking the 
wicket-users list every day. If you want to get hold of me in a hurry, 
personal e-mail is a lot better. ;-)


This is all rather last minute - it looks like we'd only be perhaps four 
people at best. I won't be very well prepared for a talk. Also, I'll be 
back out here fairly soon, I'm sure. With at least nine people 
potentially interested, maybe we should postpone this to a later date, 
with a bit more planning and notice for everyone concerned?


If people are keen on pushing on with tomorrow regardless, I can make 
it, but I'll need to know by 2pm.


Kind regards,

Al

Orion Letizi wrote:

It looks like this Thursday, Dec. 6 is the leading contender, especially if
Al Maw can give a presentation (haven't heard back from him yet, though). 
Otherwise, Eelco Hillenius has agreed to be there via teleconference, so

there will be at least one Wicket expert available to answer the hard
questions.

Unless there are any objections, let's say Dec. 6th at 7:00 PM at the
Terracotta offices:

Terracotta
650 Townsend St., Suite 325
San Francisco, CA 94107

Cheers,
Orion  
 


Orion Letizi wrote:
For anyone interested in a meetup in San Francisco, it looks like this  
week might be best for two people and next week would be better for  
one person.


I suppose we should vote.  I'll propose two dates:

Thurs. Dec. 6
Fri. Dec 14

Vote away...

--Orion



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do I get a hold of the body element so I can add class/id etc?

2007-11-24 Thread Al Maw

Edvin Syse wrote:

Johan Compagner skrev:
BodyOnLoadContainer is dropped because you shouldn't try to generate 
body

onload=xxx

What you should do is have a header contributor and add call

IHeaderResponse.renderOnLoadJavascript(String javascript);


OK. Maybe one of you guys could remove the reference from the javadoc as 
well? (Line 412 of MarkupContainer.java as of 1.3 rc1).


Done. Thanks for spotting it.

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to determine absolute URL of a mounted page?

2007-11-24 Thread Al Maw

Oliver Lieven wrote:

is there a way to determine the complete, absolute URL to a mounted page
(including protocol, host, port, application, filter and destination page)?
I need this to be able to send a link to a Registration-Confirmation page to
a user via email. 


Ah, yes, I've been meaning to get around to fixing that since forever, 
sorry. :-(


See http://issues.apache.org/jira/browse/WICKET-609

That's pretty apalling in terms of timescales. Apologies to all 
involved. Will have a look before RC2, promise. ;-)


In the meantime, you can go:
String url = http://yourserver.com/; + 
RequestCycle.get().urlFor([...]).replaceAll(\\.\\./, );


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: disabled AjaxEditableMultiLineLabel

2007-11-23 Thread Al Maw

Gerolf Seitz wrote:

i found the problem:
what i mentioned before with onBeforeRender didn't make it into rc1. sorry
for messing that up.

but now there are two checks for enabled/disabled.
i actually prefer the one with dis-/enabling the label in onBeforeRender,
because this way the onClick attribute doesn't even get rendered,
whereas with the second approach there's an ajax roundtrip which is
basically in vain, since nothing will be done anyway...

Al, if you don't mind, i'd like to remove the check in
AjaxLabelBehavior#onEvent again.


Sure, go right ahead.

I think if you enable a component, you should have to add it to the 
AjaxRequestTarget anyway (which if you do the round-trip regardless, of 
course you don't).



Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Refreshing list view with ajax

2007-11-23 Thread Al Maw

Al Maw wrote:

godin wrote:

Hi,
as a stupid newbie,
i encounters a problem with refreshing  list view with ajax
i edit an object which relate to a  list view in a modal dialog , and 
i can't manage to refresh the listview after the submit
all the object in the list are detachable , (i override the 
getItemModel to put a detachable model on each object)

and i add the panel who own the list as a target of my ajax submit
any idea ?


Go to Google.
Type in wicket ajax listview.
Hit the I'm feeling lucky button.
Read.
Achieve enlightenment.


See also:
http://cwiki.apache.org/WICKET/faqs.html

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to instanciate panels best?

2007-11-22 Thread Al Maw

Icy wrote:

*** What is the best practise to not instanciate page aggregating panels
all the time? ***


This isn't really a Wicket question.

Your page is slow because doing database/remote operations is slow. It 
has nothing to do with creating Panels, but everything to do with the 
database access you're doing in the constructor of those Panels.


You need to break those operations out into a service layer that can 
cache the results, then use that service layer in your constructor.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to generate a javascript function

2007-11-22 Thread Al Maw

lodhur wrote:
 That what I need is a javascript function which contains
 the correct call of my window
 (similar to the onlick-content of the wicket generated link).


You /really/ need to learn how to work things out for yourself. Allow me 
to lead you through such a process.




So, you want something similar to onclick in an AjaxLink...
Let's see, it's similar to AjaxLink...

Oh, I know... Why don't we go and see how AjaxLink works?

pushes CTRL+SHIFT+T in Eclipse, types AjaxLink, pushes enter

Hmmm, that looks pretty compact and simple. Oh, look; all the work is 
done in the constructor, where we add something called an 
AjaxEventBehavior for the onclick javascript event.


It looks like onClick() for the AjaxLink is called by the onEvent() 
function in that behavior. Hmmm... I wonder how that works?

ctrl+clicks on AjaxEventBehavior

Oh, look, in onComponentTag() we put an attribute into the HTML tag. The 
name is pulled from the event variable (so onclick for the AjaxLink) 
and the value of the attribute is the return value from getEventHandler().


I wonder where getEventHandler() comes from and what it does?

goes and looks

Ah, it just calls getCallbackScript().
That's not in this class - it must be in the super class.

goes and looks

Oh, yes, look - it's in AbstractDefaultAjaxBehavior. Maybe I can just 
use that?


AbstractDefaultAjaxBehavior behavior = new AbstractDefaultAjaxBehavior() {
protected void respond(AjaxRequestTarget target) {
// Do stuff here.
}
};

Then in my Javascript for the page I can just invoke the JavaScript 
generated by behavior.getCallbackScript();


Yes, mmm, that seems to work.




That wasn't so hard to work out, now, was it?


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Screen resolution and diffrent markup files

2007-11-21 Thread Al Maw

Artur W. wrote:

Is is possible to create different markup files (for the same page) depends
on user screen resolution?


This is quite easy, actually.

Create an abstract ResolutionDependentPage extends WebPage which your 
pages will extend.


Add this method:

@Override
public String getVariation() {
WebClientInfo info =
(WebClientInfo)getRequestCycle().getClientInfo();
ClientProperties p = info.getClientProperties();

// Defaults to -1 if not available (JS disabled).
int width = p.getScreenWidth();

String size;
if (width  1024) {
size = small;
}
else if (width  1280) {
size = medium;
}
else {
size = large;
}

return super.getVariation() + _ + size;
}

That should let you localize things properly, too, e.g:
HomePage_de_big.html

Note that in order to gather the extended browser info stuff like screen 
resolution, you need to go:

getRequestCycleSettings().setGatherExtendedBrowserInfo(true);
...in your application's init() method.

Should work, maybe. ;-)

BTW, note that in the example above, I'm not using exact resolutions. 
This is because I really don't think you want to do that - there are an 
awful lot of possible resolutions, what with people using widescreen 
laptop displays. If you include the randomly-sized VMware/Parallels 
desktops you can have, the possibilities are effectively infinite. ;-)


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems with spring to manage all webpages

2007-11-21 Thread Al Maw

thomas jaeckle wrote:



igor.vaynberg wrote:

make that bean a prototype?


Hm, I don't see the benefit of this. The problem remains:
I can't initialize the pages before the WebApplication is initialized (in
this case I would become a There is no application attached to current
thread main Exception). But when I initialize them lazy, they don't get
their attributes injected before Wicket displays the homePage ...


I'd stop right now and think more carefully about what you're doing if I 
were you. You need a better understanding of why page instances are 
created in Wicket and why.


It's important to realise that Wicket doesn't currently have a 
PageFactory type thing - instead we effectively just go 
getHomePage.newInstance() when the user lands on the home page URL.


Therefore, at the moment, you cannot get Spring to manage all your pages 
for you.


What's more, you probably don't want to, as this would introduce 
serialization issues with things like DAO beans, which is specifically 
why wicket-ioc and wicket-spring/wicket-spring-annot exist in the first 
place.


Pages are not singletons - they are specific instances created due to 
hitting a bookmarkable URL or whatever. You don't want to be sharing 
your Wicket Components (e.g. your Border) across pages, so those 
shouldn't be singletons either.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Screen resolution and diffrent markup files

2007-11-21 Thread Al Maw

Al Maw wrote:

return super.getVariation() + _ + size;


Should be:
  String s = super.getVariation();
  return s == null ? size : s + _ + size;

Otherwise the default locale HomePage_big.html won't work and will look 
for HomePage_null_big.html. ;-)


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: San Francisco meetup

2007-11-21 Thread Al Maw

Orion Letizi wrote:
There was some talk yesterday on IRC about having a Wicket meetup in San 
Francisco.  I offered the Terracotta offices, pizza, and beer as a good 
place to have it.


I'm in California for three weeks starting next week, would be happy to 
come and do a presentation if you guys want one.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wizard - Setting error messages for feedback panel

2007-11-20 Thread Al Maw

Gregooo wrote:

Is there anyway to change the default feedback error messages?
For example, now, I have the following error message: 


Field 'user.userName' is required.

And I would like to change it by: Please enter your Name.


http://cwiki.apache.org/WICKET/form-validation-messages.html

See also the Localization section of 
http://cwiki.apache.org/WICKET/newuserguide.html


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: setResponsePage in a WebPage constructor

2007-11-20 Thread Al Maw

karnowski wrote:

Greetings,
In the constructor of my webpages I'm wanting to do a validity check and if
it fails redirect to a different page. So I'm doing something like this:

public class OriginalPage extends WebPage {

 public OriginalPage() {
  ...
  if(!validityCheck()) {
   setResponsePage(new DifferentPage());
  }
  ...
 }
 
 ...

}

But I'm getting inconsistent results for different web pages. When the
validity check fails it always appears to call the setResponsePage() but
sometimes will display the DifferentPage in the browser (i.e. what I want)
but sometimes continues to display the OriginalPage (not what I want).

Am I not supposed to be doing a setResponsePage() in a webpage's
constructor? Is setResponsePage() only for form/ajax submission? How can I
accomplish what I'm after here?


throw new RestartResponseException(DifferentPage.class);

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RepeatingView constructors

2007-11-19 Thread Al Maw

jweekend wrote:

When instantiating a RepeatingView, is there a case where
RepeatingView(String id, IModel model) would be used instead of
RepeatingView(String id) ?
It seems that RepeatingView's (and RefreshingView's) model is unused.


Use case:

RepeatingView view = new RepeatingView(
foo, new CompoundPropertyModel(someBean)
);

view.add(new PropertyEditorPanel(name));
if (isAllowed(somebean, ACTION.EDIT.SomeBean.description)) {
view.add(new PropertyEditorPanel(description));
}


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Deployment mode Javascript error

2007-11-19 Thread Al Maw

Frank Bille wrote:

The easy solution is to disable javascript cleanup:

INIT:
getResourceSettings().setStripJavascriptCommentsAndWhitespace(false);

I have been too lazy to actually try to fix the problem, I'm afraid.


:-(

Is there a JIRA issue for this?

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IOC problem

2007-11-18 Thread Al Maw

Uwe Schäfer wrote:

Is it currently impossible to use constructor injection ?


To quickly answer my own question: no, but little tricky! :)
Well, you need to replace instances of new FooComponent() with something 
that gets injected, like a ProviderFoo if you're using Guice, or some 
kind of bean factory if you use Spring.
I´d like to share the experience to the wiki or wherever the right 
place for 'little gotchas' is.


Is there a place where you can find wicket-guice notes already?

Not really. Feel free to add like Gwyn said.

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JPA best-practices?

2007-11-13 Thread Al Maw

Uwe Schäfer wrote:

Subclass WebRequestCycle, and construct it with an EntityManager.


thanks! That may well be an alternative to the common 
ServletFilter-pattern.


Well, err, yes. ;-)

One question: isn´t it a little better to have the ThreadLocal Holder 
for the EntityManager separate from the RequestCycle, but notified of 
its events? Somewhat a 'listener' that registers itself ?


If you have one, then sure. Whatever feels cleanest to you. There is no 
single best way with all this stuff.


My DAOs actually use Spring's HibernateTemplate, so getting hold of a 
session in there is done using sessionFactory.getCurrentSession(). It's 
a bit different in your case with JPA stuff.


This would decouple things as well as make configuration at runtime 
easier. (The 'Favor decoration over inheritance' thing.)


What am i missing?


Nothing, it sounds like. ;-)

Regards,

Al


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Add fields Dynamically

2007-11-13 Thread Al Maw

Marco Aurélio Silva wrote:

So, I can create a panel to each type of answer (input, dropDown, radio...)
but how to add dynamic number of panels?


Look at the Repeater examples at http://wicketstuff.org/wicket13 .

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JPA best-practices?

2007-11-12 Thread Al Maw

Uwe Schäfer wrote:
i plan to use JPA together with Wicket. Are there any battle-proven 
best-practices out there of how to handle EnityManagers and Transactions?


What do other people use (no, not the spring crowd ;) ?

One EntityManager per Request seems to be the obvious idea and a guice 
Provider may help with that. Does anyone have serious experiences with 
that or other suggestions?


Subclass WebRequestCycle, and construct it with an EntityManager.

In onBeginRequest(), create a transaction, storing it in a private variable.

In onEndRequest(), commit the transaction if it hasn't already been 
rolled back and clean up the EntityManager.


In onRuntimeException(...), rollback the transaction and then return 
super.onRuntimeException(...).


You'll need to inject a ProviderEntityManager into your WebApplication 
subclass such that you can call .get() on it when you make your custom 
WebRequestCycle. You'll need to configure that provider in a Guice 
module somewhere, obviously. You should be able to figure that out. ;-)


How do you inject things into your WebApplication? Well, you can use the 
new GuiceWebApplicationFactory, which unfortunately didn't quite make it 
into 1.3.0-rc1 but is in trunk. However, you can copy that class from 
trunk and use it in your own project quite happily - it has no extra 
dependencies.


If you need to integrate with your container-managed JTA transactions 
you'll need something a little different (the container may well start 
and commit the tx for you), but the principle is roughly the same.


Alternatively, you can take Wicket out of the picture and do stuff using 
a ServletFilter (like Spring's OpenEntityManagerInView).


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Disabling serialization/storage of pages in session?

2007-11-09 Thread Al Maw

serban.balamaci wrote:

I am just saying that it may be ok in some cases to keep state on
some objects and not have detachable models.


I agree.

Anything that uses a List of database entities, I tend to put in a 
detachable model.


If I'm merely using a single POJO that was originally pulled from 
Hibernate, then I don't usually bother, unless it has a bunch of 
associated objects/collections that are likely to be large.


Adding detachable models for absolutely everything is more complex, 
takes longer to code, and is less obvious; all for very little gain in 
many situations.


Don't prematurely optimize.

Do use a profiler.

That is all. ;-)

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket behind a front-end proxy

2007-11-09 Thread Al Maw

Johan Compagner wrote:

so we dont support this currently?

myserver1.xxx.com:80 - localhost:8080/myapp1
myserver2.xxx.com:80 - localhost:8080/myapp2


We support that just fine. That, in fact, is most of the reason why 
we're using relative URLs in 1.3.


Murat: I have this working perfectly fine on lots of hosts.

What version of Apache do you have? Don't forget to add the 
ProxyPassReverseCookiePath directive in, or you may have issues with 
sessions.


It sounds to me like your Apache isn't honouring the ProxyPassReverse 
directive.


Explanation
===

When a request comes in to your Apache, it forwards it on using the 
ProxyPass configuration to your tomcat/jetty/whatever.


If you're using a context path other than the root one, then that 
request looks like this:

http://appserver:8080/contextPath/filterMapping/pageName
or
http://appserver:8080/contextPath/filterMapping/?wicket:interface=[...]
etc.

The appserver doesn't know anything about your proxy, so when it does a 
302 redirect, it will do it to somewhere like this:

/contextPath/filterMapping/?wicket:interface=[...]

Apache is then responsible for converting the URL in the 302 redirect 
into the proxied-version. It does this using the ProxyPassReverse 
config. In the above example, it'll need to rewrite /contextPath/ to /


ProxyPassReverseCookiePath is used to do the same thing with any cookies 
in the response. Cookies have a URL/domain, and your Tomcat will set 
them at /contextPath/, so that also needs rewriting to / otherwise 
the browser won't send them on the next request, which means your 
session won't work.


Murat: My suggestion to you is to strip out all the other config from 
your VirtualHost (all the RewriteEngine stuff, etc.) and first get it 
working using the basic set-up on the wiki-page. This does work.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Change css-class of form on validation

2007-11-09 Thread Al Maw

BatiB80 wrote:

Hmmm... - sorry, but one more question on this. I added an attributemodifier
to my component. When accessing the page the attribute is correctly
renderred. But I want to rerender the component after the validation
failed. But the validation method isn't called again.

example: myfield.add(new AttributeModifier(class, getClassValue());

The method getClassValue is only called when the page is displayed the first
time. After validation I want to called it again, but it isn't. Does anybody
knows why???


Well, why do you think? You're calling getClassValue() once, at 
constructor time.


Take a look at the other constructors for AttributeModifier.

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question about Guice integration with Wicket 1.3 beta 4

2007-11-09 Thread Al Maw

pmularien wrote:

Was there a conscious design decision to not use the
org.apache.wicket.injection.web.InjectorHolder class (and, by association,
have the wicket-guice stuff inherit from ConfigurableInjector)? It would be
pretty convenient if the GuiceComponentInjector worked similarly to the
SpringComponentInjector and stuffed away a reference to the Guice injector -
for easy access throughout the application, and also for easier mock
testing.


Yes, there was, and this issue hasn't been resolved for 1.3 yet.

I did it like this because some people will want to use both Guice and 
Spring in their apps at the same time, especially if they're mid-migration.


We should come up with a decent way to make this still possible. 
Suggestions/patches are welcome.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question about Guice integration with Wicket 1.3 beta 4

2007-11-09 Thread Al Maw

pmularien wrote:


Al Maw wrote:

Yes, there was, and this issue hasn't been resolved for 1.3 yet.

I did it like this because some people will want to use both Guice and 
Spring in their apps at the same time, especially if they're

mid-migration.

We should come up with a decent way to make this still possible. 
Suggestions/patches are welcome.



Suggestions (not really thought through well, so apologies if they seem
silly):
- InjectorHolder.getInjectors() returns any/all injector references
- InjectorHolder.getInjector(_some enum / constant)

If you're planning supporting multiple ConfigurableInjectors within the same
wicket app simultaneously, changing InjectorHolder to a multi-valued object
would make the most sense. Although I agree this gets a bit away from the
simplicity of the existing model.


Yeah. I think maybe:

public static ConfigurableInjector getInjector() {
return getInjectors(null);
}

public static ConfigurableInjector getInjector() {
if (type == null  injectors.size()  1) {
throw new IllegalArgumentException(
Have more than one Injector available
);
}
}

...sort of thing, would make some sense. That way we won't break 
existing people's code. I'll have a look into this ahead of the RC2 release.


Could you create a JIRA issue for it please?

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Several localized buttons in a form

2007-11-08 Thread Al Maw

Pills wrote:

How can I put several buttons on a form?


If you look at the code you've written, you've nearly answered your own 
question. ;-)


Don't use the Form's onSubmit().
Just use the Buttons' onSubmit()s instead.

If you want to allow a Button#onSubmit() without the Form validating, 
then you'll need to call setDefaultFormProcessing(false) on it like 
Sebastiaan said.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: multiple url mappings for the wicket web application

2007-11-07 Thread Al Maw

Johan Compagner wrote:

I dont think that will work quite that way out of the box.

because our normal statefull redirect page will go to
/?wicket:interface=:0:
And also form post will go to that kind of url (and then redirect)


Actually, we rely on the servlet container to convert relative URL 
redirects into absolute ones for us. It does this by looking at the 
request URL, so I think this might work just fine.


I'm assuming here that Tom is using web.xml to set up the NL/*, EN/* 
etc. mappings.


You're assuming the mappings are done using a single page entry-point, 
which isn't what he means, I think.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help understaning AjaxCallDecorator problem

2007-11-07 Thread Al Maw

skatz wrote:

Is it possible for a javascript function to fail in such a way that
the rest of the script would not be called?


It can throw an exception.

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] CSS issues - suggestions?

2007-11-07 Thread Al Maw

Gwyn Evans wrote:

I've got some text that shows up fine in Firefox but only when
selected in IE (IE7) and I've no idea what the real issue is, so I'm
hoping someone can take a glance.


That bug tends to be triggered by floats, but there are various things 
that can cause it. You can almost always work around it by giving the 
affected element layout.


See: http://www.satzansatz.de/cssd/onhavinglayout.html

You could also try making the element position: relative and see if that 
fixes it.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Link text

2007-11-07 Thread Al Maw

Sam Hough wrote:

Anything similar for spitting something out _after_ the tag that the
component is mapped to? e.g. Sending out some text/html after a checkbox?

Presumably onComponentTagBody doesn't get called because it is not a
Container and the input tag is send after anything I do in onComponentTag :(


Have a look at how WicketAjaxIndicatorAppender works.

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 1.2 or 1.3 beta 4 ?

2007-11-07 Thread Al Maw

Martijn Dashorst wrote:

As for 1.2 or 1.3.. .I suggest 1.3. It is running on a couple of
production systems already [...]


LOL.

Hands Martijn the Understatement of the Century Award.

 ;-)

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Rendering a fieldset class attribute

2007-11-07 Thread Al Maw

William Hoover wrote:


final AttributeModifier levelModifier = new 
AttributeModifier(class,
new Model() {
@Override
public Object getObject() {
return fieldset-class;
}
});

[...]

The fieldset is not rendering the css class attribute?


This is because you need to provide a second constructor parameter of 
true (read the javadoc for AttributeModifier).


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Form: onSubmit not called

2007-11-07 Thread Al Maw

Brill Pappin wrote:

For some reason onSubmit is never called on a simple form.
 
Has anyone seen this problem before?


Throw us a bone here...

Some code please?

Regards,

Al


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Rendering a fieldset class attribute

2007-11-07 Thread Al Maw

William Hoover wrote:
Is it better to use AbstractBehavior and override onComponentTag? 


I assume that the AttributeModifier is only for cases when the attribute 
already exists in the markup, correct?


Well, given the javadoc I told you to read for the second parameter 
there, no. ;-)


It doesn't make much difference which you use.

AbstractBehavior is more direct and concise.

AttributeModifier is named such that people will find it.

I tend to use the former for what you're doing, and the latter if I 
already have a model kicking around.


There's also a SimpleAttributeModifier if you have a simple String, and 
an AttributeAppender if you wish to mess with what's currently there.


IMO, the API here is far too broad - we should just give people 
AbstractBehavior and tell them to get on with it, but hey ho.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Multiple wicket:child / tags on a single base page?

2007-11-07 Thread Al Maw

Chris Colman wrote:

heh, wellyou can be against this, but i think if we take a vote
right now most core-devs with binding votes will vote this down


I still can't see the reason for the negativity of some of the
core-devs: this is an existing feature.


No offense to anyone involved, but I'm getting very bored. This thread 
is about ten times longer than it needs to be, the arguments in it have 
been rather confused, and the same thing has been said by the same 
people about a hundred times.


Please can we improve the signal-to-noise ratio? If you have anything 
concrete to add, please comment on the appropriate JIRA issue where 
hopefully people won't have such bad verbal diarrhea.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: New page from Ajax form issues - What am I missing?

2007-11-06 Thread Al Maw

Gwyn Evans wrote:

Hi,
  I've got a form, which I'm processing with Ajax, but I need to go
onto a different page once it submits correctly.  The problem I'm
seeing is that if I do a
   setResponsePage(Sent.class);

then the URL that's being generated is:
  http://.../xyz/?wicket:bookmarkablePage=%3Acom.s.c.web.xyz.Sent

The problem might be that my Home page is mounted as /sc (using
HybridUrlCodingStrategy) but as a result there's no '/' page, so the
request isn't picked up by the Wicket filter  goes to the default
index.html.

  (I'll try mounting the 'Sent' page  see what effect that has, but
wanted to run that by people  I can't access the IRC at the moment!)


Sounds like a bug. As luck would have it, I'm looking at the code around 
there for another bug at the moment, so give me a quickstart and a JIRA 
issue and I'll fix it.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: multiple url mappings for the wicket web application

2007-11-06 Thread Al Maw

Tom Desmet wrote:

http://myserver:8080/mywicketwebapp/NL/*
http://myserver:8080/mywicketwebapp/EN/*
http://myserver:8080/mywicketwebapp/FR/*
...

What I would like to achieve is that when someone enters the web application
by the url /mywicketwebapp/NL, that all wicket requests stay under this URL.
Same for all other urls.


Are you using Wicket 1.2.x? In Wicket 1.3.x this should Just Work(tm), 
as all URLs are relative. You just can't do it in 1.2.x, I'm afraid.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do I get the current page?

2007-11-06 Thread Al Maw

maentele wrote:

My question/problem is: how do I get the currentPage (the currently active
link)?


Just call Component#getPage()

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: default wicket:child / and prevent access for base page

2007-11-06 Thread Al Maw

Will Jackson wrote:

What is the proper way to declare a default wicket:child / and
ensure that the page containing the wicket:child / is not directly
accessible on its own?

I know I can just call the extending page (i.e. Page1 extends
BasePage, calling Page1.html), but how do I ensure that BasePage.html
is not directly accessible? When I call the page in the browser it
just shows a blank region where the page extension will appear. What
I really want is possibly a 404 response.


Make BasePage an abstract class.

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do I get the current page?

2007-11-06 Thread Al Maw

Martijn Dashorst wrote:

It doesn't work until after adding the component to the page.


This is true.

So you need something like this (I've modified your variable names to 
make it more obvious what is what):


pageLink.add(new AttributeModifier(class, true,
new AbstractReadOnlyModel() {
public Object getObject() {
return
getPage().getClass().equals(menuItem.getPageClass())
? activeMenuItem
: AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
}
}
);

Probably. ;-)

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: default wicket:child / and prevent access for base page

2007-11-06 Thread Al Maw

Johan Compagner wrote:


Make BasePage an abstract class.


some things in live are soo simple :)
(are we testing for abstract pages or will there just be an exception?)


Probably the latter, but if your users are guessing URLs then they 
deserve to lose.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Make PageableListView row click

2007-11-06 Thread Al Maw

Marco Aurélio Silva wrote:

I'm using a PageableListView component and I want to make each row of the
list clickable. I don't want to add a column with a label like details, I
just want to click in any place of the row to go to details. Is there a way
to do this?


If you don't mind requiring JavaScript, this might work well for you:

protected void populateItem(ListItem item) {
item.add(new AjaxEventBehavior(onclick) {
protected void onEvent(AjaxRequestTarget target) {
// Do stuff here.
}
});
}



Good luck.

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Make PageableListView row click

2007-11-06 Thread Al Maw

Marco Aurélio Silva wrote:

Is there a way to do it without javascript?


Well, obviously if you want to handle clicking on things without 
Javascript then whatever it is needs to be a standard Link.


You can abandon tables and do something like this:

div wicket:id=listView
a wicket:id=link class=rowLink
span wicket:id=name/span
span wicket:id=summary/span
/a
/div

.rowLink {
display: block;
}

.rowLink span {
width: 50%;
display: block;
float: left;
}

==

Or maybe you could do this with CSS, but it'd break the accessibility 
totally:


table class=clickableRows
tr
tda class=rowLink wicket:id=link/a/td
tdName/td
tdSummary/td
/tr
/table

.clickableRows tr {
position: relative;
}

.clickableRows a.rowLink {
display: block;
position: absolute;
z-index: 1000;
top: 0;
right: 0;
bottom: 0;
left: 0;
}


Although the browsers may well not know what to make of that, IE in 
particular. No idea if it will even vaguely work, but it might give you 
ideas. ;-)


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Link text

2007-11-05 Thread Al Maw

Sam Hough wrote:

Lots of the time I just want a link with text as the body of the  ... ...

The Link class takes an IModel so presumably uses that for something but I
can't see it in the source or get it to appear...

Sorry I'm being thick and I did search honest!


You'd typically use the model so you have something to get at in the 
onClick().


Of course, if you don't care about how much state is in your session, 
you can just make whatever it is final so you can use it in there anyway.


If you want to use the model for the text of the link instead, then you 
could write a class like this:



public abstract class TextLink extends Link {
public TextLink(String id, IModel model) {
super(id, model);
}

protected void onComponentTagBody(final MarkupStream markupStream,
final ComponentTag openTag)
{
replaceComponentTagBody(
markupStream, openTag, getModelObjectAsString()
);
}

}


If you want enabled/disabled to work properly, you'll need to copy the 
relevant bits out of AbstractLink#onComponentTagBody(...)



Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Is Beta5 coming soon? Beta4 has caused these issues for us....

2007-11-04 Thread Al Maw

landry soules wrote:

Sorry Al, but you lost your money  ;-)

I put back slf4j-api-1.4.2.jar , and still the same problem... Using the
jars suggested by Cristi doesn't help either. But since it seems i'm the
only one to still have the problem, must be a problem with my classpath. I
will recheck after deploying the project in a war. Maybe it's just eclipse
WTP that does some weird things with my classpath.
As always, thanks a lot for your support, guys.


Gah. Can't believe you haven't sorted this issue out yet!

It's conceptually really simple...

org.slf4j.Logger#isTraceEnabled()

...is a method in the org.slf4j.Logger interface. That interface is in 
the main SLF4J API JAR.


The isTraceEnabled() method, according to the javadoc, has been 
available in that interface since version 1.4.


So you either don't have slf4j-api-1.4.x on your classpath, or you also 
have a version prior to 1.4 also your classpath which is being picked up 
instead.


If both of those two things weren't the case, you wouldn't be having 
this issue.


To check the classpath of a running project in Eclipse, Right click on 
the root node in the debug dialog and choose Properties. You can find 
the classpath in the dialog that is shown.



Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Is Beta5 coming soon? Beta4 has caused these issues for us....

2007-11-03 Thread Al Maw

landry soules wrote:

Actually, i didn't go on with maven, since my project is already quite
advanced now, i don't want to reconfigure it to use maven. I just tried to
create a sample project to figure out what is the correct combination of
slf4j/log4j to use (bad idea, since it appears to be broken in the original
wicket pom).
So i'm back in my real eclipse project, and this neverending error :

Exception in thread ModificationWatcher Task java.lang.NoSuchMethodError:
org.slf4j.Logger.isTraceEnabled()Z
at org.apache.wicket.util.thread.Task$1.run(Task.java:103)
at java.lang.Thread.run(Thread.java:595)

 even though i'm using slf4j-log4j12-1.4.2.jar + log4j-1.2.14.jar.


You also need slf4j-api-1.4.2.jar. I'd lay money on your not having that 
version on your classpath (or having an earlier version as well).


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: difference between Link(SomePage.class) and Link(new SomePage())

2007-11-03 Thread Al Maw

auron wrote:

Sorry to be the wicket newbie, but I was wondering if you guys could help me
to understand how Links work. 


I understand that when you do Link(SomePage.class), it calls the zero param
constructor of SomePage, and when you do Link(new SomePage(someParams)) you
can call other constructors, but besides this, what are the other
differences?


I assume you're talking about PageLink not Link?

new PageLink(id, SomePage.class) will generate a URL which will 
construct a new page when you click on it.


new PageLink(id, new SomePage()) obviously creates a SomePage instance 
right then and there. The page instance is stored in the session and dug 
out if the user clicks on the link.


You should obviously try to create links which create new pages when you 
click on them, not when you construct the link (i.e. the former). For 
this reason, in Wicket 1.3 we've deprecated the second form as this 
seemed to confuse people. Instead, use a normal Link and call 
setResponsePage() in the onClick(). At least, then it'll be obvious what 
you're doing and encourage people to only construct their new pages 
within a click handler, rather than within the constructor for the 
original page.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: empty wicket:message

2007-11-03 Thread Al Maw

Sebastiaan van Erk wrote:
I was wondering if it is possible to configure wicket to make 
wicket:message output the key in braces when the key is not found (at 
least in development mode), because that would make it a lot easier to 
spot missing labels...


That is, what I'd like to do is:

wicket:message key=bla /

And have wicket output [bla] if the key bla cannot be found. I know I 
could do this:


wicket:message key=bla[bla]/wicket:message

but this is a lot more verbose and it requires me to correctly type the 
key name twice every time. Currently if the resource is not found it 
just outputs nothing at all (which is hard to spot).


Mmmm. I must say I agree with this. I'd actually prefer it to throw an 
exception. ;-)


Maybe we should add this as a feature?
getMarkupSettings().setThrowExceptionOnEmptyMessageTagKeyMissing(true) 
or something equally descriptive. ;-)


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Jira issue moved to the list: constructors and init of components

2007-11-03 Thread Al Maw

Brill Pappin wrote:

Moving to the list as suggested by Gwyn.
 
From Jira issue: 
https://issues.apache.org/jira/browse/WICKET-1108
 
Maybe I wasn't clear on what my problem with it was. 


1) doing any extensive amount of work in a constructor is an anti-pattern
AFAIK. 


Blindly declaring things anti-patterns with no real rationale is dangerous.

Constructors are designed to ensure that your object is completely 
initialised and ready for use. If your page doesn't have all its 
components added, then it's not initialised and ready for use. 
Therefore, I think putting all that logic in there is a perfectly valid 
place for it.


There's nothing to stop you making your constructor call methods to 
initialise things that people can then override. Generally you won't 
want to make/let people completely override everything, so you need to 
put some thought into this. If you do want this, then just use a blank 
super constructor and you're done (you can then sit back and watch your 
users hate you).



2) If the API is designed so that I am expected to build a complex component
in it's constructor then I should be able to override any of the
constructors and expect it to be called. 


But, err, you can't override constructors. So if you're writing the API, 
call overridable methods from your constructor. I don't understand what 
you're doing discussing this on the Wicket user list - this is just 
basic Java.



If you don't want to include a specialized method for initializing a
component (e.g. the way Servlet works) and expect the constructor to be the
primary means of building up the component, then the constructors should
follow good practice and all get called. 


Errr, what? We don't get a choice here - this is all governed by the 
language itself. I think you might be confused about how constructor 
chaining works. Either that, or you're completely failing to make 
yourself understood properly.



This is a common Java pattern. There should be only one place in the code
where properties are set from a constructor, all other constructors should
pass on their parameters, defaults if required, to the one constructor that
actually sets the properties. 


This is nonsense. You write code to achieve what you want it to in the 
most concise and simple way possible.


If that means a single constructor which actually does stuff with a 
bunch of other constructors that delegate to it with default arguments, 
then fine.


If it means you have a commonInit() method that all your constructors 
call, then fine.


If that means you have a bunch of constructors that do different things, 
then fine.



If you don't code well, you have three immediate problems which as an agile
fan, I would cringe at: 
1) You have duplicate code, no way around it. 
2) you can never be certain which constructor is called by the API and any

given point. You may be able to get it to work, but a future change to the
API could break your code, and you might well not catch it with your own
unit test (you have some right?).


Again; errr, what? No offense, but if you can't work out which 
constructor is being called for a given bit of code, you probably 
shouldn't be writing Java for a living.


Future API changes can always break your code. I don't see how that's 
relevant specifically to constructors as opposed to anything else. If 
someone changes the API and your unit test doesn't pick it up, your unit 
tests are very obviously broken. Changing constructors is really no 
different to changing other method signatures, with the possible 
exception that you're slightly more likely to be doing reflection on 
constructors than methods (although with the prevalence of Hibernate's 
HQL and Wicket's PropertyModels even that is arguable).



3) in order to support having two overridden constructors, I now am *forced*
to duplicate my own code (granted it could be one line, but its still
duplication). 


Errr, why?


Now... fixing the constructor calls is not impossible but may require a bit
of thought (I don't believe thinking is a problem for the developers of
Wicket as they have clearly done a lot of it already) however I personally
would prefer a specific method call for initializing the component... at the
very least so I don't have to do all that work in the constructor, but it
also has the benefit of being *very* easy to implement with the current
codebase. 


Despite my preference for an init override, I think the correct thing to do
with or without it is to fix the constructor calls. 


Fix them how? I still don't even remotely understand why you think 
they're broken. I'm not being deliberately obtuse, defensive or 
belligerent. I've read the original bug report. I just genuinely don't 
understand where you're coming from.


What is to stop you going:

public BasePage() {
commonInit();
}

public BasePage(IModel model) {
super(model);
commonInit();
}

private void commonInit() {
add(new Label(myid1, foo));
}

?

Regards,


Re: empty wicket:message

2007-11-03 Thread Al Maw

Johan Compagner wrote:

Yes we could do that. Just remove that default value.
But what i would like to have IF you have a body specified then we don't
throw anything
This way we keep old behavior and we have the new one


FWIW, I entirely agree with this. If we just change it for tags that 
have a default body then we'll almost certainly break people's sites.


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mvn netbeans:netbeans command for QuickStart Project

2007-10-31 Thread Al Maw

Francisco Diaz Trepat - gmail wrote:

Hi I just downloaded the maven 2.0.7 and ran the *mvn archetype:create
-DarchetypeGroupId=org.apache.wicket*

then ran the *mvn netbeans:netbeans* inside the project to get a Netbeans
project. And got an error.


That's because there is no such plug-in.

RTFM here: 
http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: is it a bug? (using beta 4)

2007-10-26 Thread Al Maw

Otan wrote:

The problem with the extra dot-dot in the image src that arises when the
filter is map to /* seems to be fixed when I do this:
mountBookmarkablePage(/home, HomePage.class);

Now, the URL I see in the browser when I access the homepage is this:
http://server/context-path/home
instead of http://server/context-path/


I don't see that this makes any difference.
../images/foo would map to the same place in both cases.

Regardless of that, this is working absolutely fine for me, whether the 
home page is mounted or not.



that makes the extra dot-dot in the images src acceptable.



To reproduce the problem,
1. map the filter to /*
2. have an unmounted page (page not mounted to a path).
3. Access the the page. The src paths in the images will be problematic
because of the extra dot-dot (..)


This doesn't reproduce the problem for me.

Make us a quickstart.

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: possible bug in 1.2.6 / 1.3 Include

2007-10-25 Thread Al Maw

Jeremy Levy wrote:

I found this while working on 1.2.6 and checked it out in 1.3 and it's the
same. It appears as though Include does not pay attention to the contextpath
if it is explicitly set.

Line 162 (In 1.2.6) or line 233 (in 1.3b4) of Include is the following line
which as I understands it builds a absolute URL from a relative path from
the model:

buildUrl.append(req.getContextPath()).append('/').append(url);

It's using the request's context path to build the absolute URL, if this is
behind a proxy it will fail, I changed my copy to this:

buildUrl.append
(getApplication().getApplicationSettings().getContextPath()).append('/').append(url);

Am I misunderstanding this?


Yeah, looks like a bug. Please open a JIRA issue and I'll look into it.

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: is it a bug? (using beta 4)

2007-10-25 Thread Al Maw

This should work just fine.

What's the URL in your browser's address bar?

Wicket will automatically prepend things to make paths relative to the 
context root.


Regards,

Al

Johan Compagner wrote:

filter should be mapped on /* thats why we have the filter.
I don't know why the ../ is generated what is the url that you see in the
browser?
Maybe AlMaw can pitch in a bit.

johan



On 10/18/07, Otan [EMAIL PROTECTED] wrote:

I'm using wicket beta 4 release.

Images source path is wrong when my wicket filter is mapped to the url /*
The reason is because the src path of each images changes into something
with double dot (..)

Example:
my wicket filter:
   filter
   description /description
   filter-nameWicket/filter-name
   filter-classorg.apache.wicket.protocol.http.WicketFilter
/filter-class
   init-param
   param-nameapplicationClassName/param-name
   param-valuefackage.MyApplication/param-value
   /init-param
   /filter
   filter-mapping
   filter-nameWicket/filter-name
   url-pattern/*/url-pattern
   /filter-mapping

the html...
!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;
   head
   title~/title
   /head
   body
   div
   img src=images/kulafu.jpg alt= /
   /div
   /body
/html


then the img tag in the html becomes...
img alt= src=../images/kulafu.jpg/

the rendered src path is wrong because of the extra dot-dot-slash. But
it's
correct if the wicket filter is mapped with /something/*

If it's not a bug, am I discouraged to map my filter using /* ?




!DSPAM:471a337530941545816891!




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to forward request to an external URL

2007-10-10 Thread Al Maw

Nili Adoram wrote:

Suppose I want to forward the HTTP request to some external url (NOT a
wicket page, e.g. a JSP page).
I want to end the request cycle at this point ( not include this URL inside my 
page).
How can I simulate request.getRequestDispatcher(url).forward() within a
wicket page?


You use getRequestDispatcher(url).forward(). ;-)

((WebRequest)getRequest()).getHttpServletRequest().getRequestDispatcher(url).forward() 
to be precise.


For details of how to embed JSP fragments within a page, see here:
http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/

...which is basically the same problem (only I'm include()ing, not 
forward()ing). You might need to tell Wicket to use one-pass rendering 
to make this work properly, and you may need to fiddle with 
setRedirect(false).


Good luck,

Regards,

Al



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help - Best Practice - Mapping Database Constraint Violation to User Interface

2007-10-01 Thread Al Maw

mchack wrote:

Could someone provide a pointer/link as to the best mechanism to map DB
constraint violations from Hibernate (or ORM layer) back to the user
interface layer. I'm sure this has been solved but wasn't successful in
searching for an answer.


I'm not sure if this is the best way to do it, but I use a custom 
RequestCyleProcessor that extends WebRequestCycleProcessor.


It overrides #response(RuntimeException, RequestCycle) to check the 
RuntimeException for a ConstraintViolationException (call 
exception.getCause() recursively until you find one or it's null).


If it finds one, I send the user to a special error page.

The error will be vendor-specific, unfortunately.
I use something like this for MySQL:
ConstraintViolationException e = (ConstraintViolationException)t;
String detail = e.getSQLException().getMessage();
if (detail != null  detail.startsWith(Duplicate entry ')) {
detail = detail.replaceAll(.*'(.*)'.*, $1);
detail = getString(
DuplicateEntry,
new SingleStringMapModel(detail, detail)
);
}

We do this for StaleObjectStateException too (use 
StaleObjectStateException#getEntityName() for your error message).


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Reach into a component to change XML attribute

2007-09-27 Thread Al Maw
You can override onComponentTag for the component itself, if that's an 
option. Call super.onComponentTag(...) then tag.put(class, foo) or 
whatever it is.


Regards,

Al

Sam Hough wrote:

In my ignorance it seems tough to make that work the second time if the list
has changed. It is also less pretty as the only extension points I have are
renderIterator and renderChild. I can think of nasty hacks like using
IdentityHashMap to hold onto Components I've already added an
AttributeAppender (the HTML monkey is class happy) to...

If I can't hook into all child add/remove events and looking for my
attributeappender in each component is a bit slow seems like the only
option.


Martijn Dashorst wrote:

This:

Component first = null;
Component last = null;
for(Foo foo : foos) {
last = new Component(view.newChildId());
if(first == null) first = last;
view.add(last);
}

first.add(new SimpleAttributeModifier(class, first));
last.add(new SimpleAttributeModifier(class, last));

doesn't work?

Martijn

On 9/27/07, Sam Hough [EMAIL PROTECTED] wrote:

I've got my own wiz bang extension of RepeatingView and I want to add
class
attributes last, first to the children for the HTML monkey.

Is the best way to add an AttributeAppender to each child Component that
uses an IModel to get the class? Maybe in beforeOnRender I can't see an
onChildAttach or onChildRemove method or anything like that. All my ideas
seem a bit heavy and clumsy.

This must be somewhere in existing code or Nabble but I'm afraid I
couldn't
see it. Sorry.
--
View this message in context:
http://www.nabble.com/Reach-into-a-component-to-change-XML-attribute-tf4527906.html#a12919632
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Howto center new window on screen?

2007-09-26 Thread Al Maw

Per Newgro wrote:

I don't know exactly from the top of my head, but I think you'd do
this with Javascript.
Ahh ok. I found an example here: 
http://www.boutell.com/newfaq/creating/windowcenter.html


Where do i have store the java scripts i want to use oftenly? I expected that 
Page.class would provide it out of the box. Should i add a RFE?


This is what we do:

== JavaScript.java ==

package com.yourcompany.web.wicket.scripts;

public class JavaScript {
public static final ResourceReference CENTER_WINDOW =
get(center_window.js);

public static final ResourceReference FOCUS_FIRST_TEXTBOX =
get(focus_first_textbox.js);

// ...

private JavaScript() { /* prevent construction */ }

private static ResourceReference get(String path) {
return new ResourceReference(JavaScript.class, path);
}
}

== EOF ==

Add your scripts to the same package, with appropriate references.

Then in your page or panels or other components:
add(HeaderContributor.forJavascript(JavaScript.CENTER_WINDOW));


Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NoSuchMethodException / PropertyResolver

2007-09-25 Thread Al Maw

Johan Compagner wrote:

thats just a debug log:

*

catch* (Exception e)

{

*log*.debug(Cannot find getter  + clz + . + expression, e);

}
maybe i should just delete that log statement to kill the confusion.


Just log it without the stack trace.

Regards,

Al

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   >