Re: How do I elegantly put feedback per form field?

2008-03-21 Thread Sam Barnum
+1 on the london wicket slides, an excellent (and quick) read. Would  
love to see more example like this.  Guice?


-Sam

On Mar 20, 2008, at 8:46 AM, James Carman wrote:


On 3/20/08, Ned Collyer [EMAIL PROTECTED] wrote:


 Thanks Craig,

 Perfect.

 Super perfect :)



Yeah, that's really cool!  I think I might borrow your ideas on our
project at work.  Thanks!

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



Dubble redirect?

2008-03-21 Thread Martijn Lindhout
Hi all,

I use auth-roles and when somebody hits a secured page, he gets redirected
to the loginpage. When login succeeds, the user is redirected back to the
original page.
Now comes the problem: in the constructor of the original page, I want to
check the role or username of the user and redirect to another page, but
then Wicket complains about that it already is redirecting. I used
setReponsePage, RequestCycle.redirect, etc...

How do I fix this?



-- 
Martijn Lindhout
JointEffort IT Services
http://www.jointeffort.nl
[EMAIL PROTECTED]
+31 (0)6 18 47 25 29


Re: Redirect after post Issue

2008-03-21 Thread Sebastiaan van Erk
Looking at your mod_proxy config again I noticed that you are using 
ProxyPreserveHost on. I think this is causing the problems, you should 
remove this directive.


What I think is happening is this:

1) Wicket says: redirect to /web/
2) Tocmat makes the url absolute by prepending the virtual host. Since 
you have ProxyPreserveHost on, tomcat sees the virtual host as 
localhost and NOT localhost:8080, and returns 
http://localhost/web/xxx as the new lcoation.
3) Apache mod_proxy does NOT reverse proxy the url, because it does not 
have the :8080 on it and does not match your rule.


If you remove the ProxyPreserveHost on, tomcat will return 
http://localhost:8080/web/x as the redirect location and Apache will 
reverse proxy it.


The only downside of this is that your wicket app will not know the REAL 
virtual host, and so automatically generated absolute URL's (for example 
in emails) will be wrong.


Regards,
Sebastiaan

Sebastiaan van Erk wrote:

Hi,

Jeremy Levy wrote:
I have been having trouble with this for a couple of months, it seems 
that
redirects in Wicket 1.3.x seem to be writing out the URL incorrectly 
in our

set up.

We are running JBoss 4.2 with embedded Tomcat 5.5 using Apache/2.2.4 with
mod_proxy.

The Tomcat URL for the application is http://localhost:8080/web/

The Apache URL for the application is http://localhost

For the most part the site works well when accessed via Apache (and
perfectly directly via Tomcat), except on links/urls that involve 
(from what

I can tell) a redirect from Wicket.  These redirect the users browser to
/web/ which shouldn't happen from infront of the proxy.


 From what I can tell your mod_proxy config looks correct, you could 
check the log to see what it's doing. But Wicket redirecting you to 
/web/ is perfectly fine, as far as Wicket is concerned, that's where 
the site is at! It seems that mod_proxy is not properly reverse proxying 
the redirect...


Regards,
Sebastiaan


Examples of this are:

1. Form submits (they go through, but the next page is requested with the
/web in the url)
2. Redirects from Application.getHomePage()
3. Any use of RestartResponseAtInterceptPageException
4. setResponsePage(MyPage.class) inside of an
Link.onClick(BookmarkablePageLink works fine to the same page)

Further evidence that this is a bug is that if I set my application to
IRequestCycleSettings.ONE_PASS_RENDER everything works perfectly but with
both IRequestCycleSettings.REDIRECT_TO_BUFFER and
IRequestCycleSettings.REDIRECT_TO_RENDER it fails.

Our mod_proxy / virtualhost configuration:

VirtualHost *
ServerAdmin [EMAIL PROTECTED]
ServerAlias localhost

ServerSignature On

DocumentRoot /var/www

ProxyRequests Off

Proxy *
Order deny,allow
Allow from all
/Proxy

RewriteEngine on

RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 2

ProxyPass / http://localhost:8080/web/
ProxyPassReverse / http://localhost:8080/web/
ProxyPassReverseCookiePath  /web /
ProxyPreserveHost On

ErrorLog /var/log/apache2/error.log
LogLevel warn
/VirtualHost

I'm not 100% sure that the mod_proxy configuration is correct, but 
I've read
all the articles on this list about it as well as the wiki page and 
have run

out of ideas to mess with.

Any help is appreciated.

Jeremy



smime.p7s
Description: S/MIME Cryptographic Signature


Re: How to set focus to a textfield inside AJAX

2008-03-21 Thread Johan Compagner
Igor is right, it is strange to do a roundtrip for just the focus, but
normally setting focus in ajax can be done through
AjaxRequestTarget.focusComponent

On 3/20/08, Michael Mehrle [EMAIL PROTECTED] wrote:
 I have a WMC that I added an AjaxEventBehavior(onclick) to. Inside I
 want to set the focus to a particular textfield - how would I do that?

 I have seen some techniques on how to do this on page load, but this is
 AJAX so I need something dynamic.

 Anyone solved this problem before?

 Michael

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



AjaxTree : how to locate a node based on its label

2008-03-21 Thread bhitai

Hi 
I'm kinda new to Apache wicket. I have a LinkTree on a page on which I also
have other Ajax enabled components (basically 5,6 links on the page). When
my other component is clicked, I want to locate the node in the tree and
expand it, to show the user's selection.  I know tree.getTreeState() will
allow me to expand a particular tree node, but I can't seem to find a way to
locate the treeNode inside the tree in the first place. I have the label of
the node coming back in the Ajax model, and I'm wondering if I can navigate
to that particular node (all names are unique in this scenario) using the
label string to search in the tree.

thanks in advance,
jaffry

-- 
View this message in context: 
http://www.nabble.com/AjaxTree-%3A-how-to-locate-a-node-based-on-its-label-tp16194936p16194936.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]



Panel setVisible() in Ajax call

2008-03-21 Thread Stephan Koch

Hi all,

I have a Page with a DropDown Component and a Panel. The Panel displays 
some stuff based on the model object of the DropDown.
In the constructor of my page, I set panel.setVisible(false) to prevent 
the panel from being rendered while the model object of the DropDown is 
null because the user has not yet selected an option.


Now I want the Panel to be rendered once a valid choice is selected by 
the user. I tried this:


protected void onEvent(AjaxRequestTarget target) {
   log.debug(ddMonth onChange triggered.);
   if(month != null) {
   reportPanel.setVisible(true);
   reportPanel.updatePanel(getServiceManager(), 
getUser(), month);
   target.addComponent(reportPanel); 
   }

}


The event is triggered, the panel is not rendered though. Is there a way 
to achieve this without reloading the entire page?

If not, how would I trigger a page reload from the onEvent method?

Thanks,
Stephan

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



Re: Panel setVisible() in Ajax call

2008-03-21 Thread Gerolf Seitz
if you set the panel to be invisible on first render,
you also have to call panel.setOutputMarkupPlaceholderTag(true) so that
a hidden placeholder is rendered, which gets replaced with the real panel
once you set it to visible and add it to the ajaxrequestarget.

  Gerolf

On Fri, Mar 21, 2008 at 10:54 AM, Stephan Koch [EMAIL PROTECTED]
wrote:

 Hi all,

 I have a Page with a DropDown Component and a Panel. The Panel displays
 some stuff based on the model object of the DropDown.
 In the constructor of my page, I set panel.setVisible(false) to prevent
 the panel from being rendered while the model object of the DropDown is
 null because the user has not yet selected an option.

 Now I want the Panel to be rendered once a valid choice is selected by
 the user. I tried this:

 protected void onEvent(AjaxRequestTarget target) {
log.debug(ddMonth onChange triggered.);
if(month != null) {
reportPanel.setVisible(true);
reportPanel.updatePanel(getServiceManager(),
 getUser(), month);
target.addComponent(reportPanel);
}
 }


 The event is triggered, the panel is not rendered though. Is there a way
 to achieve this without reloading the entire page?
 If not, how would I trigger a page reload from the onEvent method?

 Thanks,
 Stephan

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




Re: Display of own message in FeedbackPanel

2008-03-21 Thread Fabien D.

Thank you all for your help,

There is no problem for the password, but now I'm trying to create my own
validator. I have a problem during compilation (with ant).

I have done this :

email.add(new IValidator() {
validate(IValidatable v) {
if ( !CDataVerification.validEmail( 
(String)v.getvalue() ) )
v.add(new 
ValidationError().addMessageKey(error)); 
} 
});

where CDataVerification.validEmail is a method to check if it's a correct
email ( with @, . , ...), in input a string and in output a boolean.

During compilation, I have this message : invalid method declaration; return
type required  validate(IValidatable v)

In the java doc, the method validate don't have any return type, that's why
I don't understand what is my mistake.

Thank you for your help.
-- 
View this message in context: 
http://www.nabble.com/Display-of-own-message-in-FeedbackPanel-tp16182720p16196105.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: Display of own message in FeedbackPanel

2008-03-21 Thread Sebastiaan van Erk
This is elementary Java... you should probably use an IDE like eclipse, 
works much better than finding errors later on with a build tool like 
ant. You're declaring a method and you don't declare it's return type... 
add the workd void before validate... the compiler gives you the exact 
location of the problem...


Regards,
Sebastiaan

Fabien D. wrote:

Thank you all for your help,

There is no problem for the password, but now I'm trying to create my own
validator. I have a problem during compilation (with ant).

I have done this :

email.add(new IValidator() {
validate(IValidatable v) {
if ( !CDataVerification.validEmail( 
(String)v.getvalue() ) )
	v.add(new ValidationError().addMessageKey(error)); 
			} 
		});


where CDataVerification.validEmail is a method to check if it's a correct
email ( with @, . , ...), in input a string and in output a boolean.

During compilation, I have this message : invalid method declaration; return
type required  validate(IValidatable v)

In the java doc, the method validate don't have any return type, that's why
I don't understand what is my mistake.

Thank you for your help.


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Display of own message in FeedbackPanel

2008-03-21 Thread Fabien D.

O_o sorry for this mistake  I try this : 

email.add(new IValidator() {
public void validate(IValidatable v) {
if ( !CDataVerification.validEmail( 
(String)v.getvalue() ) )
v.add(new 
ValidationError().addMessageKey(error)); 
} 
});

I'm not an expert in java too  It's not compiling : it don't find the
method getvalue()...
-- 
View this message in context: 
http://www.nabble.com/Display-of-own-message-in-FeedbackPanel-tp16182720p16196588.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: Display of own message in FeedbackPanel

2008-03-21 Thread Gerolf Seitz
because it's getValue() - capital V

  Gerolf

On Fri, Mar 21, 2008 at 11:49 AM, Fabien D. [EMAIL PROTECTED]
wrote:


 O_o sorry for this mistake  I try this :

email.add(new IValidator() {
public void validate(IValidatable v) {
 if ( !CDataVerification.validEmail(
 (String)v.getvalue() ) )
v.add(new
 ValidationError().addMessageKey(error));
}
});

 I'm not an expert in java too  It's not compiling : it don't find the
 method getvalue()...
 --
 View this message in context:
 http://www.nabble.com/Display-of-own-message-in-FeedbackPanel-tp16182720p16196588.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]




Getting client's date and time

2008-03-21 Thread Cristi Manole
Hello,

I'm looking for a quick solution to get the client's date and time in a
wicket modal, without a post

I can have a wicket component, like a label and I can use js functions to
set it in a span for example.

The question is... how can i read that value I set in js in wicket?

Is it possible?

Thanks in advance,
Cristi


Re: Getting client's date and time

2008-03-21 Thread James Carman
On 3/21/08, Cristi Manole [EMAIL PROTECTED] wrote:
 Hello,

  I'm looking for a quick solution to get the client's date and time in a
  wicket modal, without a post

  I can have a wicket component, like a label and I can use js functions to
  set it in a span for example.

  The question is... how can i read that value I set in js in wicket?

Can you write the value to a hidden form field?

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



Delete from RepeatingView from Panel Page

2008-03-21 Thread taygolf

Hey guys I really have learned a lot about wicket over the last month from
this board and I really appreciate it. I am stuck on how to solve a problem
and I wanted some input on the direction I should go.

I have a link that says add employees. When that link is clicked a popup is
created with a form that has textfields(first name, last, name, function).
There is a one to one relationship for forst and last name for each employee
but an employee can have many functions.

So I create a RepeatingView and a TextFieldPanel. I think create a link and
onClick I add a TextFieldPanel to the RepeatingView so a new field will show
up under function and will allow the user to enter a new function. This all
works prefectly.

Now to the problem. I want to add a delete button next to the new TextField
I have just created in case the user wants to delete the function they just
created. I know I need to remove the the entry from my RepeatingView but the
delete button will be created in the creation of the TextFieldPanel so how
do I delete from my RepeatingView from the Panel page? Do I need to make the
RepeatingView or the PropertyModel for the RepeatingView a Session Variable
or can I pass it to the Panel and then back? I am just lost as to the best
way to delete from my repeatingview.

Thanks for the help

T
-- 
View this message in context: 
http://www.nabble.com/Delete-from-RepeatingView-from-Panel-Page-tp16197416p16197416.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: Getting client's date and time

2008-03-21 Thread Cristi Manole
yes, i can, but how can i read it without post?

it doesn't even need to be hidden as i want it shown... i just want to query
it from time to time., again - without a post.

is it possible to read it through ajax or from the dom... or something,
inside wicket?

On Fri, Mar 21, 2008 at 2:21 PM, James Carman [EMAIL PROTECTED]
wrote:

 On 3/21/08, Cristi Manole [EMAIL PROTECTED] wrote:
  Hello,
 
   I'm looking for a quick solution to get the client's date and time in a
   wicket modal, without a post
 
   I can have a wicket component, like a label and I can use js functions
 to
   set it in a span for example.
 
   The question is... how can i read that value I set in js in wicket?

 Can you write the value to a hidden form field?

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




Re: Getting client's date and time

2008-03-21 Thread James Carman
On 3/21/08, Cristi Manole [EMAIL PROTECTED] wrote:
 yes, i can, but how can i read it without post?

  it doesn't even need to be hidden as i want it shown... i just want to query
  it from time to time., again - without a post.

  is it possible to read it through ajax or from the dom... or something,
  inside wicket?

Could you have a completely hidden form?  Just create a simple form
that just has that hidden field in it.  Then, post it using Ajax.  I'm
just thinking out loud here, but it might just be crazy enough to
work. :)

Disclaimer: This advice has been given before I've had my morning
coffee.  It has been given as-is with no warranty, neither expressed
nor implied.

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



Re: Getting client's date and time

2008-03-21 Thread James Carman
On 3/21/08, James Carman [EMAIL PROTECTED] wrote:
 On 3/21/08, Cristi Manole [EMAIL PROTECTED] wrote:

  yes, i can, but how can i read it without post?
  
it doesn't even need to be hidden as i want it shown... i just want to 
 query
it from time to time., again - without a post.
  
is it possible to read it through ajax or from the dom... or something,
inside wicket?


 Could you have a completely hidden form?  Just create a simple form
  that just has that hidden field in it.  Then, post it using Ajax.  I'm
  just thinking out loud here, but it might just be crazy enough to
  work. :)

Perhaps you could snoop their browser as in this example (look at the
bottom of the page):

http://www.wicketstuff.org/wicket13/hellobrowser

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



Showing Wicket AJAX Debug Window for certain users...

2008-03-21 Thread James Carman
Suppose we have a user send us a bug report for our production system
and we would like to see what's going on with the AJAX requests.  Is
there any way to turn on the ajax debug window for a certain session?
It seems like it's either turned on for everyone or not.

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



Re: Getting client's date and time

2008-03-21 Thread Cristi Manole
now that was a great tip :)

thanks for reminding me... i knew about this feature... i even used it in a
previous project...

wicket can gather a lot of browser settings including time :)

for ppl also looking for this, don't forget to put this into your
WebApplication class:
getRequestCycleSettings().setGatherExtendedBrowserInfo(true);

Thanks again, James :)

Cristi

On Fri, Mar 21, 2008 at 2:32 PM, James Carman [EMAIL PROTECTED]
wrote:

 On 3/21/08, James Carman [EMAIL PROTECTED] wrote:
  On 3/21/08, Cristi Manole [EMAIL PROTECTED] wrote:
 
   yes, i can, but how can i read it without post?
   
 it doesn't even need to be hidden as i want it shown... i just want
 to query
 it from time to time., again - without a post.
   
 is it possible to read it through ajax or from the dom... or
 something,
 inside wicket?
 
 
  Could you have a completely hidden form?  Just create a simple form
   that just has that hidden field in it.  Then, post it using Ajax.  I'm
   just thinking out loud here, but it might just be crazy enough to
   work. :)

 Perhaps you could snoop their browser as in this example (look at the
 bottom of the page):

 http://www.wicketstuff.org/wicket13/hellobrowser

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




Re: Showing Wicket AJAX Debug Window for certain users...

2008-03-21 Thread Matej Knopp
Unfortunately there is not a straightforward way to do this. You can
add a feature request. In the meantime you can override
application#getDebugSettings and proxy the IDebugSettings interface so
that isAjaxDebugModeEnabled() method returns falue specific for
current session.

-Matej

On Fri, Mar 21, 2008 at 1:37 PM, James Carman
[EMAIL PROTECTED] wrote:
 Suppose we have a user send us a bug report for our production system
  and we would like to see what's going on with the AJAX requests.  Is
  there any way to turn on the ajax debug window for a certain session?
  It seems like it's either turned on for everyone or not.

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





-- 
Resizable and reorderable grid components.
http://www.inmethod.com

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



Re: Showing Wicket AJAX Debug Window for certain users...

2008-03-21 Thread James Carman
On 3/21/08, Matej Knopp [EMAIL PROTECTED] wrote:
 Unfortunately there is not a straightforward way to do this. You can
  add a feature request. In the meantime you can override
  application#getDebugSettings and proxy the IDebugSettings interface so
  that isAjaxDebugModeEnabled() method returns falue specific for
  current session.

Well, currently we don't *need* it per se.  I was just thinking that
it might come in handy someday.  My devious mind is coming up with all
sorts of schemes as I learn more and more about Wicket.  I just wanted
to make sure I wasn't missing something obvious in this case.  Thanks
for the quick reply!

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



Re: Display of own message in FeedbackPanel

2008-03-21 Thread Fabien D.

For the last time, Thank you :)
-- 
View this message in context: 
http://www.nabble.com/Display-of-own-message-in-FeedbackPanel-tp16182720p16197598.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]



SingleSortState multiple sorts?

2008-03-21 Thread Hoover, William
I was looking into providing a ListSortParam in a ISortState/IClusterable 
(multiple version of SingleSortState) for a SortableDataProvider. Does the list 
within the sort state need to be IClusterable?


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



Re: SingleSortState multiple sorts?

2008-03-21 Thread Sebastiaan van Erk
I wanted to have this the other day, so I came up with (see attached). 
I'd like to see your ideas about it, since this was just a 20 minute 
first hack...


IClusterable is just a tagging interface for the sole purpose of 
clustering via Terracotta. So if you don't need TC, then Serializable 
should be fine.


Regards,
Sebastiaan


Hoover, William wrote:

I was looking into providing a ListSortParam in a ISortState/IClusterable 
(multiple version of SingleSortState) for a SortableDataProvider. Does the list 
within the sort state need to be IClusterable?


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

package com.sebster.util.wicket;

import java.util.Collections;
import java.util.List;

import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortState;
import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;

public abstract class MultiSortableDataProvider implements ISortableDataProvider {

	private static final long serialVersionUID = 1L;

	private MultiSortState state = new MultiSortState();

	/**
	 * @see ISortableDataProvider#getSortState()
	 */
	public final ISortState getSortState() {
		return state;
	}

	/**
	 * @see ISortableDataProvider#setSortState(org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortState)
	 */
	public final void setSortState(final ISortState state) {
		if (!(state instanceof MultiSortState)) {
			throw new IllegalArgumentException(state must be an instance of  + MultiSortState.class.getName());
		}
		this.state = (MultiSortState) state;
	}

	public ListSortParam getSort() {
		return state.getSort();
	}

	@SuppressWarnings(unchecked)
	public void clearSort() {
		state.setSort(Collections.EMPTY_LIST);
	}

	/**
	 * Sets the current sort state
	 * 
	 * @param sortParams
	 *list of parameters containing new sorting information
	 */
	public void setSort(ListSortParam sortParams) {
		state.setSort(sortParams);
	}

	public void sortBy(final String property, final boolean ascending) {
		state.setPropertySortOrder(property, ascending ? ISortState.ASCENDING : ISortState.DESCENDING);
	}

	/**
	 * @see ISortableDataProvider#detach()
	 */
	public void detach() {
		// Do nothing.
	}

}
package com.sebster.util.wicket;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import org.apache.wicket.IClusterable;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortState;
import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;

public class MultiSortState implements ISortState, IClusterable {

	private static final long serialVersionUID = 1L;

	private final ListSortParam sortParams = new ArrayListSortParam();

	public int getPropertySortOrder(final String property) {
		if (property == null) {
			throw new NullPointerException(property);
		}
		for (final SortParam sortParam : sortParams) {
			if (property.equals(sortParam.getProperty())) {
return sortParam.isAscending() ? ISortState.ASCENDING : ISortState.DESCENDING;
			}
		}
		return ISortState.NONE;
	}

	public void setPropertySortOrder(final String property, final int state) {
		if (property == null) {
			throw new NullPointerException(property);
		}
		for (final IteratorSortParam i = sortParams.iterator(); i.hasNext();) {
			if (property.equals(i.next().getProperty())) {
i.remove();
break;
			}
		}
		if (state != ISortState.NONE) {
			sortParams.add(0, new SortParam(property, state == ISortState.ASCENDING));
		}
	}
	
	public ListSortParam getSort() {
		return Collections.unmodifiableList(sortParams);
	}
	
	public void setSort(final ListSortParam sortParams) {
		sortParams.clear();
		sortParams.addAll(sortParams);
	}
	
}


smime.p7s
Description: S/MIME Cryptographic Signature


RE: SingleSortState multiple sorts?

2008-03-21 Thread Hoover, William
Ironically, your code looks very similar to what I have done on my end. Can we 
create a feature request for this?

-Original Message-
From: Sebastiaan van Erk [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2008 9:13 AM
To: users@wicket.apache.org
Subject: Re: SingleSortState multiple sorts?


I wanted to have this the other day, so I came up with (see attached). 
I'd like to see your ideas about it, since this was just a 20 minute 
first hack...

IClusterable is just a tagging interface for the sole purpose of 
clustering via Terracotta. So if you don't need TC, then Serializable 
should be fine.

Regards,
Sebastiaan


Hoover, William wrote:
 I was looking into providing a ListSortParam in a ISortState/IClusterable 
 (multiple version of SingleSortState) for a SortableDataProvider. Does the 
 list within the sort state need to be IClusterable?
 
 
 -
 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: SingleSortState multiple sorts?

2008-03-21 Thread Hoover, William
It seems as though this would be a good candidate for a replacement for 
SingleSortState/SortableDataProvider. We really don't need the single sort 
version if we have a multiple sort version (reduce bloat ;o)?

-Original Message-
From: Hoover, William [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2008 9:23 AM
To: users@wicket.apache.org
Subject: RE: SingleSortState multiple sorts?


Ironically, your code looks very similar to what I have done on my end. Can we 
create a feature request for this?

-Original Message-
From: Sebastiaan van Erk [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2008 9:13 AM
To: users@wicket.apache.org
Subject: Re: SingleSortState multiple sorts?


I wanted to have this the other day, so I came up with (see attached). 
I'd like to see your ideas about it, since this was just a 20 minute 
first hack...

IClusterable is just a tagging interface for the sole purpose of 
clustering via Terracotta. So if you don't need TC, then Serializable 
should be fine.

Regards,
Sebastiaan


Hoover, William wrote:
 I was looking into providing a ListSortParam in a ISortState/IClusterable 
 (multiple version of SingleSortState) for a SortableDataProvider. Does the 
 list within the sort state need to be IClusterable?
 
 
 -
 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: SingleSortState multiple sorts?

2008-03-21 Thread Sebastiaan van Erk
Yes, I too would prefer multisort to be in Wicket by default. It is much 
more logical for the sort to be stable, i.e., it sorts the *current* 
list with respect to the new sort order, rather than the original list.


Especially when the original list is from the database and it is 
essentially undefined what order it is coming out (with respect to 
non-sort columns).


Problem is that it is an incompatible change and a hassle for the 
implementors of sortable data providers, because suddenly they need to 
take into account many sorts instead of only 1.


Regards,
Sebastiaan

Hoover, William wrote:

It seems as though this would be a good candidate for a replacement for 
SingleSortState/SortableDataProvider. We really don't need the single sort 
version if we have a multiple sort version (reduce bloat ;o)?

-Original Message-
From: Hoover, William [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2008 9:23 AM
To: users@wicket.apache.org
Subject: RE: SingleSortState multiple sorts?


Ironically, your code looks very similar to what I have done on my end. Can we 
create a feature request for this?

-Original Message-
From: Sebastiaan van Erk [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2008 9:13 AM
To: users@wicket.apache.org
Subject: Re: SingleSortState multiple sorts?


I wanted to have this the other day, so I came up with (see attached). 
I'd like to see your ideas about it, since this was just a 20 minute 
first hack...


IClusterable is just a tagging interface for the sole purpose of 
clustering via Terracotta. So if you don't need TC, then Serializable 
should be fine.


Regards,
Sebastiaan


Hoover, William wrote:

I was looking into providing a ListSortParam in a ISortState/IClusterable 
(multiple version of SingleSortState) for a SortableDataProvider. Does the list 
within the sort state need to be IClusterable?


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



smime.p7s
Description: S/MIME Cryptographic Signature


RE: SingleSortState multiple sorts?

2008-03-21 Thread Hoover, William
I'm just thinking out loud, but what if we added a getSorts() to avoid 
incompatibility issues? 

public ListSortParam getSorts() {
return state.getSorts();
}

public SortParam getSort() {
return (state.getSorts().isEmpty()) ? null : 
state.getSorts().get(0);
}

-Original Message-
From: Sebastiaan van Erk [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2008 9:34 AM
To: users@wicket.apache.org
Subject: Re: SingleSortState multiple sorts?


Yes, I too would prefer multisort to be in Wicket by default. It is much 
more logical for the sort to be stable, i.e., it sorts the *current* 
list with respect to the new sort order, rather than the original list.

Especially when the original list is from the database and it is 
essentially undefined what order it is coming out (with respect to 
non-sort columns).

Problem is that it is an incompatible change and a hassle for the 
implementors of sortable data providers, because suddenly they need to 
take into account many sorts instead of only 1.

Regards,
Sebastiaan

Hoover, William wrote:
 It seems as though this would be a good candidate for a replacement for 
 SingleSortState/SortableDataProvider. We really don't need the single sort 
 version if we have a multiple sort version (reduce bloat ;o)?
 
 -Original Message-
 From: Hoover, William [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 21, 2008 9:23 AM
 To: users@wicket.apache.org
 Subject: RE: SingleSortState multiple sorts?
 
 
 Ironically, your code looks very similar to what I have done on my end. Can 
 we create a feature request for this?
 
 -Original Message-
 From: Sebastiaan van Erk [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 21, 2008 9:13 AM
 To: users@wicket.apache.org
 Subject: Re: SingleSortState multiple sorts?
 
 
 I wanted to have this the other day, so I came up with (see attached). 
 I'd like to see your ideas about it, since this was just a 20 minute 
 first hack...
 
 IClusterable is just a tagging interface for the sole purpose of 
 clustering via Terracotta. So if you don't need TC, then Serializable 
 should be fine.
 
 Regards,
 Sebastiaan
 
 
 Hoover, William wrote:
 I was looking into providing a ListSortParam in a ISortState/IClusterable 
 (multiple version of SingleSortState) for a SortableDataProvider. Does the 
 list within the sort state need to be IClusterable?


 -
 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: SingleSortState multiple sorts?

2008-03-21 Thread Sebastiaan van Erk
I guess that could work, though I'd like to think this stuff through 
some more...


The problem that I have with the current design is that ISortState is 
not designed for multiple sorts. The setting works fine as it is, but 
the order is not recoverable from the current ISortState interface.


This means that in the data provider you need to cast the interface to a 
specific class (which kind of defeats the purpose of the interface 
IMHO). That's why we have to do the ugly casts to MultiSortState.


I'd like to see the state properly included in ISortState. If you look 
at the ISortState interface, it has


public void setPropertySortOrder(String property, int state);

If this is the only thing you can do to CHANGE the sort state, then a 
list of property/state pairs is the only thing you should be able to get 
out of it, so I'd like to see more of a:


public ListSortOrder getPropertySortOrders();

With SortOrder having a property and a state. Then a sortable data 
provider could decide on its own what it would want to do, i.e., use 
only 1 sort order, or use multiple... SingleSortState would simply 
return a singleton list every time... Casts would no longer be necessary...


Anyway, this is probably a big too big of an API break. But in my 
opinion the main problem is in the design of the ISortState interface.


Regards,
Sebastiaan



Hoover, William wrote:
I'm just thinking out loud, but what if we added a getSorts() to avoid incompatibility issues? 


public ListSortParam getSorts() {
return state.getSorts();
}

public SortParam getSort() {
return (state.getSorts().isEmpty()) ? null : 
state.getSorts().get(0);
}

-Original Message-
From: Sebastiaan van Erk [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2008 9:34 AM
To: users@wicket.apache.org
Subject: Re: SingleSortState multiple sorts?


Yes, I too would prefer multisort to be in Wicket by default. It is much 
more logical for the sort to be stable, i.e., it sorts the *current* 
list with respect to the new sort order, rather than the original list.


Especially when the original list is from the database and it is 
essentially undefined what order it is coming out (with respect to 
non-sort columns).


Problem is that it is an incompatible change and a hassle for the 
implementors of sortable data providers, because suddenly they need to 
take into account many sorts instead of only 1.


Regards,
Sebastiaan

Hoover, William wrote:

It seems as though this would be a good candidate for a replacement for 
SingleSortState/SortableDataProvider. We really don't need the single sort 
version if we have a multiple sort version (reduce bloat ;o)?

-Original Message-
From: Hoover, William [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2008 9:23 AM
To: users@wicket.apache.org
Subject: RE: SingleSortState multiple sorts?


Ironically, your code looks very similar to what I have done on my end. Can we 
create a feature request for this?

-Original Message-
From: Sebastiaan van Erk [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2008 9:13 AM
To: users@wicket.apache.org
Subject: Re: SingleSortState multiple sorts?


I wanted to have this the other day, so I came up with (see attached). 
I'd like to see your ideas about it, since this was just a 20 minute 
first hack...


IClusterable is just a tagging interface for the sole purpose of 
clustering via Terracotta. So if you don't need TC, then Serializable 
should be fine.


Regards,
Sebastiaan


Hoover, William wrote:

I was looking into providing a ListSortParam in a ISortState/IClusterable 
(multiple version of SingleSortState) for a SortableDataProvider. Does the list 
within the sort state need to be IClusterable?


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



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Redirect after post Issue

2008-03-21 Thread Jeremy Levy
Sebastiaan,

Thanks very much, that helps a lot.  It now works. Now that it's working I
want to switch it to use ajp instead of http.

I understand from your explanation how ProxyPreserveHost was breaking it.
However, when I switch to use ajp, I'm seeing the same behavior.  I'm having
trouble understanding what tomcat is returning in terms of what I should
define as my ProxyPassReverse. Is there an easier way to debug this?  Here
is how my virtualhost looks now:


VirtualHost *:80
ServerName tiger
ServerAdmin [EMAIL PROTECTED]

DocumentRoot /opt/www/

ProxyRequests Off

Proxy *
Order deny,allow
Allow from all
/Proxy

ProxyPass / ajp://pabst:8009/web/
ProxyPassReverse / ajp://pabst:8009/web/
ProxyPassReverseCookiePath  /web /

/VirtualHost

I've tried a couple of variations of the ProxyPassReverse

ProxyPassReverse / ajp://pabst:8009/web/
ProxyPassReverse / ajp://pabst/web/
ProxyPassReverse / http://pabst:8080/web/
ProxyPassReverse / http://pabst/web/

All have the same effect.  Should this work?

Jeremy


On Fri, Mar 21, 2008 at 3:17 AM, Sebastiaan van Erk [EMAIL PROTECTED]
wrote:

 Looking at your mod_proxy config again I noticed that you are using
 ProxyPreserveHost on. I think this is causing the problems, you should
 remove this directive.

 What I think is happening is this:

 1) Wicket says: redirect to /web/
 2) Tocmat makes the url absolute by prepending the virtual host. Since
 you have ProxyPreserveHost on, tomcat sees the virtual host as
 localhost and NOT localhost:8080, and returns
 http://localhost/web/xxx as the new lcoation.
 3) Apache mod_proxy does NOT reverse proxy the url, because it does not
 have the :8080 on it and does not match your rule.

 If you remove the ProxyPreserveHost on, tomcat will return
 http://localhost:8080/web/x as the redirect location and Apache will
 reverse proxy it.

 The only downside of this is that your wicket app will not know the REAL
 virtual host, and so automatically generated absolute URL's (for example
 in emails) will be wrong.

 Regards,
 Sebastiaan

 Sebastiaan van Erk wrote:
  Hi,
 
  Jeremy Levy wrote:
  I have been having trouble with this for a couple of months, it seems
  that
  redirects in Wicket 1.3.x seem to be writing out the URL incorrectly
  in our
  set up.
 
  We are running JBoss 4.2 with embedded Tomcat 5.5 using Apache/2.2.4
 with
  mod_proxy.
 
  The Tomcat URL for the application is http://localhost:8080/web/
 
  The Apache URL for the application is http://localhost
 
  For the most part the site works well when accessed via Apache (and
  perfectly directly via Tomcat), except on links/urls that involve
  (from what
  I can tell) a redirect from Wicket.  These redirect the users browser
 to
  /web/ which shouldn't happen from infront of the proxy.
 
   From what I can tell your mod_proxy config looks correct, you could
  check the log to see what it's doing. But Wicket redirecting you to
  /web/ is perfectly fine, as far as Wicket is concerned, that's where
  the site is at! It seems that mod_proxy is not properly reverse proxying
  the redirect...
 
  Regards,
  Sebastiaan
 
  Examples of this are:
 
  1. Form submits (they go through, but the next page is requested with
 the
  /web in the url)
  2. Redirects from Application.getHomePage()
  3. Any use of RestartResponseAtInterceptPageException
  4. setResponsePage(MyPage.class) inside of an
  Link.onClick(BookmarkablePageLink works fine to the same page)
 
  Further evidence that this is a bug is that if I set my application to
  IRequestCycleSettings.ONE_PASS_RENDER everything works perfectly but
 with
  both IRequestCycleSettings.REDIRECT_TO_BUFFER and
  IRequestCycleSettings.REDIRECT_TO_RENDER it fails.
 
  Our mod_proxy / virtualhost configuration:
 
  VirtualHost *
  ServerAdmin [EMAIL PROTECTED]
  ServerAlias localhost
 
  ServerSignature On
 
  DocumentRoot /var/www
 
  ProxyRequests Off
 
  Proxy *
  Order deny,allow
  Allow from all
  /Proxy
 
  RewriteEngine on
 
  RewriteLog /var/log/apache2/rewrite.log
  RewriteLogLevel 2
 
  ProxyPass / http://localhost:8080/web/
  ProxyPassReverse / http://localhost:8080/web/
  ProxyPassReverseCookiePath  /web /
  ProxyPreserveHost On
 
  ErrorLog /var/log/apache2/error.log
  LogLevel warn
  /VirtualHost
 
  I'm not 100% sure that the mod_proxy configuration is correct, but
  I've read
  all the articles on this list about it as well as the wiki page and
  have run
  out of ideas to mess with.
 
  Any help is appreciated.
 
  Jeremy
 



Page Expired Problems (wicket 1.2.6)

2008-03-21 Thread Markus Strickler

Hi-

I have a simple form with some required fields set as homepage for my  
application.
Now if I open this page in 2 tabs of the same browser and just hit  
submit in the two tabs I get Page Exipred pages.
This seems to happen rather randomly, sometimes on the first submit  
click sometimes it takes 10 ore more clicks.

There is no error in the log file.
I've set logging to DEBUG and get this after i click on submit:
2008-03-21 15:10:06,040 DEBUG [wicket.Session] - updateSession():  
Attaching session to PageMap [PageMap name=null, access=[[Access  
id=0, version=0]]]
2008-03-21 15:10:06,041 DEBUG [wicket.Session] - Getting page [path  
= 1:newsForm, versionNumber = 0]
2008-03-21 15:10:06,042 DEBUG  
[wicket.request.compound.DefaultEventProcessorStrategy] - commencing  
event handling for [EMAIL PROTECTED]  
pageClass=wicket.markup.html.pages.PageExpiredErrorPage]



Is this expected behavior? Any hints on how to debug Page Expired  
problems in general?

This is on wicket 1.2.6

Thanks for any help,

-markus


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



Re: Redirect after post Issue

2008-03-21 Thread James Carman
On 3/21/08, Jeremy Levy [EMAIL PROTECTED] wrote:
 Sebastiaan,

  Thanks very much, that helps a lot.  It now works. Now that it's working I
  want to switch it to use ajp instead of http.

  I understand from your explanation how ProxyPreserveHost was breaking it.
  However, when I switch to use ajp, I'm seeing the same behavior.  I'm having
  trouble understanding what tomcat is returning in terms of what I should
  define as my ProxyPassReverse. Is there an easier way to debug this?  Here
  is how my virtualhost looks now:

Have you tried asking the tomcat folks?  They're much more adept at
this stuff than us, I would imagine.  They may have seen this sort of
stuff before.  Can you reproduce the issue with a simple JSP-based
example?

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



Re: Showing Wicket AJAX Debug Window for certain users...

2008-03-21 Thread lars vonk
Another option is to install the FireBug plugin in Firefox and use that.
This also allows you to see what the request and responses are.

Lars

On Fri, Mar 21, 2008 at 1:44 PM, James Carman [EMAIL PROTECTED]
wrote:

 On 3/21/08, Matej Knopp [EMAIL PROTECTED] wrote:
  Unfortunately there is not a straightforward way to do this. You can
   add a feature request. In the meantime you can override
   application#getDebugSettings and proxy the IDebugSettings interface so
   that isAjaxDebugModeEnabled() method returns falue specific for
   current session.

 Well, currently we don't *need* it per se.  I was just thinking that
 it might come in handy someday.  My devious mind is coming up with all
 sorts of schemes as I learn more and more about Wicket.  I just wanted
 to make sure I wasn't missing something obvious in this case.  Thanks
 for the quick reply!

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




Re: Showing Wicket AJAX Debug Window for certain users...

2008-03-21 Thread James Carman
That's true.  Firebug is very nice.

On 3/21/08, lars vonk [EMAIL PROTECTED] wrote:
 Another option is to install the FireBug plugin in Firefox and use that.
  This also allows you to see what the request and responses are.

  Lars

  On Fri, Mar 21, 2008 at 1:44 PM, James Carman [EMAIL PROTECTED]
  wrote:


   On 3/21/08, Matej Knopp [EMAIL PROTECTED] wrote:
Unfortunately there is not a straightforward way to do this. You can
 add a feature request. In the meantime you can override
 application#getDebugSettings and proxy the IDebugSettings interface so
 that isAjaxDebugModeEnabled() method returns falue specific for
 current session.
  
   Well, currently we don't *need* it per se.  I was just thinking that
   it might come in handy someday.  My devious mind is coming up with all
   sorts of schemes as I learn more and more about Wicket.  I just wanted
   to make sure I wasn't missing something obvious in this case.  Thanks
   for the quick reply!
  

  -
   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: [vote] Release 1.4 with only generics and stop support for 1.3

2008-03-21 Thread Philip A. Chapman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I believe that this vote has been a landslide.

Jörn Zaefferer wrote:
 +1
 
 On Thu, Mar 20, 2008 at 4:30 AM, Eelco Hillenius
 [EMAIL PROTECTED] wrote:
 This is starting to look like a voting record! Will me reach 100? :-)
  Eelco



  On Wed, Mar 19, 2008 at 8:22 PM, Penn [EMAIL PROTECTED] wrote:

  
   +1
  
   Penn
  
  
   Martijn Dashorst wrote:
   
This thread is for voting only. Use the [discuss] thread for voicing
your opinion or asking questions. This makes counting the votes much
easier.
   
The discussion on our development list makes it clear that a lot of
folks are anxious for generified models. Most users if not all wish us
to release a quick release which is 1.3 + generics. The consequence is
that the core team will stop to support 1.3, and that everybody that
wishes updates will have to migrate to 1.4, and upgrade to Java 5.
   
Everybody is invited to vote! Please use
   
[ ] +1, Wicket 1.4 is 1.3 + generics, drop support for 1.3
[ ] -1, I need a supported version running on Java 1.4
   
Let your voices be heard!
   
Martijn
--
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]
   
   
   
  
   --
   View this message in context:
   
 http://www.nabble.com/-vote--Release-1.4-with-only-generics-and-stop-support-for-1.3-tp16090054p16170790.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]
 


- --
Philip A. Chapman

Desktop and Web Application Development:
Java, .NET, PostgreSQL, MySQL, MSSQL
Linux, Windows 2000, Windows XP

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH4+DlAdpynRSGw3URAgItAJ9jqadeoHhOCq0PGKN8gWVH3wRWpACff8Td
G6wvn6I9T40eSKBPdXQ5CZA=
=DLej
-END PGP SIGNATURE-

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



Re: [vote] Release 1.4 with only generics and stop support for 1.3

2008-03-21 Thread Patrick Angeles

+1

(has anyone voted -1 yet?)


Martijn Dashorst wrote:
 
 This thread is for voting only. Use the [discuss] thread for voicing
 your opinion or asking questions. This makes counting the votes much
 easier.
 
 The discussion on our development list makes it clear that a lot of
 folks are anxious for generified models. Most users if not all wish us
 to release a quick release which is 1.3 + generics. The consequence is
 that the core team will stop to support 1.3, and that everybody that
 wishes updates will have to migrate to 1.4, and upgrade to Java 5.
 
 Everybody is invited to vote! Please use
 
 [ ] +1, Wicket 1.4 is 1.3 + generics, drop support for 1.3
 [ ] -1, I need a supported version running on Java 1.4
 
 Let your voices be heard!
 
 Martijn
 -- 
 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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-vote--Release-1.4-with-only-generics-and-stop-support-for-1.3-tp16090054p16201965.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: AjaxTree : how to locate a node based on its label

2008-03-21 Thread Igor Vaynberg
you need to be able to know not just the label but the full path. then
use your TreeModel impl to locate the node...

-igor


On Fri, Mar 21, 2008 at 1:24 AM, bhitai [EMAIL PROTECTED] wrote:

  Hi
  I'm kinda new to Apache wicket. I have a LinkTree on a page on which I also
  have other Ajax enabled components (basically 5,6 links on the page). When
  my other component is clicked, I want to locate the node in the tree and
  expand it, to show the user's selection.  I know tree.getTreeState() will
  allow me to expand a particular tree node, but I can't seem to find a way to
  locate the treeNode inside the tree in the first place. I have the label of
  the node coming back in the Ajax model, and I'm wondering if I can navigate
  to that particular node (all names are unique in this scenario) using the
  label string to search in the tree.

  thanks in advance,
  jaffry

  --
  View this message in context: 
 http://www.nabble.com/AjaxTree-%3A-how-to-locate-a-node-based-on-its-label-tp16194936p16194936.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: Page Expired Problems (wicket 1.2.6)

2008-03-21 Thread Johan Compagner
do you have new browser window detection enabled?

for example do you see an extra redirect happening when you open the page in
another tab?

this has to happen in 1.2 better is to upgrade to 1.3

johan


On Fri, Mar 21, 2008 at 3:12 PM, Markus Strickler [EMAIL PROTECTED]
wrote:

 Hi-

 I have a simple form with some required fields set as homepage for my
 application.
 Now if I open this page in 2 tabs of the same browser and just hit
 submit in the two tabs I get Page Exipred pages.
 This seems to happen rather randomly, sometimes on the first submit
 click sometimes it takes 10 ore more clicks.
 There is no error in the log file.
 I've set logging to DEBUG and get this after i click on submit:
 2008-03-21 15:10:06,040 DEBUG [wicket.Session] - updateSession():
 Attaching session to PageMap [PageMap name=null, access=[[Access
 id=0, version=0]]]
 2008-03-21 15:10:06,041 DEBUG [wicket.Session] - Getting page [path
 = 1:newsForm, versionNumber = 0]
 2008-03-21 15:10:06,042 DEBUG
 [wicket.request.compound.DefaultEventProcessorStrategy] - commencing
 event handling for [EMAIL PROTECTED]
 pageClass=wicket.markup.html.pages.PageExpiredErrorPage]
 

 Is this expected behavior? Any hints on how to debug Page Expired
 problems in general?
 This is on wicket 1.2.6

 Thanks for any help,

 -markus


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




Re: [vote] Release 1.4 with only generics and stop support for 1.3

2008-03-21 Thread Philip A. Chapman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I *think* there have been two -1 votes and one -0.

Patrick Angeles wrote:
 +1
 
 (has anyone voted -1 yet?)
 
 
 Martijn Dashorst wrote:
 This thread is for voting only. Use the [discuss] thread for voicing
 your opinion or asking questions. This makes counting the votes much
 easier.

 The discussion on our development list makes it clear that a lot of
 folks are anxious for generified models. Most users if not all wish us
 to release a quick release which is 1.3 + generics. The consequence is
 that the core team will stop to support 1.3, and that everybody that
 wishes updates will have to migrate to 1.4, and upgrade to Java 5.

 Everybody is invited to vote! Please use

 [ ] +1, Wicket 1.4 is 1.3 + generics, drop support for 1.3
 [ ] -1, I need a supported version running on Java 1.4

 Let your voices be heard!

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



 


- --
Philip A. Chapman

Desktop and Web Application Development:
Java, .NET, PostgreSQL, MySQL, MSSQL
Linux, Windows 2000, Windows XP

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH4+QKAdpynRSGw3URAvfXAJ9Pk0j6XOWD/5d15CZH8kaPbLEq6ACeMEMT
tnkdzcr3LkasNmmtmS6mRtw=
=1jUZ
-END PGP SIGNATURE-

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



Re: Delete from RepeatingView from Panel Page

2008-03-21 Thread Igor Vaynberg
delete.onsubmit() { Panel p=TextFieldPanel.this; WebMarkupContainer
item=p.getParent(); RepeatingView rv=item.getParent();
rv.remove(item.getId()); }

there are cleaner ways to do this, but this should get you started

-igor


On Fri, Mar 21, 2008 at 5:23 AM, taygolf [EMAIL PROTECTED] wrote:

  Hey guys I really have learned a lot about wicket over the last month from
  this board and I really appreciate it. I am stuck on how to solve a problem
  and I wanted some input on the direction I should go.

  I have a link that says add employees. When that link is clicked a popup is
  created with a form that has textfields(first name, last, name, function).
  There is a one to one relationship for forst and last name for each employee
  but an employee can have many functions.

  So I create a RepeatingView and a TextFieldPanel. I think create a link and
  onClick I add a TextFieldPanel to the RepeatingView so a new field will show
  up under function and will allow the user to enter a new function. This all
  works prefectly.

  Now to the problem. I want to add a delete button next to the new TextField
  I have just created in case the user wants to delete the function they just
  created. I know I need to remove the the entry from my RepeatingView but the
  delete button will be created in the creation of the TextFieldPanel so how
  do I delete from my RepeatingView from the Panel page? Do I need to make the
  RepeatingView or the PropertyModel for the RepeatingView a Session Variable
  or can I pass it to the Panel and then back? I am just lost as to the best
  way to delete from my repeatingview.

  Thanks for the help

  T
  --
  View this message in context: 
 http://www.nabble.com/Delete-from-RepeatingView-from-Panel-Page-tp16197416p16197416.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: Page Expired Problems (wicket 1.2.6)

2008-03-21 Thread Igor Vaynberg
was multiwindow support in 1.2? i dont remember anymore. basically
what is happening is that you open the page in two different windows
but they are in the same pagemap. so you can click 10 times in one
window - what that will do is push 3 older pages ( i think by default
pagemap size is 7) , including the one opened in another tab, out of
the pagemap. so when you go to click on the window in the other tab
you get page expired error.

-igor


On Fri, Mar 21, 2008 at 9:33 AM, Johan Compagner [EMAIL PROTECTED] wrote:
 do you have new browser window detection enabled?

  for example do you see an extra redirect happening when you open the page in
  another tab?

  this has to happen in 1.2 better is to upgrade to 1.3

  johan


  On Fri, Mar 21, 2008 at 3:12 PM, Markus Strickler [EMAIL PROTECTED]
  wrote:



   Hi-
  
   I have a simple form with some required fields set as homepage for my
   application.
   Now if I open this page in 2 tabs of the same browser and just hit
   submit in the two tabs I get Page Exipred pages.
   This seems to happen rather randomly, sometimes on the first submit
   click sometimes it takes 10 ore more clicks.
   There is no error in the log file.
   I've set logging to DEBUG and get this after i click on submit:
   2008-03-21 15:10:06,040 DEBUG [wicket.Session] - updateSession():
   Attaching session to PageMap [PageMap name=null, access=[[Access
   id=0, version=0]]]
   2008-03-21 15:10:06,041 DEBUG [wicket.Session] - Getting page [path
   = 1:newsForm, versionNumber = 0]
   2008-03-21 15:10:06,042 DEBUG
   [wicket.request.compound.DefaultEventProcessorStrategy] - commencing
   event handling for [EMAIL PROTECTED]
   pageClass=wicket.markup.html.pages.PageExpiredErrorPage]
   
  
   Is this expected behavior? Any hints on how to debug Page Expired
   problems in general?
   This is on wicket 1.2.6
  
   Thanks for any help,
  
   -markus
  
  
   -
   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: Page Expired Problems (wicket 1.2.6)

2008-03-21 Thread Johan Compagner
yes it should be in 1.2
in 1.3 its not needed anymore so it should come from 1.2...

On Fri, Mar 21, 2008 at 5:51 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 was multiwindow support in 1.2? i dont remember anymore. basically
 what is happening is that you open the page in two different windows
 but they are in the same pagemap. so you can click 10 times in one
 window - what that will do is push 3 older pages ( i think by default
 pagemap size is 7) , including the one opened in another tab, out of
 the pagemap. so when you go to click on the window in the other tab
 you get page expired error.

 -igor


 On Fri, Mar 21, 2008 at 9:33 AM, Johan Compagner [EMAIL PROTECTED]
 wrote:
  do you have new browser window detection enabled?
 
   for example do you see an extra redirect happening when you open the
 page in
   another tab?
 
   this has to happen in 1.2 better is to upgrade to 1.3
 
   johan
 
 
   On Fri, Mar 21, 2008 at 3:12 PM, Markus Strickler [EMAIL PROTECTED]
   wrote:
 
 
 
Hi-
   
I have a simple form with some required fields set as homepage for my
application.
Now if I open this page in 2 tabs of the same browser and just hit
submit in the two tabs I get Page Exipred pages.
This seems to happen rather randomly, sometimes on the first submit
click sometimes it takes 10 ore more clicks.
There is no error in the log file.
I've set logging to DEBUG and get this after i click on submit:
2008-03-21 15:10:06,040 DEBUG [wicket.Session] - updateSession():
Attaching session to PageMap [PageMap name=null, access=[[Access
id=0, version=0]]]
2008-03-21 15:10:06,041 DEBUG [wicket.Session] - Getting page [path
= 1:newsForm, versionNumber = 0]
2008-03-21 15:10:06,042 DEBUG
[wicket.request.compound.DefaultEventProcessorStrategy] - commencing
event handling for [EMAIL PROTECTED]
pageClass=wicket.markup.html.pages.PageExpiredErrorPage]

   
Is this expected behavior? Any hints on how to debug Page Expired
problems in general?
This is on wicket 1.2.6
   
Thanks for any help,
   
-markus
   
   
-
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: Page Expired Problems (wicket 1.2.6)

2008-03-21 Thread Markus Strickler

Thanks for the quick replies.
Upgrading to 1.3 is only an option of last resort, as this only an  
isolated example from a full application that is close to going live...
I've set getPageSettings().setAutomaticMultiWindowSupport(true); in  
my application's init() method just to make sure.
I'v seen a redirect happen occasionally, but most of the time there  
is none.
If I got it right wicket uses some javascript to do the redirect if  
the window's name is empty and the set a name on that window?

So it probably will only work in a newly opened window/tab, right?

Is there a quick way to get the pagemaps and their contents for the  
current session to see what's actually in them?

And where can I check/set the pagemap size?

Thanks for the help,

-markus

Am 21.03.2008 um 17:52 schrieb Johan Compagner:

yes it should be in 1.2
in 1.3 its not needed anymore so it should come from 1.2...

On Fri, Mar 21, 2008 at 5:51 PM, Igor Vaynberg  
[EMAIL PROTECTED]

wrote:


was multiwindow support in 1.2? i dont remember anymore. basically
what is happening is that you open the page in two different windows
but they are in the same pagemap. so you can click 10 times in one
window - what that will do is push 3 older pages ( i think by default
pagemap size is 7) , including the one opened in another tab, out of
the pagemap. so when you go to click on the window in the other tab
you get page expired error.

-igor


On Fri, Mar 21, 2008 at 9:33 AM, Johan Compagner  
[EMAIL PROTECTED]

wrote:

do you have new browser window detection enabled?

 for example do you see an extra redirect happening when you open  
the

page in

 another tab?

 this has to happen in 1.2 better is to upgrade to 1.3

 johan


 On Fri, Mar 21, 2008 at 3:12 PM, Markus Strickler  
[EMAIL PROTECTED]

 wrote:




Hi-

I have a simple form with some required fields set as homepage  
for my

application.
Now if I open this page in 2 tabs of the same browser and just hit
submit in the two tabs I get Page Exipred pages.
This seems to happen rather randomly, sometimes on the first submit
click sometimes it takes 10 ore more clicks.
There is no error in the log file.
I've set logging to DEBUG and get this after i click on submit:
2008-03-21 15:10:06,040 DEBUG [wicket.Session] - updateSession():
Attaching session to PageMap [PageMap name=null, access=[[Access
id=0, version=0]]]
2008-03-21 15:10:06,041 DEBUG [wicket.Session] - Getting page  
[path

= 1:newsForm, versionNumber = 0]
2008-03-21 15:10:06,042 DEBUG
[wicket.request.compound.DefaultEventProcessorStrategy] -  
commencing

event handling for [EMAIL PROTECTED]
pageClass=wicket.markup.html.pages.PageExpiredErrorPage]


Is this expected behavior? Any hints on how to debug Page Expired
problems in general?
This is on wicket 1.2.6

Thanks for any help,

-markus


--- 
--

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]



DataView size() iterator() call order issue

2008-03-21 Thread Hoover, William
When using DataView/IDataProvider size() is called before iterator(int first, 
int count) causing calls to DAOs to be duplicated. Our current framework that 
is internally using Hibernate allows one call to be made to a DAO that returns 
both the total result size and the actual records (based off first/count). The 
problem is that the first and count are unknown until the iterator method is 
called- forcing multiple calls to the DAO to retrieve the data (also forcing 
multiple transactions). What are the reasons behind calling size before 
iterator?


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



Re: DataView size() iterator() call order issue

2008-03-21 Thread Igor Vaynberg
knowing the size and the window together seems like a ui requirement,
it is a bit strange to me that you have it inside a dao which should
cater to business logic. eg, as far as i know there is no single db
operation that will produce both, so you are still doing two calls
inside the dao.

also transaction management should be handled outside the dao, daos
are too fine an object to implement transaction management for.

anywho, just nitpicking :)

size() is called first for a lot of reasons, namely even knowing if
there are any rows to retrieve before a much heavier iterator() is
called. some clients want to hide a repeater if there are no items
visible, and so size() might get called from inside isvisible() as
well.

idataprovider is quiet old and we havent had many complaints about its
design so far. if all you are using is the dataview it should be
pretty simple for you to roll your own dataview, if you look at
dataview all it does is implement idataprovider handling to feed the
pageable view. however, if you do you will also lose datatable as well
:|

if you got suggestions on how to improve it im all ears.

-igor


On Fri, Mar 21, 2008 at 11:24 AM, Hoover, William [EMAIL PROTECTED] wrote:
 When using DataView/IDataProvider size() is called before iterator(int first, 
 int count) causing calls to DAOs to be duplicated. Our current framework that 
 is internally using Hibernate allows one call to be made to a DAO that 
 returns both the total result size and the actual records (based off 
 first/count). The problem is that the first and count are unknown until the 
 iterator method is called- forcing multiple calls to the DAO to retrieve the 
 data (also forcing multiple transactions). What are the reasons behind 
 calling size before iterator?


  -
  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: AjaxEditableChoiceLabel: localize labels

2008-03-21 Thread Timo Rantalaiho
On Thu, 20 Mar 2008, francisco treacy wrote:
 i already tried with lots of suggestions, mostly looking at
 DropDownChoice documentation, but this doesn't seem to be in the same
 hierarchy as AjaxEditableChoiceLabel. for instance there is no
 setNullValid method...

Have you looked at how AjaxEditableChoiceLabel is 
implemented?
 
 i used a custom Converter and a ChoiceRenderer and it has partially
 done the trick. what i would like to know is:  how can i labelize /
 internationalize the labels and options itselves in a tidy/ best
 practice manner? i mean, a simple way to map  null - Unknown, true
 - Yes, false - No
 
 and most important where do i set nullValid(), as it was with DropDownChoice ?

I'm not  familiar with AjaxEditableChoiceLabel, but it
sounds like you might have to roll your own component with
DropDownChoice and Label or something such, maybe using
AjaxEditableChoiceLabel as a starting point.

However, it might be that you are almost there with the
ready-made component? Custom Converter and Choicerenderer
sound OK for showing the values you want, and you can easily
make them return getString(my.resource.key) for
localizable strings. 

You should look at the source code to see how nullValid
handling is done in AjaxEditableChoiceLabel, if there is a
suitable hook for settting that, a method to override or
something such.

You are developing with Wicket sources attached in your IDE,
right?

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

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



Re: AjaxEditableChoiceLabel: localize labels

2008-03-21 Thread francisco treacy
yes, a few minutes ago i came back to this issue and was thinking
about rolling my own component (based on a DropDownChoice/
AjaxEditableChoiceLabel mix). if i come up with something interesting
i'll keep you posted.

thanks

francisco

On Fri, Mar 21, 2008 at 5:03 PM, Timo Rantalaiho [EMAIL PROTECTED] wrote:
 On Thu, 20 Mar 2008, francisco treacy wrote:
   i already tried with lots of suggestions, mostly looking at
   DropDownChoice documentation, but this doesn't seem to be in the same
   hierarchy as AjaxEditableChoiceLabel. for instance there is no
   setNullValid method...

  Have you looked at how AjaxEditableChoiceLabel is
  implemented?


   i used a custom Converter and a ChoiceRenderer and it has partially
   done the trick. what i would like to know is:  how can i labelize /
   internationalize the labels and options itselves in a tidy/ best
   practice manner? i mean, a simple way to map  null - Unknown, true
   - Yes, false - No
  
   and most important where do i set nullValid(), as it was with 
 DropDownChoice ?

  I'm not  familiar with AjaxEditableChoiceLabel, but it
  sounds like you might have to roll your own component with
  DropDownChoice and Label or something such, maybe using
  AjaxEditableChoiceLabel as a starting point.

  However, it might be that you are almost there with the
  ready-made component? Custom Converter and Choicerenderer
  sound OK for showing the values you want, and you can easily
  make them return getString(my.resource.key) for
  localizable strings.

  You should look at the source code to see how nullValid
  handling is done in AjaxEditableChoiceLabel, if there is a
  suitable hook for settting that, a method to override or
  something such.

  You are developing with Wicket sources attached in your IDE,
  right?

  Best wishes,
  Timo

  --
  Timo Rantalaiho
  Reaktor Innovations OyURL: http://www.ri.fi/ 

  -
  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: Panel setVisible() in Ajax call

2008-03-21 Thread Timo Rantalaiho
On Fri, 21 Mar 2008, Gerolf Seitz wrote:
 if you set the panel to be invisible on first render,
 you also have to call panel.setOutputMarkupPlaceholderTag(true) so that
 a hidden placeholder is rendered, which gets replaced with the real panel
 once you set it to visible and add it to the ajaxrequestarget.

...and when this is the case, you should see an error about
it on the Ajax debug console (Wicket javascript complaining
about how it cannot find the specified element in HTML.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

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



RE: DataView size() iterator() call order issue

2008-03-21 Thread Dan Kaplan
FYI, in oracle you can use Analytical Functions to do this in one query.  In
other db's you can do this:
select username, x.* from customlist, (select count(*) from customlist) as
x;

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 21, 2008 11:44 AM
To: users@wicket.apache.org
Subject: Re: DataView size() iterator() call order issue

knowing the size and the window together seems like a ui requirement,
it is a bit strange to me that you have it inside a dao which should
cater to business logic. eg, as far as i know there is no single db
operation that will produce both, so you are still doing two calls
inside the dao.

also transaction management should be handled outside the dao, daos
are too fine an object to implement transaction management for.

anywho, just nitpicking :)

size() is called first for a lot of reasons, namely even knowing if
there are any rows to retrieve before a much heavier iterator() is
called. some clients want to hide a repeater if there are no items
visible, and so size() might get called from inside isvisible() as
well.

idataprovider is quiet old and we havent had many complaints about its
design so far. if all you are using is the dataview it should be
pretty simple for you to roll your own dataview, if you look at
dataview all it does is implement idataprovider handling to feed the
pageable view. however, if you do you will also lose datatable as well
:|

if you got suggestions on how to improve it im all ears.

-igor


On Fri, Mar 21, 2008 at 11:24 AM, Hoover, William [EMAIL PROTECTED]
wrote:
 When using DataView/IDataProvider size() is called before iterator(int
first, int count) causing calls to DAOs to be duplicated. Our current
framework that is internally using Hibernate allows one call to be made to a
DAO that returns both the total result size and the actual records (based
off first/count). The problem is that the first and count are unknown until
the iterator method is called- forcing multiple calls to the DAO to retrieve
the data (also forcing multiple transactions). What are the reasons behind
calling size before iterator?


  -
  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: DataView size() iterator() call order issue

2008-03-21 Thread Igor Vaynberg
yes you can technically mangle it into a single query and get a single
result set back, but where is your savings? the database is still
doing two operations...

not to mention once you include any sort of filtering you have to
repeat your where clause in both the main select and the subselect...

-igor


On Fri, Mar 21, 2008 at 1:23 PM, Dan Kaplan [EMAIL PROTECTED] wrote:
 FYI, in oracle you can use Analytical Functions to do this in one query.  In
  other db's you can do this:
  select username, x.* from customlist, (select count(*) from customlist) as
  x;



  -Original Message-
  From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
  Sent: Friday, March 21, 2008 11:44 AM
  To: users@wicket.apache.org
  Subject: Re: DataView size() iterator() call order issue

  knowing the size and the window together seems like a ui requirement,
  it is a bit strange to me that you have it inside a dao which should
  cater to business logic. eg, as far as i know there is no single db
  operation that will produce both, so you are still doing two calls
  inside the dao.

  also transaction management should be handled outside the dao, daos
  are too fine an object to implement transaction management for.

  anywho, just nitpicking :)

  size() is called first for a lot of reasons, namely even knowing if
  there are any rows to retrieve before a much heavier iterator() is
  called. some clients want to hide a repeater if there are no items
  visible, and so size() might get called from inside isvisible() as
  well.

  idataprovider is quiet old and we havent had many complaints about its
  design so far. if all you are using is the dataview it should be
  pretty simple for you to roll your own dataview, if you look at
  dataview all it does is implement idataprovider handling to feed the
  pageable view. however, if you do you will also lose datatable as well
  :|

  if you got suggestions on how to improve it im all ears.

  -igor


  On Fri, Mar 21, 2008 at 11:24 AM, Hoover, William [EMAIL PROTECTED]
  wrote:
   When using DataView/IDataProvider size() is called before iterator(int
  first, int count) causing calls to DAOs to be duplicated. Our current
  framework that is internally using Hibernate allows one call to be made to a
  DAO that returns both the total result size and the actual records (based
  off first/count). The problem is that the first and count are unknown until
  the iterator method is called- forcing multiple calls to the DAO to retrieve
  the data (also forcing multiple transactions). What are the reasons behind
  calling size before iterator?
  
  
-
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: DataView size() iterator() call order issue

2008-03-21 Thread Dan Kaplan
Well, there could be savings in the amount of code.  You also could save by
reducing the transactions to 1.  I'm not saying DataView should work with
this, I'm just saying that's a way to get the count and the list
simultaneously.

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 21, 2008 1:27 PM
To: users@wicket.apache.org
Subject: Re: DataView size() iterator() call order issue

yes you can technically mangle it into a single query and get a single
result set back, but where is your savings? the database is still
doing two operations...

not to mention once you include any sort of filtering you have to
repeat your where clause in both the main select and the subselect...

-igor


On Fri, Mar 21, 2008 at 1:23 PM, Dan Kaplan [EMAIL PROTECTED] wrote:
 FYI, in oracle you can use Analytical Functions to do this in one query.
In
  other db's you can do this:
  select username, x.* from customlist, (select count(*) from customlist)
as
  x;



  -Original Message-
  From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
  Sent: Friday, March 21, 2008 11:44 AM
  To: users@wicket.apache.org
  Subject: Re: DataView size() iterator() call order issue

  knowing the size and the window together seems like a ui requirement,
  it is a bit strange to me that you have it inside a dao which should
  cater to business logic. eg, as far as i know there is no single db
  operation that will produce both, so you are still doing two calls
  inside the dao.

  also transaction management should be handled outside the dao, daos
  are too fine an object to implement transaction management for.

  anywho, just nitpicking :)

  size() is called first for a lot of reasons, namely even knowing if
  there are any rows to retrieve before a much heavier iterator() is
  called. some clients want to hide a repeater if there are no items
  visible, and so size() might get called from inside isvisible() as
  well.

  idataprovider is quiet old and we havent had many complaints about its
  design so far. if all you are using is the dataview it should be
  pretty simple for you to roll your own dataview, if you look at
  dataview all it does is implement idataprovider handling to feed the
  pageable view. however, if you do you will also lose datatable as well
  :|

  if you got suggestions on how to improve it im all ears.

  -igor


  On Fri, Mar 21, 2008 at 11:24 AM, Hoover, William [EMAIL PROTECTED]
  wrote:
   When using DataView/IDataProvider size() is called before iterator(int
  first, int count) causing calls to DAOs to be duplicated. Our current
  framework that is internally using Hibernate allows one call to be made
to a
  DAO that returns both the total result size and the actual records (based
  off first/count). The problem is that the first and count are unknown
until
  the iterator method is called- forcing multiple calls to the DAO to
retrieve
  the data (also forcing multiple transactions). What are the reasons
behind
  calling size before iterator?
  
  
-
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]


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



Re: DataView size() iterator() call order issue

2008-03-21 Thread Igor Vaynberg
On Fri, Mar 21, 2008 at 1:32 PM, Dan Kaplan [EMAIL PROTECTED] wrote:
 Well, there could be savings in the amount of code.

i dont buy this, at the very minimum you will have a helper that does
counts no matter how you are accessing the db

 You also could save by reducing the transactions to 1.

i dont buy this either. it doesnt scale. if you have two dataviews you
probably want those two requests to be executed in the same
transaction also. so transaction boundaries need to be managed on a
higher level.

 I'm not saying DataView should work with
  this, I'm just saying that's a way to get the count and the list
  simultaneously.

i get it. im just trying to rationalize why and how the design choice
of idataprovider was made.

-igor




  -Original Message-
  From: Igor Vaynberg [mailto:[EMAIL PROTECTED]


 Sent: Friday, March 21, 2008 1:27 PM
  To: users@wicket.apache.org
  Subject: Re: DataView size() iterator() call order issue

  yes you can technically mangle it into a single query and get a single
  result set back, but where is your savings? the database is still
  doing two operations...

  not to mention once you include any sort of filtering you have to
  repeat your where clause in both the main select and the subselect...

  -igor


  On Fri, Mar 21, 2008 at 1:23 PM, Dan Kaplan [EMAIL PROTECTED] wrote:
   FYI, in oracle you can use Analytical Functions to do this in one query.
  In
other db's you can do this:
select username, x.* from customlist, (select count(*) from customlist)
  as
x;
  
  
  
-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
Sent: Friday, March 21, 2008 11:44 AM
To: users@wicket.apache.org
Subject: Re: DataView size() iterator() call order issue
  
knowing the size and the window together seems like a ui requirement,
it is a bit strange to me that you have it inside a dao which should
cater to business logic. eg, as far as i know there is no single db
operation that will produce both, so you are still doing two calls
inside the dao.
  
also transaction management should be handled outside the dao, daos
are too fine an object to implement transaction management for.
  
anywho, just nitpicking :)
  
size() is called first for a lot of reasons, namely even knowing if
there are any rows to retrieve before a much heavier iterator() is
called. some clients want to hide a repeater if there are no items
visible, and so size() might get called from inside isvisible() as
well.
  
idataprovider is quiet old and we havent had many complaints about its
design so far. if all you are using is the dataview it should be
pretty simple for you to roll your own dataview, if you look at
dataview all it does is implement idataprovider handling to feed the
pageable view. however, if you do you will also lose datatable as well
:|
  
if you got suggestions on how to improve it im all ears.
  
-igor
  
  
On Fri, Mar 21, 2008 at 11:24 AM, Hoover, William [EMAIL PROTECTED]
wrote:
 When using DataView/IDataProvider size() is called before iterator(int
first, int count) causing calls to DAOs to be duplicated. Our current
framework that is internally using Hibernate allows one call to be made
  to a
DAO that returns both the total result size and the actual records (based
off first/count). The problem is that the first and count are unknown
  until
the iterator method is called- forcing multiple calls to the DAO to
  retrieve
the data (also forcing multiple transactions). What are the reasons
  behind
calling size before iterator?


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


  -
  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: No AjaxRadioChoice?

2008-03-21 Thread Timo Rantalaiho
On Thu, 20 Mar 2008, Michael Mehrle wrote:
 How come there is no AjaxRadioChoice? I would like to have my form
 updated cleared when one of my radio buttons is selected. What's the
 best way of doing this?

Add a suitable AjaxBehavior to it --- if you succeed, as it
seems to be difficult based on the earlier part of this 
thread :) AjaxFormChoiceComponentUpdatingBehavior and a Jira
issue concerning it was mentioned by Igor.

  
http://www.nabble.com/Problem-with-using-RadioGorup-and-AjaxEventBehavior-in-a-FormComponentPanel-td16165403.html

Ajax* versions of components are mostly just convenience 
classes that add a suitable Ajax behavior to the component.
When you get this working well with radio buttons, feel free
to submit it in a patch :)
  
Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

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



RE: No AjaxRadioChoice?

2008-03-21 Thread Michael Mehrle
Yes Timo - I saw that thread, which is why I was asking. I did in the
end add my own JS behavior per Igor's suggestion, which right now works
just fine :-)

Thanks!

Michael

-Original Message-
From: Timo Rantalaiho [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 21, 2008 1:56 PM
To: users@wicket.apache.org
Subject: Re: No AjaxRadioChoice?

On Thu, 20 Mar 2008, Michael Mehrle wrote:
 How come there is no AjaxRadioChoice? I would like to have my form
 updated cleared when one of my radio buttons is selected. What's the
 best way of doing this?

Add a suitable AjaxBehavior to it --- if you succeed, as it
seems to be difficult based on the earlier part of this 
thread :) AjaxFormChoiceComponentUpdatingBehavior and a Jira
issue concerning it was mentioned by Igor.

 
http://www.nabble.com/Problem-with-using-RadioGorup-and-AjaxEventBehavio
r-in-a-FormComponentPanel-td16165403.html

Ajax* versions of components are mostly just convenience 
classes that add a suitable Ajax behavior to the component.
When you get this working well with radio buttons, feel free
to submit it in a patch :)
  
Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

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



Message Bundles - 1.3.2

2008-03-21 Thread Jeremy Thomerson
I am finally migrating my largest app from 1.2.6 to 1.3.  Most of my other
applications were built from the ground up with 1.3.  Overall, it has been a
fairly painless transition.  I guess it took about three hours to do all of
the conversion to where there were no more compiler errors (code base is
about 50k LoC java/html).  Most of the biggest problems were from when I
first started with Wicket and had done some stuff weird ways, and they broke
in 1.3.  Good - I get to clean up some.

Anyway, I'm hoping you can help with a problem I'm trying to fix.  Normally,
I scramble through the code to find what's going on, but the last time I did
that with resource bundles, I spent hours tracking it all down, and I'm
hoping someone knows off the top of their head.

In WebApp.properties, I have this:
subject.RequiredValidator=Please fill in the Title field of this article.

That always worked before - everywhere in my application, if I had a
TextField with setRequired(true), it would use this message.  Now, it
doesn't work, and falls back to Wicket's default message.

Second (similar) problem.
I have WebPage.properties (my base page that all pages inherit from).
head.title=TexasHuntFish.com

Then in particular pages, I overrode that string.  This always worked
before.  Corresponding HTML is:
head
title wicket:id=pageTitleTexasHuntFish.com/title
/head

Now, I get an error that it can't find head.title.  I had to put that in
WebApp.properties.

So, in one problem, it's not finding something that it should in
WebApp.properties.  In the other, that's the only place it will find it.

Any ideas?

Thanks,
Jeremy Thomerson


Re: Message Bundles - 1.3.2

2008-03-21 Thread Igor Vaynberg
On Fri, Mar 21, 2008 at 5:49 PM, Jeremy Thomerson
[EMAIL PROTECTED] wrote:

  In WebApp.properties, I have this:
  subject.RequiredValidator=Please fill in the Title field of this article.

can you try subject.Required=Please...

-igor

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



Re: How to get error message register in IModel.getObject() to show up in FeedbackPanel?

2008-03-21 Thread Matthew Young
Thank you Igor for showing me this.  Wow, so much new stuff for me in
there.  I'll dig in and try to understand it all.

On Thu, Mar 20, 2008 at 3:54 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 in a real app people will be invested in fixing the issue and not
 having someone else do their homework for them :)

 like i said, right now we consider errors in models unrecoverable - eg
 you go to an error page. seemed to satisfy everyone for 3? years that
 wicket has been out.

 that said, you can get a little creative and come up with something.
 stuff below should work with regular requests, havent tested it with
 ajax yet.


 -igor

public abstract static class ErrorAwareModelAdapter
implements
IModel,
IComponentAssignedModel,
IWrapModel
{
private boolean error = false;
private final IModel delegate;
private Component component;

public ErrorAwareModelAdapter(IModel delegate)
{

this.delegate = delegate;
}

/** gets value that should be returned from
 getobject() if exception is thrown */
protected Object getErrorResult()
{
return null;
}

/** handles the error - such as
 component.getsession().error(e.getmessage()); */
protected void handleError(RuntimeException e)
{

}

@Override
public Object getObject()
{
if (error)
{
error = false;
return getErrorResult();
}
else
{
try
{
return delegate.getObject();
}
catch (RuntimeException e)
{
error = true;
handleError(e);
component.getPage().detach();
throw new
 AbstractRestartResponseException()
{
};
}
}
}


@Override
public void setObject(Object object)
{
delegate.setObject(object);
}


@Override
public void detach()
{
delegate.detach();
}


@Override
public IWrapModel wrapOnAssignment(Component component)
{
this.component = component;
return this;
}


@Override
public IModel getWrappedModel()
{
return delegate;
 }

}


 On Thu, Mar 20, 2008 at 2:48 PM, Matthew Young [EMAIL PROTECTED] wrote:
  Then what? In real app, the model is calling some flakey remote service
 that
   can fail.  Is there no way to show error message on the same page?
  That the
   only thing is put up a different error page?
 
 
 
   On Thu, Mar 20, 2008 at 1:29 PM, Matej Knopp [EMAIL PROTECTED]
 wrote:
 
This doesn't work because the model.getObject method is only called
when the value is pulled out of the model, which is on label render.
Even if you refresh it on ajax request, it might be too late because
the feedback panel retrieves the feedback messages in onBeforeRender
(before actual rendering).
   
-Matej
   
On Wed, Mar 19, 2008 at 10:04 PM, Matthew Young [EMAIL PROTECTED]
 wrote:
  I register an error to the page in the model but the feedback
 message
  doesn't show in FeedbackPanel.  Only the error message register in
  onSubmit() event handler shows.  Please have a look.  Thanks!

  HomePage.html:

  html
  head/head
 span wicket:id=messagemessage will be here/span
 form wicket:id=form
 input type=text wicket:id=word/
 input type=submit value=Enter
 wicket:id=submitButton/
 /form
 span wicket:id=feedbackFEEDBACK/span
  /html


  HomePage.java

  import ...

  public class HomePage extends WebPage {private static final
 long
  serialVersionUID = 1L;

 private String word;

 public HomePage(final PageParameters parameters) {

 add(new
  

Re: Message Bundles - 1.3.2

2008-03-21 Thread Jeremy Thomerson
That was so terribly easy we might want to add it here:
http://cwiki.apache.org/WICKET/migrate-13.html

I also figured out the other problem by doing new
ResourceModel(head.title).wrapOnAssignment(this)
where as before I just had new ResourceModel(head.title).  Is that
correct?  Should I need to do that?

Thanks Igor!
Jeremy Thomerson

On Fri, Mar 21, 2008 at 7:56 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 On Fri, Mar 21, 2008 at 5:49 PM, Jeremy Thomerson
 [EMAIL PROTECTED] wrote:
 
   In WebApp.properties, I have this:
   subject.RequiredValidator=Please fill in the Title field of this
 article.

 can you try subject.Required=Please...

 -igor

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