Re: Wicket Session grows too big real fast

2008-11-26 Thread Ladislav Thon
Agree. I was almost shocked :-) by Martijn's e-mail about keeping references
between pages. I believed it is a standard practice to keep reference to
previous page for the purpose of cancelling, and of course do it all the
time. It seems very natural to me. O-oops.

LT

2008/11/26 Piller Sébastien [EMAIL PROTECTED]

 I vote for such a document, too. I am now trying to reduce my session size
 too, and if I could find some hints somewhere (ie, be extremly carefull
 with anonymous subclasses, etc) it may be a big plus.

 jhp a écrit :

 Removing references pointing to previous pages solved a lot, very good
 point.
 Also making sure that individual domain objects don't get stored to
 session
 makes  a difference. I have still a lot of code to go through to make sure
 that all unnecessary references don't get stored to session, but making a
 few changes in the most important pages makes already a big difference.

 I noticed that this is a problem that others have experienced too. I guess
 it is pretty easy unintentionally stuff the session with domain objects
 ,and
 if using modern day persistence framework, those domain objects can be
 quite
 large if they have collections etc.

 I think there is a need for small document outlining the common pitfalls
 and
 remedies for them. I haven't seen such. Wicket reference of course tells
 about LoadableDetachableModel, but this thread has info that I haven't
 found
 anywhere else. I might try compose such a document, if I just have the
 time
 and energy in the near future.

 Thanks to Martijn, Johan and John for your responses!

 BR,
 Jukka




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




Re: Wicket with GWT

2008-11-13 Thread Ladislav Thon

 At the same time, I want to embed certain GWT or GWT-Ext widgets in the
 Wicket pages because they are really cool and would take a considerable
 effort for any developer to implement them in javascript.


Sounds like an idea I also had before: using GWT to create rich JavaScript
components embeddable in any kind of HTML page (be it static, Wicket
generated or whatever). Not really a Wicket question, but still.

One can think of using GWT to produce highly optimized JavaScript which
exports some API to plain JavaScript you write -- gwt-exporter
http://code.google.com/p/gwt-exporter/ might be useful to do this. Maybe it
is possible to create standard GWT application consisting only of your
library and a few lines of code to actually export the API (which should
prevent GWT compiler from optimizing your library out :-) ). Not tested
that, though.

Hope that helps.

LT


Re: new url strategy

2008-09-24 Thread Ladislav Thon
This could be useful to you:
http://wicketstuff.org/confluence/display/STUFFWIKI/wicketstuff-annotation
LT

2008/9/24 Some user [EMAIL PROTECTED]


 Hello,

 I am designing my application java packages in order to keep related
 programs grouped in sections :

 myenterprise/myapplication/section1/program1.java
 myenterprise/myapplication/section1/program2.java
 myenterprise/myapplication/section1/program3.java

 myenterprise/myapplication/section2/program1.java
 myenterprise/myapplication/section2/program2.java
 myenterprise/myapplication/section2/program3.java

 I want to use a url strategy in order to make a call like
 http://myserver/section1/program1 , http://myserver/section2/program3,
 etc.
 but I do not want to modify the webapplication init in order to add an
 entry mount each time I add a section or a program. Can you post an
 example of how to do this other way?

 Thanks in advance for your help
 
 David J.

 -
 --
 http://www.vic-fontaine.com/ http://www.vic-fontaine.com/
 --
 View this message in context:
 http://www.nabble.com/new-url-strategy-tp19644584p19644584.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: why does ExternalLink generate span instead of a simple a

2008-08-07 Thread Ladislav Thon
 I see, but in this case I didn't provide any markup. ExternalLink is being
 added in a PropertyColumn.populateItem method to a (cell) Item of
 PropertyColumn of a DataTable.



So see the markup of DataTable -- you are gonna see those spans there :-) As
Igor said, the easiest way is to use a Fragment (or Panel, as you wish).

LT


Re: Hook for hiding columns of DataTable?

2008-08-06 Thread Ladislav Thon
I've managed to solve similar problem by

1. setting a specific CSS class on each column, both in th and td tags (this
can be done by overriding getCssClass() method of AbstractColumn)

2. setting a specific CSS class on the table when some columns should be
hidden (this can be done e.g. using an AttributeAppender behavior)

3. hiding the columns in CSS, like table.hideFirstColumn .col1 {display:
none}

Not very nice (quite ugly in fact), but works for my needs. Yours might be
more dynamic though (I basically have only two states, in the first all
columns are shown, in the second few of them are hidden).

LT

2008/8/3 Jeremy Thomerson [EMAIL PROTECTED]

 I've perused the source and can't find an easy way to do this.  I'm hoping
 that maybe someone else has done it.

 In an app for one customer, I have a table that lists parts that could be
 purchased.  It is a subclass of DefaultDataTable.  I pass it in a custom
 sortable data provider that wraps a list - so it has all parts in a list.
 Then, I have filters above the table that can filter the list to a specific
 category of parts.  But if you filter down to a certain category of parts,
 some of those columns will be completely empty.  It would be nice to hide
 them.  But the table was already created - and it operates off of a static
 array of columns.  The column doesn't provide an isVisible mechanism.  Is
 there an easy way to hide it, or does the table need to be recreated and
 replaced within the ajax link?

 The current code is basically like this:

 final ListSortableDataProvider dp = new
 ListSortableDataProvider(listOfParts, columnToSortOn);
 final PartInfoTable table = new PartInfoTable(table, new
 VendorColumnFactory(vendor), vendor, dp);
 add(table.setOutputMarkupId(true));

 AjaxFallbackLink filterLink = new AjaxFallbackLink(link) {
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
OrderVendorColumn column = (OrderVendorColumn)
 nextFilterableColumn.getObject();
String valueToFilterOn = (String) item.getModelObject();
mPartFilter.addFilter(column, valueToFilterOn);
dp.setList(mPartFilter.filterPartsList(parts));
if (target != null) {
target.addComponent(table);
target.addComponent(LookupPartsPage.this.get(currentFilter));
target.addComponent(LookupPartsPage.this.get(addFilter));
}
}
 };
 filterLink.add(new Label(label,
 item.getModel()).setRenderBodyOnly(true));


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



Re: modal window navigation?

2008-07-20 Thread Ladislav Thon
Hello,

I'm using a Page within a modal window and when the user clicks an 'OK'
 button, I want to refresh the whole page (not the modal window). I've tried
 a few variations of:

form.add( new AjaxButton(actionSave)
{
  @Override
  protected void onSubmit(AjaxRequestTarget target, Form? form) {
getRequestCycle().setResponsePage( ExplorePage.class );
  }
});

 but that refreshes the iframe, not the page.


I had the same problem few days ago. You should create a
WindowClosedCallback and call setResponsePage in there, presumably after
checking some variable set by the button's onSubmit. At least this worked
for me :-)

LT



 Any pointers?

 For extra credit...  what is the easiest way to make the modal window
 background darker?  Do I need to extend the modal window and include a
 different CSS file?  what is the best practice for this kind of thing?

 thanks!
 ryan


Re: Prevent form from being onSubmit()'ed when button is called

2008-07-19 Thread Ladislav Thon
Yes, you should call setDefaultFormProcessing(false) on your button. And if
you want to submit the form using a link, use SubmitLink instead (it has
setDefaultFormProcessing method too).

LT

2008/7/19 Jeremy Thomerson [EMAIL PROTECTED]:

 I'm not at a computer and it's been a while since I've done this, but I
 think there's a method like Form.setDefaultFormProcessing(false) that you
 can call from within your button.

 Jeremy Thomerson
 http://www.wickettraining.com
 -- sent from a wireless device


 -Original Message-
 From: Kaspar Fischer [EMAIL PROTECTED]
 Sent: Saturday, July 19, 2008 10:24 AM
 To: users@wicket.apache.org
 Subject: Prevent form from being onSubmit()'ed when button is called

 My form as a onSubmit() implementation and, in addition, contains a
 button. If
 I hit the button, both the button and the form's onSubmit() is
 executed as
 expected. How can I prevent the form's onSubmit() from being executed?

 (I tried using a Link, but this bypasses the form processing
 completely, so
 setObject() is not called on my models -- which is not what I want.)

 Many thanks,
 Kaspar

 -
 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]