RE: WebMarkupContainer with AjaxTabbedPanel - duplicating panel data

2008-11-11 Thread Yazeed Isaacs
Hi Igor

Here is my code:

final WebMarkupContainer terminalsContainer = new
WebMarkupContainer(terminalsContainer);

terminalsContainer.setOutputMarkupId(true);
terminalsContainer.add(new ListView(terminalDetails, new ArrayList())
{
@Override
protected void populateItem(ListItem item) {
}
});

add(terminalsContainer);


AjaxLink link = new AjaxLink(terminalIdLink) {

@Override
public void onClick(AjaxRequestTarget target) {

ArrayList tabs = new ArrayList();

// details tab
tabs.add(new AbstractTab(new Model(Details)) {

public Panel getPanel(String panelId) {
return new
TerminalMonitorDetailsTabPanel(panelId, terminal.getId());
}

});

terminalsContainer.replace(new
AjaxTabbedPanel(terminalDetails, tabs));

target.addComponent(terminalsContainer);
}

};

add(link);





-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: 10 November 2008 06:11 PM
To: users@wicket.apache.org
Subject: Re: WebMarkupContainer with AjaxTabbedPanel - duplicating panel
data

could you paste your cod einto a pastebin that will show it properly
formatted. i cant read it in your email. also make sure you do not
have any divs inside spans, that is invalid html and causes browsers
to do funny things.

-igor

On Mon, Nov 10, 2008 at 4:12 AM, Yazeed Isaacs
[EMAIL PROTECTED] wrote:
 Hi



 I have a WebMarkupContainer with a AjaxTabbedPanel. When I click on
the
 tab it duplicates the panel data.



 What  am I doing wrong?



 Here is my code:



 final WebMarkupContainer terminalsContainer = new WebMarkupContainer(

terminalsContainer);



terminalsContainer.setOutputMarkupId(true);

terminalsContainer

.add(new ListView(terminalDetails, new
 ArrayList()) {

  @Override

  protected void populateItem(ListItem
item)
 {

  }

});



add(terminalsContainer);



..



 AjaxLink link = new AjaxLink(terminalIdLink) {

  @Override

 public void onClick(AjaxRequestTarget target) {

 ArrayList tabs = new ArrayList();



 tabs.add(new AbstractTab(new Model(Details)) {



 public Panel getPanel(String panelId) {

return new TerminalMonitorDetailsTabPanel(

  panelId, terminal.getId());

  }

 });



 terminalsContainer.replace(new AjaxTabbedPanel(terminalDetails,
 tabs));

 target.addComponent(terminalsContainer);

 }

}







 When I click on the Details tab then the data returned by the panel
 TerminalMonitorDetailsTabPanel is duplicated below each time.









 Yazeed Isaacs - Java Developer

 [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: WebMarkupContainer with AjaxTabbedPanel - duplicating panel data

2008-11-11 Thread Yazeed Isaacs
Hi Igor

Forgot it. I made a really foolish mistake. I must have been in a hurry
and that I left out the tr and td markup.

I had the following:
table
div wicket:id=tabs class=tabpanel
/div
/table

When I should have had:
table
tr
td
div wicket:id=tabs class=tabpanel
/div
/td
/tr
/table

It works now :D


Could you please help me out with following:
I am still having a problem with the paging  sorting of the
AjaxFallbackDefaultDataTable when it is used within a LazyLoadPanel ie.
LazyLoadPanel.getLazyLoadComponent() returns the
AjaxFallbackDefaultDataTable. Refer to AjaxFallbackDefaultDataTable
with ajax lazy loading - sorting and paging throws an
IllegalStateException

Regards,
Yazeed Isaacs - Java Developer
[EMAIL PROTECTED]



-Original Message-
From: Yazeed Isaacs [mailto:[EMAIL PROTECTED] 
Sent: 11 November 2008 10:05 AM
To: users@wicket.apache.org
Subject: RE: WebMarkupContainer with AjaxTabbedPanel - duplicating panel
data

Hi Igor

Here is my code:

final WebMarkupContainer terminalsContainer = new
WebMarkupContainer(terminalsContainer);

terminalsContainer.setOutputMarkupId(true);
terminalsContainer.add(new ListView(terminalDetails, new ArrayList())
{
@Override
protected void populateItem(ListItem item) {
}
});

add(terminalsContainer);


AjaxLink link = new AjaxLink(terminalIdLink) {

@Override
public void onClick(AjaxRequestTarget target) {

ArrayList tabs = new ArrayList();

// details tab
tabs.add(new AbstractTab(new Model(Details)) {

public Panel getPanel(String panelId) {
return new
TerminalMonitorDetailsTabPanel(panelId, terminal.getId());
}

});

terminalsContainer.replace(new
AjaxTabbedPanel(terminalDetails, tabs));

target.addComponent(terminalsContainer);
}

};

add(link);





-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: 10 November 2008 06:11 PM
To: users@wicket.apache.org
Subject: Re: WebMarkupContainer with AjaxTabbedPanel - duplicating panel
data

could you paste your cod einto a pastebin that will show it properly
formatted. i cant read it in your email. also make sure you do not
have any divs inside spans, that is invalid html and causes browsers
to do funny things.

-igor

On Mon, Nov 10, 2008 at 4:12 AM, Yazeed Isaacs
[EMAIL PROTECTED] wrote:
 Hi



 I have a WebMarkupContainer with a AjaxTabbedPanel. When I click on
the
 tab it duplicates the panel data.



 What  am I doing wrong?



 Here is my code:



 final WebMarkupContainer terminalsContainer = new WebMarkupContainer(

terminalsContainer);



terminalsContainer.setOutputMarkupId(true);

terminalsContainer

.add(new ListView(terminalDetails, new
 ArrayList()) {

  @Override

  protected void populateItem(ListItem
item)
 {

  }

});



add(terminalsContainer);



..



 AjaxLink link = new AjaxLink(terminalIdLink) {

  @Override

 public void onClick(AjaxRequestTarget target) {

 ArrayList tabs = new ArrayList();



 tabs.add(new AbstractTab(new Model(Details)) {



 public Panel getPanel(String panelId) {

return new TerminalMonitorDetailsTabPanel(

  panelId, terminal.getId());

  }

 });



 terminalsContainer.replace(new AjaxTabbedPanel(terminalDetails,
 tabs));

 target.addComponent(terminalsContainer);

 }

}







 When I click on the Details tab then the data returned by the panel
 TerminalMonitorDetailsTabPanel is duplicated below each time.









 Yazeed Isaacs - Java Developer

 [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: Re: AutoCompleteTextField and wicket 1.3.5

2008-11-11 Thread rzsolt

I have the same problem using IE6. I get an 'Error on page' message when I
press the first key in my AutoCompleteTextField type field. The complete IE6
error massage as:
Line: 288
Char: 9
Error: Type mismatch

Inspecting the recent changes in wicket-autocomplete.js (1.3.4 - 1.3.5), I
found that there was a change around that line:

in 1.3.4:
container.style.zIndex=(Number(index)!=Number.NaN?Number(index)+1:index);
container.style.left=position[0]+'px'
container.style.top=(input.offsetHeight+position[1])+'px';

in 1.3.5:
container.style.zIndex=(!isNaN(Number(index))?Number(index)+1:index);
container.style.left=position[0]+'px'
container.style.top=(input.offsetHeight+position[1])+'px';

As you can see, there is no semicolon in the end of the second line. I think
putting a semicolon there solves the problem for IE.
-- 
View this message in context: 
http://www.nabble.com/Re%3A-Re%3A-AutoCompleteTextField-and-wicket-1.3.5-tp20423114p20435361.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: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting and paging throws an IllegalStateException

2008-11-11 Thread Yazeed Isaacs
Hi Igor

I am still having a problem with the paging  sorting of the
AjaxFallbackDefaultDataTable when it is used within a LazyLoadPanel ie.
LazyLoadPanel.getLazyLoadComponent() returns the
AjaxFallbackDefaultDataTable.

The AjaxFallbackDefaultDataTable loads correctly within the
LazyLoadPanel, but when I sort a column or navigate to the next page,
the IllegalStateException is thrown and the error message is: Ajax
render cannot be called on component that has setRenderBodyOnly enabled
- Component id: content.

lazyloadpanel:content.AjaxFallbackDefaultDataTable

Please help.

Yazeed Isaacs - Java Developer
[EMAIL PROTECTED]



-Original Message-
From: Yazeed Isaacs [mailto:[EMAIL PROTECTED] 
Sent: 10 November 2008 03:04 PM
To: users@wicket.apache.org
Subject: RE: AjaxFallbackDefaultDataTable with ajax lazy loading -
sorting and paging throws an IllegalStateException

I understand that the markupid needs to be there in order for ajax to
update the component.

The component that it complains about is called content which is the
inner content of the AjaxLazyLoadPanel.

I have set the ajaxlazyloadpanel to setRenderBodyOnly(false) and
setOutputMarkupId(true) and I did the same for the
AjaxFallbackDefaultDataTable, but I still get the same error.

This is my component layout:

Form  - AjaxButton
- AjaxLazyLoadPanel returns AjaxFallbackDefaultDataTable


Component id = content, page =
za.co.transactionjunction.transpector.pages.TransactionQueryPage, path =
8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable


Any ideas?

Yazeed Isaacs - Java Developer
[EMAIL PROTECTED]



-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:[EMAIL PROTECTED] 
Sent: 06 October 2008 10:01 AM
To: users@wicket.apache.org
Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
sorting and paging throws an IllegalStateException

The problem is, as Igor pointed, you cannot re-render a component via
AJAX
if it has set setRenderBodyOnly(true)... Why?
div wicket:id=testAjax
  pContent.../p
/div

will be renderend as

pContent.../p

instead of

div id=someid
  pContent.../p
/div

So, there is no way wicket AJAX js can replace the div with something
else... Additionally you have to set setOutputMarkupId(true) on the
component you want to replace..

Ernesto

On Mon, Oct 6, 2008 at 9:41 AM, Yazeed Isaacs 
[EMAIL PROTECTED] wrote:

 Hi Igor

 Here is the java code:

 add(new AjaxButton(ajaxSubmitButton, this) {

protected void onSubmit(AjaxRequestTarget target, Form form) {

AjaxLazyLoadPanel transactions = new AjaxLazyLoadPanel(
transactions) {

private static final long serialVersionUID =
1L;

@Override
public Component getLazyLoadComponent(String
id)
 {

TransactionQuery transactionQuery = new
 TransactionQuery();


 transactionQuery.setCardNumber(cardNumberField
.getInput());

 transactionQuery.setDateFrom(dateFromField
.getInput());

 transactionQuery.setDateTo(dateToField.getInput());

 transactionQuery.setStoreId(storeIdsDropDownChoice
.getInput());
transactionQuery

 .setTerminalId(terminalIdsDropDownChoice

 .getInput());
int transactionNumber = 0;
if (transNumberField.getInput() !=
null)
 {
if
 ((transNumberField.getInput().length()  0))
transactionNumber =
 Integer

 .parseInt(transNumberField

 .getInput());
}
transactionQuery

 .setTransactionNumber(transactionNumber);



AjaxFallbackDefaultDataTable results =
 new AjaxFallbackDefaultDataTable(
id,
columns,
new
 SortableTransactionQueryResultsDataProvider(

 transactionQuery), 10);

//
transactions.setOutputMarkupId(true);

results.setRenderBodyOnly(false);

return results;
}

};

transactions.setRenderBodyOnly(false);

form.replace(transactions);

target.addComponent(transactions);
}

 });



 HTML code:

 table cellpadding=2 cellspacing=0 width=521
 wicket:id=transactions

 /table


 I have tried playing around with the way I've implemented this, but I
 keep on getting the same exception (java.lang.IllegalStateException)
 when I sort a column or navigate to a page.

 Let me 

Re: Size of session cache

2008-11-11 Thread Johan Compagner
which size exactly are you talking about?


On Mon, Nov 10, 2008 at 11:03 PM, David R Robison 
[EMAIL PROTECTED] wrote:

 Is there a convenient way to tell the size of user's session cache? David

 --

 David R Robison
 Open Roads Consulting, Inc.
 103 Watson Road, Chesapeake, VA 23320
 phone: (757) 546-3401
 e-mail: [EMAIL PROTECTED]
 web: http://openroadsconsulting.com
 blog: http://therobe.blogspot.com
 book: http://www.xulonpress.com/book_detail.php?id=2579

 This e-mail communication (including any attachments) may contain
 confidential and/or privileged material intended solely for the individual
 or entity to which it is addressed.  If you are not the intended recipient,
 you should immediately stop reading this message and delete it from all
 computers that it resides on. Any unauthorized reading, distribution,
 copying or other use of this communication (or its attachments) is strictly
 prohibited.  If you have received this communication in error, please notify
 us immediately.







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




Adding a header contributor raise an error in logs

2008-11-11 Thread eyalbenamram

Hi,
I get a message:
http-8095-Processor20 ERROR html.WebPage - You probably forgot to add a
body or header tag to your markup since no Header Container was 
found but components where found which want to write to the head section.
meta http-equiv=refresh content=10/

but my markup already contains head and body tags.

here is the java code:
add(new StringHeaderContributor(meta http-equiv=\refresh\ content=\ +
+ refreshRate + \/));

HTML code:

?xml version=1.0 encoding=UTF-8?
!DOCTYPE html PUBLIC -//WAPFORUM//DTD XHTML Mobile 1.0//EN
http://www.wapforum.org/DTD/xhtml-mobile10.dtd;
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en
  xmlns:wicket=http://wicket.apache.org/; wicket:id=htmlTag 
dir=ltr  
  head
meta http-equiv=Cache-Control content=no-cache/

title wicket:id=titleOwn Community/title
style type=text/css
body {background-color: #FF; font-family:verdana;}
.link{  font-weight: bold; white-space: nowrap;}
.center{ text-align: center;}
.footer{background:rgb(204,236,255); 
border-top: blue solid 3px; 
text-align: center;
width:100%;
line-height: 120%;
margin-top: 5px; 
}
.header {background:#FF; 
border-bottom: rgb(51,102,204) solid 3px; 
width:100%;
line-height: 200%;
margin-bottom: 5px; 
text-align: center;
}
.navigationLinks { 
background:rgb(204,236,255); 
text-align: center;
height:20px;
margin-top: 5px; 
}
.bottom {
/*position:fixed;*/
/*bottom:20%;*/
width:100%;
}
.contacts {
margin-top: 5px; 
}
/style
  /head
  
  body wicket:id=body...


-- 
View this message in context: 
http://www.nabble.com/Adding-a-header-contributor-raise-an-error-in-logs-tp20436118p20436118.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: internationalising error messages

2008-11-11 Thread Steve Swinsburg

Hi Jurrie,

Interesting. The property was in my main Application properties file,  
not in the properties for the class that threw this error (lets say  
TestPage.java). I'm not too keen on having multiple properties files  
for lots of different Classes so I keep them all in one spot, I was  
under the understanding it was meant to cascade up the tree? Does  
Component's getString() method not cascade for properties?


If they are both just as localisable, I'm happy ;)


cheers,
Steve






On 11 Nov 2008, at 14:12, Jurrie Overgoor wrote:


Steve Swinsburg wrote:
That throws a java.util.MissingResourceException: Unable to find  
resource: error.empty.file.uploaded for component: .


Is there a reason why StringResourceModel is not preferred. Its  
just as localisable as the other method right?


I'm not saying that StringResourceModel is less preferred. They are  
both just as localisable. (Perhaps under the hood both methods boil  
down to the same thing?)


I'm just saying that I mostly see examples that use Component's  
getString() method :)


Why the MissingResourceException is thrown is a little unclear to  
me. Are you sure that the resource is in the correct file?  
getString() should load the string from the  
corresponding .properties file. So, if the code was in  
HelloWorld.java, then HelloWorld.properties should contain a line  
like error.empty.file.uploaded = You have uploaded an empty file.


--
With kind regards,
Jurrie Overgoor
2go-mobile b.v.


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




smime.p7s
Description: S/MIME cryptographic signature


Re: IDataProvider Implementation.

2008-11-11 Thread Jeremy Thomerson
In my apps, I bring them all in whenever the first call to iterator or size
is done, and cache them until detach.  It's a very reasonable pattern.  Then
in the model method, I basically do new Model(object)


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


On Tue, Nov 11, 2008 at 8:03 AM, Graeme Knight [EMAIL PROTECTED] wrote:


 Hi.

 From the examples I've seen the IDataProvider implementation of the
 iterator
 method brings back (for example) a list of keys from the database.

 The model method uses something like a LoadableDetachableModel to populate
 a
 model for use by the consumer using the list of keys previously retrieved.

 This seems like a lot of database hits to me. Is this simply because of the
 serialization/model mechanism?

 It seems to me that the iterator could/should bring back the data in one
 hit
 and then after use be detached. Is this common?

 Many thanks, Graeme.
 --
 View this message in context:
 http://www.nabble.com/IDataProvider-Implementation.-tp20440141p20440141.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: IDataProvider Implementation.

2008-11-11 Thread Erik van Oosten
Not a good idea for large objects. A few days back I improved load time 
of a page from more then 40 sec to about 5 sec by replacing new 
Model(object) with a proper LoadableDetachableModel.


Nevertheless, there is no reason to let the LoadableDetachableModel get 
the object if you already have it, just pass the object to the constructor!


E.g. see first ctor below.

public class LoadableMemberModel
   extends LoadableDetachableModelMember {

   @SpringBean
   private MemberService memberService;

   private long memberId;

   //
   // Constructor that has object has direct parameter
   //
   public LoadableMemberModel(Member member) {
   super(member);
   this.memberId = member.getId();
   }
*
*public LoadableMemberModel(long memberId) {
   this.memberId = memberId;
   }

   protected Member load() {
   InjectorHolder.getInjector().inject(this);
   return memberService.getById(memberId);
   }
}



Regards,
   Erik.


Graeme Knight wrote:

Hey Jeremy,

Thanks for the heads up - actually that's what I ended up doing this
morning. Works like a charm!

Cheers, Graeme.


Jeremy Thomerson-5 wrote:
  

In my apps, I bring them all in whenever the first call to iterator or
size
is done, and cache them until detach.  It's a very reasonable pattern. 
Then

in the model method, I basically do new Model(object)


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


On Tue, Nov 11, 2008 at 8:03 AM, Graeme Knight [EMAIL PROTECTED]
wrote:



Hi.

From the examples I've seen the IDataProvider implementation of the
iterator
method brings back (for example) a list of keys from the database.

The model method uses something like a LoadableDetachableModel to
populate
a
model for use by the consumer using the list of keys previously
retrieved.

This seems like a lot of database hits to me. Is this simply because of
the
serialization/model mechanism?

It seems to me that the iterator could/should bring back the data in one
hit
and then after use be detached. Is this common?

Many thanks, Graeme.
--
View this message in context:
http://www.nabble.com/IDataProvider-Implementation.-tp20440141p20440141.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]


  



  



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


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



Re: Size of session cache

2008-11-11 Thread Johan Compagner
See:

/**
 * Creates a new [EMAIL PROTECTED] DiskPageStore} instance.
 *
 * @param maxSizePerPagemap
 *the maximum size of pagemap file (in bytes)
 * @param maxSizePerSession
 *the maximum size of session (in bytes)
 * @param fileChannelPoolCapacity
 *the maximum number of concurrently opened files (higher
number improves
 *performance under heavy load).
 *
 */
public DiskPageStore(int maxSizePerPagemap, int maxSizePerSession, int
fileChannelPoolCapacity)
{
this(getDefaultFileStoreFolder(), maxSizePerPagemap,
maxSizePerSession,
fileChannelPoolCapacity);
}


On Tue, Nov 11, 2008 at 2:37 PM, David R Robison 
[EMAIL PROTECTED] wrote:

 The size the session takes up on the disk. David


 Johan Compagner wrote:

 which size exactly are you talking about?


 On Mon, Nov 10, 2008 at 11:03 PM, David R Robison 
 [EMAIL PROTECTED] wrote:



 Is there a convenient way to tell the size of user's session cache? David

 --

 David R Robison
 Open Roads Consulting, Inc.
 103 Watson Road, Chesapeake, VA 23320
 phone: (757) 546-3401
 e-mail: [EMAIL PROTECTED]
 web: http://openroadsconsulting.com
 blog: http://therobe.blogspot.com
 book: http://www.xulonpress.com/book_detail.php?id=2579

 This e-mail communication (including any attachments) may contain
 confidential and/or privileged material intended solely for the
 individual
 or entity to which it is addressed.  If you are not the intended
 recipient,
 you should immediately stop reading this message and delete it from all
 computers that it resides on. Any unauthorized reading, distribution,
 copying or other use of this communication (or its attachments) is
 strictly
 prohibited.  If you have received this communication in error, please
 notify
 us immediately.







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








 --

 David R Robison
 Open Roads Consulting, Inc.
 103 Watson Road, Chesapeake, VA 23320
 phone: (757) 546-3401
 e-mail: [EMAIL PROTECTED]
 web: http://openroadsconsulting.com
 blog: http://therobe.blogspot.com
 book: http://www.xulonpress.com/book_detail.php?id=2579

 This e-mail communication (including any attachments) may contain
 confidential and/or privileged material intended solely for the individual
 or entity to which it is addressed.  If you are not the intended recipient,
 you should immediately stop reading this message and delete it from all
 computers that it resides on. Any unauthorized reading, distribution,
 copying or other use of this communication (or its attachments) is strictly
 prohibited.  If you have received this communication in error, please notify
 us immediately.







Re: IDataProvider Implementation.

2008-11-11 Thread Martijn Dashorst
That, and that typically your ORM (hibernate, etc) will put the object
in second level cache. The LDM should hit that cache most of the time
between requests.

Martijn

On Tue, Nov 11, 2008 at 3:58 PM, Erik van Oosten [EMAIL PROTECTED] wrote:
 Not a good idea for large objects. A few days back I improved load time of a
 page from more then 40 sec to about 5 sec by replacing new Model(object)
 with a proper LoadableDetachableModel.

 Nevertheless, there is no reason to let the LoadableDetachableModel get the
 object if you already have it, just pass the object to the constructor!

 E.g. see first ctor below.

 public class LoadableMemberModel
   extends LoadableDetachableModelMember {

   @SpringBean
   private MemberService memberService;

   private long memberId;

   //
   // Constructor that has object has direct parameter
   //
   public LoadableMemberModel(Member member) {
   super(member);
   this.memberId = member.getId();
   }
 *
 *public LoadableMemberModel(long memberId) {
   this.memberId = memberId;
   }

   protected Member load() {
   InjectorHolder.getInjector().inject(this);
   return memberService.getById(memberId);
   }
 }



 Regards,
   Erik.


 Graeme Knight wrote:

 Hey Jeremy,

 Thanks for the heads up - actually that's what I ended up doing this
 morning. Works like a charm!

 Cheers, Graeme.


 Jeremy Thomerson-5 wrote:


 In my apps, I bring them all in whenever the first call to iterator or
 size
 is done, and cache them until detach.  It's a very reasonable pattern.
 Then
 in the model method, I basically do new Model(object)


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


 On Tue, Nov 11, 2008 at 8:03 AM, Graeme Knight [EMAIL PROTECTED]
 wrote:



 Hi.

 From the examples I've seen the IDataProvider implementation of the
 iterator
 method brings back (for example) a list of keys from the database.

 The model method uses something like a LoadableDetachableModel to
 populate
 a
 model for use by the consumer using the list of keys previously
 retrieved.

 This seems like a lot of database hits to me. Is this simply because of
 the
 serialization/model mechanism?

 It seems to me that the iterator could/should bring back the data in one
 hit
 and then after use be detached. Is this common?

 Many thanks, Graeme.
 --
 View this message in context:

 http://www.nabble.com/IDataProvider-Implementation.-tp20440141p20440141.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]









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


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





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

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



Wicket IE7 Ajax problem

2008-11-11 Thread JohannesK

Hello

I am having the problem discussed here:
http://www.mail-archive.com/users@wicket.apache.org/msg02284.html

I see that in that thread and also in Jira several different solutions are
suggested to the problem but I don't think any of them made it to Wicket
1.3.5? Do you have any plans on implementing a fix for this issue? I've
tried adding the fix suggested by Lonnie there to wicket-ajax.js by hand but
that for some reason stops Ajax working altogether in IE or Firefox...

Any help on this issue would be greatly appreciated.
-- 
View this message in context: 
http://www.nabble.com/Wicket---IE7-Ajax-problem-tp20441746p20441746.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: wicket prepends unnecessary ../ before href/src html element attributes

2008-11-11 Thread Erik van Oosten

Anirban,

Your resources still start with xxweb. If you want them to be served 
by wicket replace it with xx/web or something like that. If you want 
them to be served by something else (context xxweb?) prepend a /.


Regards,
   Erik.


Alan Romaniusc wrote:

Could it be anything like this?
http://www.nabble.com/Wicket-1.4-m3,-wicket-auth-roles-and-Context-Path-td20249711.html

On Tue, Nov 11, 2008 at 9:51 AM, Anirban Basak [EMAIL PROTECTED] wrote:
  

(replacing proprietary names/texts with xx)



I'm running wicket web app with context 'xx'.



As long I'm mounting pages with mountBookmarkablePage(..) or other URL
encoding strategies (http://www.test-server.com/xx/web/page/partner) or
mentioning /xx/* as the filter pattern, everything is running fine. But I
was told not to append any word after the context
(http://www.test-server.com/xx/). I tried removing URL encoding strategies,
but wicket returning wrong relative urls by prepending unnecessary '../' to
the resource uris like:



link href=xxweb/css/styles.css rel=stylesheet type=text/css /

link rel=stylesheet href=xxweb/css/dhtmlwindow.css type=text/css /

script type=text/javascript src=xxweb/js/dhtmlwindow.js/script

script type=text/javascript src=xxweb/js/partnerpages.js/script



Wicket converting them into:



link href=../xxweb/css/styles.css rel=stylesheet type=text/css /

link rel=stylesheet href=../xxweb/css/dhtmlwindow.css type=text/css
/

script type=text/javascript src=../xxweb/js/dhtmlwindow.js/script

script type=text/javascript src=../xxweb/js/partnerpages.js/script



This makes the browser unable to fetch the resources as

../xxweb/css/styles.css ==
http://www.test-server.com/xxweb/css/styles.css;



Structure of the WAR

xx-snapshot.war

 |-- index.html (incase wicket not running)

 |-- xx-config.xml

 |-- WEB-INF

   |-- web.xml

   |-- lib

   |-- classes

 |-- xxweb

  |-- css

  |-- images

  |-- js





Web.xml

filter

   filter-namewicket.xx/filter-name

   filter-class

 org.apache.wicket.protocol.http.WicketFilter

   /filter-class

   init-param

 param-nameapplicationClassName/param-name

 param-valuecom.xx.xx.xxWebApplication/param-value

   /init-param

 /filter



 filter-mapping

   filter-namewicket.xx/filter-name

   url-pattern/*/url-pattern

   dispatcherREQUEST/dispatcher

   dispatcherINCLUDE/dispatcher

 /filter-mapping



Is this because of any wicket specific restriction or something else?



Anirban











  



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


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



Re: Overriding builtin error messages

2008-11-11 Thread Steve Swinsburg
Ah so is the form-id in the docs the wicket:id which is static in the  
HTML or is it the markup id of the form which is dynamic?  Does this  
then mean that in my Application properties I should put:


myForm.uploadTooLarge=No way dude, far too large!

What about including the actual size ( ie 2M) like the Form component  
does?




cheers,
Steve
4 (0) 1524 594870







On 11 Nov 2008, at 15:55, [EMAIL PROTECTED] wrote:


How dynamic is your form's id?

Shouldn't be static because of HTML reference?

On Nov 11, 2008 1:53pm, Steve Swinsburg  
[EMAIL PROTECTED] wrote:
I'd like to override the default form feedback messages (also so I  
can

localise them). ie

'Upload must be less than'

In Form.java I found this :
// Resource key should be .uploadTooLarge to
// override default message


But I'm still not sure how to override it in a Properties file if the

form-id is dynamic?



Any help much appreciated.


Steve















smime.p7s
Description: S/MIME cryptographic signature


Re: FallbackSubmitLink (yes it sounds crazy)

2008-11-11 Thread Igor Vaynberg
the naming is bad since in wicket fallback means it still does the
exact same thing albeit without ajax/js. i think if you want that kind
of behavior you will have to roll your own link, possibly extending
from abstractsubmitlink.

-igor

On Tue, Nov 11, 2008 at 9:14 AM, Ryan [EMAIL PROTECTED] wrote:
 Currently SubmitLink sets the to href='#', instead it would have a valid
 href (similar to a regular Link). The onclick would still submit the
 form but return false to prevent the href being followed in javascript
 browswers.

 Then the you have 1 of 2 cases:
 1) the browswer has javascript and runs the onclick handler, which
 returns false so the href is not followed. This is standard SubmitLink
 behavior.

 2) the browser does not support javascript, completely ignores the
 onclick handler and instead follows the href. This *does not* submit the
 form. This is standard Link behavior.

 The usecase for this is when you have a form that would be nice to
 submit, but its not required that it be submitted (such as pagination).
 I realize this is a very weird corner case. At this point the design
 calls for a lot of stuff that cannot be done without javascript so I am
 probably going to just use submitlink anyway.

 I only asked on the list to see if someone had done the work for something
 like this already.

 Thanks!
 -Ryan

 On Tue, Nov 11, 2008 at 08:52:50AM -0800, Igor Vaynberg exclaimed:

you cannot have a submitLINK and not have javascript. what would your
href be? links do not submit forms, only buttons do.

-igor

On Mon, Nov 10, 2008 at 2:03 PM, Ryan [EMAIL PROTECTED] wrote:
 I have a DataView component and each row has a CheckBox to select that
 row. I prefer not to have an ajax call on each selection by the user.
 The issue is that with the default PagingNavigator I lose which
 checkboxes were selected when the page is changed (naturally, because the
 form is not submitted).

 I can make a PagingNavigator that uses SubmitLink, but then I lose
 pagination for those without javascript (rare, I know).

 SubmitLink uses the onclick handler (despite what the javadoc says, see
 WICKET-1925), and its href is set to #. I was planning on making a
 FallbackSubmitLink with the same onclick as SubmitLink and the same href
 as a regular Link. I just need to make sure that the onclick always
 returns false so browsers with javascript will not follow the href.

 If such a component existed, users with javascript would be able to
 paginate without losing selections. Those without javascript can still
 paginate, but the checkboxes do not stay checked across pages.

 My questions are... has anyone built something like this already? Is there
 a better way?

 Thanks!
 Ryan

 -
 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: SessionHandling: WicketRuntimeException: There is no application attached to current thread http-8080-1

2008-11-11 Thread Igor Vaynberg
wouldnt say its a bug, looks like a method invocation is done on a
wicket-spring proxy outside a wicket request and it cannot find the
application when it tries to resolve the application context. those
proxies are not mean to be used outside wicket requests.

-igor

On Tue, Nov 11, 2008 at 7:11 AM, Martijn Dashorst
[EMAIL PROTECTED] wrote:
 I guess 
 org.apache.wicket.spring.SpringWebApplication$1.getSpringContext(SpringWebApplication.java:51)
 has a bug because it assumes it is always called inside the scope of a
 wicket request.

 Martijn

 On Tue, Nov 11, 2008 at 12:59 PM, Agent Mahone [EMAIL PROTECTED] wrote:
 Hi guys

 I´m just trying to execute some code after a session timeout occurs.
 I´m using spring / wicket / hibernate frameworks.
 Why do I get this error WicketRuntimeException: There is no application 
 attached to current thread http-8080-1?
 I´m not getting it...I appreciate any hints. Thanks in advance !!!

 Here is my application class:

 public class MyApplication extends SpringWebApplication implements 
 HttpSessionListener {

 protected void init() {
 //some code
 }

 public Session newSession(Request request, Response response) {
return new MySession(request);
 }

 public ClassIndexPage getHomePage() {
return IndexPage.class;
  }

 public Object getBean(Class? clazz, String beanName) {
return createSpringBeanProxy(clazz, beanName);
 }

  @Override
 public void sessionCreated(HttpSessionEvent arg0) {
//nothing sepcial
 }

 @Override
 public void sessionDestroyed(HttpSessionEvent arg0) {
  String sessionId = arg0.getSession().getId();

  IRegistrationLoginUseCase bean = 
 (ILoginService)getBean(ILoginService.class, loginService);

  bean.logout(sessionId);
 }

 Here is my error stack trace:

 org.apache.wicket.WicketRuntimeException: There is no application attached 
 to current thread http-8080-1
at org.apache.wicket.Application.get(Application.java:166)
at 
 org.apache.wicket.spring.SpringWebApplication$1.getSpringContext(SpringWebApplication.java:51)
at 
 org.apache.wicket.spring.SpringBeanLocator.getSpringContext(SpringBeanLocator.java:176)
at 
 org.apache.wicket.spring.SpringBeanLocator.locateProxyTarget(SpringBeanLocator.java:162)
at 
 org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:412)
at org.apache.wicket.proxy.$Proxy3.logout(Unknown Source)
at 
 com.studentcv.web.MyApplication.sessionDestroyed(StudentCVApplication.java:82)
at 
 org.apache.catalina.session.StandardSession.expire(StandardSession.java:702)
at 
 org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2287)
at org.apache.catalina.connector.Request.getSession(Request.java:2075)
at 
 org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
at 
 org.apache.wicket.protocol.http.AbstractHttpSessionStore.getSessionId(AbstractHttpSessionStore.java:180)
at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:303)
at 
 org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)






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

 -
 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: FallbackSubmitLink (yes it sounds crazy)

2008-11-11 Thread Ryan
Yes, the name I chose was misleading. There was a discussion back in
January about PagingNavigator.newPagingNavigationIncrementLink and
PagingNavigator.newPagingNavigationLink returning Link objects and not
AbstractLink objects. I could not find a JIRA issue for the enhancement
so I created one https://issues.apache.org/jira/browse/WICKET-1929 .

The original discussion is here:
http://markmail.org/message/dfgnis2rc7ysjlhj

Thanks again Igor, your always quick to respond and a huge help!
-Ryan

On Tue, Nov 11, 2008 at 09:26:44AM -0800, Igor Vaynberg exclaimed:

the naming is bad since in wicket fallback means it still does the
exact same thing albeit without ajax/js. i think if you want that kind
of behavior you will have to roll your own link, possibly extending
from abstractsubmitlink.

-igor

On Tue, Nov 11, 2008 at 9:14 AM, Ryan [EMAIL PROTECTED] wrote:
 Currently SubmitLink sets the to href='#', instead it would have a valid
 href (similar to a regular Link). The onclick would still submit the
 form but return false to prevent the href being followed in javascript
 browswers.

 Then the you have 1 of 2 cases:
 1) the browswer has javascript and runs the onclick handler, which
 returns false so the href is not followed. This is standard SubmitLink
 behavior.

 2) the browser does not support javascript, completely ignores the
 onclick handler and instead follows the href. This *does not* submit the
 form. This is standard Link behavior.

 The usecase for this is when you have a form that would be nice to
 submit, but its not required that it be submitted (such as pagination).
 I realize this is a very weird corner case. At this point the design
 calls for a lot of stuff that cannot be done without javascript so I am
 probably going to just use submitlink anyway.

 I only asked on the list to see if someone had done the work for something
 like this already.

 Thanks!
 -Ryan

 On Tue, Nov 11, 2008 at 08:52:50AM -0800, Igor Vaynberg exclaimed:

you cannot have a submitLINK and not have javascript. what would your
href be? links do not submit forms, only buttons do.

-igor

On Mon, Nov 10, 2008 at 2:03 PM, Ryan [EMAIL PROTECTED] wrote:
 I have a DataView component and each row has a CheckBox to select that
 row. I prefer not to have an ajax call on each selection by the user.
 The issue is that with the default PagingNavigator I lose which
 checkboxes were selected when the page is changed (naturally, because the
 form is not submitted).

 I can make a PagingNavigator that uses SubmitLink, but then I lose
 pagination for those without javascript (rare, I know).

 SubmitLink uses the onclick handler (despite what the javadoc says, see
 WICKET-1925), and its href is set to #. I was planning on making a
 FallbackSubmitLink with the same onclick as SubmitLink and the same href
 as a regular Link. I just need to make sure that the onclick always
 returns false so browsers with javascript will not follow the href.

 If such a component existed, users with javascript would be able to
 paginate without losing selections. Those without javascript can still
 paginate, but the checkboxes do not stay checked across pages.

 My questions are... has anyone built something like this already? Is there
 a better way?

 Thanks!
 Ryan

 -
 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: FallbackSubmitLink (yes it sounds crazy)

2008-11-11 Thread Igor Vaynberg
On Tue, Nov 11, 2008 at 9:53 AM, Ryan [EMAIL PROTECTED] wrote:
 Thanks again Igor, your always quick to respond and a huge help!

you are welcome

-igor

 -Ryan

 On Tue, Nov 11, 2008 at 09:26:44AM -0800, Igor Vaynberg exclaimed:

the naming is bad since in wicket fallback means it still does the
exact same thing albeit without ajax/js. i think if you want that kind
of behavior you will have to roll your own link, possibly extending
from abstractsubmitlink.

-igor

On Tue, Nov 11, 2008 at 9:14 AM, Ryan [EMAIL PROTECTED] wrote:
 Currently SubmitLink sets the to href='#', instead it would have a valid
 href (similar to a regular Link). The onclick would still submit the
 form but return false to prevent the href being followed in javascript
 browswers.

 Then the you have 1 of 2 cases:
 1) the browswer has javascript and runs the onclick handler, which
 returns false so the href is not followed. This is standard SubmitLink
 behavior.

 2) the browser does not support javascript, completely ignores the
 onclick handler and instead follows the href. This *does not* submit the
 form. This is standard Link behavior.

 The usecase for this is when you have a form that would be nice to
 submit, but its not required that it be submitted (such as pagination).
 I realize this is a very weird corner case. At this point the design
 calls for a lot of stuff that cannot be done without javascript so I am
 probably going to just use submitlink anyway.

 I only asked on the list to see if someone had done the work for something
 like this already.

 Thanks!
 -Ryan

 On Tue, Nov 11, 2008 at 08:52:50AM -0800, Igor Vaynberg exclaimed:

you cannot have a submitLINK and not have javascript. what would your
href be? links do not submit forms, only buttons do.

-igor

On Mon, Nov 10, 2008 at 2:03 PM, Ryan [EMAIL PROTECTED] wrote:
 I have a DataView component and each row has a CheckBox to select that
 row. I prefer not to have an ajax call on each selection by the user.
 The issue is that with the default PagingNavigator I lose which
 checkboxes were selected when the page is changed (naturally, because the
 form is not submitted).

 I can make a PagingNavigator that uses SubmitLink, but then I lose
 pagination for those without javascript (rare, I know).

 SubmitLink uses the onclick handler (despite what the javadoc says, see
 WICKET-1925), and its href is set to #. I was planning on making a
 FallbackSubmitLink with the same onclick as SubmitLink and the same href
 as a regular Link. I just need to make sure that the onclick always
 returns false so browsers with javascript will not follow the href.

 If such a component existed, users with javascript would be able to
 paginate without losing selections. Those without javascript can still
 paginate, but the checkboxes do not stay checked across pages.

 My questions are... has anyone built something like this already? Is there
 a better way?

 Thanks!
 Ryan

 -
 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: image link inside of table problem

2008-11-11 Thread Igor Vaynberg
what url is generated for that link (look in source). how is the url
different from what it is supposed to be? you need to learn how to
provide more *useful* information if you want help.

-igor

On Tue, Nov 11, 2008 at 8:09 AM, itayh [EMAIL PROTECTED] wrote:

 Hi,

 I am having a table with deactivate and delete link columns. In the delete
 column I want to have delete image, so pressing on the image will activate
 the delete function on the server.

 My html code:
 td a href=# wicket:id=active-link  span wicket:id=poll.active 
 /td
 td a href=# wicket:id=delete-link  img src=images/delete_icon.png
 / /td

 My java code:
 Link activeLink = new Link(active-link, item.getModel()) {
public void onClick() {
onActivePoll((Poll) getModelObject());
   }
 };
 activeLink.add(new Label(poll.active, activate));
 item.add(activeLink);

 Link deleteLink = new Link(delete-link, item.getModel()) {
public void onClick() {
onDeletePoll((Poll) getModelObject());
}
 };
 item.add(deleteLink);

 While the activate link work ok, the delete link which use the image is not
 appearing in the html and I see just the image with no link.
 Any idea what I am doing wrong?

 Thanks in advance,
  Itay

 --
 View this message in context: 
 http://www.nabble.com/image-link-inside-of-table-problem-tp20442713p20442713.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: How to use TextTemplateHeaderContributor.forCss method?

2008-11-11 Thread Eelco Hillenius
The substitution doesn't happen at all? Any errors you see in the logs?

Eelco

On Sun, Nov 9, 2008 at 2:16 PM, shetc [EMAIL PROTECTED] wrote:

 Hi All,

 I've had success using the TextTemplateHeaderContributor.forJavaScript
 method but can't get the equivalent TextTemplateHeaderContributor.forCss
 method to work. Here are some snippets:

 From CSS:
 .someClass {
background: #fff url('${brand}/someImage.jpg') 100% 100% no-repeat;
 }

 From Java:
 IModel skinModel = new AbstractReadOnlyModel() {
private static final long serialVersionUID = 1L;
@Override
public Map getObject() {
MapString, CharSequence variables =
new HashMapString, CharSequence(1);
variables.put(brand, getStyle());
return variables;
}
 };
 add(TextTemplateHeaderContributor.forCss(
MyApplication.class, skins/style.css, skinModel));

 The problem is that the substitution seems to fail and the someImage.jpg
 file is not drawn. Any ideas on what I am doing wrong?

 Thanks,
 Steve
 --
 View this message in context: 
 http://www.nabble.com/How-to-use-TextTemplateHeaderContributor.forCss-method--tp20411565p20411565.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: Issue with FileUpload.writeToTempFile()

2008-11-11 Thread Igor Vaynberg
please open a jira issue.

-igor

On Tue, Nov 11, 2008 at 1:59 AM, Lauri Piispanen - Conmio Ltd
[EMAIL PROTECTED] wrote:
 Hi all,

 I seem to be having a small portability glitch with
 FileUpload.writeToTempFile(). Looking at the source code it seems to be
 using item.getFieldName(), which on my page translates to
 filefields:1:upload. Windows doesn't really like colons, which gives me
 the following stacktrace:

 ...snip until root cause...

 Caused by: java.io.IOException: The parameter is incorrect
   at java.io.WinNTFileSystem.createFileExclusively(Native Method)
   at java.io.File.checkAndCreate(File.java:1704)
   at java.io.File.createTempFile(File.java:1793)
   at java.io.File.createTempFile(File.java:1830)
   at
 org.apache.wicket.markup.html.form.upload.FileUpload.writeToTempFile(FileUpload.java:189)

 ...snip...

 On mac  linux this works just fine. I know that more elegant way would be
 using the InputStream, but having a file is much more useful for reading
 image dimensions and file length etc. than juggling things in memory.

 Sincerely,

 --
 Lauri Piispanen
   Senior Product Architect
  Conmio Ltd


 -
 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: mounts and resources

2008-11-11 Thread Igor Vaynberg
wicket should be rewriting static urls for you so it should work
transparently. what usecase exactly does not work?

-igor

On Mon, Nov 10, 2008 at 5:22 PM, Craig Tataryn [EMAIL PROTECTED] wrote:
 If one were to mount a page like so:

 mount(new QueryStringUrlCodingStrategy(foo/HomePage.html,HomePage.class));

 How would you go about having it so resources referenced in HomePage.html
 are relative to foo/ and not /?  So if there was an img
 src=images/myimage.jpg / inside HomePage.html, currently the server would
 get a request for context for webapp/images/myimage.jpg, whereas the goal
 is to have it requested as context of webapp/foo/images/myimage.jpg.

 Thought base href=foo// would do the trick, but it didn't seem to.


 Craig.

 --
 Craig Tataryn
 site: http://www.basementcoders.com/
 podcast:http://feeds.feedburner.com/TheBasementCoders
 irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
 im: [EMAIL PROTECTED], skype: craig.tataryn


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



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



Re: Howto mark a FormComponent as invalid without having a feedbackmessage?

2008-11-11 Thread Jim Pinkham
Matt,

Try using a CheckGroup

- Jim.

On Tue, Nov 11, 2008 at 5:50 AM, Matthias Keller
[EMAIL PROTECTED]wrote:

 Hi

 I'm using a custom FormValidator to validate a group of  checkboxes. I want
 to raise an error whenever none of the checkboxes is checked.
 In the effect I must have all checkboxes marked as invalid so that I can
 apply some style to them to visually display this too. Unfortunately when I
 add the error to every formcomponent concerned, I get 10 error messages with
 the same text.
 Marking a FormComponent invalid by invoking  invalid()  doesn't work too,
 as this method does NOTHING by default. The only class overriding
 onInvalid() I found was
 org.apache.wicket.extensions.markup.html.form.palette.component.Recorder
 Shouldn't  FormComponent.invalid()  also mark a component as invalid so
 that it returns  false  when asked for isValid() ?

 Is there any other method to have them marked as invalid while only getting
 that one feedback message?

 Thanks

 Matt

 --
 [EMAIL PROTECTED]  +41 44 268 83 98
 Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich
 http://www.ergon.ch
 __
 e r g o nsmart people - smart software





Re: Wicket IE7 Ajax problem

2008-11-11 Thread Igor Vaynberg
umm, the link you gave points to a thread about a problem with
wicket-velocity...?

do you have the right link to the mailing list thread and the jira issue?

-igor

On Tue, Nov 11, 2008 at 7:22 AM, JohannesK [EMAIL PROTECTED] wrote:

 Hello

 I am having the problem discussed here:
 http://www.mail-archive.com/users@wicket.apache.org/msg02284.html

 I see that in that thread and also in Jira several different solutions are
 suggested to the problem but I don't think any of them made it to Wicket
 1.3.5? Do you have any plans on implementing a fix for this issue? I've
 tried adding the fix suggested by Lonnie there to wicket-ajax.js by hand but
 that for some reason stops Ajax working altogether in IE or Firefox...

 Any help on this issue would be greatly appreciated.
 --
 View this message in context: 
 http://www.nabble.com/Wicket---IE7-Ajax-problem-tp20441746p20441746.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: Re: AutoCompleteTextField and wicket 1.3.5

2008-11-11 Thread Kai Mutz
rzsolt mailto:[EMAIL PROTECTED] wrote:
 I have the same problem using IE6. I get an 'Error on page' message
 when I press the first key in my AutoCompleteTextField type field.
 The complete IE6 error massage as:
 Line: 288
 Char: 9
 Error: Type mismatch

 Inspecting the recent changes in wicket-autocomplete.js (1.3.4 -
 1.3.5), I found that there was a change around that line:

 in 1.3.4:
 container.style.zIndex=(Number(index)!=Number.NaN?Number(index)+1:index);
 container.style.left=position[0]+'px'
 container.style.top=(input.offsetHeight+position[1])+'px';

 in 1.3.5:
 container.style.zIndex=(!isNaN(Number(index))?Number(index)+1:index);
 container.style.left=position[0]+'px'
 container.style.top=(input.offsetHeight+position[1])+'px';

 As you can see, there is no semicolon in the end of the second line.
 I think putting a semicolon there solves the problem for IE.

Have you testet it? I just have testet it on IE7 and the missing semicolon
did not solve this problem.

See https://issues.apache.org/jira/browse/WICKET-1504 for tracing this
issue...

Kai




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



Re: Overriding builtin error messages

2008-11-11 Thread Charlie Dobbie
Unless I'm missing something, hopefully your wicket:id in markup matches the
id you're giving the component... :-)

Charlie.



2008/11/11 Steve Swinsburg [EMAIL PROTECTED]

 Ah so is the form-id in the docs the wicket:id which is static in the HTML
 or is it the markup id of the form which is dynamic?  Does this then mean
 that in my Application properties I should put:

 myForm.uploadTooLarge=No way dude, far too large!

 What about including the actual size ( ie 2M) like the Form component does?



 cheers,
 Steve
 4 (0) 1524 594870








 On 11 Nov 2008, at 15:55, [EMAIL PROTECTED] wrote:

  How dynamic is your form's id?

 Shouldn't be static because of HTML reference?

 On Nov 11, 2008 1:53pm, Steve Swinsburg [EMAIL PROTECTED]
 wrote:

 I'd like to override the default form feedback messages (also so I can

 localise them). ie

 'Upload must be less than'

 In Form.java I found this :
 // Resource key should be .uploadTooLarge to
 // override default message


 But I'm still not sure how to override it in a Properties file if the

 form-id is dynamic?



 Any help much appreciated.


 Steve















Re: SessionHandling: WicketRuntimeException: There is no application attached to current thread http-8080-1

2008-11-11 Thread Martijn Dashorst
I guess 
org.apache.wicket.spring.SpringWebApplication$1.getSpringContext(SpringWebApplication.java:51)
has a bug because it assumes it is always called inside the scope of a
wicket request.

Martijn

On Tue, Nov 11, 2008 at 12:59 PM, Agent Mahone [EMAIL PROTECTED] wrote:
 Hi guys

 I´m just trying to execute some code after a session timeout occurs.
 I´m using spring / wicket / hibernate frameworks.
 Why do I get this error WicketRuntimeException: There is no application 
 attached to current thread http-8080-1?
 I´m not getting it...I appreciate any hints. Thanks in advance !!!

 Here is my application class:

 public class MyApplication extends SpringWebApplication implements 
 HttpSessionListener {

 protected void init() {
 //some code
 }

 public Session newSession(Request request, Response response) {
return new MySession(request);
 }

 public ClassIndexPage getHomePage() {
return IndexPage.class;
  }

 public Object getBean(Class? clazz, String beanName) {
return createSpringBeanProxy(clazz, beanName);
 }

  @Override
 public void sessionCreated(HttpSessionEvent arg0) {
//nothing sepcial
 }

 @Override
 public void sessionDestroyed(HttpSessionEvent arg0) {
  String sessionId = arg0.getSession().getId();

  IRegistrationLoginUseCase bean = 
 (ILoginService)getBean(ILoginService.class, loginService);

  bean.logout(sessionId);
 }

 Here is my error stack trace:

 org.apache.wicket.WicketRuntimeException: There is no application attached to 
 current thread http-8080-1
at org.apache.wicket.Application.get(Application.java:166)
at 
 org.apache.wicket.spring.SpringWebApplication$1.getSpringContext(SpringWebApplication.java:51)
at 
 org.apache.wicket.spring.SpringBeanLocator.getSpringContext(SpringBeanLocator.java:176)
at 
 org.apache.wicket.spring.SpringBeanLocator.locateProxyTarget(SpringBeanLocator.java:162)
at 
 org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:412)
at org.apache.wicket.proxy.$Proxy3.logout(Unknown Source)
at 
 com.studentcv.web.MyApplication.sessionDestroyed(StudentCVApplication.java:82)
at 
 org.apache.catalina.session.StandardSession.expire(StandardSession.java:702)
at 
 org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2287)
at org.apache.catalina.connector.Request.getSession(Request.java:2075)
at 
 org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
at 
 org.apache.wicket.protocol.http.AbstractHttpSessionStore.getSessionId(AbstractHttpSessionStore.java:180)
at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:303)
at 
 org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)






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

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



Re: Adding a header contributor raise an error in logs

2008-11-11 Thread Igor Vaynberg
create a quickstart and attach it to a jira issue.

-igor

On Tue, Nov 11, 2008 at 1:30 AM, eyalbenamram [EMAIL PROTECTED] wrote:

 Hi,
 I get a message:
 http-8095-Processor20 ERROR html.WebPage - You probably forgot to add a
 body or header tag to your markup since no Header Container was
 found but components where found which want to write to the head section.
 meta http-equiv=refresh content=10/

 but my markup already contains head and body tags.

 here is the java code:
 add(new StringHeaderContributor(meta http-equiv=\refresh\ content=\ +
+ refreshRate + \/));

 HTML code:

 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE html PUBLIC -//WAPFORUM//DTD XHTML Mobile 1.0//EN
 http://www.wapforum.org/DTD/xhtml-mobile10.dtd;
 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en
  xmlns:wicket=http://wicket.apache.org/; wicket:id=htmlTag 
 dir=ltr
  head
meta http-equiv=Cache-Control content=no-cache/

title wicket:id=titleOwn Community/title
style type=text/css
body {background-color: #FF; font-family:verdana;}
.link{  font-weight: bold; white-space: nowrap;}
.center{ text-align: center;}
.footer{background:rgb(204,236,255);
border-top: blue solid 3px;
text-align: center;
width:100%;
line-height: 120%;
margin-top: 5px;
}
.header {background:#FF;
border-bottom: rgb(51,102,204) solid 3px;
width:100%;
line-height: 200%;
margin-bottom: 5px;
text-align: center;
}
.navigationLinks {
background:rgb(204,236,255);
text-align: center;
height:20px;
margin-top: 5px;
}
.bottom {
/*position:fixed;*/
/*bottom:20%;*/
width:100%;
}
.contacts {
margin-top: 5px;
}
/style
  /head

  body wicket:id=body...


 --
 View this message in context: 
 http://www.nabble.com/Adding-a-header-contributor-raise-an-error-in-logs-tp20436118p20436118.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: Re: Issue with FileUpload.writeToTempFile()

2008-11-11 Thread bruno . borges

JIRA issue created - *with patch included*

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

cheers,
Bruno

On Nov 11, 2008 4:11pm, Igor Vaynberg [EMAIL PROTECTED] wrote:

please open a jira issue.



-igor



On Tue, Nov 11, 2008 at 1:59 AM, Lauri Piispanen - Conmio Ltd

wrote:

 Hi all,



 I seem to be having a small portability glitch with

 FileUpload.writeToTempFile(). Looking at the source code it seems to be

 using item.getFieldName(), which on my page translates to

 filefields:1:upload. Windows doesn't really like colons, which gives  

me


 the following stacktrace:



 ...snip until root cause...



 Caused by: java.io.IOException: The parameter is incorrect

 at java.io.WinNTFileSystem.createFileExclusively(Native Method)

 at java.io.File.checkAndCreate(File.java:1704)

 at java.io.File.createTempFile(File.java:1793)

 at java.io.File.createTempFile(File.java:1830)

 at

  

org.apache.wicket.markup.html.form.upload.FileUpload.writeToTempFile(FileUpload.java:189)




 ...snip...



 On mac  linux this works just fine. I know that more elegant way would  

be


 using the InputStream, but having a file is much more useful for reading

 image dimensions and file length etc. than juggling things in memory.



 Sincerely,



 --

 Lauri Piispanen

 Senior Product Architect

 Conmio Ltd





 -

 To unsubscribe, e-mail: [EMAIL PROTECTED]

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







-

To unsubscribe, e-mail: [EMAIL PROTECTED]

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





Re: How to use TextTemplateHeaderContributor.forCss method?

2008-11-11 Thread shetc

bump
-- 
View this message in context: 
http://www.nabble.com/How-to-use-TextTemplateHeaderContributor.forCss-method--tp20411565p20439494.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How to use TextTemplateHeaderContributor.forCss method?

2008-11-11 Thread shetc

ERROR SharedResourceRequestTarget:185 - shared resource
com.test.wicket.MyApplication/skins/${brand}/someImage.jpg not found
-- 
View this message in context: 
http://www.nabble.com/How-to-use-TextTemplateHeaderContributor.forCss-method--tp20411565p20446152.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]



Overriding builtin error messages

2008-11-11 Thread Steve Swinsburg
I'd like to override the default form feedback messages (also so I can  
localise them). ie


'Upload must be less than'

In Form.java I found this :
// Resource key should be form-id.uploadTooLarge to
// override default message

But I'm still not sure how to override it in a Properties file if the  
form-id is dynamic?


Any help much appreciated.

Steve



smime.p7s
Description: S/MIME cryptographic signature


Re: internationalising error messages

2008-11-11 Thread Jurrie Overgoor

Steve Swinsburg wrote:

Cool, ended up doing this:

error(new StringResourceModel(error.empty.file.uploaded, this, 
null).getString());


Reckon thats the best solution? It's a bit heavier than just 
ResourceModel, for simple strings with no param substitution would it 
still be ok?


I suppose it would work, but I think in Wicket you are ment to do:

error(getString(error.empty.file.uploaded));

--
Met vriendelijke groet,
Jurrie Overgoor
2go-mobile b.v.

t: +31 570 609 910
f: +31 877 844 210
e: [EMAIL PROTECTED]
w: www.2go-mobile.nl


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

Why don't I get onSubmit() for my form?

2008-11-11 Thread Jim Pinkham
I can't figure out why my form's onSubmit isn't firing when I click my
submit button.

Can anyone see what I've done wrong?

Here's the HTML:  http://pastebin.com/m5b1440a0

Here's Java code: http://pastebin.com/m4a217d31

At line#114, onSubmit is not being called.  I've tried lots of different
things - I've tried adding a wicket:id to make it a Link, it gets execution
flow, but without the model having been updated yet, which isn't really what
I want.   Similarly, I can make it a Button, but that also doesn't get the
onSubmit.

Any tips for me?  I feel like I'm missing something really simple...

Thanks,
-- Jim

(To see the larger app this is a part of, goto:
http://firstuucolumbus.org/auction)


Re: image link inside of table problem

2008-11-11 Thread itayh

Hi Charlie,
You are correct, I removed some not relevant data.
Here is my table full markup:

table class=table id=pollList
thead
tr
th wicket:id=orderByIdwicket:message
key=poll.id[id]/wicket:message/th
th wicket:id=orderByNamewicket:message
key=poll.name[name]/wicket:message/th
th wicket:id=orderByDescriptionwicket:message

key=poll.description[description]/wicket:message/th
th wicket:id=orderByQuestionwicket:message

key=poll.question[question]/wicket:message/th
th wicket:id=orderByMaxVoteswicket:message

key=poll.maxVotes[maxVotes]/wicket:message/th
th wicket:id=orderByActivewicket:message
key=poll.active[active]/wicket:message/th
th wicket:id=orderByDeletewicket:message
key=poll.delete[delete]/wicket:message/th
/tr
/thead
tbody
tr wicket:id=polls
td a href=# wicket:id=edit-link[id] /td
td span wicket:id=poll.name[name]/td
td span 
wicket:id=poll.description[description]/td
td span wicket:id=poll.question[question]/td
td span wicket:id=poll.maxVotes[maxVotes]/td
td a href=# wicket:id=active-link[active] /td
td a href=# wicket:id=delete-link img  src = 
images/delete_icon.png / /td   
/tr
/tbody
/table

here is the javacode parts that create the onclick actions for all the
links. It work ok for all links except the delete link that I try to use
image:
Link link = new Link(edit-link, 
item.getModel()) {
public void onClick() {
onEditPoll((Poll) 
getModelObject());
}
};
link.add(new Label(poll.id, 
String.valueOf(poll.getId(;
item.add(link);

item.add(new Label(poll.name, 
poll.getName()));
item.add(new Label(poll.description, 
poll.getDescription()));
item.add(new Label(poll.question, 
poll.getQuestion()));
item.add(new Label(poll.maxVotes,
String.valueOf(poll.getMaxVotes(;
//second link
Link activeLink = new Link(active-link, 
item.getModel()) {
public void onClick() {
onActivePoll((Poll) 
getModelObject());
}   
};
if 
(poll.getStatus().equals(VidgetStatus.ACTIVE))
activeLink.add(new Label(poll.active, 
deactivate));
else
activeLink.add(new Label(poll.active, 
activate));
item.add(activeLink);

Link deleteLink = new Link(delete-link, 
item.getModel()) {
public void onClick() {
onDeletePoll((Poll) 
getModelObject());
}   
};


if(poll.getStatus().equals(VidgetStatus.ACTIVE))
deleteLink.setEnabled(false);
item.add(deleteLink);

In the generated html page I dont see the delete link. All the other links
in the generated html  look like:
td a href=?wicket:interface=:2:polls:9:edit-link::ILinkListener::2
/td

while for the delete I have:
tdem img src=../images/delete_icon.png//em/td   

Igor, I did not understand your comment.

Thanks in advance,
  Itay


Charlie Dobbie wrote:
 
 That can't be your real markup - you've not closed the span or anchor
 tags,
 and Wicket won't accept that at all.
 
 Please post your real markup!
 
 Charlie.
 
 
 
 
 
 2008/11/11 Igor Vaynberg [EMAIL PROTECTED]
 
 what url is generated for that link (look in source). how is the url
 different from what it is supposed to be? you need to learn how to
 provide more *useful* information if you want help.

 -igor

 On Tue, Nov 11, 2008 at 8:09 AM, itayh [EMAIL PROTECTED] wrote:
 
  

Re: FallbackSubmitLink (yes it sounds crazy)

2008-11-11 Thread Ryan
Currently SubmitLink sets the to href='#', instead it would have a valid
href (similar to a regular Link). The onclick would still submit the
form but return false to prevent the href being followed in javascript
browswers.

Then the you have 1 of 2 cases:
1) the browswer has javascript and runs the onclick handler, which
returns false so the href is not followed. This is standard SubmitLink
behavior.

2) the browser does not support javascript, completely ignores the
onclick handler and instead follows the href. This *does not* submit the
form. This is standard Link behavior.

The usecase for this is when you have a form that would be nice to
submit, but its not required that it be submitted (such as pagination).
I realize this is a very weird corner case. At this point the design
calls for a lot of stuff that cannot be done without javascript so I am
probably going to just use submitlink anyway.

I only asked on the list to see if someone had done the work for something
like this already.

Thanks!
-Ryan

On Tue, Nov 11, 2008 at 08:52:50AM -0800, Igor Vaynberg exclaimed:

you cannot have a submitLINK and not have javascript. what would your
href be? links do not submit forms, only buttons do.

-igor

On Mon, Nov 10, 2008 at 2:03 PM, Ryan [EMAIL PROTECTED] wrote:
 I have a DataView component and each row has a CheckBox to select that
 row. I prefer not to have an ajax call on each selection by the user.
 The issue is that with the default PagingNavigator I lose which
 checkboxes were selected when the page is changed (naturally, because the
 form is not submitted).

 I can make a PagingNavigator that uses SubmitLink, but then I lose
 pagination for those without javascript (rare, I know).

 SubmitLink uses the onclick handler (despite what the javadoc says, see
 WICKET-1925), and its href is set to #. I was planning on making a
 FallbackSubmitLink with the same onclick as SubmitLink and the same href
 as a regular Link. I just need to make sure that the onclick always
 returns false so browsers with javascript will not follow the href.

 If such a component existed, users with javascript would be able to
 paginate without losing selections. Those without javascript can still
 paginate, but the checkboxes do not stay checked across pages.

 My questions are... has anyone built something like this already? Is there
 a better way?

 Thanks!
 Ryan

 -
 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: Wicket IE7 Ajax problem

2008-11-11 Thread JohannesK

Terribly sorry about that...  http://markmail.org/message/3llzlsmoa7jrbe32
here's a better link  



igor.vaynberg wrote:
 
 umm, the link you gave points to a thread about a problem with
 wicket-velocity...?
 
 do you have the right link to the mailing list thread and the jira issue?
 
 -igor
 
 On Tue, Nov 11, 2008 at 7:22 AM, JohannesK [EMAIL PROTECTED]
 wrote:

 Hello

 I am having the problem discussed here:
 http://www.mail-archive.com/users@wicket.apache.org/msg02284.html

 I see that in that thread and also in Jira several different solutions
 are
 suggested to the problem but I don't think any of them made it to Wicket
 1.3.5? Do you have any plans on implementing a fix for this issue? I've
 tried adding the fix suggested by Lonnie there to wicket-ajax.js by hand
 but
 that for some reason stops Ajax working altogether in IE or Firefox...

 Any help on this issue would be greatly appreciated.
 --
 View this message in context:
 http://www.nabble.com/Wicket---IE7-Ajax-problem-tp20441746p20441746.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/Wicket---IE7-Ajax-problem-tp20441746p20446675.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: internationalising error messages

2008-11-11 Thread Jurrie Overgoor

Steve Swinsburg wrote:
That throws a 
java.util.MissingResourceException: Unable to find resource: 
error.empty.file.uploaded for component: .


Is there a reason why StringResourceModel is not preferred. Its just 
as localisable as the other method right?


I'm not saying that StringResourceModel is less preferred. They are both 
just as localisable. (Perhaps under the hood both methods boil down to 
the same thing?)


I'm just saying that I mostly see examples that use Component's 
getString() method :)


Why the MissingResourceException is thrown is a little unclear to me. 
Are you sure that the resource is in the correct file? getString() 
should load the string from the corresponding .properties file. So, if 
the code was in HelloWorld.java, then HelloWorld.properties should 
contain a line like error.empty.file.uploaded = You have uploaded an 
empty file.


--
With kind regards,
Jurrie Overgoor
2go-mobile b.v.


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

Re: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting and paging throws an IllegalStateException

2008-11-11 Thread Igor Vaynberg
create a quickstart and i will take a look.

-igor

On Tue, Nov 11, 2008 at 12:38 AM, Yazeed Isaacs
[EMAIL PROTECTED] wrote:
 Hi Igor

 I am still having a problem with the paging  sorting of the
 AjaxFallbackDefaultDataTable when it is used within a LazyLoadPanel ie.
 LazyLoadPanel.getLazyLoadComponent() returns the
 AjaxFallbackDefaultDataTable.

 The AjaxFallbackDefaultDataTable loads correctly within the
 LazyLoadPanel, but when I sort a column or navigate to the next page,
 the IllegalStateException is thrown and the error message is: Ajax
 render cannot be called on component that has setRenderBodyOnly enabled
 - Component id: content.

 lazyloadpanel:content.AjaxFallbackDefaultDataTable

 Please help.

 Yazeed Isaacs - Java Developer
 [EMAIL PROTECTED]



 -Original Message-
 From: Yazeed Isaacs [mailto:[EMAIL PROTECTED]
 Sent: 10 November 2008 03:04 PM
 To: users@wicket.apache.org
 Subject: RE: AjaxFallbackDefaultDataTable with ajax lazy loading -
 sorting and paging throws an IllegalStateException

 I understand that the markupid needs to be there in order for ajax to
 update the component.

 The component that it complains about is called content which is the
 inner content of the AjaxLazyLoadPanel.

 I have set the ajaxlazyloadpanel to setRenderBodyOnly(false) and
 setOutputMarkupId(true) and I did the same for the
 AjaxFallbackDefaultDataTable, but I still get the same error.

 This is my component layout:

 Form  - AjaxButton
- AjaxLazyLoadPanel returns AjaxFallbackDefaultDataTable


 Component id = content, page =
 za.co.transactionjunction.transpector.pages.TransactionQueryPage, path =
 8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable


 Any ideas?

 Yazeed Isaacs - Java Developer
 [EMAIL PROTECTED]



 -Original Message-
 From: Ernesto Reinaldo Barreiro [mailto:[EMAIL PROTECTED]
 Sent: 06 October 2008 10:01 AM
 To: users@wicket.apache.org
 Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
 sorting and paging throws an IllegalStateException

 The problem is, as Igor pointed, you cannot re-render a component via
 AJAX
 if it has set setRenderBodyOnly(true)... Why?
 div wicket:id=testAjax
  pContent.../p
 /div

 will be renderend as

 pContent.../p

 instead of

 div id=someid
  pContent.../p
 /div

 So, there is no way wicket AJAX js can replace the div with something
 else... Additionally you have to set setOutputMarkupId(true) on the
 component you want to replace..

 Ernesto

 On Mon, Oct 6, 2008 at 9:41 AM, Yazeed Isaacs 
 [EMAIL PROTECTED] wrote:

 Hi Igor

 Here is the java code:

 add(new AjaxButton(ajaxSubmitButton, this) {

protected void onSubmit(AjaxRequestTarget target, Form form) {

AjaxLazyLoadPanel transactions = new AjaxLazyLoadPanel(
transactions) {

private static final long serialVersionUID =
 1L;

@Override
public Component getLazyLoadComponent(String
 id)
 {

TransactionQuery transactionQuery = new
 TransactionQuery();


 transactionQuery.setCardNumber(cardNumberField
.getInput());

 transactionQuery.setDateFrom(dateFromField
.getInput());

 transactionQuery.setDateTo(dateToField.getInput());

 transactionQuery.setStoreId(storeIdsDropDownChoice
.getInput());
transactionQuery

 .setTerminalId(terminalIdsDropDownChoice

 .getInput());
int transactionNumber = 0;
if (transNumberField.getInput() !=
 null)
 {
if
 ((transNumberField.getInput().length()  0))
transactionNumber =
 Integer

 .parseInt(transNumberField

 .getInput());
}
transactionQuery

 .setTransactionNumber(transactionNumber);



AjaxFallbackDefaultDataTable results =
 new AjaxFallbackDefaultDataTable(
id,
columns,
new
 SortableTransactionQueryResultsDataProvider(

 transactionQuery), 10);

//
 transactions.setOutputMarkupId(true);

results.setRenderBodyOnly(false);

return results;
}

};

transactions.setRenderBodyOnly(false);

form.replace(transactions);

target.addComponent(transactions);
}

 });



 HTML code:

 table cellpadding=2 cellspacing=0 width=521
 wicket:id=transactions

 /table


 I have tried playing around with the way I've 

Re: Why don't I get onSubmit() for my form?

2008-11-11 Thread jWeekend

Jim,

Temporarily add a FeedbackPanel to make sure you are successfully getting
through validation. 
There's much too much irrelevant code there (to demonstrate such a problem),
but I did notice, for instance, that you're using a RequiredTextField which
means that the form must have a value for that field, otherwise the form
processing lifecyle will be cut short - one of the consequences of failing
validation is that onSubmit() will not get called, onError() will.

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



Jim Pinkham wrote:
 
 I can't figure out why my form's onSubmit isn't firing when I click my
 submit button.
 
 Can anyone see what I've done wrong?
 
 Here's the HTML:  http://pastebin.com/m5b1440a0
 
 Here's Java code: http://pastebin.com/m4a217d31
 
 At line#114, onSubmit is not being called.  I've tried lots of different
 things - I've tried adding a wicket:id to make it a Link, it gets
 execution
 flow, but without the model having been updated yet, which isn't really
 what
 I want.   Similarly, I can make it a Button, but that also doesn't get the
 onSubmit.
 
 Any tips for me?  I feel like I'm missing something really simple...
 
 Thanks,
 -- Jim
 
 (To see the larger app this is a part of, goto:
 http://firstuucolumbus.org/auction)
 
 

-- 
View this message in context: 
http://www.nabble.com/Why-don%27t-I-get-onSubmit%28%29-for-my-form--tp20446473p20447007.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Why don't I get onSubmit() for my form?

2008-11-11 Thread Marcus Mattila
 Any tips for me?  I feel like I'm missing something really simple...

Override the Form's onError() -method, to check whether there's a
validation error you haven't noticed.

-Marcus

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



Re: Why don't I get onSubmit() for my form?

2008-11-11 Thread Jim Pinkham
Thanks!

That helped me find the problem - I broke it when I added this to get $
prefix for my Double (in this app all doubles are currency) values:

converterLocator.set(Double.class, new AbstractDecimalConverter() {
private static final long serialVersionUID = 1L;

@Override
public NumberFormat getNumberFormat(Locale locale) {
return NumberFormat.getCurrencyInstance();
}
// from DoubleConverter
public Object convertToObject(final String value, Locale locale)
{
final Number number = parse(value, -Double.MAX_VALUE,
Double.MAX_VALUE, locale);
if (number == null)
return null;
return new Double(number.doubleValue());
}
@SuppressWarnings(unchecked)
protected Class getTargetType() {
return Double.class;
}
});

Seemed like a good idea, except I forgot about input!  oops!

So, I'll take away from this the lesson to always have a feedback panel
someplace on any form.

Thanks again,
-- Jim.

On Tue, Nov 11, 2008 at 2:51 PM, jWeekend [EMAIL PROTECTED]wrote:


 Jim,

 Temporarily add a FeedbackPanel to make sure you are successfully getting
 through validation.
 There's much too much irrelevant code there (to demonstrate such a
 problem),
 but I did notice, for instance, that you're using a RequiredTextField which
 means that the form must have a value for that field, otherwise the form
 processing lifecyle will be cut short - one of the consequences of failing
 validation is that onSubmit() will not get called, onError() will.

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



 Jim Pinkham wrote:
 
  I can't figure out why my form's onSubmit isn't firing when I click my
  submit button.
 
  Can anyone see what I've done wrong?
 
  Here's the HTML:  http://pastebin.com/m5b1440a0
 
  Here's Java code: http://pastebin.com/m4a217d31
 
  At line#114, onSubmit is not being called.  I've tried lots of different
  things - I've tried adding a wicket:id to make it a Link, it gets
  execution
  flow, but without the model having been updated yet, which isn't really
  what
  I want.   Similarly, I can make it a Button, but that also doesn't get
 the
  onSubmit.
 
  Any tips for me?  I feel like I'm missing something really simple...
 
  Thanks,
  -- Jim
 
  (To see the larger app this is a part of, goto:
  http://firstuucolumbus.org/auction)
 
 

 --
 View this message in context:
 http://www.nabble.com/Why-don%27t-I-get-onSubmit%28%29-for-my-form--tp20446473p20447007.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: Why don't I get onSubmit() for my form?

2008-11-11 Thread Christopher Lyth
Is the onError getting called for the form?

-- 
Christopher J Lyth
[EMAIL PROTECTED]

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



Re: Why don't I get onSubmit() for my form?

2008-11-11 Thread Jim Pinkham
Thanks to all who helped find this - yes, it was failing to validate my
input numeric 123.45.

I came up with this fix in my application class:

protected IConverterLocator newConverterLocator() {
converterLocator.set(Double.class, new AbstractDecimalConverter() {
private static final long serialVersionUID = 1L;
IConverter delegate = DoubleConverter.INSTANCE;

@Override
public String convertToString(final Object value, Locale locale)
{
return Currency.getInstance(locale).getSymbol() +
super.convertToString(value, locale);
}
@Override
protected Class getTargetType() {
return Double.class;
}
public Object convertToObject(String value, Locale locale) {
if (value != null 
value.startsWith(Currency.getInstance(locale).getSymbol()))
value = value.substring(1);
return delegate.convertToObject(value, locale);
}
});

Thanks,
-- Jim.

On Tue, Nov 11, 2008 at 2:29 PM, Christopher Lyth 
[EMAIL PROTECTED] wrote:

 Is the onError getting called for the form?

 --
 Christopher J Lyth
 [EMAIL PROTECTED]

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




Re: image link inside of table problem

2008-11-11 Thread Ned Collyer

if you have em's wrapped around the link, its probably disabled.

Eg, from
  if(poll.getStatus().equals(VidgetStatus.ACTIVE))
deleteLink.setEnabled(false); 

Rgds

Ned



itayh wrote:
 
 Hi Charlie,
 You are correct, I removed some not relevant data.
 Here is my table full markup:
 
 table class=table id=pollList
   thead
   tr
   th wicket:id=orderByIdwicket:message
 key=poll.id[id]/wicket:message/th
   th wicket:id=orderByNamewicket:message
 key=poll.name[name]/wicket:message/th
   th wicket:id=orderByDescriptionwicket:message
   
 key=poll.description[description]/wicket:message/th
   th wicket:id=orderByQuestionwicket:message
   
 key=poll.question[question]/wicket:message/th
   th wicket:id=orderByMaxVoteswicket:message
   
 key=poll.maxVotes[maxVotes]/wicket:message/th
   th wicket:id=orderByActivewicket:message
 key=poll.active[active]/wicket:message/th
   th wicket:id=orderByDeletewicket:message
 key=poll.delete[delete]/wicket:message/th
   /tr
   /thead
   tbody
   tr wicket:id=polls
   td a href=# wicket:id=edit-link[id] /td
   td span wicket:id=poll.name[name]/td
   td span 
 wicket:id=poll.description[description]/td
   td span wicket:id=poll.question[question]/td
   td span wicket:id=poll.maxVotes[maxVotes]/td
   td a href=# wicket:id=active-link[active] /td
   td a href=# wicket:id=delete-link img  src = 
 images/delete_icon.png / /td 
   /tr
   /tbody
 /table
 
 here is the javacode parts that create the onclick actions for all the
 links. It work ok for all links except the delete link that I try to use
 image:
   Link link = new Link(edit-link, 
 item.getModel()) {
   public void onClick() {
   onEditPoll((Poll) 
 getModelObject());
   }
   };
   link.add(new Label(poll.id, 
 String.valueOf(poll.getId(;
   item.add(link);
   
   item.add(new Label(poll.name, 
 poll.getName()));
   item.add(new Label(poll.description, 
 poll.getDescription()));
   item.add(new Label(poll.question, 
 poll.getQuestion()));
   item.add(new Label(poll.maxVotes,
 String.valueOf(poll.getMaxVotes(;
   //second link
   Link activeLink = new Link(active-link, 
 item.getModel()) {
   public void onClick() {
   onActivePoll((Poll) 
 getModelObject());
   }   
   };
   if 
 (poll.getStatus().equals(VidgetStatus.ACTIVE))
   activeLink.add(new Label(poll.active, 
 deactivate));
   else
   activeLink.add(new Label(poll.active, 
 activate));
   item.add(activeLink);
   
   Link deleteLink = new Link(delete-link, 
 item.getModel()) {
   public void onClick() {
   onDeletePoll((Poll) 
 getModelObject());
   }   
   };
   
   
   if(poll.getStatus().equals(VidgetStatus.ACTIVE))
   deleteLink.setEnabled(false);
   item.add(deleteLink);
 
 In the generated html page I dont see the delete link. All the other links
 in the generated html  look like:
 td a href=?wicket:interface=:2:polls:9:edit-link::ILinkListener::2
 /td
 
 while for the delete I have:
 tdem img src=../images/delete_icon.png//em/td 
 
 Igor, I did not understand your comment.
 
 Thanks in advance,
   Itay
 
 
 Charlie Dobbie wrote:
 
 That can't be your real markup - you've not closed the span or anchor
 tags,
 and Wicket won't accept that at all.
 
 Please post your real markup!
 
 Charlie.
 
 
 
 
 
 2008/11/11 Igor Vaynberg [EMAIL PROTECTED]
 
 what url is generated for that link (look in source). 

Re: internationalising error messages

2008-11-11 Thread Steve Swinsburg

Cool, ended up doing this:

error(new StringResourceModel(error.empty.file.uploaded, this,  
null).getString());


Reckon thats the best solution? It's a bit heavier than just  
ResourceModel, for simple strings with no param substitution would it  
still be ok?



cheers,
Steve








On 11 Nov 2008, at 13:24, James Carman wrote:


Component has a getString() method that you can use to access its
message bundle.

On Tue, Nov 11, 2008 at 8:17 AM, Steve Swinsburg
[EMAIL PROTECTED] wrote:
Is there a way to internationalise the error messages? I'd like  
them to come

from my resource bundle:
error(new ResourceModel(error.empty.file.uploaded));
doesnt work and gives:
Model:classname=[org.apache.wicket.model.ResourceModel]
as the output. Alternatively I'll need to look at using a custom  
panel to

render my messages in one spot.

cheers,
Steve








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





smime.p7s
Description: S/MIME cryptographic signature


AW: SessionHandling: WicketRuntimeException: There is no application attached to current thread http-8080-1

2008-11-11 Thread Agent Mahone
Hello guys

The only thing what I was trying to do was, to execute some code
if a time out occurs. (mark that user is not anymore available or online).
How then can I achieve this behaviour?

Am I forced to use the classic instantiation through the new operator?
Or is there any other solution?




Von: Igor Vaynberg [EMAIL PROTECTED]
An: users@wicket.apache.org
Gesendet: Dienstag, den 11. November 2008, 18:48:24 Uhr
Betreff: Re: SessionHandling: WicketRuntimeException: There is no application 
attached to current thread http-8080-1

wouldnt say its a bug, looks like a method invocation is done on a
wicket-spring proxy outside a wicket request and it cannot find the
application when it tries to resolve the application context. those
proxies are not mean to be used outside wicket requests.

-igor

On Tue, Nov 11, 2008 at 7:11 AM, Martijn Dashorst
[EMAIL PROTECTED] wrote:
 I guess 
 org.apache.wicket.spring.SpringWebApplication$1.getSpringContext(SpringWebApplication.java:51)
 has a bug because it assumes it is always called inside the scope of a
 wicket request.

 Martijn

 On Tue, Nov 11, 2008 at 12:59 PM, Agent Mahone [EMAIL PROTECTED] wrote:
 Hi guys

 I´m just trying to execute some code after a session timeout occurs.
 I´m using spring / wicket / hibernate frameworks.
 Why do I get this error WicketRuntimeException: There is no application 
 attached to current thread http-8080-1?
 I´m not getting it...I appreciate any hints. Thanks in advance !!!

 Here is my application class:

 public class MyApplication extends SpringWebApplication implements 
 HttpSessionListener {

 protected void init() {
 //some code
 }

 public Session newSession(Request request, Response response) {
return new MySession(request);
 }

 public ClassIndexPage getHomePage() {
return IndexPage.class;
  }

 public Object getBean(Class? clazz, String beanName) {
return createSpringBeanProxy(clazz, beanName);
 }

  @Override
 public void sessionCreated(HttpSessionEvent arg0) {
//nothing sepcial
 }

 @Override
 public void sessionDestroyed(HttpSessionEvent arg0) {
  String sessionId = arg0.getSession().getId();

  IRegistrationLoginUseCase bean = 
 (ILoginService)getBean(ILoginService.class, loginService);

  bean.logout(sessionId);
 }

 Here is my error stack trace:

 org.apache.wicket.WicketRuntimeException: There is no application attached 
 to current thread http-8080-1
at org.apache.wicket.Application.get(Application.java:166)
at 
 org.apache.wicket.spring.SpringWebApplication$1.getSpringContext(SpringWebApplication.java:51)
at 
 org.apache.wicket.spring.SpringBeanLocator.getSpringContext(SpringBeanLocator.java:176)
at 
 org.apache.wicket.spring.SpringBeanLocator.locateProxyTarget(SpringBeanLocator.java:162)
at 
 org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:412)
at org.apache.wicket.proxy.$Proxy3.logout(Unknown Source)
at 
 com.studentcv.web.MyApplication.sessionDestroyed(StudentCVApplication.java:82)
at 
 org.apache.catalina.session.StandardSession.expire(StandardSession.java:702)
at 
 org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2287)
at org.apache.catalina.connector.Request.getSession(Request.java:2075)
at 
 org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
at 
 org.apache.wicket.protocol.http.AbstractHttpSessionStore.getSessionId(AbstractHttpSessionStore.java:180)
at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:303)
at 
 org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)






 --
 Become a Wicket expert, 

Re: Re: AutoCompleteTextField and wicket 1.3.5

2008-11-11 Thread rzsolt

There is another typo in AutoCompleteTextField.java.

Line 257 should be like this:
tag.put(autocomplete, off);
instead of this
tag.put(autocomplete, false);

A temporary workaround:
myActf.add(new SimpleAttributeModifier(autocomplete, off));
-- 
View this message in context: 
http://www.nabble.com/Re%3A-Re%3A-AutoCompleteTextField-and-wicket-1.3.5-tp20423114p20437568.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]



internationalising error messages

2008-11-11 Thread Steve Swinsburg
Is there a way to internationalise the error messages? I'd like them  
to come from my resource bundle:


error(new ResourceModel(error.empty.file.uploaded));

doesnt work and gives:

Model:classname=[org.apache.wicket.model.ResourceModel]

as the output. Alternatively I'll need to look at using a custom panel  
to render my messages in one spot.



cheers,
Steve








smime.p7s
Description: S/MIME cryptographic signature


Question on PageMap

2008-11-11 Thread David R Robison
I have been monitoring the size of the pm-null file stored in the Work 
directory from Tomcat. I assume that it is the serialized version of the 
PageMap. I have an application where, if I navigate from page A to page 
B and then back to page A, the pm-null file keeps growing. I understand 
that I can set the maximum number of pages saved in the PageMap but I am 
not sure what the default is set to. Also, if I am leaving a page with a 
form and do not intend to return to that page and submit its values, do 
I even need it in the PageMap? Is there a way I can remove my page from 
the PageMap when I know I am no longer going to need its values? My end 
goal is to try and squeeze more performance out of my application. I 
hope this is understandable... any thoughts?


--

David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: [EMAIL PROTECTED]
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/book_detail.php?id=2579







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



Re: image link inside of table problem

2008-11-11 Thread itayh

Thanks  Ned, that was the problem

Ned Collyer wrote:
 
 if you have em's wrapped around the link, its probably disabled.
 
 Eg, from
   if(poll.getStatus().equals(VidgetStatus.ACTIVE))
 deleteLink.setEnabled(false); 
 
 Rgds
 
 Ned
 
 
 
 itayh wrote:
 
 Hi Charlie,
 You are correct, I removed some not relevant data.
 Here is my table full markup:
 
 table class=table id=pollList
  thead
  tr
  th wicket:id=orderByIdwicket:message
 key=poll.id[id]/wicket:message/th
  th wicket:id=orderByNamewicket:message
 key=poll.name[name]/wicket:message/th
  th wicket:id=orderByDescriptionwicket:message
  
 key=poll.description[description]/wicket:message/th
  th wicket:id=orderByQuestionwicket:message
  
 key=poll.question[question]/wicket:message/th
  th wicket:id=orderByMaxVoteswicket:message
  
 key=poll.maxVotes[maxVotes]/wicket:message/th
  th wicket:id=orderByActivewicket:message
 key=poll.active[active]/wicket:message/th
  th wicket:id=orderByDeletewicket:message
 key=poll.delete[delete]/wicket:message/th
  /tr
  /thead
  tbody
  tr wicket:id=polls
  td a href=# wicket:id=edit-link[id] /td
  td span wicket:id=poll.name[name]/td
  td span 
 wicket:id=poll.description[description]/td
  td span wicket:id=poll.question[question]/td
  td span wicket:id=poll.maxVotes[maxVotes]/td
  td a href=# wicket:id=active-link[active] /td
  td a href=# wicket:id=delete-link img  src = 
 images/delete_icon.png / /td
  /tr
  /tbody
 /table
 
 here is the javacode parts that create the onclick actions for all the
 links. It work ok for all links except the delete link that I try to use
 image:
  Link link = new Link(edit-link, 
 item.getModel()) {
  public void onClick() {
  onEditPoll((Poll) 
 getModelObject());
  }
  };
  link.add(new Label(poll.id, 
 String.valueOf(poll.getId(;
  item.add(link);
  
  item.add(new Label(poll.name, 
 poll.getName()));
  item.add(new Label(poll.description, 
 poll.getDescription()));
  item.add(new Label(poll.question, 
 poll.getQuestion()));
  item.add(new Label(poll.maxVotes,
 String.valueOf(poll.getMaxVotes(;
  //second link
  Link activeLink = new Link(active-link, 
 item.getModel()) {
  public void onClick() {
  onActivePoll((Poll) 
 getModelObject());
  }   
  };
  if 
 (poll.getStatus().equals(VidgetStatus.ACTIVE))
  activeLink.add(new Label(poll.active, 
 deactivate));
  else
  activeLink.add(new Label(poll.active, 
 activate));
  item.add(activeLink);
  
  Link deleteLink = new Link(delete-link, 
 item.getModel()) {
  public void onClick() {
  onDeletePoll((Poll) 
 getModelObject());
  }   
  };
  
  
  if(poll.getStatus().equals(VidgetStatus.ACTIVE))
  deleteLink.setEnabled(false);
  item.add(deleteLink);
 
 In the generated html page I dont see the delete link. All the other
 links in the generated html  look like:
 td a href=?wicket:interface=:2:polls:9:edit-link::ILinkListener::2
 /td
 
 while for the delete I have:
 tdem img src=../images/delete_icon.png//em/td
 
 Igor, I did not understand your comment.
 
 Thanks in advance,
   Itay
 
 
 Charlie Dobbie wrote:
 
 That can't be your real markup - you've not closed the span or anchor
 tags,
 and Wicket won't accept that at all.
 
 Please post your real markup!
 
 Charlie.
 
 
 
 
 
 2008/11/11 Igor Vaynberg [EMAIL PROTECTED]
 
 what url is generated for that link (look in 

Howto mark a FormComponent as invalid without having a feedbackmessage?

2008-11-11 Thread Matthias Keller

Hi

I'm using a custom FormValidator to validate a group of  checkboxes. I 
want to raise an error whenever none of the checkboxes is checked.
In the effect I must have all checkboxes marked as invalid so that I can 
apply some style to them to visually display this too. Unfortunately 
when I add the error to every formcomponent concerned, I get 10 error 
messages with the same text.
Marking a FormComponent invalid by invoking  invalid()  doesn't work 
too, as this method does NOTHING by default. The only class overriding 
onInvalid() I found was 
org.apache.wicket.extensions.markup.html.form.palette.component.Recorder
Shouldn't  FormComponent.invalid()  also mark a component as invalid so 
that it returns  false  when asked for isValid() ?


Is there any other method to have them marked as invalid while only 
getting that one feedback message?


Thanks

Matt

--
[EMAIL PROTECTED]  +41 44 268 83 98
Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich
http://www.ergon.ch
__
e r g o nsmart people - smart software




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Size of session cache

2008-11-11 Thread David R Robison

The size the session takes up on the disk. David

Johan Compagner wrote:

which size exactly are you talking about?


On Mon, Nov 10, 2008 at 11:03 PM, David R Robison 
[EMAIL PROTECTED] wrote:

  

Is there a convenient way to tell the size of user's session cache? David

--

David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: [EMAIL PROTECTED]
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/book_detail.php?id=2579

This e-mail communication (including any attachments) may contain
confidential and/or privileged material intended solely for the individual
or entity to which it is addressed.  If you are not the intended recipient,
you should immediately stop reading this message and delete it from all
computers that it resides on. Any unauthorized reading, distribution,
copying or other use of this communication (or its attachments) is strictly
prohibited.  If you have received this communication in error, please notify
us immediately.







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





  


--

David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: [EMAIL PROTECTED]
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/book_detail.php?id=2579

This e-mail communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed.  If you are not the intended recipient, you should immediately stop reading this message and delete it from all computers that it resides on. Any unauthorized reading, distribution, copying or other use of this communication (or its attachments) is strictly prohibited.  If you have received this communication in error, please notify us immediately.  








Re: wicket prepends unnecessary ../ before href/src html element attributes

2008-11-11 Thread Alan Romaniusc
Could it be anything like this?
http://www.nabble.com/Wicket-1.4-m3,-wicket-auth-roles-and-Context-Path-td20249711.html

On Tue, Nov 11, 2008 at 9:51 AM, Anirban Basak [EMAIL PROTECTED] wrote:
 (replacing proprietary names/texts with xx)



 I'm running wicket web app with context 'xx'.



 As long I'm mounting pages with mountBookmarkablePage(..) or other URL
 encoding strategies (http://www.test-server.com/xx/web/page/partner) or
 mentioning /xx/* as the filter pattern, everything is running fine. But I
 was told not to append any word after the context
 (http://www.test-server.com/xx/). I tried removing URL encoding strategies,
 but wicket returning wrong relative urls by prepending unnecessary '../' to
 the resource uris like:



 link href=xxweb/css/styles.css rel=stylesheet type=text/css /

 link rel=stylesheet href=xxweb/css/dhtmlwindow.css type=text/css /

 script type=text/javascript src=xxweb/js/dhtmlwindow.js/script

 script type=text/javascript src=xxweb/js/partnerpages.js/script



 Wicket converting them into:



 link href=../xxweb/css/styles.css rel=stylesheet type=text/css /

 link rel=stylesheet href=../xxweb/css/dhtmlwindow.css type=text/css
 /

 script type=text/javascript src=../xxweb/js/dhtmlwindow.js/script

 script type=text/javascript src=../xxweb/js/partnerpages.js/script



 This makes the browser unable to fetch the resources as

 ../xxweb/css/styles.css ==
 http://www.test-server.com/xxweb/css/styles.css;



 Structure of the WAR

 xx-snapshot.war

  |-- index.html (incase wicket not running)

  |-- xx-config.xml

  |-- WEB-INF

|-- web.xml

|-- lib

|-- classes

  |-- xxweb

   |-- css

   |-- images

   |-- js





 Web.xml

 filter

filter-namewicket.xx/filter-name

filter-class

  org.apache.wicket.protocol.http.WicketFilter

/filter-class

init-param

  param-nameapplicationClassName/param-name

  param-valuecom.xx.xx.xxWebApplication/param-value

/init-param

  /filter



  filter-mapping

filter-namewicket.xx/filter-name

url-pattern/*/url-pattern

dispatcherREQUEST/dispatcher

dispatcherINCLUDE/dispatcher

  /filter-mapping



 Is this because of any wicket specific restriction or something else?



 Anirban









-- 
Albert

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



SessionHandling: WicketRuntimeException: There is no application attached to current thread http-8080-1

2008-11-11 Thread Agent Mahone
Hi guys

I´m just trying to execute some code after a session timeout occurs. 
I´m using spring / wicket / hibernate frameworks.
Why do I get this error WicketRuntimeException: There is no application 
attached to current thread http-8080-1? 
I´m not getting it...I appreciate any hints. Thanks in advance !!!

Here is my application class:

public class MyApplication extends SpringWebApplication implements 
HttpSessionListener {

protected void init() { 
//some code
}

public Session newSession(Request request, Response response) {
return new MySession(request);
}

public ClassIndexPage getHomePage() {
return IndexPage.class;
 }

public Object getBean(Class? clazz, String beanName) {
return createSpringBeanProxy(clazz, beanName);
}

 @Override
public void sessionCreated(HttpSessionEvent arg0) {
//nothing sepcial   
}

@Override
public void sessionDestroyed(HttpSessionEvent arg0) {
  String sessionId = arg0.getSession().getId();

  IRegistrationLoginUseCase bean = 
(ILoginService)getBean(ILoginService.class, loginService);

  bean.logout(sessionId);
}

Here is my error stack trace:

org.apache.wicket.WicketRuntimeException: There is no application attached to 
current thread http-8080-1
at org.apache.wicket.Application.get(Application.java:166)
at 
org.apache.wicket.spring.SpringWebApplication$1.getSpringContext(SpringWebApplication.java:51)
at 
org.apache.wicket.spring.SpringBeanLocator.getSpringContext(SpringBeanLocator.java:176)
at 
org.apache.wicket.spring.SpringBeanLocator.locateProxyTarget(SpringBeanLocator.java:162)
at 
org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:412)
at org.apache.wicket.proxy.$Proxy3.logout(Unknown Source)
at 
com.studentcv.web.MyApplication.sessionDestroyed(StudentCVApplication.java:82)
at 
org.apache.catalina.session.StandardSession.expire(StandardSession.java:702)
at 
org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2287)
at org.apache.catalina.connector.Request.getSession(Request.java:2075)
at 
org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
at 
org.apache.wicket.protocol.http.AbstractHttpSessionStore.getSessionId(AbstractHttpSessionStore.java:180)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:303)
at 
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)


  

IDataProvider Implementation.

2008-11-11 Thread Graeme Knight

Hi.

From the examples I've seen the IDataProvider implementation of the iterator
method brings back (for example) a list of keys from the database.

The model method uses something like a LoadableDetachableModel to populate a
model for use by the consumer using the list of keys previously retrieved.

This seems like a lot of database hits to me. Is this simply because of the
serialization/model mechanism?

It seems to me that the iterator could/should bring back the data in one hit
and then after use be detached. Is this common?

Many thanks, Graeme.
-- 
View this message in context: 
http://www.nabble.com/IDataProvider-Implementation.-tp20440141p20440141.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: wicket prepends unnecessary ../ before href/src html element attributes

2008-11-11 Thread Anirban Basak
Exactly... I have seen discussions regarding index.html and tomcat issue
several times before. But, since I'm using jboss, it haven't come to my mind
that jboss uses tomcat internally.

Thanks a lot :)


Warm Regards,
Anirban Basak
Ph : 91 33 2357 7177 Extn: 277


-Original Message-
From: Alan Romaniusc [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 11, 2008 8:46 PM
To: users@wicket.apache.org
Subject: Re: wicket prepends unnecessary ../ before href/src html element
attributes

Could it be anything like this?
http://www.nabble.com/Wicket-1.4-m3,-wicket-auth-roles-and-Context-Path-td20
249711.html

On Tue, Nov 11, 2008 at 9:51 AM, Anirban Basak [EMAIL PROTECTED]
wrote:
 (replacing proprietary names/texts with xx)



 I'm running wicket web app with context 'xx'.



 As long I'm mounting pages with mountBookmarkablePage(..) or other URL
 encoding strategies (http://www.test-server.com/xx/web/page/partner) or
 mentioning /xx/* as the filter pattern, everything is running fine. But I
 was told not to append any word after the context
 (http://www.test-server.com/xx/). I tried removing URL encoding
strategies,
 but wicket returning wrong relative urls by prepending unnecessary '../'
to
 the resource uris like:



 link href=xxweb/css/styles.css rel=stylesheet type=text/css /

 link rel=stylesheet href=xxweb/css/dhtmlwindow.css type=text/css /

 script type=text/javascript src=xxweb/js/dhtmlwindow.js/script

 script type=text/javascript src=xxweb/js/partnerpages.js/script



 Wicket converting them into:



 link href=../xxweb/css/styles.css rel=stylesheet type=text/css /

 link rel=stylesheet href=../xxweb/css/dhtmlwindow.css type=text/css
 /

 script type=text/javascript src=../xxweb/js/dhtmlwindow.js/script

 script type=text/javascript src=../xxweb/js/partnerpages.js/script



 This makes the browser unable to fetch the resources as

 ../xxweb/css/styles.css ==
 http://www.test-server.com/xxweb/css/styles.css;



 Structure of the WAR

 xx-snapshot.war

  |-- index.html (incase wicket not running)

  |-- xx-config.xml

  |-- WEB-INF

|-- web.xml

|-- lib

|-- classes

  |-- xxweb

   |-- css

   |-- images

   |-- js





 Web.xml

 filter

filter-namewicket.xx/filter-name

filter-class

  org.apache.wicket.protocol.http.WicketFilter

/filter-class

init-param

  param-nameapplicationClassName/param-name

  param-valuecom.xx.xx.xxWebApplication/param-value

/init-param

  /filter



  filter-mapping

filter-namewicket.xx/filter-name

url-pattern/*/url-pattern

dispatcherREQUEST/dispatcher

dispatcherINCLUDE/dispatcher

  /filter-mapping



 Is this because of any wicket specific restriction or something else?



 Anirban









-- 
Albert

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


No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.175 / Virus Database: 270.9.1/1781 - Release Date: 11/11/2008
8:59 AM

No virus found in this outgoing message.
Checked by AVG - http://www.avg.com 
Version: 8.0.175 / Virus Database: 270.9.1/1781 - Release Date: 11/11/2008
8:59 AM


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



Re: Overriding builtin error messages

2008-11-11 Thread Igor Vaynberg
max size is available via ${maxSize}, not sure if we have the actual
size availabel as a variable.

-igor

On Tue, Nov 11, 2008 at 8:01 AM, Steve Swinsburg
[EMAIL PROTECTED] wrote:
 Ah so is the form-id in the docs the wicket:id which is static in the HTML
 or is it the markup id of the form which is dynamic?  Does this then mean
 that in my Application properties I should put:

 myForm.uploadTooLarge=No way dude, far too large!

 What about including the actual size ( ie 2M) like the Form component does?



 cheers,
 Steve
 4 (0) 1524 594870







 On 11 Nov 2008, at 15:55, [EMAIL PROTECTED] wrote:

 How dynamic is your form's id?

 Shouldn't be static because of HTML reference?

 On Nov 11, 2008 1:53pm, Steve Swinsburg [EMAIL PROTECTED]
 wrote:

 I'd like to override the default form feedback messages (also so I can

 localise them). ie

 'Upload must be less than'

 In Form.java I found this :
 // Resource key should be .uploadTooLarge to
 // override default message


 But I'm still not sure how to override it in a Properties file if the

 form-id is dynamic?


 Any help much appreciated.


 Steve














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



Re: wicket 1.4 - Localizer getCacheKey BUG

2008-11-11 Thread Ned Collyer

I'm in the process of updating to 1.4m3.

The following is resulting in the same cache key for each item. (which did
not happen in 1.4m1)

ListView createLinks = new ListViewLink(createLinks, links) {
protected void populateItem(ListItemLink item) {
Link link = item.getModelObject();
link.add(new Label(banana))
item.add(link);
}
};

Is this the correct behaviour?  It's causing my links to all have the same
label (ie, whichever was hit first)


Rgds

Ned

igor.vaynberg wrote:
 
 should be fixed in m3 which is coming out any hour
 
 -igor
 
 On Sat, Jul 12, 2008 at 9:07 AM, FakeBoy [EMAIL PROTECTED] wrote:

 Hi,
 I migrate my app from wicket 1.3 to wicket 1.4.
 Everything works fine, but one thing behaves strange.
 I have BasePage and all others pages in my app extends this page.
 BasePage have some responsibilities and one of them is set correct page
 title.
 Example:
 public class BasePage ext WebPage {

  public BasePage() {
add(new Label(title, getTitle()));
  }

  protected IModel getTitle() {
return new ResourceModel(pageTitle);
  }
 }
 All pages, which extends BasePage need to define properties file with key
 pageTitle if want to declare own page title.

 In Wicket 1.3 everythigs works correct, but in Wicket 1.4 NOT.
 The problem is in constructing CacheKey for localizer's properties cache.

 In Wicket 1.3 CacheKey containts:
 1. component.getPageRelativePath()
 2. component.findPage() - page.getClass().getName()
 There is all suffcient information for correct cashing properties.

 But in Wicket 1.4 it changed and page class name missed in constructing
 CacheKey.
 CacheKey containts:
 1. resourceKey
 2. component class name
 3. component id
 4. locale
 5. style

 Result :
 If page identifier missed, title on my pages are still same, they are
 cached.
 Reason is that CacheKey is same for all my pages, although they contains
 properties file with own declared pageTitle.
 CacheKey is:
 pageTitle-org.apache.wicket.markup.html.basic.Label:title-en_EN-null
 This CacheKey is same for Page1, Page2, Page3 because it don't care about
 page.

 What are you think about it?
 Thanks

 

-- 
View this message in context: 
http://www.nabble.com/wicket-1.4---Localizer-getCacheKey-BUG-tp18421093p20449490.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]



Issue with FileUpload.writeToTempFile()

2008-11-11 Thread Lauri Piispanen - Conmio Ltd

Hi all,

I seem to be having a small portability glitch with 
FileUpload.writeToTempFile(). Looking at the source code it seems to be 
using item.getFieldName(), which on my page translates to 
filefields:1:upload. Windows doesn't really like colons, which gives 
me the following stacktrace:


...snip until root cause...

Caused by: java.io.IOException: The parameter is incorrect
   at java.io.WinNTFileSystem.createFileExclusively(Native Method)
   at java.io.File.checkAndCreate(File.java:1704)
   at java.io.File.createTempFile(File.java:1793)
   at java.io.File.createTempFile(File.java:1830)
   at 
org.apache.wicket.markup.html.form.upload.FileUpload.writeToTempFile(FileUpload.java:189)


...snip...

On mac  linux this works just fine. I know that more elegant way would 
be using the InputStream, but having a file is much more useful for 
reading image dimensions and file length etc. than juggling things in 
memory.


Sincerely,

--
Lauri Piispanen
   Senior Product Architect
  Conmio Ltd


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



Re: internationalising error messages

2008-11-11 Thread Steve Swinsburg

That throws a
java.util.MissingResourceException: Unable to find resource:  
error.empty.file.uploaded for component: .


Is there a reason why StringResourceModel is not preferred. Its just  
as localisable as the other method right?



Steve







On 11 Nov 2008, at 13:34, Jurrie Overgoor wrote:


Steve Swinsburg wrote:

Cool, ended up doing this:

error(new StringResourceModel(error.empty.file.uploaded, this,  
null).getString());


Reckon thats the best solution? It's a bit heavier than just  
ResourceModel, for simple strings with no param substitution would  
it still be ok?


I suppose it would work, but I think in Wicket you are ment to do:

error(getString(error.empty.file.uploaded));

--
Met vriendelijke groet,
Jurrie Overgoor
2go-mobile b.v.
t: +31 570 609 910
f: +31 877 844 210
e: [EMAIL PROTECTED]
w: www.2go-mobile.nl


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




smime.p7s
Description: S/MIME cryptographic signature


Re: Overriding builtin error messages

2008-11-11 Thread bruno . borges

How dynamic is your form's id?

Shouldn't be static because of HTML reference?

On Nov 11, 2008 1:53pm, Steve Swinsburg [EMAIL PROTECTED] wrote:
I'd like to override the default form feedback messages (also so I can  

localise them). ie

'Upload must be less than'

In Form.java I found this :
// Resource key should be .uploadTooLarge to
// override default message


But I'm still not sure how to override it in a Properties file if the  

form-id is dynamic?



Any help much appreciated.


Steve













Re: wicket 1.4 - Localizer getCacheKey BUG

2008-11-11 Thread Ned Collyer

actually.. found out what it was (and the example i gave was incorrect -
oops).

the new Localizer#getCacheKey(String, Component) assumes that for a given
key in the markup, there will only ever be a single translation.

I have my own resource resolver, which allows for resolution of the keys
based on the class of the model object (which saves having to duplicate
translations, and allows me to store translations against the domain
entities).  Igor has mentioned this is a bad idea, but it has been VERY
useful, and means that the translations are appropriate outside of the
wicket world (I also use them for web services through another application).

Previously, the following would result in different cache keys based on the
index of the list item - which was good because my custom
StringResourceResolver relied upon it.

wicket:container wicket:id=createLinks
 # wicket:message key=entity[entity]/wicket:message 
/wicket:container

I have fixed this by overriding the getCacheKey method with the old code.

It could be cleaned up a bit - the cache keys are HUGE...

Rgds

Ned



I'm in the process of updating to 1.4m3.

The following is resulting in the same cache key for each item. (which did
not happen in 1.4m1)

ListView createLinks = new ListViewLink(createLinks, links) {
protected void populateItem(ListItemLink item) {
Link link = item.getModelObject();
link.add(new Label(banana))
item.add(link);
}
};

Is this the correct behaviour?  It's causing my links to all have the same
label (ie, whichever was hit first)


Rgds

Ned

igor.vaynberg wrote:
 
 should be fixed in m3 which is coming out any hour
 
 -igor
 

-- 
View this message in context: 
http://www.nabble.com/wicket-1.4---Localizer-getCacheKey-BUG-tp18421093p20449836.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]



London Wicket Event - December 3rd @ Google

2008-11-11 Thread jWeekend

Our next London Wicket Event will be on December 3rd (most likely at Google's
offices at Victoria station). We'll be ordering the Pizza to be there by
18:15.
I am still working on the schedule but it is almost finalised; registration
and up-to-date details are   http://www.jweekend.com/dev/LWUGReg/ here .
You'll see that we're covering some very interesting ground, as usual. Feel
free to bring your laptops if you want us to look at any
code/design/problems you are working on. 

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

PS Thanks for the kind words, emails and blog entries about the
organisation, content and our event in general. These blog entries and posts
can also give more people the opportunity to find out about our events. 
PPS Don't hesitate to  http://www.jweekend.com/dev/ContactUsBody/ contact us  
if you have ideas for presentations that could be interesting for our guests
at future events or if you'd like to promote your project/product. 
-- 
View this message in context: 
http://www.nabble.com/London-Wicket-Event---December-3rd-%40-Google-tp20441529p20441529.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]



wicket prepends unnecessary ../ before href/src html element attributes

2008-11-11 Thread Anirban Basak
(replacing proprietary names/texts with xx)

 

I’m running wicket web app with context ‘xx’.

 

As long I’m mounting pages with mountBookmarkablePage(..) or other URL
encoding strategies (http://www.test-server.com/xx/web/page/partner) or
mentioning /xx/* as the filter pattern, everything is running fine. But I
was told not to append any word after the context
(http://www.test-server.com/xx/). I tried removing URL encoding strategies,
but wicket returning wrong relative urls by prepending unnecessary ‘../’ to
the resource uris like:

 

link href=xxweb/css/styles.css rel=stylesheet type=text/css /

link rel=stylesheet href=xxweb/css/dhtmlwindow.css type=text/css /

script type=text/javascript src=xxweb/js/dhtmlwindow.js/script

script type=text/javascript src=xxweb/js/partnerpages.js/script

 

Wicket converting them into:

 

link href=../xxweb/css/styles.css rel=stylesheet type=text/css /

link rel=stylesheet href=../xxweb/css/dhtmlwindow.css type=text/css
/

script type=text/javascript src=../xxweb/js/dhtmlwindow.js/script

script type=text/javascript src=../xxweb/js/partnerpages.js/script

 

This makes the browser unable to fetch the resources as 

“../xxweb/css/styles.css” ==
“http://www.test-server.com/xxweb/css/styles.css”

 

Structure of the WAR

xx-snapshot.war

 |-- index.html (incase wicket not running)

 |-- xx-config.xml

 |-- WEB-INF

|-- web.xml

|-- lib

|-- classes

 |-- xxweb

   |-- css

   |-- images

   |-- js

 

 

Web.xml

filter

filter-namewicket.xx/filter-name

filter-class

  org.apache.wicket.protocol.http.WicketFilter

/filter-class

init-param

  param-nameapplicationClassName/param-name

  param-valuecom.xx.xx.xxWebApplication/param-value

/init-param

  /filter

 

  filter-mapping

filter-namewicket.xx/filter-name

url-pattern/*/url-pattern

dispatcherREQUEST/dispatcher

dispatcherINCLUDE/dispatcher

  /filter-mapping

 

Is this because of any wicket specific restriction or something else?

 

Anirban

 

 



Re: IDataProvider Implementation.

2008-11-11 Thread Graeme Knight

Hi guys,

I am using hibernate and it is caching (which is great) so that overhead is
not a problem -

after some reflection I think it appears to me that because you get rid of
the loadabledetachablemodel to 'save database hits' (which if cached,
doesn't really) then the affect is more serialized data. Bad.

Got it.

Thanks, Graeme.
 

Martijn Dashorst wrote:
 
 That, and that typically your ORM (hibernate, etc) will put the object
 in second level cache. The LDM should hit that cache most of the time
 between requests.
 
 Martijn
 
 On Tue, Nov 11, 2008 at 3:58 PM, Erik van Oosten [EMAIL PROTECTED]
 wrote:
 Not a good idea for large objects. A few days back I improved load time
 of a
 page from more then 40 sec to about 5 sec by replacing new
 Model(object)
 with a proper LoadableDetachableModel.

 Nevertheless, there is no reason to let the LoadableDetachableModel get
 the
 object if you already have it, just pass the object to the constructor!

 E.g. see first ctor below.

 public class LoadableMemberModel
   extends LoadableDetachableModelMember {

   @SpringBean
   private MemberService memberService;

   private long memberId;

   //
   // Constructor that has object has direct parameter
   //
   public LoadableMemberModel(Member member) {
   super(member);
   this.memberId = member.getId();
   }
 *
 *public LoadableMemberModel(long memberId) {
   this.memberId = memberId;
   }

   protected Member load() {
   InjectorHolder.getInjector().inject(this);
   return memberService.getById(memberId);
   }
 }



 Regards,
   Erik.


 Graeme Knight wrote:

 Hey Jeremy,

 Thanks for the heads up - actually that's what I ended up doing this
 morning. Works like a charm!

 Cheers, Graeme.


 Jeremy Thomerson-5 wrote:


 In my apps, I bring them all in whenever the first call to iterator or
 size
 is done, and cache them until detach.  It's a very reasonable pattern.
 Then
 in the model method, I basically do new Model(object)


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


 On Tue, Nov 11, 2008 at 8:03 AM, Graeme Knight [EMAIL PROTECTED]
 wrote:



 Hi.

 From the examples I've seen the IDataProvider implementation of the
 iterator
 method brings back (for example) a list of keys from the database.

 The model method uses something like a LoadableDetachableModel to
 populate
 a
 model for use by the consumer using the list of keys previously
 retrieved.

 This seems like a lot of database hits to me. Is this simply because
 of
 the
 serialization/model mechanism?

 It seems to me that the iterator could/should bring back the data in
 one
 hit
 and then after use be detached. Is this common?

 Many thanks, Graeme.
 --
 View this message in context:

 http://www.nabble.com/IDataProvider-Implementation.-tp20440141p20440141.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]









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


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


 
 
 
 -- 
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/IDataProvider-Implementation.-tp20440141p20441836.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: Question on PageMap

2008-11-11 Thread Erik van Oosten

I am not sure what the default is set to

Look at the constructors of DiskPageStore.


My end goal is to try and squeeze more performance out of my application.
If that is your goal you are on the wrong track. The disk store is a 
rotating logging based, mostly write-only store. Logging based as new 
content is written sequentially from start to end of the file, rotated 
because when the file is full it starts at byte 0 thereby overwriting 
old pages. It is mostly write-only as only when a user presses the back 
button data may be read back from the page store.


Early removal of data will only mean more disk-head movements making it 
slower instead of faster.


Regards,
   Erik.



David R Robison wrote:
I have been monitoring the size of the pm-null file stored in the Work 
directory from Tomcat. I assume that it is the serialized version of 
the PageMap. I have an application where, if I navigate from page A to 
page B and then back to page A, the pm-null file keeps growing. I 
understand that I can set the maximum number of pages saved in the 
PageMap but I am not sure what the default is set to. Also, if I am 
leaving a page with a form and do not intend to return to that page 
and submit its values, do I even need it in the PageMap? Is there a 
way I can remove my page from the PageMap when I know I am no longer 
going to need its values? My end goal is to try and squeeze more 
performance out of my application. I hope this is understandable... 
any thoughts?





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



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



image link inside of table problem

2008-11-11 Thread itayh

Hi,

I am having a table with deactivate and delete link columns. In the delete
column I want to have delete image, so pressing on the image will activate
the delete function on the server.

My html code:
td a href=# wicket:id=active-link  span wicket:id=poll.active 
/td
td a href=# wicket:id=delete-link  img src=images/delete_icon.png
/ /td

My java code:
Link activeLink = new Link(active-link, item.getModel()) {
public void onClick() {
onActivePoll((Poll) getModelObject());
   }
};
activeLink.add(new Label(poll.active, activate));
item.add(activeLink);

Link deleteLink = new Link(delete-link, item.getModel()) {
public void onClick() {
onDeletePoll((Poll) getModelObject());
}   
};
item.add(deleteLink);

While the activate link work ok, the delete link which use the image is not
appearing in the html and I see just the image with no link.
Any idea what I am doing wrong?

Thanks in advance,
  Itay
 
-- 
View this message in context: 
http://www.nabble.com/image-link-inside-of-table-problem-tp20442713p20442713.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: internationalising error messages

2008-11-11 Thread James Carman
Component has a getString() method that you can use to access its
message bundle.

On Tue, Nov 11, 2008 at 8:17 AM, Steve Swinsburg
[EMAIL PROTECTED] wrote:
 Is there a way to internationalise the error messages? I'd like them to come
 from my resource bundle:
 error(new ResourceModel(error.empty.file.uploaded));
 doesnt work and gives:
 Model:classname=[org.apache.wicket.model.ResourceModel]
 as the output. Alternatively I'll need to look at using a custom panel to
 render my messages in one spot.

 cheers,
 Steve







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



Re: SessionHandling: WicketRuntimeException: There is no application attached to current thread http-8080-1

2008-11-11 Thread Igor Vaynberg
you can retrieve the application context via the servlet context and
use vanilla spring to do whatever it is you are trying to do. you only
need the proxies when dealing from inside wicket - which you do not
appear to be doing.

-igor

On Tue, Nov 11, 2008 at 1:06 PM, Agent Mahone [EMAIL PROTECTED] wrote:
 Hello guys

 The only thing what I was trying to do was, to execute some code
 if a time out occurs. (mark that user is not anymore available or online).
 How then can I achieve this behaviour?

 Am I forced to use the classic instantiation through the new operator?
 Or is there any other solution?



 
 Von: Igor Vaynberg [EMAIL PROTECTED]
 An: users@wicket.apache.org
 Gesendet: Dienstag, den 11. November 2008, 18:48:24 Uhr
 Betreff: Re: SessionHandling: WicketRuntimeException: There is no application 
 attached to current thread http-8080-1

 wouldnt say its a bug, looks like a method invocation is done on a
 wicket-spring proxy outside a wicket request and it cannot find the
 application when it tries to resolve the application context. those
 proxies are not mean to be used outside wicket requests.

 -igor

 On Tue, Nov 11, 2008 at 7:11 AM, Martijn Dashorst
 [EMAIL PROTECTED] wrote:
 I guess 
 org.apache.wicket.spring.SpringWebApplication$1.getSpringContext(SpringWebApplication.java:51)
 has a bug because it assumes it is always called inside the scope of a
 wicket request.

 Martijn

 On Tue, Nov 11, 2008 at 12:59 PM, Agent Mahone [EMAIL PROTECTED] wrote:
 Hi guys

 I´m just trying to execute some code after a session timeout occurs.
 I´m using spring / wicket / hibernate frameworks.
 Why do I get this error WicketRuntimeException: There is no application 
 attached to current thread http-8080-1?
 I´m not getting it...I appreciate any hints. Thanks in advance !!!

 Here is my application class:

 public class MyApplication extends SpringWebApplication implements 
 HttpSessionListener {

 protected void init() {
 //some code
 }

 public Session newSession(Request request, Response response) {
return new MySession(request);
 }

 public ClassIndexPage getHomePage() {
return IndexPage.class;
  }

 public Object getBean(Class? clazz, String beanName) {
return createSpringBeanProxy(clazz, beanName);
 }

  @Override
 public void sessionCreated(HttpSessionEvent arg0) {
//nothing sepcial
 }

 @Override
 public void sessionDestroyed(HttpSessionEvent arg0) {
  String sessionId = arg0.getSession().getId();

  IRegistrationLoginUseCase bean = 
 (ILoginService)getBean(ILoginService.class, loginService);

  bean.logout(sessionId);
 }

 Here is my error stack trace:

 org.apache.wicket.WicketRuntimeException: There is no application attached 
 to current thread http-8080-1
at org.apache.wicket.Application.get(Application.java:166)
at 
 org.apache.wicket.spring.SpringWebApplication$1.getSpringContext(SpringWebApplication.java:51)
at 
 org.apache.wicket.spring.SpringBeanLocator.getSpringContext(SpringBeanLocator.java:176)
at 
 org.apache.wicket.spring.SpringBeanLocator.locateProxyTarget(SpringBeanLocator.java:162)
at 
 org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:412)
at org.apache.wicket.proxy.$Proxy3.logout(Unknown Source)
at 
 com.studentcv.web.MyApplication.sessionDestroyed(StudentCVApplication.java:82)
at 
 org.apache.catalina.session.StandardSession.expire(StandardSession.java:702)
at 
 org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2287)
at org.apache.catalina.connector.Request.getSession(Request.java:2075)
at 
 org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
at 
 org.apache.wicket.protocol.http.AbstractHttpSessionStore.getSessionId(AbstractHttpSessionStore.java:180)
at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:303)
at 
 org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at 
 

Re: FallbackSubmitLink (yes it sounds crazy)

2008-11-11 Thread Igor Vaynberg
you cannot have a submitLINK and not have javascript. what would your
href be? links do not submit forms, only buttons do.

-igor

On Mon, Nov 10, 2008 at 2:03 PM, Ryan [EMAIL PROTECTED] wrote:
 I have a DataView component and each row has a CheckBox to select that
 row. I prefer not to have an ajax call on each selection by the user.
 The issue is that with the default PagingNavigator I lose which
 checkboxes were selected when the page is changed (naturally, because the
 form is not submitted).

 I can make a PagingNavigator that uses SubmitLink, but then I lose
 pagination for those without javascript (rare, I know).

 SubmitLink uses the onclick handler (despite what the javadoc says, see
 WICKET-1925), and its href is set to #. I was planning on making a
 FallbackSubmitLink with the same onclick as SubmitLink and the same href
 as a regular Link. I just need to make sure that the onclick always
 returns false so browsers with javascript will not follow the href.

 If such a component existed, users with javascript would be able to
 paginate without losing selections. Those without javascript can still
 paginate, but the checkboxes do not stay checked across pages.

 My questions are... has anyone built something like this already? Is there
 a better way?

 Thanks!
 Ryan

 -
 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: mounts and resources

2008-11-11 Thread Craig Tataryn


On 11-Nov-08, at 2:44 PM, Igor Vaynberg wrote:


wicket always rewrites links to be context-relative. just because
something is mounted as /foo/page doesnt mean that is the only way to
access it. the behavior he is seeing is that his img src=bar.gif/
is rewritten as img src=../bar.gif/ when the page is accessed
under its foo mount - which makes the url context-relative. this is
the correct behavior of wicket. if he wants that url to always be
/foo/bar.gif that is the url he should put into the markup.

-igor



Bummer.  Ok well thanks for clearing that up, much appreciated.

Craig.

On Tue, Nov 11, 2008 at 1:25 PM, Craig Tataryn [EMAIL PROTECTED]  
wrote:


On 11-Nov-08, at 10:13 AM, Igor Vaynberg wrote:


wicket should be rewriting static urls for you so it should work
transparently. what usecase exactly does not work?

-igor



Basically he has a setup like this: Apache2.2 - Tomcat.

He has Rewrite rules setup to make Apache serve the static content  
(and he
confirmed they worked) and a ProxyPass rule to have requests to / 
hiswebapp

served by Tomcat.

So Apache handles all requests for:
/hiswebapp/images/*
/hiswebapp/styles/*
/hiswebapp/js/*
/hiswebapp/foo/images/*
/hiswebapp/foo/styles/*
/hiswebapp/foo/js/*

And Tomcat handles the rest of the requests to /hiswebapp/*

In his Wicket Application he'll do something like:

mount(new QueryStringUrlCodingStrategy(foo/ 
HomePage.html,HomePage.class));


Now in the HomePage.html file that's linked to HomePage.class he  
expects
that links to resources like img src=images/myimage.jpg/ should  
be
requested from the browser as /hiswebapp/foo/images/ 
myimage.jpg (because

of the way he mounted the page under foo)  Likewise img
src=../images/anotherimage.jpg/ should be requested as
/hiswebapp/images/anotherimage.jpg.  This doesn't seem to be the case
however.  When he tails the apache access_log he sees requests for
/hiswebapp/images/myimage.jpg and /images/anotherimage.jpg  
respectively

which give 404s.

Not sure if that is enough info to go on, let me know if you need  
more.  If

you say it should work the way he expects it to, then I tell him to
re-examine things to see if perhaps he messed up his links or  
something.


Craig.


On Mon, Nov 10, 2008 at 5:22 PM, Craig Tataryn [EMAIL PROTECTED]
wrote:


If one were to mount a page like so:

mount(new
QueryStringUrlCodingStrategy(foo/HomePage.html,HomePage.class));

How would you go about having it so resources referenced in  
HomePage.html

are relative to foo/ and not /?  So if there was an img
src=images/myimage.jpg / inside HomePage.html, currently the  
server

would
get a request for context for webapp/images/myimage.jpg,  
whereas the

goal
is to have it requested as context of webapp/foo/images/ 
myimage.jpg.


Thought base href=foo// would do the trick, but it didn't  
seem to.



Craig.

--
Craig Tataryn
site: http://www.basementcoders.com/
podcast:http://feeds.feedburner.com/TheBasementCoders
irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
im: [EMAIL PROTECTED], skype: craig.tataryn


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



--
Craig Tataryn
site: http://www.basementcoders.com/
podcast:http://feeds.feedburner.com/TheBasementCoders
irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
im: [EMAIL PROTECTED], skype: craig.tataryn


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



--
Craig Tataryn
site: http://www.basementcoders.com/
podcast:http://feeds.feedburner.com/TheBasementCoders
irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
im: [EMAIL PROTECTED], skype: craig.tataryn


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



Re: mounts and resources

2008-11-11 Thread Igor Vaynberg
wicket always rewrites links to be context-relative. just because
something is mounted as /foo/page doesnt mean that is the only way to
access it. the behavior he is seeing is that his img src=bar.gif/
is rewritten as img src=../bar.gif/ when the page is accessed
under its foo mount - which makes the url context-relative. this is
the correct behavior of wicket. if he wants that url to always be
/foo/bar.gif that is the url he should put into the markup.

-igor

On Tue, Nov 11, 2008 at 1:25 PM, Craig Tataryn [EMAIL PROTECTED] wrote:

 On 11-Nov-08, at 10:13 AM, Igor Vaynberg wrote:

 wicket should be rewriting static urls for you so it should work
 transparently. what usecase exactly does not work?

 -igor


 Basically he has a setup like this: Apache2.2 - Tomcat.

 He has Rewrite rules setup to make Apache serve the static content (and he
 confirmed they worked) and a ProxyPass rule to have requests to /hiswebapp
 served by Tomcat.

 So Apache handles all requests for:
 /hiswebapp/images/*
 /hiswebapp/styles/*
 /hiswebapp/js/*
 /hiswebapp/foo/images/*
 /hiswebapp/foo/styles/*
 /hiswebapp/foo/js/*

 And Tomcat handles the rest of the requests to /hiswebapp/*

 In his Wicket Application he'll do something like:

 mount(new QueryStringUrlCodingStrategy(foo/HomePage.html,HomePage.class));

 Now in the HomePage.html file that's linked to HomePage.class he expects
 that links to resources like img src=images/myimage.jpg/ should be
 requested from the browser as /hiswebapp/foo/images/myimage.jpg (because
 of the way he mounted the page under foo)  Likewise img
 src=../images/anotherimage.jpg/ should be requested as
 /hiswebapp/images/anotherimage.jpg.  This doesn't seem to be the case
 however.  When he tails the apache access_log he sees requests for
 /hiswebapp/images/myimage.jpg and /images/anotherimage.jpg respectively
 which give 404s.

 Not sure if that is enough info to go on, let me know if you need more.  If
 you say it should work the way he expects it to, then I tell him to
 re-examine things to see if perhaps he messed up his links or something.

 Craig.

 On Mon, Nov 10, 2008 at 5:22 PM, Craig Tataryn [EMAIL PROTECTED]
 wrote:

 If one were to mount a page like so:

 mount(new
 QueryStringUrlCodingStrategy(foo/HomePage.html,HomePage.class));

 How would you go about having it so resources referenced in HomePage.html
 are relative to foo/ and not /?  So if there was an img
 src=images/myimage.jpg / inside HomePage.html, currently the server
 would
 get a request for context for webapp/images/myimage.jpg, whereas the
 goal
 is to have it requested as context of webapp/foo/images/myimage.jpg.

 Thought base href=foo// would do the trick, but it didn't seem to.


 Craig.

 --
 Craig Tataryn
 site: http://www.basementcoders.com/
 podcast:http://feeds.feedburner.com/TheBasementCoders
 irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
 im: [EMAIL PROTECTED], skype: craig.tataryn


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


 --
 Craig Tataryn
 site: http://www.basementcoders.com/
 podcast:http://feeds.feedburner.com/TheBasementCoders
 irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
 im: [EMAIL PROTECTED], skype: craig.tataryn


 -
 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: Re: Issue with FileUpload.writeToTempFile()

2008-11-11 Thread Igor Vaynberg
hi bruno.

first off let me say that we really appreciate the patches...

but :) i would like to make a couple of small comments:

it would be nice if you used the same formatting settings as us. your
patches contain 90% noise which makes them hard to read.

try to use simpler names. normalizeFilename doesnt really say much.
what is normalize mean.

and this is the most important one, do not prematurely optimize and
know when to optimize. this method is called extremely rarely so the
requirement of maintaining the array ordered vs the speed improvement
doesnt make sense - too much of a maintenance headache, easy to make a
mistake, etc. further, in this particular case, a binary search is
slower then a linear search by, i would venture, about 5x.

thanks,

-igor

On Tue, Nov 11, 2008 at 11:03 AM,  [EMAIL PROTECTED] wrote:
 JIRA issue created - *with patch included*

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

 cheers,
 Bruno

 On Nov 11, 2008 4:11pm, Igor Vaynberg [EMAIL PROTECTED] wrote:

 please open a jira issue.



 -igor



 On Tue, Nov 11, 2008 at 1:59 AM, Lauri Piispanen - Conmio Ltd

 wrote:

  Hi all,

 

  I seem to be having a small portability glitch with

  FileUpload.writeToTempFile(). Looking at the source code it seems to be

  using item.getFieldName(), which on my page translates to

  filefields:1:upload. Windows doesn't really like colons, which gives

 me

  the following stacktrace:

 

  ...snip until root cause...

 

  Caused by: java.io.IOException: The parameter is incorrect

  at java.io.WinNTFileSystem.createFileExclusively(Native Method)

  at java.io.File.checkAndCreate(File.java:1704)

  at java.io.File.createTempFile(File.java:1793)

  at java.io.File.createTempFile(File.java:1830)

  at

 

 org.apache.wicket.markup.html.form.upload.FileUpload.writeToTempFile(FileUpload.java:189)

 

  ...snip...

 

  On mac  linux this works just fine. I know that more elegant way would

 be

  using the InputStream, but having a file is much more useful for reading

  image dimensions and file length etc. than juggling things in memory.

 

  Sincerely,

 

  --

  Lauri Piispanen

  Senior Product Architect

  Conmio Ltd

 

 

  -

  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]



Pretty url for tabs

2008-11-11 Thread rmoskal

I'm familiar with the a lot of the strategies that make for nicer urls in
Wicket, but am at a loss for how to make the urls for a tabpanel friendlier.

Instead of /Home:1:1, /Home:2:1, etc.

I'd like to have  /Home:Account:1, /Home:Alerts:1, etc.

It would be nice to lose the last bit on the right, but I could live with it
if it messes with wickets state maintaining ability.

Has anyone had a client pester them for this?

Thanks and regards,

Robert Moskal
Brooklyn, USA
-- 
View this message in context: 
http://www.nabble.com/Pretty-url-for-tabs-tp20451052p20451052.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: Re: Issue with FileUpload.writeToTempFile()

2008-11-11 Thread Bruno Borges
sure igor... :-) your opinion is more than welcome.

about the binary search specially. I will keep that in mind for future codes
:-) (and not just for wicket)

but, about the formatting, I really don't know what's going on. I'm using
Ganymede and I've been applying the EclipseCodeFormat.xml without success.
Whenever I save  the file or just format it manually, it does that with the
code. Sorry about that. I will disable it for future patches and will try to
format by hand. At least, the whole code won't be messed up.

and about the name of that method, I never would feel sad if you decide to
change it, really. :-) I took the first shot so I had  to come with
something, but there's no reason to not change it.

with everything said, I'll try to improve the quality (or the lack of
premature quality) of submited patches... :-D

thanks for your comments,
Bruno Borges
blog.brunoborges.com.br
+55 21 76727099

The glory of great men should always be
measured by the means they have used to
acquire it.
- Francois de La Rochefoucauld


On Tue, Nov 11, 2008 at 9:25 PM, Igor Vaynberg [EMAIL PROTECTED]wrote:

 hi bruno.

 first off let me say that we really appreciate the patches...

 but :) i would like to make a couple of small comments:

 it would be nice if you used the same formatting settings as us. your
 patches contain 90% noise which makes them hard to read.

 try to use simpler names. normalizeFilename doesnt really say much.
 what is normalize mean.

 and this is the most important one, do not prematurely optimize and
 know when to optimize. this method is called extremely rarely so the
 requirement of maintaining the array ordered vs the speed improvement
 doesnt make sense - too much of a maintenance headache, easy to make a
 mistake, etc. further, in this particular case, a binary search is
 slower then a linear search by, i would venture, about 5x.

 thanks,

 -igor

 On Tue, Nov 11, 2008 at 11:03 AM,  [EMAIL PROTECTED] wrote:
  JIRA issue created - *with patch included*
 
  https://issues.apache.org/jira/browse/WICKET-1930
 
  cheers,
  Bruno
 
  On Nov 11, 2008 4:11pm, Igor Vaynberg [EMAIL PROTECTED] wrote:
 
  please open a jira issue.
 
 
 
  -igor
 
 
 
  On Tue, Nov 11, 2008 at 1:59 AM, Lauri Piispanen - Conmio Ltd
 
  wrote:
 
   Hi all,
 
  
 
   I seem to be having a small portability glitch with
 
   FileUpload.writeToTempFile(). Looking at the source code it seems to
 be
 
   using item.getFieldName(), which on my page translates to
 
   filefields:1:upload. Windows doesn't really like colons, which gives
 
  me
 
   the following stacktrace:
 
  
 
   ...snip until root cause...
 
  
 
   Caused by: java.io.IOException: The parameter is incorrect
 
   at java.io.WinNTFileSystem.createFileExclusively(Native Method)
 
   at java.io.File.checkAndCreate(File.java:1704)
 
   at java.io.File.createTempFile(File.java:1793)
 
   at java.io.File.createTempFile(File.java:1830)
 
   at
 
  
 
 
 org.apache.wicket.markup.html.form.upload.FileUpload.writeToTempFile(FileUpload.java:189)
 
  
 
   ...snip...
 
  
 
   On mac  linux this works just fine. I know that more elegant way
 would
 
  be
 
   using the InputStream, but having a file is much more useful for
 reading
 
   image dimensions and file length etc. than juggling things in memory.
 
  
 
   Sincerely,
 
  
 
   --
 
   Lauri Piispanen
 
   Senior Product Architect
 
   Conmio Ltd
 
  
 
  
 
   -
 
   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: mounts and resources

2008-11-11 Thread Johan Compagner
I think that is what happens.
If pages are mounted we will fix the images so that they are not
screwed up because of the mount. What is ecactly in the html? I guess
../images/xxx right?

On 11/11/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 wicket should be rewriting static urls for you so it should work
 transparently. what usecase exactly does not work?

 -igor

 On Mon, Nov 10, 2008 at 5:22 PM, Craig Tataryn [EMAIL PROTECTED] wrote:
 If one were to mount a page like so:

 mount(new
 QueryStringUrlCodingStrategy(foo/HomePage.html,HomePage.class));

 How would you go about having it so resources referenced in HomePage.html
 are relative to foo/ and not /?  So if there was an img
 src=images/myimage.jpg / inside HomePage.html, currently the server
 would
 get a request for context for webapp/images/myimage.jpg, whereas the
 goal
 is to have it requested as context of webapp/foo/images/myimage.jpg.

 Thought base href=foo// would do the trick, but it didn't seem to.


 Craig.

 --
 Craig Tataryn
 site: http://www.basementcoders.com/
 podcast:http://feeds.feedburner.com/TheBasementCoders
 irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
 im: [EMAIL PROTECTED], skype: craig.tataryn


 -
 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: Issue with FileUpload.writeToTempFile()

2008-11-11 Thread Johan Compagner
If you use eclipse you should use the project specific format we have
defined for it. You should have a .settings dir or something like
that. Look at the wicket project preferences and look what formatter
you use there

On 11/12/08, Bruno Borges [EMAIL PROTECTED] wrote:
 sure igor... :-) your opinion is more than welcome.

 about the binary search specially. I will keep that in mind for future codes
 :-) (and not just for wicket)

 but, about the formatting, I really don't know what's going on. I'm using
 Ganymede and I've been applying the EclipseCodeFormat.xml without success.
 Whenever I save  the file or just format it manually, it does that with the
 code. Sorry about that. I will disable it for future patches and will try to
 format by hand. At least, the whole code won't be messed up.

 and about the name of that method, I never would feel sad if you decide to
 change it, really. :-) I took the first shot so I had  to come with
 something, but there's no reason to not change it.

 with everything said, I'll try to improve the quality (or the lack of
 premature quality) of submited patches... :-D

 thanks for your comments,
 Bruno Borges
 blog.brunoborges.com.br
 +55 21 76727099

 The glory of great men should always be
 measured by the means they have used to
 acquire it.
 - Francois de La Rochefoucauld


 On Tue, Nov 11, 2008 at 9:25 PM, Igor Vaynberg
 [EMAIL PROTECTED]wrote:

 hi bruno.

 first off let me say that we really appreciate the patches...

 but :) i would like to make a couple of small comments:

 it would be nice if you used the same formatting settings as us. your
 patches contain 90% noise which makes them hard to read.

 try to use simpler names. normalizeFilename doesnt really say much.
 what is normalize mean.

 and this is the most important one, do not prematurely optimize and
 know when to optimize. this method is called extremely rarely so the
 requirement of maintaining the array ordered vs the speed improvement
 doesnt make sense - too much of a maintenance headache, easy to make a
 mistake, etc. further, in this particular case, a binary search is
 slower then a linear search by, i would venture, about 5x.

 thanks,

 -igor

 On Tue, Nov 11, 2008 at 11:03 AM,  [EMAIL PROTECTED] wrote:
  JIRA issue created - *with patch included*
 
  https://issues.apache.org/jira/browse/WICKET-1930
 
  cheers,
  Bruno
 
  On Nov 11, 2008 4:11pm, Igor Vaynberg [EMAIL PROTECTED] wrote:
 
  please open a jira issue.
 
 
 
  -igor
 
 
 
  On Tue, Nov 11, 2008 at 1:59 AM, Lauri Piispanen - Conmio Ltd
 
  wrote:
 
   Hi all,
 
  
 
   I seem to be having a small portability glitch with
 
   FileUpload.writeToTempFile(). Looking at the source code it seems to
 be
 
   using item.getFieldName(), which on my page translates to
 
   filefields:1:upload. Windows doesn't really like colons, which
   gives
 
  me
 
   the following stacktrace:
 
  
 
   ...snip until root cause...
 
  
 
   Caused by: java.io.IOException: The parameter is incorrect
 
   at java.io.WinNTFileSystem.createFileExclusively(Native Method)
 
   at java.io.File.checkAndCreate(File.java:1704)
 
   at java.io.File.createTempFile(File.java:1793)
 
   at java.io.File.createTempFile(File.java:1830)
 
   at
 
  
 
 
 org.apache.wicket.markup.html.form.upload.FileUpload.writeToTempFile(FileUpload.java:189)
 
  
 
   ...snip...
 
  
 
   On mac  linux this works just fine. I know that more elegant way
 would
 
  be
 
   using the InputStream, but having a file is much more useful for
 reading
 
   image dimensions and file length etc. than juggling things in memory.
 
  
 
   Sincerely,
 
  
 
   --
 
   Lauri Piispanen
 
   Senior Product Architect
 
   Conmio Ltd
 
  
 
  
 
   -
 
   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]