A question for Igor

2008-04-24 Thread Matthew Young
I am looking at the wicket.markup.html.tabs.TabbedPanel
(wicket-extensions)http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.compref.TabbedPanelPageexample
on
http://wicketstuff.org/wicket13/compref/, I couldn't figure out how you
switch the css.  Is that done in WicketExamplePage?  Unfortunately,
WicketExamplePage.java is not part of the source.


Re: A question for Igor

2008-04-24 Thread Igor Vaynberg
the code is on TabbedPanelPage, the links simply switch the css class
that is on the div tag used to attach to tabbed panel.

-igor


On Wed, Apr 23, 2008 at 11:08 PM, Matthew Young [EMAIL PROTECTED] wrote:
 I am looking at the wicket.markup.html.tabs.TabbedPanel
  
 (wicket-extensions)http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.compref.TabbedPanelPageexample
  on
  http://wicketstuff.org/wicket13/compref/, I couldn't figure out how you
  switch the css.  Is that done in WicketExamplePage?  Unfortunately,
  WicketExamplePage.java is not part of the source.


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



Re: Request for hints: Long duration requests; ajax 'status' line

2008-04-24 Thread lars vonk
Hi,

The code in the blog contains some visibility issues. So I wouldn't use that
code in your application without making it Thread safe.

Since the write and read of the uploading and uploadComplete flag happen in
different Threads access to those variables must be either protected by a
lock or you can declare those attributes volatile. Otherwise the JMM gives
no garantuee what so ever about changes made to those variables in one
Thread can be seen in another Thread.

So before you use the code either declare the uploading and uploadComplete
flag as volatile or make the isXXX and setXXX methods synchronized.

Cheers, Lars


On Thu, Apr 24, 2008 at 4:52 AM, PhilipJohnson [EMAIL PROTECTED] wrote:


 Thanks everyone for all the great tips!

 The last hint on using a background thread led me to the following post by
 Julian Sinai, who seemed to realize exactly what code example I would want
 to look at, four days before I knew it myself!

 
 http://javathoughts.capesugarbird.com/2008/04/spawning-thread-for-lengthy-operation.html
 

 Thanks, Julian!

 Cheers,
 Philip
 --
 View this message in context:
 http://www.nabble.com/Request-for-hints%3A-Long-duration-requests--ajax-%27status%27-line-tp16830536p16837476.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: Integer only NumberValidator?

2008-04-24 Thread Martijn Dashorst
new TextField(number, ..., Integer.class);

Integer-ness is checked at conversion level before validation.

Martijn

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



  Thanks,




  Michael




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

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



Re: autocomplete: no popup when field is empty

2008-04-24 Thread Gerolf Seitz
right, but since it's in extensions, everything has to be homegrown :/

On Wed, Apr 23, 2008 at 11:11 PM, Johan Compagner [EMAIL PROTECTED]
wrote:

 not by us ;)
 Gerolf is ofcourse using a standard fully tested lib right ;)


 On Wed, Apr 23, 2008 at 10:58 PM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:

  heh, that is 10kb more of javascript to maintain
 
  -igor
 
 
  On Wed, Apr 23, 2008 at 12:40 PM, Johan Compagner [EMAIL PROTECTED]
  wrote:
   i really dont care about a 3kb or 13kb script ..
Those are cached anyway so thats fine by me
its not that it its 100kb+ or something like that
  
johan
  
  
On Wed, Apr 23, 2008 at 8:34 PM, Gerolf Seitz [EMAIL PROTECTED]
 
wrote:
  
  
  
 i _could_ use something from a combobox i did some time ago:
 
   http://people.apache.org/~gseitz/combo/http://people.apache.org/%7Egseitz/combo/
 http://people.apache.org/%7Egseitz/combo/
  http://people.apache.org/%7Egseitz/combo/
 http://people.apache.org/%7Egseitz/combo/
 but that script is 13kb (unstripped) compared to
 wicket-autocomplete
 3k (stripped) and it's based on YUI...

 On Wed, Apr 23, 2008 at 4:49 PM, Gerolf Seitz 
 [EMAIL PROTECTED]
  
 wrote:

  k, it's basically done.
  if the list is longer than the browser's height, scrolling with
  both the
  keyboard
  and the mouse either feels kinda awkward (because the entire page
  gets
  scrolled
  with .scrollIntoView) or even impossible.
  what we could do now is the following:
  put the list in another div with style overflow:scroll; height:
  XYpx;
  this way scrollIntoView does not affect the entire page.
 
  now if anyone can think of better names than allowEmptyInput or
  showListOnEmptyInput i will happily use the better suggestions
 ;)
 
  Gerolf
 
 
  On Wed, Apr 23, 2008 at 4:26 PM, Gerolf Seitz 
  [EMAIL PROTECTED]
  wrote:
 
   nah, i think this should be pretty straight forward.
   let me take a look.
  
   Gabriel, can you file a jira issue for that? thanks.
  
   Gerolf
  
  
   On Wed, Apr 23, 2008 at 4:14 PM, Johan Compagner 
  [EMAIL PROTECTED]
 
   wrote:
  
I guess this is being done because when nothing is typed
 there
  is
normally
no list?
   
Gerolf do you see any problem making this configurable so
 that
  it
 does
show
always a list if there are values?
   
johan
   
   
On Wed, Apr 23, 2008 at 2:53 PM, Gabriel Erzse 
[EMAIL PROTECTED]
wrote:
   
 Hi,

 I am using the autocomplete feature of Wicket, and I would
  like
 the
user
 to see the entire list of available values when the input
  field is
empty.
 Then, as he starts typing values in the input field, the
 list
  of
values will
 narrow down.

 However I see that when the input field is empty, the popup
  for
 autocomplete is not displayed (for example when I press
 down
 arrow).
I
 searched in the wicket code and I saw that in file
wicket-autocomplete.js,
 in function doUpdateChoices there are two checks for the
 situation
when
 the input field is empty. These checks don't allow for the
  popup
 to
be
 visible.

 So, my questions would be: does anyone know why this was
 done
  so,
and can
 I somehow disable this behavior? I would find it really
  useful to
 be
able to
 display a list of values even when the input field is
 empty.

 Thank you,
 Gabi.



   

 -
 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: Show feedbackpanel on modalwindow

2008-04-24 Thread Maurice Marrink
Add a feedbackpanel to the modal window.
If needed you can also use a IFeedbackMessageFilter on the
feedbackpanels to decide which panel shows which message.
In the ajaxsubmit you should also add the feedbackpanel on the
modalwindow to the ajaxtarget

Maurice

On Wed, Apr 23, 2008 at 2:20 PM, tsuresh [EMAIL PROTECTED] wrote:

  Hello,

  What should I do to show the feedback messages on modalwindow instead of
  page?.( e.g show Login failed message on modal window when user tries to
  login). I tried but could not succeed.

  thanks
  tsuresh
  --
  View this message in context: 
 http://www.nabble.com/Show-feedbackpanel-on-modalwindow-tp16834532p16834532.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: modal window, javascript error

2008-04-24 Thread Maurice Marrink
could you create a jira issue please.

Maurice

On Wed, Apr 23, 2008 at 2:59 PM, Ivan Bodrov [EMAIL PROTECTED] wrote:

  http://wicketstuff.org/wicket13/ajax/modal-window

  Internet Explorer 6.0.2900.2180.xpsp2_rtm.040803-2158 (Windows XP SP2)

  1. click on 'Show modal dialog with a page'
  2. in modal window click on 'Close this window with result OK'
  3. javascript error: 'Invalid procedure call or argument' at line 837:5

  On Internet Explorer 6.0.2800.1106 (ies4linux) works fine. :-)
  --
  View this message in context: 
 http://www.nabble.com/modal-window%2C-javascript-error-tp16834578p16834578.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: Problem with how to make variation

2008-04-24 Thread StephenP

Override webrequestcycle.onbeginrequest()

Get the hostname:
String hostname = ((WebRequest)
getRequest()).getHttpServletRequest().getHeader(host);

Then based on the host you can set Session.setstyle() and
Session.setLocale()




Mathias P.W Nilsson wrote:
 
 Hi!
 
 I have a model that should be shared with 4 websites.  site1.se,
 site1.com, site2.se, site2.com
 
 So the only diffrents between site1.se and site2.com is the language. The
 diffrents between site2 and site1 is layout.
 
 How can this be done? I want to set the langauge in startup. the site1.se
 is only swedish and site1.com is only english. It should be integrated
 with payment so https will be supported. All the sites points to a domain
 name but is located on the same server. 
 
 Do I have to have 4 wicket sites? What is the approach here? 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-how-to-make-variation-tp16834129p16845768.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 include Javascript in Head tag

2008-04-24 Thread Maurice Marrink
Use wicket:head script../script/wicket:head

Maurice

On Thu, Apr 24, 2008 at 1:02 AM, PJ Pillai [EMAIL PROTECTED] wrote:
 
   Hello,
  
   I am new to Wicket. I am trying to build a dynamic navigational menus. I
   am building the menuitems from the database in my java code and want to
   include it at runtime in the page.
  
   Please see the my html below. I tried label, include component but it
   doesn't work. Please note the
  
   span wicket:id=includeinclude menu items here/span towards the end
   of the html.
  
   Please help.
  
   Thanks,
  
   Pravin
  
  
  
  
   
   HTML xmlns:wicket=http://wicket.apache.org;
  
   
   head
  
   
   titleSample menu/title
  
   
   SCRIPT type=text/javascript
  
   var
   tWorkPath=/MM2000/HTML/tree-menu/;
  
   /
   script
  
  
  
   
   script type=text/javascript language=JavaScript1.2 src=
   /MM2000/HTML/tree-menu/dtree.js/script
  
   
   script
  
   // Lines
  
   var
   tpoints = 1;
  
   var
   tpointsImage = vpoint.gif;
  
   var
   tpointsVImage = hpoint.gif;
  
   var
   tpointsCImage = cpoint.gif;
  
  
  
   var
   tpressedFontColor = #AA;
  
   var
   tpathPrefix_img = /MM2000/HTML/img/;
  
   var
   tlevelDX = 20;
  
   var
   ttoggleMode = 1;
  
   var
   texpanded = 0;
  
   var
   tcloseExpanded = 0;
  
   var
   tcloseExpandedXP = 0;
  
   var
   tblankImage = img/blank.gif;
  
   var
   tmenuWidth = 200px;
  
   var
   tmenuHeight = auto;
  
   var
   tabsolute = 1;
  
   var
   tleft = 1;
  
   var
   ttop = 10;
  
   var
   tfloatable = 1;
  
   var
   tfloatIterations = 10;
  
   var
   tmoveable = 0;
  
   var
   tmoveImage = ;
  
   var
   tmoveImageHeight = 12;
  
   var
   tfontStyle = normal 10pt Tahoma;
  
   var
   tfontColor = [#3F3D3D,#7E7C7C];
  
   var
   tfontDecoration = [none,underline];
  
   var
   titemBackColor = [#FF,#FF];
  
   var
   titemAlign = left;
  
   var
   titemBackImage = [blank.gif,blank.gif];
  
   var
   titemCursor = pointer;
  
   var
   titemHeight = 26;
  
   var
   titemTarget = _self;
  
   var
   ticonWidth = 21;
  
   var
   ticonHeight = 15;
  
   var
   ticonAlign = left;
  
   var
   tmenuBackImage = ;
  
   var
   tmenuBackColor = #E0E0E0;
  
   var
   tmenuBorderColor = #FF;
  
   var
   tmenuBorderStyle = solid;
  
   var
   tmenuBorderWidth = 2;
  
   var
   texpandBtn =[expandbtn2.gif,expandbtn2.gif,collapsebtn2.gif];
  
   var
   texpandBtnW = 9;
  
   var
   texpandBtnH = 9;
  
   var
   texpandBtnAlign = left
  
   // XP-Style Parameters
  
   var
   tXPStyle = 0;
  
   var
   tXPIterations = 10; // expand/collapse speed
  
   var
   tXPTitleTopBackColor = ;
  
   var
   tXPTitleBackColor = #AFB1C3;
  
   var
   tXPTitleLeft = xptitleleft_s.gif;
  
   var
   tXPTitleLeftWidth = 4;
  
   var
   tXPExpandBtn = [xpexpand1_s.gif,xpexpand1_s.gif,xpcollapse1_s.gif,
   xpcollapse1_s.gif];
  
   var
   tXPTitleBackImg = xptitle_s.gif;
  
   var
   tXPBtnWidth = 25;
  
   var
   tXPBtnHeight = 23;
  
   var
   tXPIconWidth = 31;
  
   var
   tXPIconHeight = 32;
  
   var
   tXPFilter=1;
  
   var
   tXPBorderWidth = 1;
  
   var
   tXPBorderColor = '#FF';
  
  
  
   var
   tstyles =
  
   [
  
   [
   tfontDecoration=none,none]
  
   ];
  
   var
   tmenuItems =
  
   [
  
   span wicket:id=
   includeinclude menu items here/span
  
   ];
  
   dtree_init();
  
   /
   script
  
  
  
   /
   head
  
   
   body class=XPSilverTopBack1 topmargin=0 leftmargin=0 rightmargin=0
   bottommargin=0 marginheight=0 marginwidth=0
  
   /
   body
  
   /
   HTML
  


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



VOTE: Generics of IDataProvider

2008-04-24 Thread Jan Kriesten


Hi,

I have a usecase where the current proposed generic Interface for IDataProvider 
with upcoming v1.4 of Wicket would break the implementation concept working with 
Wicket 1.3. The usecase needs different types for iterator + model. Example and 
explanation are found below the vote:


VOTE:

[ ] IDataProviderI,T
[ ] IteratorIModelT , drop model
[ ] Leave as is.


Example:
new IDataProviderInteger, Topics {
  public IteratorInteger iterator( int first, int count ) { 
getForum().getTopics( first, count ); }


  public int size() { getForum().getTopicsCount(); }

  public IModelTopics model( Integer id ) { return new TopicsDetachableModel( 
id ); }

 }

The current proposed IDataProviderT would enforce model + iterator to be of 
the same type, resulting in the above not working without hassle. I.e. either to 
work without type safetey (always use Object to comply), or wrapping/querying 
the type within iterator + model (which could cause time consuming lookups when 
remote services are involved).


To get around this, there are 2 solutions:

- drop the 'model' method and have iterator return an IteratorIModelT

That would fit this usecase since the Model could just be wrapped within 
iterator and no extra lookups would be necessary. Implementation code of 
iterator might get a bit uglier, though.


- add a second type as shown with example above

Would lead to redundant type definitions for many usecases where iterator + 
model actually return the same type.



I'd really like to see support for generics with these cases as well.

Best regards, --- Jan.

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



default spring transaction on request cycle

2008-04-24 Thread Stefan Selariu
Hi!

I need to call inside a request cycle an unknown number of transactional
spring beans. How can I call those beans within the same transaction?

Thanks.



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



StatelessForm + UrlCompressingWebRequestProcessor

2008-04-24 Thread Martin Grigorov
Hi,

My application uses UrlCompressingWebRequestProcessor. After changing
the Form in my LoginPage to StatelessForm the following exception
occurred:

ERROR - RequestCycle   - For input string: loginForm
java.lang.NumberFormatException: For input string: loginForm
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.parseInt(Integer.java:497)
at
org.apache.wicket.protocol.http.request.urlcompressing.UrlCompressor.getComponentAndInterfaceForUID(UrlCompressor.java:122)
at
org.apache.wicket.protocol.http.request.urlcompressing.UrlCompressingWebRequestProcessor.resolveListenerInterfaceTarget(UrlCompressingWebRequestProcessor.java:79)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461)
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1224)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1084)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
.

It seems that there is no URL compression for stateless forms.

Am I doing something wrong or I should file an issue ?

--martin-g 


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



Re: VOTE: Generics of IDataProvider

2008-04-24 Thread Sebastiaan van Erk

[ ] IDataProviderI,T
[X] IteratorIModelT , drop model
[ ] Leave as is.

Regards,
Sebastiaan

Jan Kriesten wrote:


Hi,

I have a usecase where the current proposed generic Interface for 
IDataProvider with upcoming v1.4 of Wicket would break the 
implementation concept working with Wicket 1.3. The usecase needs 
different types for iterator + model. Example and explanation are found 
below the vote:


VOTE:

[ ] IDataProviderI,T
[ ] IteratorIModelT , drop model
[ ] Leave as is.


Example:
new IDataProviderInteger, Topics {
  public IteratorInteger iterator( int first, int count ) { 
getForum().getTopics( first, count ); }


  public int size() { getForum().getTopicsCount(); }

  public IModelTopics model( Integer id ) { return new 
TopicsDetachableModel( id ); }

 }

The current proposed IDataProviderT would enforce model + iterator to 
be of the same type, resulting in the above not working without hassle. 
I.e. either to work without type safetey (always use Object to comply), 
or wrapping/querying the type within iterator + model (which could cause 
time consuming lookups when remote services are involved).


To get around this, there are 2 solutions:

- drop the 'model' method and have iterator return an IteratorIModelT

That would fit this usecase since the Model could just be wrapped within 
iterator and no extra lookups would be necessary. Implementation code of 
iterator might get a bit uglier, though.


- add a second type as shown with example above

Would lead to redundant type definitions for many usecases where 
iterator + model actually return the same type.



I'd really like to see support for generics with these cases as well.

Best regards, --- Jan.

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



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Return to Original Destination gets the ajax response and not the page

2008-04-24 Thread Michael Sparer

What wicket version are you using? I know this bug has been fixed for version
1.3.2 and above

regards, 
Michael


Warren Bell wrote:
 
 I am getting an ajax response xml instead of the page when I return to
 original destination page that is ajax enabled after a
 RestartResponseAtInterceptPageException is thrown. Here is the URL:
 
 http://127.0.0.1:8080/blahblah/?wicket:interface=:8:body:receiveItemDetailFo
 rm:lineItem.item.upc::IActivePageBehaviorListener:0:-1wicket:ignoreIfNotAct
 ive=truerandom=0.8907246112298193
 
 What am I doing wrong?
 
 Thanks,
 
 Warren Bell
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/Return-to-Original-Destination-gets-the-ajax-response-and-not-the-page-tp16845566p16847805.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: default spring transaction on request cycle

2008-04-24 Thread lars vonk
I would advice you to group the transactional beans in one Service, define
that service in Spring and make it transactional. By using the proper
Transaction Propagation levels the wrapped beans can use existing
transactions if there is one.

See
http://static.springframework.org/spring/docs/2.5.x/reference/transaction.htmlfor
more info on Spring and Transactions.

Lars


On Thu, Apr 24, 2008 at 10:01 AM, Stefan Selariu [EMAIL PROTECTED]
wrote:

 Hi!

 I need to call inside a request cycle an unknown number of transactional
 spring beans. How can I call those beans within the same transaction?

 Thanks.



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




Re: VOTE: Generics of IDataProvider

2008-04-24 Thread Johan Compagner
[ ] IDataProviderI,T
[X] IteratorIModelT , drop model
[X] Leave as is.


I dont care much between those 2.
But i definitely  dont like option 1, because your example gives me exact
the feeling why i dont want that
It gives the wrong idea to peoples mind. If they would do what you do,
Integer list of pks, and then in the model you get the Topics objects,
this would for most OR mapping tools be a real performance issue, and we get
the blame for that for being slow.

johan


On Thu, Apr 24, 2008 at 9:42 AM, Jan Kriesten [EMAIL PROTECTED]
wrote:


 Hi,

 I have a usecase where the current proposed generic Interface for
 IDataProvider with upcoming v1.4 of Wicket would break the implementation
 concept working with Wicket 1.3. The usecase needs different types for
 iterator + model. Example and explanation are found below the vote:

 VOTE:




 Example:
 new IDataProviderInteger, Topics {
  public IteratorInteger iterator( int first, int count ) {
 getForum().getTopics( first, count ); }

  public int size() { getForum().getTopicsCount(); }

  public IModelTopics model( Integer id ) { return new
 TopicsDetachableModel( id ); }
  }

 The current proposed IDataProviderT would enforce model + iterator to be
 of the same type, resulting in the above not working without hassle. I.e.
 either to work without type safetey (always use Object to comply), or
 wrapping/querying the type within iterator + model (which could cause time
 consuming lookups when remote services are involved).

 To get around this, there are 2 solutions:

 - drop the 'model' method and have iterator return an IteratorIModelT

 That would fit this usecase since the Model could just be wrapped within
 iterator and no extra lookups would be necessary. Implementation code of
 iterator might get a bit uglier, though.

 - add a second type as shown with example above

 Would lead to redundant type definitions for many usecases where
 iterator + model actually return the same type.


 I'd really like to see support for generics with these cases as well.

 Best regards, --- Jan.

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




Re: StatelessForm + UrlCompressingWebRequestProcessor

2008-04-24 Thread Johan Compagner
add a jira issue. (if there isnt already one, there are some but dont know
for this specific case)

please add a sample.


On Thu, Apr 24, 2008 at 10:20 AM, Martin Grigorov 
[EMAIL PROTECTED] wrote:

 Hi,

 My application uses UrlCompressingWebRequestProcessor. After changing
 the Form in my LoginPage to StatelessForm the following exception
 occurred:

 ERROR - RequestCycle   - For input string: loginForm
 java.lang.NumberFormatException: For input string: loginForm
at

 java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.parseInt(Integer.java:497)
at

 org.apache.wicket.protocol.http.request.urlcompressing.UrlCompressor.getComponentAndInterfaceForUID(UrlCompressor.java:122)
at

 org.apache.wicket.protocol.http.request.urlcompressing.UrlCompressingWebRequestProcessor.resolveListenerInterfaceTarget(UrlCompressingWebRequestProcessor.java:79)
at

 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461)
at

 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1224)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
at

 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at org.mortbay.jetty.servlet.ServletHandler
 $CachedChain.doFilter(ServletHandler.java:1084)
at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at

 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
.

 It seems that there is no URL compression for stateless forms.

 Am I doing something wrong or I should file an issue ?

 --martin-g


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




Re: VOTE: Generics of IDataProvider

2008-04-24 Thread Thijs



[ ] IDataProviderI,T
[ X ] IteratorIModelT , drop model
[ ] Leave as is.

Thijs

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



How to set the path for a uploadfolder?

2008-04-24 Thread unka_hahrry

Hi!

I want to save images to a specified uploadfolder, but I don't want to
define the Folder object with an absolute path. Is there a possiblity to
define a Folder relative to the context root? 
-- 
View this message in context: 
http://www.nabble.com/How-to-set-the-path-for-a-uploadfolder--tp16848200p16848200.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 include Javascript in Head tag

2008-04-24 Thread Nino Saturnino Martinez Vazquez Wael

you can also implement iheadercontributor

PJ Pillai wrote:

Hello,

I am new to Wicket. I am trying to build a dynamic navigational menus. I
am building the menuitems from the database in my java code and want to
include it at runtime in the page.

Please see the my html below. I tried label, include component but it
doesn't work. Please note the

span wicket:id=includeinclude menu items here/span towards the end
of the html.

Please help.

Thanks,

Pravin





HTML xmlns:wicket=http://wicket.apache.org;


head


titleSample menu/title


SCRIPT type=text/javascript

var
tWorkPath=/MM2000/HTML/tree-menu/;

/
script




script type=text/javascript language=JavaScript1.2 src=
/MM2000/HTML/tree-menu/dtree.js/script


script

// Lines

var
tpoints = 1;

var
tpointsImage = vpoint.gif;

var
tpointsVImage = hpoint.gif;

var
tpointsCImage = cpoint.gif;



var
tpressedFontColor = #AA;

var
tpathPrefix_img = /MM2000/HTML/img/;

var
tlevelDX = 20;

var
ttoggleMode = 1;

var
texpanded = 0;

var
tcloseExpanded = 0;

var
tcloseExpandedXP = 0;

var
tblankImage = img/blank.gif;

var
tmenuWidth = 200px;

var
tmenuHeight = auto;

var
tabsolute = 1;

var
tleft = 1;

var
ttop = 10;

var
tfloatable = 1;

var
tfloatIterations = 10;

var
tmoveable = 0;

var
tmoveImage = ;

var
tmoveImageHeight = 12;

var
tfontStyle = normal 10pt Tahoma;

var
tfontColor = [#3F3D3D,#7E7C7C];

var
tfontDecoration = [none,underline];

var
titemBackColor = [#FF,#FF];

var
titemAlign = left;

var
titemBackImage = [blank.gif,blank.gif];

var
titemCursor = pointer;

var
titemHeight = 26;

var
titemTarget = _self;

var
ticonWidth = 21;

var
ticonHeight = 15;

var
ticonAlign = left;

var
tmenuBackImage = ;

var
tmenuBackColor = #E0E0E0;

var
tmenuBorderColor = #FF;

var
tmenuBorderStyle = solid;

var
tmenuBorderWidth = 2;

var
texpandBtn =[expandbtn2.gif,expandbtn2.gif,collapsebtn2.gif];

var
texpandBtnW = 9;

var
texpandBtnH = 9;

var
texpandBtnAlign = left

// XP-Style Parameters

var
tXPStyle = 0;

var
tXPIterations = 10; // expand/collapse speed

var
tXPTitleTopBackColor = ;

var
tXPTitleBackColor = #AFB1C3;

var
tXPTitleLeft = xptitleleft_s.gif;

var
tXPTitleLeftWidth = 4;

var
tXPExpandBtn = [xpexpand1_s.gif,xpexpand1_s.gif,xpcollapse1_s.gif,
xpcollapse1_s.gif];

var
tXPTitleBackImg = xptitle_s.gif;

var
tXPBtnWidth = 25;

var
tXPBtnHeight = 23;

var
tXPIconWidth = 31;

var
tXPIconHeight = 32;

var
tXPFilter=1;

var
tXPBorderWidth = 1;

var
tXPBorderColor = '#FF';



var
tstyles =

[

[
tfontDecoration=none,none]

];

var
tmenuItems =

[

span wicket:id=
includeinclude menu items here/span

];

dtree_init();

/
script



/
head


body class=XPSilverTopBack1 topmargin=0 leftmargin=0 rightmargin=0
bottommargin=0 marginheight=0 marginwidth=0

/
body

/
HTML




  


--
-Wicket for love

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


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



Re: How to set the path for a uploadfolder?

2008-04-24 Thread Guðmundur Bjarni Ólafsson
If memory serves, then you can get access to the servlet request, and pull
out the context path from your page via:

getWebRequestCycle().getWebRequest().getHttpServletRequest()

regards,
Guðmundur


On Thu, Apr 24, 2008 at 11:20 AM, unka_hahrry [EMAIL PROTECTED]
wrote:


 Hi!

 I want to save images to a specified uploadfolder, but I don't want to
 define the Folder object with an absolute path. Is there a possiblity to
 define a Folder relative to the context root?
 --
 View this message in context:
 http://www.nabble.com/How-to-set-the-path-for-a-uploadfolder--tp16848200p16848200.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: VOTE: Generics of IDataProvider

2008-04-24 Thread Martijn Dashorst
On 4/24/08, Jan Kriesten [EMAIL PROTECTED] wrote:
  [ ] IDataProviderI,T
  [ ] IteratorIModelT , drop model
  [X] Leave as is.

I don't see the additional benefit of removing the model method. It
only breaks API for nothing much gained.

Martijn

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



Re: How to set the path for a uploadfolder?

2008-04-24 Thread Maurice Marrink
You can also use one of the many methods in the servletcontext. you
can get it from the application.

Maurice

On Thu, Apr 24, 2008 at 11:20 AM, unka_hahrry [EMAIL PROTECTED] wrote:

  Hi!

  I want to save images to a specified uploadfolder, but I don't want to
  define the Folder object with an absolute path. Is there a possiblity to
  define a Folder relative to the context root?
  --
  View this message in context: 
 http://www.nabble.com/How-to-set-the-path-for-a-uploadfolder--tp16848200p16848200.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: StatelessForm + UrlCompressingWebRequestProcessor

2008-04-24 Thread Martin Grigorov
It have to be something with my application settings ...
I just tried with simple quickstart and there is no exception.
Though the produced URL is not compressed again:

form id=loginForm1 action=../login/?wicket:interface=%3A0%
3AloginForm%3A%3AIFormSubmitListener%3A%3A method=post
wicket:id=loginForm

I'll try to debug it.

--martin-g

On Thu, 2008-04-24 at 11:16 +0200, Johan Compagner wrote:
 add a jira issue. (if there isnt already one, there are some but dont
 know for this specific case)
 
 please add a sample.
 
 
 On Thu, Apr 24, 2008 at 10:20 AM, Martin Grigorov
 [EMAIL PROTECTED] wrote:
 Hi,
 
 My application uses UrlCompressingWebRequestProcessor. After
 changing
 the Form in my LoginPage to StatelessForm the following
 exception
 occurred:
 
 ERROR - RequestCycle   - For input string:
 loginForm
 java.lang.NumberFormatException: For input string: loginForm
at
 
 java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.parseInt(Integer.java:497)
at
 
 org.apache.wicket.protocol.http.request.urlcompressing.UrlCompressor.getComponentAndInterfaceForUID(UrlCompressor.java:122)
at
 
 org.apache.wicket.protocol.http.request.urlcompressing.UrlCompressingWebRequestProcessor.resolveListenerInterfaceTarget(UrlCompressingWebRequestProcessor.java:79)
at
 
 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461)
at
 
 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
at
 org.apache.wicket.RequestCycle.step(RequestCycle.java:1224)
at
 org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330)
at
 org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358)
at
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at org.mortbay.jetty.servlet.ServletHandler
 $CachedChain.doFilter(ServletHandler.java:1084)
at
 
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at
 
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
.
 
 It seems that there is no URL compression for stateless forms.
 
 Am I doing something wrong or I should file an issue ?
 
 --martin-g
 
 
 -
 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: Problems with FileUploadField

2008-04-24 Thread Cristi Manole
I really don't think it can be done w/o an iframe.

@Fabien - here's the (simple) code:

http://www.dooriented.com/blog/2008/04/

Cristi Manole

On Wed, Apr 23, 2008 at 5:39 PM, Rüdiger Schulz [EMAIL PROTECTED]
wrote:

 Hello Michael,

 Could you share this fileupload.js? I'd bet it creates some iframe tag via
 DOM manipulation ;-)

 greetings,

 Rüdiger

 2008/4/23 Michael Mehrle [EMAIL PROTECTED]:

  Yeah, that's how it works. There's a fileupload.js that leverages
  jQuery. When the user presses the upload button it does a binary upload
  to a page of your choosing - that's where I had to change the existing
  PHP-integrated lib that I used as a template. I used a Page that was
  accessible via a mapped URI to parse out the stream and store it to the
  backend. Then I bounced back a JSON msg, which can contain various
  status and error notifications. Those can be popped up as JS alerts,
  which is kind of cool. I even managed to bounce back the image id and
  the local path, so that I could do some frontend magic. Works just fine
  - one of the other problems was to make it work with Wicket since the
  component ids had to match. This was done by injecting the proper ids
  into the JS lib when loading the enclosing page.
 
  A bit of a hack, I know - but it's working, which is all I care about.
 
  Michael
 
  -Original Message-
  From: Johan Compagner [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, April 22, 2008 2:29 PM
  To: users@wicket.apache.org
  Subject: Re: Problems with FileUploadField
 
  really?
  are you using the XMLHttpRequest  request to do a binary upload with a
  form
  post?
 
  everywhere on the internet they say that isnt possible
 
  johan
 
 
  On Tue, Apr 22, 2008 at 8:05 PM, Michael Mehrle [EMAIL PROTECTED]
  wrote:
 
   I recently implemented an AJAX based file upload field that works just
   fine. It's works 'outside of Wicket AJAX' but does leverage an AJAX
   fileuploadfield. Let me know if you want to use it, I don't mind
  sharing
   the code. It took a lot of work to make this happen, since the
  original
   jQuery based upload code had to be modified + was a bit buggy to begin
   with.
  
   Cheers,
  
   Michael
  
   -Original Message-
   From: Fabien D. [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, April 22, 2008 7:02 AM
   To: users@wicket.apache.org
   Subject: Re: Problems with FileUploadField
  
  
   My researches show FileUploadField does not support ajax behavior
  
   So there is no wicket input, which permits to the user to browse his
   local
   disk?
  
   Thank you in advance.
  
  
   Fabien D. wrote:
   
Hi, I would like to add a behavior on my FileUploadField
   
But I can't get back the path of the file, or the file
   
this.logo = new FileUploadField(inputLogo);
  logo.setRequired(false);
  logo.add(new AjaxFormComponentUpdatingBehavior(onchange) {
  private static final long serialVersionUID = 1L;
protected void onUpdate(AjaxRequestTarget target) {
   ..
}
   
I have try everything :
   
FileUpload up = logo.getFileUpload(); - null
File file = (File)logo.getModelObject(); - null
logo.getModelObjectAsString() - null
   
So how can i get the file or just the path and the name file
   
   
  
   --
   View this message in context:
  
  http://www.nabble.com/Problems-with-FileUploadField-tp16823823p16824291.
  
  htmlhttp://www.nabble.com/Problems-with-FileUploadField-tp16823823p1682
  4291.html
 http://www.nabble.com/Problems-with-FileUploadField-tp16823823p16824291.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]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 greetings from Berlin,

 Rüdiger Schulz

 www.2rue.de
 www.indyphone.de - Coole Handy Logos einfach selber bauen



Re: Problem with how to make variation

2008-04-24 Thread Mathias P.W Nilsson

Thanks!

Is this really a good idé? What about testing. editing the host files I
guess? Is this what you normally do when building different websites with
the same model?
-- 
View this message in context: 
http://www.nabble.com/Problem-with-how-to-make-variation-tp16834129p16849672.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: DatePicker - CSS errors

2008-04-24 Thread Stefan Simik

Ok, I think, I can live with it ;)
Thx, for the answer .

Stefan Simik
-- 
View this message in context: 
http://www.nabble.com/DatePicker---CSS-errors-tp16834841p16849765.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]



Clicking a tree leaf and confirmation

2008-04-24 Thread Federico Fanton
Hi all!
First of all, I'd like to celebrate the achieved complete elimination of JSF 
from our project here, thanks to Wicket :)

Next, I'm facing a little problem..
I have a LinkTree and I'd like to make it ask for confirmation (via a JS alert) 
whenever the user clicks on a leaf.. If the user confirms, a component of the 
page should be AJAX-refreshed, otherwise nothing happens.
The AJAX part works right now, I need to add the confirmation bit.. I thought 
I'd override BaseTree.newLink and decorate the AJAX call, but from that method 
I can't tell if the link will be related to a leaf or a folder.. Am I going the 
wrong way? Maybe newLink(id, callback) could be expanded to something like 
newLink(id, callback, model)?

Many thanks for your attention!


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



Re: Problem with how to make variation

2008-04-24 Thread StephenP

It seems to be working ok for us although we're not in production yet. One of
our aims is to avoid code duplication across many sites and make deployment
easy (i.e. not having to deploy and cluster individual sites  in their own
war files)

Yes, we do edit the hosts file for testing, but you could investigate if you
could do things with apache virtual hosting or maybe a firefox plugin like
Tamper Data to edit the host header, if thats not an option.

I'll let you decide if its a good idea.


Mathias P.W Nilsson wrote:
 
 Thanks!
 
 Is this really a good idé? What about testing. editing the host files I
 guess? Is this what you normally do when building different websites with
 the same model?
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-how-to-make-variation-tp16834129p16849770.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: VOTE: Generics of IDataProvider

2008-04-24 Thread James Carman
On Thu, Apr 24, 2008 at 3:42 AM, Jan Kriesten [EMAIL PROTECTED] wrote:

  Hi,

  I have a usecase where the current proposed generic Interface for
 IDataProvider with upcoming v1.4 of Wicket would break the implementation
 concept working with Wicket 1.3. The usecase needs different types for
 iterator + model. Example and explanation are found below the vote:

  VOTE:

[ ] IDataProviderI,T
[X] IteratorIModelT , drop model
[X] Leave as is.

I like the idea that the standard usecase is somewhat enforced by
the interface.  I agree that the integer - object mapping usecase is
not common and could lead to performance problems.  However, I'm
somewhat torn between the last two options.  Having that model method
there was somewhat confusing in the first place when I was learning
about it, but that could just be because generics weren't there to
begin with to make it a bit more clear.  If we go with option #2, then
we're basically putting the modelizing logic onto the user.  But, if
we stick with it the way that it is, we're taking care of modelizing
each item in the iterator for them (by using their method of course).
If 99% of the people are going to have to write a method (the
iteratorT - iteratorIModelT transforming method), then why not
just do that stuff for them and allow them a bit to customize it (like
the model method)?

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



Re: Anyway to fix this generic warning?

2008-04-24 Thread ArthIT

Hi,

in Eclipse go to Window - Preferences
Type Generic in the search box. Now you should see the
Java-compiler-Errors/Warnings Node. 
Open it, and change settings under Generic types to whatever you want
(Ignore f.e.)

Cheerz


MYoung wrote:
 
 (Other than using @SupressWarnings)
 
AjaxFallbackButtonPage1 submitButton = new
 AjaxFallbackButtonPage1(submitButton, form) {
 
 @Override protected void onSubmit(AjaxRequestTarget target,
 Form
 f) {  Warning here
 .
 
 Form is a raw type. References to generic type FormT should be
 parameterized.
 
 

-- 
View this message in context: 
http://www.nabble.com/Anyway-to-fix-this-generic-warning--tp16848154p16849776.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 tester calling load twice in loadableDetachableModel

2008-04-24 Thread James Carman
On Wed, Apr 23, 2008 at 10:06 PM, Ned Collyer [EMAIL PROTECTED] wrote:

  Hi I have the following, and its resulting in 2x calls to the load on my
  model - which confuses me.

  My panel has the following in its constructor.

  setModel(new CompoundPropertyModel(new LoadableDetachableModel() {
 protected Object load() {
 return featureService.get(docRef);
 }
  }));


  In my test I have:

  
 expect(mockFeatureService.get(testFeature.getDocRef())).andReturn(testFeature);
  replay(mockFeatureService);

  applicationContext.putBean(featureService, mockFeatureService);

  wicketTester.startPanel(new TestPanelSource() {
 public Panel getTestPanel(String panelId) {
 return new TestFeatureShowPanel(panelId, testFeature.getDocRef());
 }
  });

  wicketTester.assertLabel(panel:title, testFeature.getTitle());

  verify(mockFeatureService);

  When I run this through a jetty server I get 1 call to the load method of
  my TestFeature model.

  When I run the test I get 2 calls to the load method.  The 2nd seems to be
  triggered from the assertLabel call.  If I have many assertLabel calls -
  then its still called only twice.  Ie, more assertLabels do no call load
  again.

  Any ideas why?


The first call to load happens during rendering.  When rendering is
done, your model is detached.  Then, the call to assertLabel() forces
the model to be loaded again.  Then, subsequent calls to assertLabel()
would not require a load because the model hasn't been detached.

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



Re: Wicket tester calling load twice in loadableDetachableModel

2008-04-24 Thread James Carman
On Thu, Apr 24, 2008 at 6:56 AM, James Carman
[EMAIL PROTECTED] wrote:
 On Wed, Apr 23, 2008 at 10:06 PM, Ned Collyer [EMAIL PROTECTED] wrote:
  
Hi I have the following, and its resulting in 2x calls to the load on my
model - which confuses me.
  
My panel has the following in its constructor.
  
setModel(new CompoundPropertyModel(new LoadableDetachableModel() {
   protected Object load() {
   return featureService.get(docRef);
   }
}));
  
  
In my test I have:
  

 expect(mockFeatureService.get(testFeature.getDocRef())).andReturn(testFeature);
replay(mockFeatureService);
  
applicationContext.putBean(featureService, mockFeatureService);
  
wicketTester.startPanel(new TestPanelSource() {
   public Panel getTestPanel(String panelId) {
   return new TestFeatureShowPanel(panelId, testFeature.getDocRef());
   }
});
  
wicketTester.assertLabel(panel:title, testFeature.getTitle());
  
verify(mockFeatureService);

Can you move the verify stuff up above the assertLabel?  Would that
help?  The verification you're looking for is to verify that stuff is
called correctly during rendering.  The assertions don't need to go on
within the context of the replay of the mocks.

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



Re: Problem with how to make variation

2008-04-24 Thread Mathias P.W Nilsson

Thanks you very much. Do you set up virtual hosts in tomcat, JBoss that all
points to the same application?

This is what I got so far.

public class HairlessSession extends WebSession
{

private static final long serialVersionUID = 1L;

public HairlessSession( Request request ){
super( request );

String hostname = ((WebRequest)
request).getHttpServletRequest().getHeader(host); 
System.out.println( host:  + hostname );

}

}


-- 
View this message in context: 
http://www.nabble.com/Problem-with-how-to-make-variation-tp16834129p16849801.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]



Gzipping of pages (HTML output, not only resources)

2008-04-24 Thread Stefan Simik

Hi boys, 

I would like to ask, how it is possible to  gzip output of wicket pages
(html). 
I like gzipping of resources in wicket and I would like to add gzipping all
pages (i.e. html output) too.

Please, where in wicket can I add such a functionality or what/where should
I something wrap
to make it work ?

Stefan Simik

-- 
View this message in context: 
http://www.nabble.com/Gzipping-of-pages-%28HTML-output%2C-not-only-resources%29-tp16849900p16849900.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: Problem with how to make variation

2008-04-24 Thread Mathias P.W Nilsson

Another question for this.. 

The site1.com text will be different from Site2.com text even if the
resource key is the same the
text will not be the same. Can you set a resource based on locale and style?
-- 
View this message in context: 
http://www.nabble.com/Problem-with-how-to-make-variation-tp16834129p16850004.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: default spring transaction on request cycle

2008-04-24 Thread Stefan Selariu
Thanks for your answer, but sadly this is not possible.
I cannot group the beans in one service because the beans are invoked
from different wicket components.
I need the request cycle to be transactional because on the submit event
one component calls the required transactional service and at render
time the page components sometimes need to invoke other transactional
beans to complete the rendering.

If I quit using spring's transactions support I could use onBeginRequest
and onEndRequest to start and close the transaction. This approach is
very limited (no nested transactions, very complicated transaction
exceptions handling, the spring beans need to be aware of the
transactions) and I don't like it :)

Has anyone an idea why RequestCycle is a class and not an interface?
This is a problem in my case :(

Thanks again.
Stefan

On Thu, 2008-04-24 at 11:03 +0200, lars vonk wrote:
 I would advice you to group the transactional beans in one Service, define
 that service in Spring and make it transactional. By using the proper
 Transaction Propagation levels the wrapped beans can use existing
 transactions if there is one.
 
 See
 http://static.springframework.org/spring/docs/2.5.x/reference/transaction.htmlfor
 more info on Spring and Transactions.
 
 Lars
 
 
 On Thu, Apr 24, 2008 at 10:01 AM, Stefan Selariu [EMAIL PROTECTED]
 wrote:
 
  Hi!
 
  I need to call inside a request cycle an unknown number of transactional
  spring beans. How can I call those beans within the same transaction?
 
  Thanks.
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



Re: Problem with how to make variation

2008-04-24 Thread StephenP

Yes



Mathias P.W Nilsson wrote:
 
 Another question for this.. 
 
 The site1.com text will be different from Site2.com text even if the
 resource key is the same the
 text will not be the same. Can you set a resource based on locale and
 style?
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-how-to-make-variation-tp16834129p16850169.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: Gzipping of pages (HTML output, not only resources)

2008-04-24 Thread Nino Saturnino Martinez Vazquez Wael
At our wug CPH yesterday we talked about something similar (ajax), I 
think theres no direct way currently. However you can setup a filter 
which does that.


http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html

Stefan Simik wrote:
Hi boys, 


I would like to ask, how it is possible to  gzip output of wicket pages
(html). 
I like gzipping of resources in wicket and I would like to add gzipping all

pages (i.e. html output) too.

Please, where in wicket can I add such a functionality or what/where should
I something wrap
to make it work ?

Stefan Simik

  


--
-Wicket for love

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


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



Modal Window not opening the second time

2008-04-24 Thread Marieke Vandamme

Hello, 

i'm having problems with the modal window. It shows up fine when I click my
link the first time, but after closing the window with the 'X', it won't
open again.
I don't know if I'm using it wrong or if it's a bug. 
Any help is welcome ! thanks. Marieke.

My code :
public class TestModalWindow extends WebPage {

public TestModalWindow() {
final ModalWindow modal = new ModalWindow(dataChooser);
add(modal);
final MyChooser myChooser = new MyChooser(modal);
modal.setPageCreator(new ModalWindow.PageCreator() {

public Page createPage() {
return myChooser;
}
});

 add(new AjaxLink(lnkOpen) {

public void onClick(AjaxRequestTarget target) {
myChooser.reload(target);
}
});
}

public class MyChooser extends WebPage {

private ModalWindow window;

public MyChooser(ModalWindow w) {
this.window = w;
}

public void reload(AjaxRequestTarget target) {
this.window.show(target);
}
}
}
-- 
View this message in context: 
http://www.nabble.com/Modal-Window-not-opening-the-second-time-tp16850180p16850180.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: Problem with how to make variation

2008-04-24 Thread Mathias P.W Nilsson

Jepp, pagename_style_language.properties.


Thank you for your feedback. I will go with this stratergy
-- 
View this message in context: 
http://www.nabble.com/Problem-with-how-to-make-variation-tp16834129p16850182.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: default spring transaction on request cycle

2008-04-24 Thread lars vonk
I wouldn't advice you to do it in the requestcycle for the reasons you
already describe yourself:

- Too cumbersome
- All request are then in a Transaction (might no be a problem though).
- How to detect that a rollback is needed.

You could still use Spring transaction though: This could be a possible
implementation, but I don't know if this is rock solid especially the
rollback I am not sure about. This approach  will enable nested transaction
IHMO since it still uses the spring configured transactions.

class TransactionalRequestCycle extends WebRequestCycle {

  @SpringBean private TransactionManager txManager

  private TransactionStatus status;

  public TransactionRequestCycle() {
// this will inject the txManager from the spring context.
InjectorHolder.getInjector().inject(this);
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
def.setPropagationBehavior(...);
  }

  protected void onBeginRequest() {
status = txManager.getTransaction(def);
  }

  protected void onEndRequest() {
txManager.commit(status);
  }
  protected void onRuntimeException() {
if(status != null)
  txManager.rollback(status);
  }
}

On Thu, Apr 24, 2008 at 1:18 PM, Stefan Selariu [EMAIL PROTECTED]
wrote:

 Thanks for your answer, but sadly this is not possible.
 I cannot group the beans in one service because the beans are invoked
 from different wicket components.
 I need the request cycle to be transactional because on the submit event
 one component calls the required transactional service and at render
 time the page components sometimes need to invoke other transactional
 beans to complete the rendering.

 If I quit using spring's transactions support I could use onBeginRequest
 and onEndRequest to start and close the transaction. This approach is
 very limited (no nested transactions, very complicated transaction
 exceptions handling, the spring beans need to be aware of the
 transactions) and I don't like it :)

 Has anyone an idea why RequestCycle is a class and not an interface?
 This is a problem in my case :(

 Thanks again.
 Stefan

 On Thu, 2008-04-24 at 11:03 +0200, lars vonk wrote:
  I would advice you to group the transactional beans in one Service,
 define
  that service in Spring and make it transactional. By using the proper
  Transaction Propagation levels the wrapped beans can use existing
  transactions if there is one.
 
  See
 
 http://static.springframework.org/spring/docs/2.5.x/reference/transaction.htmlfor
  more info on Spring and Transactions.
 
  Lars
 
 
  On Thu, Apr 24, 2008 at 10:01 AM, Stefan Selariu 
 [EMAIL PROTECTED]
  wrote:
 
   Hi!
  
   I need to call inside a request cycle an unknown number of
 transactional
   spring beans. How can I call those beans within the same transaction?
  
   Thanks.
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  


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




Re: Clicking a tree leaf and confirmation

2008-04-24 Thread Thomas Kappler
Hi Federico,

you gain a lot of flexibility when overriding newNodeComponent()
instead.  There, you return a custom Panel where you can do what you
want, i.e., add the link with all desired functionality.  And you can
of course give your Panel any constructor you like.

An example from our project:

protected Component newNodeComponent(String id, IModel model) {
return new SenseLinkPanel(id, SensesTabPanel.this,
(DefaultMutableTreeNode) 
model.getObject())
.setOutputMarkupId(true);
}

SenseLinkPanel is basically an AjaxLink with the right onClick()
functionality.  You see that via the constructor it gets the TreeNode
it represents, and the Panel the tree is in to update it via AJAX.

Cheers,
Thomas


On Thu, Apr 24, 2008 at 12:38 PM, Federico Fanton [EMAIL PROTECTED] wrote:
 Hi all!
  First of all, I'd like to celebrate the achieved complete elimination of JSF 
 from our project here, thanks to Wicket :)

  Next, I'm facing a little problem..
  I have a LinkTree and I'd like to make it ask for confirmation (via a JS 
 alert) whenever the user clicks on a leaf.. If the user confirms, a component 
 of the page should be AJAX-refreshed, otherwise nothing happens.
  The AJAX part works right now, I need to add the confirmation bit.. I 
 thought I'd override BaseTree.newLink and decorate the AJAX call, but from 
 that method I can't tell if the link will be related to a leaf or a folder.. 
 Am I going the wrong way? Maybe newLink(id, callback) could be expanded to 
 something like newLink(id, callback, model)?

  Many thanks for your attention!


  -
  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 tester calling load twice in loadableDetachableModel

2008-04-24 Thread Ned Collyer
Thanks for the feedback - an interesting work around :)

Generally I'd put my general service expectations in the setUp() and my
verifies in the tearDown(), but I think I'm comfortable moving the verify in
this circumstance.

Rgds

Ned

On Thu, Apr 24, 2008 at 8:58 PM, James Carman [EMAIL PROTECTED]
wrote:



 Can you move the verify stuff up above the assertLabel?  Would that
 help?  The verification you're looking for is to verify that stuff is
 called correctly during rendering.  The assertions don't need to go on
 within the context of the replay of the mocks.




Re: default spring transaction on request cycle

2008-04-24 Thread Stefan Selariu
I tried this approach but without the wicket-spring module, and it
didn't work (No spring web application and no springbean annotations).
Maybe it works this way. I'll give it a try (but I'm not very sure that
it helps since spring loses the transactional context, or at least so I
think)
Is there an maven archetype for a wicket-spring project?
Where is the documentation for wicket-spring?

Many thanks :)
Stefan


On Thu, 2008-04-24 at 13:36 +0200, lars vonk wrote:
 I wouldn't advice you to do it in the requestcycle for the reasons you
 already describe yourself:
 
 - Too cumbersome
 - All request are then in a Transaction (might no be a problem though).
 - How to detect that a rollback is needed.
 
 You could still use Spring transaction though: This could be a possible
 implementation, but I don't know if this is rock solid especially the
 rollback I am not sure about. This approach  will enable nested transaction
 IHMO since it still uses the spring configured transactions.
 
 class TransactionalRequestCycle extends WebRequestCycle {
 
   @SpringBean private TransactionManager txManager
 
   private TransactionStatus status;
 
   public TransactionRequestCycle() {
 // this will inject the txManager from the spring context.
 InjectorHolder.getInjector().inject(this);
 DefaultTransactionDefinition def = new DefaultTransactionDefinition();
 def.setPropagationBehavior(...);
   }
 
   protected void onBeginRequest() {
 status = txManager.getTransaction(def);
   }
 
   protected void onEndRequest() {
 txManager.commit(status);
   }
   protected void onRuntimeException() {
 if(status != null)
   txManager.rollback(status);
   }
 }
 
 On Thu, Apr 24, 2008 at 1:18 PM, Stefan Selariu [EMAIL PROTECTED]
 wrote:
 
  Thanks for your answer, but sadly this is not possible.
  I cannot group the beans in one service because the beans are invoked
  from different wicket components.
  I need the request cycle to be transactional because on the submit event
  one component calls the required transactional service and at render
  time the page components sometimes need to invoke other transactional
  beans to complete the rendering.
 
  If I quit using spring's transactions support I could use onBeginRequest
  and onEndRequest to start and close the transaction. This approach is
  very limited (no nested transactions, very complicated transaction
  exceptions handling, the spring beans need to be aware of the
  transactions) and I don't like it :)
 
  Has anyone an idea why RequestCycle is a class and not an interface?
  This is a problem in my case :(
 
  Thanks again.
  Stefan
 
  On Thu, 2008-04-24 at 11:03 +0200, lars vonk wrote:
   I would advice you to group the transactional beans in one Service,
  define
   that service in Spring and make it transactional. By using the proper
   Transaction Propagation levels the wrapped beans can use existing
   transactions if there is one.
  
   See
  
  http://static.springframework.org/spring/docs/2.5.x/reference/transaction.htmlfor
   more info on Spring and Transactions.
  
   Lars
  
  
   On Thu, Apr 24, 2008 at 10:01 AM, Stefan Selariu 
  [EMAIL PROTECTED]
   wrote:
  
Hi!
   
I need to call inside a request cycle an unknown number of
  transactional
spring beans. How can I call those beans within the same transaction?
   
Thanks.
   
   
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



Re: default spring transaction on request cycle

2008-04-24 Thread lars vonk
Well it technically shouldn't matter if you use the wicket-spring module I
guess.
It think it matters that you use the same TransactionManager and the correct
Propagation behavior (REQUIRED iirc). Did you use the same
transactionmanager in your previous attempt and what was the propagation
setting you used?

For wicket-spring see http://cwiki.apache.org/WICKET/spring.html, I would
suggest you use the annotation based approach.

On Thu, Apr 24, 2008 at 1:55 PM, Stefan Selariu [EMAIL PROTECTED]
wrote:

 I tried this approach but without the wicket-spring module, and it
 didn't work (No spring web application and no springbean annotations).
 Maybe it works this way. I'll give it a try (but I'm not very sure that
 it helps since spring loses the transactional context, or at least so I
 think)
 Is there an maven archetype for a wicket-spring project?
 Where is the documentation for wicket-spring?

 Many thanks :)
 Stefan


 On Thu, 2008-04-24 at 13:36 +0200, lars vonk wrote:
  I wouldn't advice you to do it in the requestcycle for the reasons you
  already describe yourself:
 
  - Too cumbersome
  - All request are then in a Transaction (might no be a problem though).
  - How to detect that a rollback is needed.
 
  You could still use Spring transaction though: This could be a possible
  implementation, but I don't know if this is rock solid especially the
  rollback I am not sure about. This approach  will enable nested
 transaction
  IHMO since it still uses the spring configured transactions.
 
  class TransactionalRequestCycle extends WebRequestCycle {
 
@SpringBean private TransactionManager txManager
 
private TransactionStatus status;
 
public TransactionRequestCycle() {
  // this will inject the txManager from the spring context.
  InjectorHolder.getInjector().inject(this);
  DefaultTransactionDefinition def = new
 DefaultTransactionDefinition();
  def.setPropagationBehavior(...);
}
 
protected void onBeginRequest() {
  status = txManager.getTransaction(def);
}
 
protected void onEndRequest() {
  txManager.commit(status);
}
protected void onRuntimeException() {
  if(status != null)
txManager.rollback(status);
}
  }
 
  On Thu, Apr 24, 2008 at 1:18 PM, Stefan Selariu [EMAIL PROTECTED]
 
  wrote:
 
   Thanks for your answer, but sadly this is not possible.
   I cannot group the beans in one service because the beans are invoked
   from different wicket components.
   I need the request cycle to be transactional because on the submit
 event
   one component calls the required transactional service and at render
   time the page components sometimes need to invoke other transactional
   beans to complete the rendering.
  
   If I quit using spring's transactions support I could use
 onBeginRequest
   and onEndRequest to start and close the transaction. This approach is
   very limited (no nested transactions, very complicated transaction
   exceptions handling, the spring beans need to be aware of the
   transactions) and I don't like it :)
  
   Has anyone an idea why RequestCycle is a class and not an interface?
   This is a problem in my case :(
  
   Thanks again.
   Stefan
  
   On Thu, 2008-04-24 at 11:03 +0200, lars vonk wrote:
I would advice you to group the transactional beans in one Service,
   define
that service in Spring and make it transactional. By using the
 proper
Transaction Propagation levels the wrapped beans can use existing
transactions if there is one.
   
See
   
  
 http://static.springframework.org/spring/docs/2.5.x/reference/transaction.htmlfor
more info on Spring and Transactions.
   
Lars
   
   
On Thu, Apr 24, 2008 at 10:01 AM, Stefan Selariu 
   [EMAIL PROTECTED]
wrote:
   
 Hi!

 I need to call inside a request cycle an unknown number of
   transactional
 spring beans. How can I call those beans within the same
 transaction?

 Thanks.




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


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


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




Re: Gzipping of pages (HTML output, not only resources)

2008-04-24 Thread lars vonk
Isn't this also something you could let an Apache Webserver do (if you put
that in front of your Appserver)? Or maybe Appserver can also do this
out-of-the-box?

On Thu, Apr 24, 2008 at 1:56 PM, Stefan Simik [EMAIL PROTECTED]
wrote:


 I thought about it, and I have 2 ideas:


 1. IDEA
 
  a) totally disable gzip in wicket --
 getResourceSettings().setDisableGZipCompression(true);
  b) use Gzip filter BEFORE wicket-filter. This Gzip filter will compress
 all the communication -
  HTML, resources  . Images and some mime-types should be omitted.



 2. IDEA
 -
  add gzipping funcionality to wicket by wrapping the servlet response.
 this
 wrapper will detect
  if there is a text/html mime-type, and only these mime-type will
 compress.
  So we add new compressing functionality pages (html)  to existing
 functionaliyt of compressing resources.


 Whad do you think about it a what would you prefer ?

 --
 View this message in context:
 http://www.nabble.com/Gzipping-of-pages-%28HTML-output%2C-not-only-resources%29-tp16849900p16850197.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: Clicking a tree leaf and confirmation

2008-04-24 Thread Federico Fanton
On Thu, 24 Apr 2008 13:44:15 +0200
Thomas Kappler [EMAIL PROTECTED] wrote:

 Hi Federico,
 
 you gain a lot of flexibility when overriding newNodeComponent()
 instead.  There, you return a custom Panel where you can do what you
 want, i.e., add the link with all desired functionality.  And you can
 of course give your Panel any constructor you like.

I see, thanks for your answer :)
I knew about newNodeComponent, but since the only difference between the 
standard LinkTree and my implementation is in the AJAX call, I was looking for 
a solution that could touch just that part.. I'll go with your suggestion 
though, thanks again!


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



Re: Gzipping of pages (HTML output, not only resources)

2008-04-24 Thread Martin Grigorov

in MyApplication.java:

@Override
public WebResponse newWebResponse(final HttpServletResponse
httpResponse) {
return (getRequestCycleSettings().getBufferResponse() 
? new 
BufferedCompressingWebResponse(httpResponse) 
: new CompressingWebResponse(httpResponse));
}

These CompressingWebResponses are wrappers of regular
(Buffered)WebResponse + gzip compression.


On Thu, 2008-04-24 at 14:07 +0200, lars vonk wrote:
 Isn't this also something you could let an Apache Webserver do (if you put
 that in front of your Appserver)? Or maybe Appserver can also do this
 out-of-the-box?
 
 On Thu, Apr 24, 2008 at 1:56 PM, Stefan Simik [EMAIL PROTECTED]
 wrote:
 
 
  I thought about it, and I have 2 ideas:
 
 
  1. IDEA
  
   a) totally disable gzip in wicket --
  getResourceSettings().setDisableGZipCompression(true);
   b) use Gzip filter BEFORE wicket-filter. This Gzip filter will compress
  all the communication -
   HTML, resources  . Images and some mime-types should be omitted.
 
 
 
  2. IDEA
  -
   add gzipping funcionality to wicket by wrapping the servlet response.
  this
  wrapper will detect
   if there is a text/html mime-type, and only these mime-type will
  compress.
   So we add new compressing functionality pages (html)  to existing
  functionaliyt of compressing resources.
 
 
  Whad do you think about it a what would you prefer ?
 
  --
  View this message in context:
  http://www.nabble.com/Gzipping-of-pages-%28HTML-output%2C-not-only-resources%29-tp16849900p16850197.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: default spring transaction on request cycle

2008-04-24 Thread Stefan Selariu
No, the propagation was not set to REQUIRED. Is it not the default
propagation setting?
In what way to use the same TransactionManager? The same
TransactionManager spring bean? Or the same TransactionManager spring
bean instance?

Thanks.
Stefan


On Thu, 2008-04-24 at 14:03 +0200, lars vonk wrote:
 Well it technically shouldn't matter if you use the wicket-spring module I
 guess.
 It think it matters that you use the same TransactionManager and the correct
 Propagation behavior (REQUIRED iirc). Did you use the same
 transactionmanager in your previous attempt and what was the propagation
 setting you used?
 
 For wicket-spring see http://cwiki.apache.org/WICKET/spring.html, I would
 suggest you use the annotation based approach.
 
 On Thu, Apr 24, 2008 at 1:55 PM, Stefan Selariu [EMAIL PROTECTED]
 wrote:
 
  I tried this approach but without the wicket-spring module, and it
  didn't work (No spring web application and no springbean annotations).
  Maybe it works this way. I'll give it a try (but I'm not very sure that
  it helps since spring loses the transactional context, or at least so I
  think)
  Is there an maven archetype for a wicket-spring project?
  Where is the documentation for wicket-spring?
 
  Many thanks :)
  Stefan
 
 
  On Thu, 2008-04-24 at 13:36 +0200, lars vonk wrote:
   I wouldn't advice you to do it in the requestcycle for the reasons you
   already describe yourself:
  
   - Too cumbersome
   - All request are then in a Transaction (might no be a problem though).
   - How to detect that a rollback is needed.
  
   You could still use Spring transaction though: This could be a possible
   implementation, but I don't know if this is rock solid especially the
   rollback I am not sure about. This approach  will enable nested
  transaction
   IHMO since it still uses the spring configured transactions.
  
   class TransactionalRequestCycle extends WebRequestCycle {
  
 @SpringBean private TransactionManager txManager
  
 private TransactionStatus status;
  
 public TransactionRequestCycle() {
   // this will inject the txManager from the spring context.
   InjectorHolder.getInjector().inject(this);
   DefaultTransactionDefinition def = new
  DefaultTransactionDefinition();
   def.setPropagationBehavior(...);
 }
  
 protected void onBeginRequest() {
   status = txManager.getTransaction(def);
 }
  
 protected void onEndRequest() {
   txManager.commit(status);
 }
 protected void onRuntimeException() {
   if(status != null)
 txManager.rollback(status);
 }
   }
  
   On Thu, Apr 24, 2008 at 1:18 PM, Stefan Selariu [EMAIL PROTECTED]
  
   wrote:
  
Thanks for your answer, but sadly this is not possible.
I cannot group the beans in one service because the beans are invoked
from different wicket components.
I need the request cycle to be transactional because on the submit
  event
one component calls the required transactional service and at render
time the page components sometimes need to invoke other transactional
beans to complete the rendering.
   
If I quit using spring's transactions support I could use
  onBeginRequest
and onEndRequest to start and close the transaction. This approach is
very limited (no nested transactions, very complicated transaction
exceptions handling, the spring beans need to be aware of the
transactions) and I don't like it :)
   
Has anyone an idea why RequestCycle is a class and not an interface?
This is a problem in my case :(
   
Thanks again.
Stefan
   
On Thu, 2008-04-24 at 11:03 +0200, lars vonk wrote:
 I would advice you to group the transactional beans in one Service,
define
 that service in Spring and make it transactional. By using the
  proper
 Transaction Propagation levels the wrapped beans can use existing
 transactions if there is one.

 See

   
  http://static.springframework.org/spring/docs/2.5.x/reference/transaction.htmlfor
 more info on Spring and Transactions.

 Lars


 On Thu, Apr 24, 2008 at 10:01 AM, Stefan Selariu 
[EMAIL PROTECTED]
 wrote:

  Hi!
 
  I need to call inside a request cycle an unknown number of
transactional
  spring beans. How can I call those beans within the same
  transaction?
 
  Thanks.
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
   
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Building javadoc for Wicket 1.4 from svn download

2008-04-24 Thread Stefan Lindner
The current Wicket 1.4 trunk does not create javadocs anymore (as
described on this list and on the build webpage). How can I create the
javadoc files with maven? I don't know maven mechanisms for this task.

When I build the project with maven javadoc:javadoc, the javadocs are
generated in the target directorys but not packed to jar files. How can
I let maven create the javadoc jar files?

Stefan

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



Re: Building javadoc for Wicket 1.4 from svn download

2008-04-24 Thread Martijn Dashorst
iirc:

mvn -Prelease install

Martijn

On 4/24/08, Stefan Lindner [EMAIL PROTECTED] wrote:
 The current Wicket 1.4 trunk does not create javadocs anymore (as
  described on this list and on the build webpage). How can I create the
  javadoc files with maven? I don't know maven mechanisms for this task.

  When I build the project with maven javadoc:javadoc, the javadocs are
  generated in the target directorys but not packed to jar files. How can
  I let maven create the javadoc jar files?

  Stefan

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




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

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



Re: default spring transaction on request cycle

2008-04-24 Thread lars vonk

 Is it not the default propagation setting?


Yes you are correct.

In what way to use the same TransactionManager? The same
 TransactionManager spring bean? Or the same TransactionManager spring bean
 instance?


I meant instance.

Again I am not sure if this is enough, Mixing manual and spring managed
transaction goes a bit above my transaction management experience.

Lars.

On Thu, Apr 24, 2008 at 2:25 PM, Stefan Selariu [EMAIL PROTECTED]
wrote:

 No, the propagation was not set to REQUIRED. Is it not the default
 propagation setting?
 In what way to use the same TransactionManager? The same
 TransactionManager spring bean? Or the same TransactionManager spring
 bean instance?

 Thanks.
 Stefan


 On Thu, 2008-04-24 at 14:03 +0200, lars vonk wrote:
  Well it technically shouldn't matter if you use the wicket-spring module
 I
  guess.
  It think it matters that you use the same TransactionManager and the
 correct
  Propagation behavior (REQUIRED iirc). Did you use the same
  transactionmanager in your previous attempt and what was the propagation
  setting you used?
 
  For wicket-spring see http://cwiki.apache.org/WICKET/spring.html, I
 would
  suggest you use the annotation based approach.
 
  On Thu, Apr 24, 2008 at 1:55 PM, Stefan Selariu [EMAIL PROTECTED]
 
  wrote:
 
   I tried this approach but without the wicket-spring module, and it
   didn't work (No spring web application and no springbean annotations).
   Maybe it works this way. I'll give it a try (but I'm not very sure
 that
   it helps since spring loses the transactional context, or at least so
 I
   think)
   Is there an maven archetype for a wicket-spring project?
   Where is the documentation for wicket-spring?
  
   Many thanks :)
   Stefan
  
  
   On Thu, 2008-04-24 at 13:36 +0200, lars vonk wrote:
I wouldn't advice you to do it in the requestcycle for the reasons
 you
already describe yourself:
   
- Too cumbersome
- All request are then in a Transaction (might no be a problem
 though).
- How to detect that a rollback is needed.
   
You could still use Spring transaction though: This could be a
 possible
implementation, but I don't know if this is rock solid especially
 the
rollback I am not sure about. This approach  will enable nested
   transaction
IHMO since it still uses the spring configured transactions.
   
class TransactionalRequestCycle extends WebRequestCycle {
   
  @SpringBean private TransactionManager txManager
   
  private TransactionStatus status;
   
  public TransactionRequestCycle() {
// this will inject the txManager from the spring context.
InjectorHolder.getInjector().inject(this);
DefaultTransactionDefinition def = new
   DefaultTransactionDefinition();
def.setPropagationBehavior(...);
  }
   
  protected void onBeginRequest() {
status = txManager.getTransaction(def);
  }
   
  protected void onEndRequest() {
txManager.commit(status);
  }
  protected void onRuntimeException() {
if(status != null)
  txManager.rollback(status);
  }
}
   
On Thu, Apr 24, 2008 at 1:18 PM, Stefan Selariu 
 [EMAIL PROTECTED]
   
wrote:
   
 Thanks for your answer, but sadly this is not possible.
 I cannot group the beans in one service because the beans are
 invoked
 from different wicket components.
 I need the request cycle to be transactional because on the submit
   event
 one component calls the required transactional service and at
 render
 time the page components sometimes need to invoke other
 transactional
 beans to complete the rendering.

 If I quit using spring's transactions support I could use
   onBeginRequest
 and onEndRequest to start and close the transaction. This approach
 is
 very limited (no nested transactions, very complicated transaction
 exceptions handling, the spring beans need to be aware of the
 transactions) and I don't like it :)

 Has anyone an idea why RequestCycle is a class and not an
 interface?
 This is a problem in my case :(

 Thanks again.
 Stefan

 On Thu, 2008-04-24 at 11:03 +0200, lars vonk wrote:
  I would advice you to group the transactional beans in one
 Service,
 define
  that service in Spring and make it transactional. By using the
   proper
  Transaction Propagation levels the wrapped beans can use
 existing
  transactions if there is one.
 
  See
 

  
 http://static.springframework.org/spring/docs/2.5.x/reference/transaction.htmlfor
  more info on Spring and Transactions.
 
  Lars
 
 
  On Thu, Apr 24, 2008 at 10:01 AM, Stefan Selariu 
 [EMAIL PROTECTED]
  wrote:
 
   Hi!
  
   I need to call inside a request cycle an unknown number of
 transactional
   spring beans. How can I call those beans within the same
   transaction?
  
   Thanks.
  

Re: am I doing right? entities no Serializables.

2008-04-24 Thread Martijn Dashorst
for a new entity you can always return a new entity. There is no need
to keep the filled in data between requests :-) as the fields have the
data already... When you return a new object Wicket's form update
mechanism will repopulate the object's fields.

Martijn

On 4/19/08, Fernando Wermus [EMAIL PROTECTED] wrote:
 I try to spend the less memory I can using LoadableDetachableModel. But if
  the user is filling up a form for a new entity I think I have two options,
  one serialize and the other create a kind of dto. I don't like the first
  because I don't want my domain model be modified by the web tier
  (Serializable interface) and I don't like the second because I prefer
  languages as Smalltalk, Grovee or Ruby which you don't need dtos either
  serializable interfaces. That's why I was speaking up. I like wicket and
  maybe I could find another way.

  ps: I am using db4o as my data object base (in this prototype). I know a guy
  who make wicket serialize their entities using db4o, but I don't know how
  hard is replace the serializable wicket mechanism.

  On Fri, Apr 18, 2008 at 7:30 PM, James Carman [EMAIL PROTECTED]
  wrote:


   I like for my entities to always be serializable.  Is there some
   special requirement to have a non-serializable field on your entity
   class?
  
   On Fri, Apr 18, 2008 at 4:50 PM, Fernando Wermus
   [EMAIL PROTECTED] wrote:
I am finishing my first app for production in wicket. As any newbie I try
   to
 make a side relevant non-functional problems to focus in which I
   consider
 important.
 I was implementing Serializable in all my entities, but I have to change
   now
 that. I ve done it using LoadableDetachableModel. But I couldn't do it
   in
 some parts. When the user walks over a wizard to create an entity, I
   just
 attached to the wizard a new entity and, finally I persist it in the las
 step. But, I have to change that now, because the entity is not
   Serializable
 anymore.
   
  Which is the best way?
   
 I think it is attaching a model which have all the attributes needed for
   the
 creation of the entity and at the end I have to copy the whole
   information
 to my entity, doesn' it? (like I was doing with j2ee DTO :( ). Then I
   have a
 modelForm of the view and my entities at the end of the steps.
   
 Is there a best approach to it?
   
 Bye!
   
 ps: sorry for my english.
 --
 Fernando Wermus.
   
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  



 --

 Fernando Wermus.



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

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



Re: Gzipping of pages (HTML output, not only resources)

2008-04-24 Thread Stefan Simik



Stefan Simik wrote:
 
 1. IDEA
 
   a) totally disable gzip in wicket --  
 getResourceSettings().setDisableGZipCompression(true);
   b) use Gzip filter BEFORE wicket-filter. This Gzip filter will compress
 all the communication -
   HTML, resources  . Images and some mime-types should be omitted.
 

Probably, there is one drawback in IDEA 1.
Wicket already caches the processed(gzipped) result, what is very useful. 
This functionality should be moved to the Gzip filter, which can be a lot of
effort.

-- 
View this message in context: 
http://www.nabble.com/Gzipping-of-pages-%28HTML-output%2C-not-only-resources%29-tp16849900p16850433.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 set the path for a uploadfolder?

2008-04-24 Thread Mathias P.W Nilsson

Not quite sure but you can get the folder that is the root of your
application context

File file = new File( getServletContext().getRealPath( / ) );
-- 
View this message in context: 
http://www.nabble.com/How-to-set-the-path-for-a-uploadfolder--tp16848200p16850438.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: DropDownChoice getting value into the model

2008-04-24 Thread Russell Webb

I am experiencing something similar. My LoadableDetachableModel is wrapped
with a CompoundPropertyModel.

Submitting a TexTField acquires the AttachedCompoundPropertyModel whose
setObject() acquires the target object and persists changes. 
   
CompoundPropertyModel$AttachedCompoundPropertyModel(AbstractPropertyModel).setObject(Object)
line: 146   
TextField(Component).setModelObject(Object) line: 2888  
TextField(FormComponent).updateModel() line: 1060   
Form$19.validate(FormComponent) line: 1754  

Submitting the dropdown acquires the read only setObject()
VxsNewUserWizard$3(AbstractReadOnlyModel).setObject(Object) line: 52
BoundCompoundPropertyModel(CompoundPropertyModel).setObject(Object)
line: 72
DropDownChoice(Component).setModelObject(Object) line: 2888 
DropDownChoice(FormComponent).updateModel() line: 1060  
Form$19.validate(FormComponent) line: 1754  

It seems the model is linked to the two components differently and that this
causes different behaviour when using a CompoundPropertyModel (and perhaps
others) like allowing the ReadOnlyModel.setObject to be bypassed. 

Russ



igor.vaynberg wrote:
 
 perhaps because your textfield is setting a property of the object
 loaded by the model, not the object itself.
 
 -igor
 
 
 On Fri, Mar 7, 2008 at 1:48 PM, rmattler [EMAIL PROTECTED] wrote:

  Thanks for the quick reply.  But you answer doesn't make sense to me. 
 Why do
  loadable models work for a text field but not a drop down?  If I have
 NY
  stored in the database, New York is loaded onto the form but when the
 form
  is submitted the selected value of the drop down is not saved into the
  model.  I'm trying to get the selected value stored into the Vendor
 object
  and a String not a SelectOption.

  public class Vendor implements java.io.Serializable {

 private String state;





  two problems

  1) loadable detachable models do not support the setobject() call,
  because they are...loadable. so you should use a different kind of
  model.

  2) yes, selectoption object will be put into your model, dropdown
  choice works like this:

  DropDownChoiceT(String id, IModelT model, IModelListT choices,
  IChoiceRenrererT renderer)

  -igor


  --
  View this message in context:
 http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15907046.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/DropDownChoice-getting-value-into-the-model-tp15905486p16850440.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: WicketTester: persistant error msg?

2008-04-24 Thread Martijn Dashorst
did you call

tester.setupRequestAndResponse() between your submissions?

^^^ method name might be different

Martijn

On 4/18/08, Michael Perkonigg [EMAIL PROTECTED] wrote:
 Hello,

  I tried to test a form with a required field.
  First I submitted without setting a value and got an error message as
 expected.
  Then I set the value and submitted again but again got the error message as
 if it wouldn't be cleared or something.
  Is there a problem with them or did I miss how to clear them?

  Thanks,
  Mike


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




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

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



Re: How to set the path for a uploadfolder?

2008-04-24 Thread Cristi Manole
Hi,

Beware of using getRealPath if your app is deployed on a Tomcat server where
it's set _not_ to unpack the wars (for instance 99% of the plesk domain
hostings).

It will always return null.

My 2 cents.

Cristi Manole

On Thu, Apr 24, 2008 at 4:23 PM, Mathias P.W Nilsson [EMAIL PROTECTED]
wrote:


 Not quite sure but you can get the folder that is the root of your
 application context

 File file = new File( getServletContext().getRealPath( / ) );
 --
 View this message in context:
 http://www.nabble.com/How-to-set-the-path-for-a-uploadfolder--tp16848200p16850438.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: Can't see progress in progressBar

2008-04-24 Thread adrienleroy

if you look at the wicket extension javadoc  you will find the explanation : 

in your class extending the WebApplication class you have to override the
newWebRequest method

@Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest) {
return new UploadWebRequest(servletRequest);
}



liny wrote:
 
 Hi~
 
 I run the upload - Single file upload. in wicket-examples-1.3.3 and
 found that I could not see a progress running.
 I mean I want to see, for example, percentage or how many bytes uploaded
 or a bar running from left to right.
 Hope you know what I am saying.
 So anyone can tell me why I can't see a bar running from left to right?
 
 Thanks
 
 -liny-
 

-- 
View this message in context: 
http://www.nabble.com/Can%27t-see-progress-in-progressBar-tp16836320p16850735.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: default spring transaction on request cycle

2008-04-24 Thread Igor Vaynberg
you need to surround your code with something like ths:


PlatformTransactionManager ptm = (PlatformTransactionManager)ctx
   .getBean(transactionManager);

TransactionStatus txn = ptm.getTransaction(new DefaultTransactionDefinition());

...

ptm.commit/rollback(txn)

whether you do this in onclick() or on request cycle is up to you. but
like others have mentioned, you should probably do this lazily so that
not every request starts a transaction unless it needs it.

it is too bad spring doesnt provide a Filter to do this, a
single-transaction-per-request is a pretty common pattern.

-igor



On Thu, Apr 24, 2008 at 5:56 AM, Stefan Selariu [EMAIL PROTECTED] wrote:
 I have no idea how to use tell spring which transaction manager instance
  to use.
  I'll try to put the request scope for it.

  I managed to reconfigure the application with wicket-spring, but I have
  no idea if the same transaction is used since the received session is a
  spring proxy. I'll dig some more :)

  Thanks for your help.
  Stefan




  On Thu, 2008-04-24 at 14:33 +0200, lars vonk wrote:
   
Is it not the default propagation setting?
  
  
   Yes you are correct.
  
   In what way to use the same TransactionManager? The same
TransactionManager spring bean? Or the same TransactionManager spring 
 bean
instance?
  
  
   I meant instance.
  
   Again I am not sure if this is enough, Mixing manual and spring managed
   transaction goes a bit above my transaction management experience.
  
   Lars.
  
   On Thu, Apr 24, 2008 at 2:25 PM, Stefan Selariu [EMAIL PROTECTED]
   wrote:
  
No, the propagation was not set to REQUIRED. Is it not the default
propagation setting?
In what way to use the same TransactionManager? The same
TransactionManager spring bean? Or the same TransactionManager spring
bean instance?
   
Thanks.
Stefan
   
   
On Thu, 2008-04-24 at 14:03 +0200, lars vonk wrote:
 Well it technically shouldn't matter if you use the wicket-spring 
 module
I
 guess.
 It think it matters that you use the same TransactionManager and the
correct
 Propagation behavior (REQUIRED iirc). Did you use the same
 transactionmanager in your previous attempt and what was the 
 propagation
 setting you used?

 For wicket-spring see http://cwiki.apache.org/WICKET/spring.html, I
would
 suggest you use the annotation based approach.

 On Thu, Apr 24, 2008 at 1:55 PM, Stefan Selariu [EMAIL PROTECTED]

 wrote:

  I tried this approach but without the wicket-spring module, and it
  didn't work (No spring web application and no springbean 
 annotations).
  Maybe it works this way. I'll give it a try (but I'm not very sure
that
  it helps since spring loses the transactional context, or at least so
I
  think)
  Is there an maven archetype for a wicket-spring project?
  Where is the documentation for wicket-spring?
 
  Many thanks :)
  Stefan
 
 
  On Thu, 2008-04-24 at 13:36 +0200, lars vonk wrote:
   I wouldn't advice you to do it in the requestcycle for the reasons
you
   already describe yourself:
  
   - Too cumbersome
   - All request are then in a Transaction (might no be a problem
though).
   - How to detect that a rollback is needed.
  
   You could still use Spring transaction though: This could be a
possible
   implementation, but I don't know if this is rock solid especially
the
   rollback I am not sure about. This approach  will enable nested
  transaction
   IHMO since it still uses the spring configured transactions.
  
   class TransactionalRequestCycle extends WebRequestCycle {
  
 @SpringBean private TransactionManager txManager
  
 private TransactionStatus status;
  
 public TransactionRequestCycle() {
   // this will inject the txManager from the spring context.
   InjectorHolder.getInjector().inject(this);
   DefaultTransactionDefinition def = new
  DefaultTransactionDefinition();
   def.setPropagationBehavior(...);
 }
  
 protected void onBeginRequest() {
   status = txManager.getTransaction(def);
 }
  
 protected void onEndRequest() {
   txManager.commit(status);
 }
 protected void onRuntimeException() {
   if(status != null)
 txManager.rollback(status);
 }
   }
  
   On Thu, Apr 24, 2008 at 1:18 PM, Stefan Selariu 
[EMAIL PROTECTED]
  
   wrote:
  
Thanks for your answer, but sadly this is not possible.
I cannot group the beans in one service because the beans are
invoked
from different wicket components.
I need the request cycle to be transactional because on the 
 submit
  event
one component calls the required transactional service and 

Re: Building javadoc for Wicket 1.4 from svn download

2008-04-24 Thread Igor Vaynberg
shouldnt mvn javadoc:javadoc or mvn javadoc:jar work?

-igor


On Thu, Apr 24, 2008 at 5:58 AM, Stefan Lindner [EMAIL PROTECTED] wrote:
 Thank you!

  -Ursprüngliche Nachricht-
  Von: Martijn Dashorst [mailto:[EMAIL PROTECTED]
  Gesendet: Donnerstag, 24. April 2008 14:28
  An: users@wicket.apache.org
  Betreff: Re: Building javadoc for Wicket 1.4 from svn download



  iirc:

  mvn -Prelease install

  Martijn

  On 4/24/08, Stefan Lindner [EMAIL PROTECTED] wrote:
   The current Wicket 1.4 trunk does not create javadocs anymore (as
   described on this list and on the build webpage). How can I create the
   javadoc files with maven? I don't know maven mechanisms for this task.
  
When I build the project with maven javadoc:javadoc, the javadocs are
   generated in the target directorys but not packed to jar files. How
   can  I let maven create the javadoc jar files?
  
Stefan
  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  


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

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


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



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



Re: Gzipping of pages (HTML output, not only resources)

2008-04-24 Thread Igor Vaynberg
there is also IResponseFilter

-igor


On Thu, Apr 24, 2008 at 6:08 AM, Stefan Simik [EMAIL PROTECTED] wrote:



  Stefan Simik wrote:
  
   1. IDEA
   
 a) totally disable gzip in wicket --
   getResourceSettings().setDisableGZipCompression(true);
 b) use Gzip filter BEFORE wicket-filter. This Gzip filter will compress
   all the communication -
 HTML, resources  . Images and some mime-types should be omitted.
  

  Probably, there is one drawback in IDEA 1.
  Wicket already caches the processed(gzipped) result, what is very useful.
  This functionality should be moved to the Gzip filter, which can be a lot of
  effort.

  --
  View this message in context: 
 http://www.nabble.com/Gzipping-of-pages-%28HTML-output%2C-not-only-resources%29-tp16849900p16850433.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: default spring transaction on request cycle

2008-04-24 Thread James Carman
On Thu, Apr 24, 2008 at 11:15 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 you need to surround your code with something like ths:


  PlatformTransactionManager ptm = (PlatformTransactionManager)ctx
.getBean(transactionManager);

  TransactionStatus txn = ptm.getTransaction(new 
 DefaultTransactionDefinition());

  ...

  ptm.commit/rollback(txn)

The problem with this approach is what do you do if the transaction
cannot commit (i.e. constraint violation) and you've already written
some data back to the response stream (you can't undo that)?  That's
why it's better to bundle up all that you want to do into a service
method and call that under one transactional umbrella.  Once that
completes, then you can go on and render the response.

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



Re: default spring transaction on request cycle

2008-04-24 Thread Igor Vaynberg
i completely agree. but i guess his usecase doesnt allow that...

also having a service for grouping a ui-driven usecase is kinda silly,
it has nothing to do with the business tier. we use salve at my day
job, and salve lets you @Transactional link's onclick() to unite
everything that happens inside that onclick into a single transaction.
makes life much easier.

-igor


On Thu, Apr 24, 2008 at 8:25 AM, James Carman
[EMAIL PROTECTED] wrote:
 On Thu, Apr 24, 2008 at 11:15 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
   you need to surround your code with something like ths:
  
  
PlatformTransactionManager ptm = (PlatformTransactionManager)ctx
  .getBean(transactionManager);
  
TransactionStatus txn = ptm.getTransaction(new 
 DefaultTransactionDefinition());
  
...
  
ptm.commit/rollback(txn)

  The problem with this approach is what do you do if the transaction
  cannot commit (i.e. constraint violation) and you've already written
  some data back to the response stream (you can't undo that)?  That's
  why it's better to bundle up all that you want to do into a service
  method and call that under one transactional umbrella.  Once that
  completes, then you can go on and render the response.



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



Wicket 1.4 and Wicketstuff/Dojo/DragAndDrop

2008-04-24 Thread Stefan Lindner
Is there a Wicketstuff/dojo version that works together with Wicket 1.4?
Is Wicketstuff/Dojo still alive? The latest news on the webpage state
that Wicketstuff/Dojo is still based upon wicket 1.3 beta.

Stefan

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



Re: A question for Igor

2008-04-24 Thread Matthew Young
Ah, I see.  Thanks!

// add the new tabbed panel, attribute modifier only used to switch
// between different css variations
add(new TabbedPanel(tabs, tabs).add(new AttributeModifier(class,
 true,
TabbedPanelPage.this.getModel(;


On Wed, Apr 23, 2008 at 11:12 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 the code is on TabbedPanelPage, the links simply switch the css class
 that is on the div tag used to attach to tabbed panel.

 -igor


 On Wed, Apr 23, 2008 at 11:08 PM, Matthew Young [EMAIL PROTECTED] wrote:
  I am looking at the wicket.markup.html.tabs.TabbedPanel
   (wicket-extensions)
 http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.compref.TabbedPanelPage
 example
   on
   http://wicketstuff.org/wicket13/compref/, I couldn't figure out how you
   switch the css.  Is that done in WicketExamplePage?  Unfortunately,
   WicketExamplePage.java is not part of the source.
 

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




Re: Can I create a form markup on the fly?

2008-04-24 Thread Maurice Marrink
No, you need to have matching markup and java code.

Perhaps you could set the form to invisible and
setOutputMarkupPlaceholder(true), that way an invisible tag (not form)
is used instead. However before you could submit the form you would
have to make it visible again on the server side (via ajax or a
regular request) the placeholder tag will then be replaced by the form
and you can immediately trigger some javascript to submit it if so
desired.

Maurice

On Thu, Apr 24, 2008 at 6:15 PM, Vitaly Tsaplin
[EMAIL PROTECTED] wrote:
Hi,

I have the case where I need to create a hidden form to provide a
  server side with some javascript values (no ajax, just a regular
  get/post). The form is essentially auxiliary and so it isn't
  represented into a markup somehow but it's going to be created on the
  fly. However I would like to have a wicket form bounded with it. Is it
  possible with wicket?

Vitaly

  -
  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: Anyway to fix this generic warning?

2008-04-24 Thread Matthew Young
ArthIT: How to suppress the warning is not why I asked the question.  I want
to be sure generify Wicket is correct so user code can be clean and warning
free.

in Eclipse go to Window - Preferences
Type Generic in the search box. Now you should see the
Java-compiler-Errors/Warnings Node.
Open it, and change settings under Generic types to whatever you want
(Ignore f.e.)

I don't do this because that covers up all the warnings of that kind. I
prefer to see the warnings and deal with them.  If the warning cannot be
fixed, I use @SupressWarning on the spot.

On Thu, Apr 24, 2008 at 3:53 AM, ArthIT [EMAIL PROTECTED] wrote:


 Hi,

 in Eclipse go to Window - Preferences
 Type Generic in the search box. Now you should see the
 Java-compiler-Errors/Warnings Node.
 Open it, and change settings under Generic types to whatever you want
 (Ignore f.e.)

 Cheerz


 MYoung wrote:
 
  (Other than using @SupressWarnings)
 
 AjaxFallbackButtonPage1 submitButton = new
  AjaxFallbackButtonPage1(submitButton, form) {
 
  @Override protected void onSubmit(AjaxRequestTarget target,
  Form
  f) {  Warning here
  .
 
  Form is a raw type. References to generic type FormT should be
  parameterized.
 
 

 --
 View this message in context:
 http://www.nabble.com/Anyway-to-fix-this-generic-warning--tp16848154p16849776.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]




unit test of AjaxLazyLoadPanel and ModalWindow

2008-04-24 Thread qk

Hi there,

I am having problems testing AjaxLazyLoadPanel and ModalWindow using the
WicketTester. Here are my questions:

1. after the page was rendered using WicketTester.startPage(), the real
content (the one that returned by getLazyLoadComponent()) was not loaded by
default. I always got an empty panel. Is there a way that I can have the
real content rendered?

2. how can I bring up the ModalWindow using WicketTester so that I can make
sure that components on the modalWindow work as expected?

Thanks in advance for your help.

Cheers,
Ivan
-- 
View this message in context: 
http://www.nabble.com/unit-test-of-AjaxLazyLoadPanel-and-ModalWindow-tp16851306p16851306.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: Best way to use borders tranparently

2008-04-24 Thread James Carman
Try using markup inheritance.  It's way easier than borders.

On Thu, Apr 24, 2008 at 2:07 PM, Joel Halbert [EMAIL PROTECTED] wrote:
 Hi,

  I'm trying to work out the best way to use borders within my app.

  After looking at the following docs:
  http://wicket.apache.org/examplenavomatic.html
  http://cwiki.apache.org/WICKET/consistent-page-layout-using-borders.html  
 (out of date)

  I have settled on an approach based off the suggestion in the second link 
 and was wondering if anyone could see any issues with it or suggest a better 
 way:

  I've created a base page MyBorderPage.java from which all other pages in my 
 app extend. This page takes care of creating the border.
  Components are added to the border through a custom addTo(Component) method 
 which delegates to border.add.

  public abstract class MyBorderPage extends WebPage {

   private MyBorder border;

   MyBorderPage() {
   super();
   border = new MyBorder(border);
   super.add(border);
}


  protected void addTo(Component c) {
   border.add(c);
  }
  }


  This seems to work fine but my main concern is that because I can not 
 override add() directly (since it is final) it is not very transparent 
 because the user need to know to use my addTo() method.

  Is there a better way?

  Thanks,

  Joel

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



Re: Best way to use borders tranparently

2008-04-24 Thread Joel Halbert
Markup inheritance (http://cwiki.apache.org/WICKET/markup-inheritance.html) 
certainly looks more straight forward, I'll move over to using it.


Is there any situation where borders might be preferable though?

--
From: James Carman [EMAIL PROTECTED]
Sent: Thursday, April 24, 2008 7:13 PM
To: users@wicket.apache.org
Subject: Re: Best way to use borders tranparently


Try using markup inheritance.  It's way easier than borders.

On Thu, Apr 24, 2008 at 2:07 PM, Joel Halbert [EMAIL PROTECTED] 
wrote:

Hi,

 I'm trying to work out the best way to use borders within my app.

 After looking at the following docs:
 http://wicket.apache.org/examplenavomatic.html
 http://cwiki.apache.org/WICKET/consistent-page-layout-using-borders.html 
(out of date)


 I have settled on an approach based off the suggestion in the second 
link and was wondering if anyone could see any issues with it or suggest 
a better way:


 I've created a base page MyBorderPage.java from which all other pages in 
my app extend. This page takes care of creating the border.
 Components are added to the border through a custom addTo(Component) 
method which delegates to border.add.


 public abstract class MyBorderPage extends WebPage {

  private MyBorder border;

  MyBorderPage() {
  super();
  border = new MyBorder(border);
  super.add(border);
   }


 protected void addTo(Component c) {
  border.add(c);
 }
 }


 This seems to work fine but my main concern is that because I can not 
override add() directly (since it is final) it is not very transparent 
because the user need to know to use my addTo() method.


 Is there a better way?

 Thanks,

 Joel


-
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: Best way to use borders tranparently

2008-04-24 Thread James Carman
On Thu, Apr 24, 2008 at 2:18 PM, Joel Halbert [EMAIL PROTECTED] wrote:
 Markup inheritance (http://cwiki.apache.org/WICKET/markup-inheritance.html)
 certainly looks more straight forward, I'll move over to using it.

  Is there any situation where borders might be preferable though?

Not in my (somewhat limited) experience, no.

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



Need to turn off Markupparser : Problem with param tag

2008-04-24 Thread hjuturu

Hi All
I have  some  tags in my page whose html representation doesnt have a end
tag.
When i try to invoke the page using wicket i get a parse exception

java.text.ParseException: Tag '' (line 1, column 1822) has a mismatched
close tag .
Is there anyway i can turn off the parser in wicket or have it now set to
XHTML representation.
Thanks
Haritha
-- 
View this message in context: 
http://www.nabble.com/Need-to-turn-off-Markupparser-%3A-Problem-with-%3Cparam%3E-tag-tp16851318p16851318.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: default spring transaction on request cycle

2008-04-24 Thread Stefan Selariu
Indeed, my use cases don't allow to group the bean calls in another  
service. I know it's not perfect this way, but it is better than  
writing the services with transaction awareness.


Surrounding the bean calls with the transaction manager transaction  
solved my problem.

Now I'm even using wicket-spring since it have some nice features :)

Thanks guys.
Stefan


On 2008.04.24, at 18:37, Igor Vaynberg wrote:


i completely agree. but i guess his usecase doesnt allow that...

also having a service for grouping a ui-driven usecase is kinda silly,
it has nothing to do with the business tier. we use salve at my day
job, and salve lets you @Transactional link's onclick() to unite
everything that happens inside that onclick into a single transaction.
makes life much easier.

-igor


On Thu, Apr 24, 2008 at 8:25 AM, James Carman
[EMAIL PROTECTED] wrote:
On Thu, Apr 24, 2008 at 11:15 AM, Igor Vaynberg [EMAIL PROTECTED] 
 wrote:

you need to surround your code with something like ths:


PlatformTransactionManager ptm = (PlatformTransactionManager)ctx
  .getBean(transactionManager);

TransactionStatus txn = ptm.getTransaction(new  
DefaultTransactionDefinition());


...

ptm.commit/rollback(txn)


The problem with this approach is what do you do if the transaction
cannot commit (i.e. constraint violation) and you've already written
some data back to the response stream (you can't undo that)?  That's
why it's better to bundle up all that you want to do into a service
method and call that under one transactional umbrella.  Once that
completes, then you can go on and render the response.



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



Pageless component at AjaxRequestTarget detach

2008-04-24 Thread Thomas Kappler
Hi,

we have a BaseTree where we implemented reordering of tree nodes via
drag and drop, using wicketstuff-scriptaculous.  Everything seems to
work, i.e., you can work with the page as intended.  In the logs we
see an error on each drop event, however:

org.apache.wicket.RequestCycle detach
SEVERE: there was an error cleaning up target
[EMAIL PROTECTED] markupIdToComponent
[{containerb9=[MarkupContainer [Component id = container, page = No
Page, path = 21:nodeComponent:container.SenseLinkPanel$1]], SNIP
}], prependJavascript [[Droppables.remove($(containerb9));]],
appendJavascript [[new Effect.Highlight('containerb9',
{}
);
]].
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = container, page = No Page, path =
21:nodeComponent:container.SenseLinkPanel$1]]
at org.apache.wicket.Component.getPage(Component.java:1658)
at 
org.apache.wicket.ajax.AjaxRequestTarget.detach(AjaxRequestTarget.java:437)
[...]

I verified in the debugger that this happens not during our code, but
in the ajax update after everything is done.  The component
container is the (only) top-level component of the panel
representing a tree node.  So, somehow during the node reordering, the
node panel seems to lose its page.

On the UI side, the nodes are DefaultMutableTreeNodes, and the
reordering is basically one line:
dropNode.add(dragNode);

I suspect it might be a bug in there, but I'm not sure where to start.
 Also, as I said, it seems to do no harm.

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



Re: How to set the path for a uploadfolder?

2008-04-24 Thread unka_hahrry

Thanks, works fine.

Mathias P.W Nilsson wrote:
 
 Not quite sure but you can get the folder that is the root of your
 application context
 
 File file = new File( getServletContext().getRealPath( / ) );
 

-- 
View this message in context: 
http://www.nabble.com/How-to-set-the-path-for-a-uploadfolder--tp16848200p16851513.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]



image resource

2008-04-24 Thread i ii

how to get image src from other site? i need to update image based on user input

// does not work
new Image(wicketId, new Model(http://www.someothersite.com/image.gif;));


Re: Need to turn off Markupparser : Problem with param tag

2008-04-24 Thread Martijn Dashorst
use param / instead

On 4/24/08, hjuturu [EMAIL PROTECTED] wrote:

  Hi All
  I have  some  tags in my page whose html representation doesnt have a end
  tag.
  When i try to invoke the page using wicket i get a parse exception

  java.text.ParseException: Tag '' (line 1, column 1822) has a mismatched
  close tag .
  Is there anyway i can turn off the parser in wicket or have it now set to
  XHTML representation.
  Thanks
  Haritha

 --
  View this message in context: 
 http://www.nabble.com/Need-to-turn-off-Markupparser-%3A-Problem-with-%3Cparam%3E-tag-tp16851318p16851318.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]




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

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



Using AJAX to change style of component

2008-04-24 Thread Ryan O'Hara
I'm fairly new to Wicket and was wondering if there is a way to use  
AJAX to change the style of a WebMarkupContainer?  Below is a snippet  
of my code:


IModel sourceModel = new Model() {
public Object getObject() {
return sourceOptions;
}
};
final DropDownChoice source = new DropDownChoice(source,  
new PropertyModel(this, sourceSelection), sourceModel);

source.add(new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(AjaxRequestTarget target) {
variationMetricRow.add(new AttributeModifier 
(style, true, new Model(sourceSelection.equals(CHOP_Normals) ?  
display:block : display:none)));

variationMetricRow.setOutputMarkupId(true);
target.addComponent(variationMetricRow);
}
});

In this example,  I would like to change the display to show/hide a  
particular component.  Any help would be appreciated.


Thanks,
Ryan

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



RE: Return to Original Destination gets the ajax response and not the page

2008-04-24 Thread Warren
The problem was with 1.3.1. I moved to 1.3.3 and its fixed.

 -Original Message-
 From: Michael Sparer [mailto:[EMAIL PROTECTED]
 Sent: Thursday, April 24, 2008 1:53 AM
 To: users@wicket.apache.org
 Subject: Re: Return to Original Destination gets the ajax response and
 not the page



 What wicket version are you using? I know this bug has been fixed
 for version
 1.3.2 and above

 regards,
 Michael


 Warren Bell wrote:
 
  I am getting an ajax response xml instead of the page when I return to
  original destination page that is ajax enabled after a
  RestartResponseAtInterceptPageException is thrown. Here is the URL:
 
 
 http://127.0.0.1:8080/blahblah/?wicket:interface=:8:body:receiveIt
emDetailFo

rm:lineItem.item.upc::IActivePageBehaviorListener:0:-1wicket:ignoreIfNotAct
 ive=truerandom=0.8907246112298193

 What am I doing wrong?

 Thanks,

 Warren Bell


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





-
Michael Sparer
http://talk-on-tech.blogspot.com
--
View this message in context:
http://www.nabble.com/Return-to-Original-Destination-gets-the-ajax-response-
and-not-the-page-tp16845566p16847805.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]



links in inmethod grid?

2008-04-24 Thread Ryan McKinley
Hello-Should normal links work within the grid component? As is, they get gobbled up by a _javascript_ "return false"I asked this question a while back, but was able to avoid it with a _javascript_ link (document.location=xxx) I can't do that now.http://www.nabble.com/inmethod-grid-links--td15280161.htmlI'm attaching a patch to reproduce the error, the gist of it is:columns.add(new AbstractColumn( "link", new ResourceModel("id") ) {@Overridepublic Component newCell(WebMarkupContainer parent, String componentId, IModel rowModel) { return new SimpleLink( componentId, rowModel );}});where SimpleLink is a component that includes a link.thanks for any pointers.ryan

gridlinks.patch
Description: Binary data


Re: image resource

2008-04-24 Thread Matthew Young
new WebMarkupContainer(wicketId) {
private static final long serialVersionUID = 1L;
@Override protected void onComponentTag(final ComponentTag tag){
super.onComponentTag(tag);
tag.put(src, http://www.someothersite.com/image.gif;);
}
};


On Thu, Apr 24, 2008 at 11:47 AM, i ii [EMAIL PROTECTED] wrote:


 how to get image src from other site? i need to update image based on user
 input

 // does not work
 new Image(wicketId, new Model(http://www.someothersite.com/image.gif
 ));



Re: intro and explanation about DataTable and DetachableModel

2008-04-24 Thread Doug Donohoe

This may help.  I am moving my DD Poker site to wicket and implemented an
IDataProvider around my database service as follows:

private class HistoryData implements IDataProvider
{
private static final long serialVersionUID = 42L;

private PokerUser user;
private int count;

private HistoryData(PokerUser user)
{
this.user = user;
count =
histService.getAllTournamentHistoriesForProfileCount(user.getId());
}

@SuppressWarnings({RawUseOfParameterizedType})
public Iterator iterator(int first, int pagesize)
{
return
histService.getAllTournamentHistoriesForProfile(user.getId(), count, first,
pagesize).iterator();
}

public int size()
{
return count;
}

public boolean isEmpty()
{
return count == 0;
}

public IModel model(Object object)
{
return new CompoundPropertyModel(new EntityModel(object));
}

public void detach()
{
}
}

Where EntityModel is:

public class EntityModel extends CompoundPropertyModel
{
private static final long serialVersionUID = 42L;

/**
 * Constructor
 *
 * @param object The model object, which may or may not implement IModel
 */
public EntityModel(Object object)
{
super(new NonLoadableDetachableModel(object));
}
}

and NonLoadableDetachableModel is

public class NonLoadableDetachableModel extends LoadableDetachableModel
{
private static final long serialVersionUID = 42L;

public NonLoadableDetachableModel(Object model)
{
super(model);
}

@Override
protected Object load()
{
throw new UnsupportedOperationException(load should never be
called);
}
}

I created this last class because my pages are read-only and the result set
is always fetched through the service.  I didn't want to have my (JPA based)
entities being serialized.

The HistoryData class worked great with the base DataView class in Wicket.

Note that I drew a lot of inspiration from:

http://wicketstuff.org/wicket13/repeater/

and digging around in the source.

I don't know if this will help you or not - hopefully so!

-Doug


Eyal Golan wrote:
 
 Hi,
 Can anyone give me an explanation about paging with DetachableModel?
 
 My problem:
 We have records in the DB that can be a-lot.
 We also filter them sometimes.
 
 someone in the company created a non-standard paging.
 He doesn't use the Wicket's paging.
 
 The iterator method of the DataProvider he created returns only the number
 of elements that should be displayed in the current page.
 Eg. suppose we decided we show 20 records per page.
 The DataProvider keeps track on which page we're at.
 Then he calculates the indexes of records.
 It's done in getVisibleTickets() method.
 int fromIndex = (currentPage - 1) * (ticketsPerPage);
 int toIndex = ticketsPerPage;
 
 And then he asks the DB for the records in this range (with the filter).
 This is the size() method:
 public int size() {
 if ((visibleTickets == null) || (update)) {
 getVisibleTickets();
 }
 return visibleTickets.size();
 }
 
 OK, I hope i was clear enough.
 I know that it might be done using Wicket's library.
 Can anyone explain?
 
 Thanks
 -- 
 Eyal Golan
 [EMAIL PROTECTED]
 
 Visit: http://jvdrums.sourceforge.net/
 
 

-- 
View this message in context: 
http://www.nabble.com/intro-and-explanation-about-DataTable-and-DetachableModel-tp16852272p16853277.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]



PageParameters request-for-enhancement

2008-04-24 Thread Doug Donohoe

Hi Wicket team:

I'd like to be able to call getInt(name, default) and not have to worry
about catching exceptions.  If the number can't be parsed, just return the
default.

I have a utility method which I use:

public static int getInt(PageParameters params, String name, int def)
{
try
{
return params.getInt(name, def);
}
catch (StringValueConversionException ignored)
{
return def;
}
}

Basically for my bookmarkable pages, I don't care if a user mucks with the
URL - this would let me default to something reasonable.

It would be nice if there were a comparable method on PageParameters ...
like getIntSafe(name, def) or some something similar (and for other
number-based getters).

In addition, it would be nice to have a getInteger() object method that
returns null if not defined or an Integer object.  The way it is now, I have
to pick a default value that I assume won't ever be valid (usually -1). 
There are valid use cases where null is an expected value.

-Doug

-Doug


-- 
View this message in context: 
http://www.nabble.com/PageParameters-request-for-enhancement-tp16853545p16853545.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]



Administration in wicket

2008-04-24 Thread Mathias P.W Nilsson

Hi!

I want to create administration for a site. Site.se. The administration
should reside in Site.se/administration

How can I tell wicket to go to a BasePage when user types in
Site.se/administration. The HomePage is
already set for the Site.se. How can I set a HomePage for
Site.se/administration?
-- 
View this message in context: 
http://www.nabble.com/Administration-in-wicket-tp16853893p16853893.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: VOTE: Generics of IDataProvider

2008-04-24 Thread Matej Knopp
  VOTE:

  [ ] IDataProviderI,T
  [ ] IteratorIModelT , drop model
  [X] Leave as is.



-Matej

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



Re: VOTE: Generics of IDataProvider

2008-04-24 Thread Eelco Hillenius
I would have a better idea if I would have had the chance to actually
play with it, but here is mine:

[ ] IDataProviderI,T
[ x ] IteratorIModelT , drop model
[ ] Leave as is.

Looks most elegant to me, and it is immediately clear what T is for.
Also, I think that generics are bloody verbose anyway, so I'm not much
in favor of shortening things up - and not support some of the use
cases - for just this occasion. I rather have something that works for
everyone.

Eelco

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



RE: Problems with FileUploadField

2008-04-24 Thread Michael Mehrle
It creates a new frame via JS, yes. I want to send this to you, but it has to 
be packaged properly and commented so you know what is happening. My project is 
keeping me up late, is it okay if I do this during the weekend?

Michael

-Original Message-
From: Cristi Manole [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 24, 2008 2:41 AM
To: users@wicket.apache.org
Subject: Re: Problems with FileUploadField

I really don't think it can be done w/o an iframe.

@Fabien - here's the (simple) code:

http://www.dooriented.com/blog/2008/04/

Cristi Manole

On Wed, Apr 23, 2008 at 5:39 PM, Rüdiger Schulz [EMAIL PROTECTED]
wrote:

 Hello Michael,

 Could you share this fileupload.js? I'd bet it creates some iframe tag via
 DOM manipulation ;-)

 greetings,

 Rüdiger

 2008/4/23 Michael Mehrle [EMAIL PROTECTED]:

  Yeah, that's how it works. There's a fileupload.js that leverages
  jQuery. When the user presses the upload button it does a binary upload
  to a page of your choosing - that's where I had to change the existing
  PHP-integrated lib that I used as a template. I used a Page that was
  accessible via a mapped URI to parse out the stream and store it to the
  backend. Then I bounced back a JSON msg, which can contain various
  status and error notifications. Those can be popped up as JS alerts,
  which is kind of cool. I even managed to bounce back the image id and
  the local path, so that I could do some frontend magic. Works just fine
  - one of the other problems was to make it work with Wicket since the
  component ids had to match. This was done by injecting the proper ids
  into the JS lib when loading the enclosing page.
 
  A bit of a hack, I know - but it's working, which is all I care about.
 
  Michael
 
  -Original Message-
  From: Johan Compagner [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, April 22, 2008 2:29 PM
  To: users@wicket.apache.org
  Subject: Re: Problems with FileUploadField
 
  really?
  are you using the XMLHttpRequest  request to do a binary upload with a
  form
  post?
 
  everywhere on the internet they say that isnt possible
 
  johan
 
 
  On Tue, Apr 22, 2008 at 8:05 PM, Michael Mehrle [EMAIL PROTECTED]
  wrote:
 
   I recently implemented an AJAX based file upload field that works just
   fine. It's works 'outside of Wicket AJAX' but does leverage an AJAX
   fileuploadfield. Let me know if you want to use it, I don't mind
  sharing
   the code. It took a lot of work to make this happen, since the
  original
   jQuery based upload code had to be modified + was a bit buggy to begin
   with.
  
   Cheers,
  
   Michael
  
   -Original Message-
   From: Fabien D. [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, April 22, 2008 7:02 AM
   To: users@wicket.apache.org
   Subject: Re: Problems with FileUploadField
  
  
   My researches show FileUploadField does not support ajax behavior
  
   So there is no wicket input, which permits to the user to browse his
   local
   disk?
  
   Thank you in advance.
  
  
   Fabien D. wrote:
   
Hi, I would like to add a behavior on my FileUploadField
   
But I can't get back the path of the file, or the file
   
this.logo = new FileUploadField(inputLogo);
  logo.setRequired(false);
  logo.add(new AjaxFormComponentUpdatingBehavior(onchange) {
  private static final long serialVersionUID = 1L;
protected void onUpdate(AjaxRequestTarget target) {
   ..
}
   
I have try everything :
   
FileUpload up = logo.getFileUpload(); - null
File file = (File)logo.getModelObject(); - null
logo.getModelObjectAsString() - null
   
So how can i get the file or just the path and the name file
   
   
  
   --
   View this message in context:
  
  http://www.nabble.com/Problems-with-FileUploadField-tp16823823p16824291.
  
  htmlhttp://www.nabble.com/Problems-with-FileUploadField-tp16823823p1682
  4291.html
 http://www.nabble.com/Problems-with-FileUploadField-tp16823823p16824291.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]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 --
 greetings from Berlin,

 Rüdiger Schulz

 www.2rue.de
 www.indyphone.de - Coole Handy Logos einfach selber bauen


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



RE: Integer only NumberValidator?

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

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

Michael

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

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

Integer-ness is checked at conversion level before validation.

Martijn

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



  Thanks,




  Michael




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

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


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



Re: Administration in wicket

2008-04-24 Thread Jeremy Thomerson
I did it this way, although you may not want the extra path for other
pages

In WebApplication.init() :

mountBookmarkablePage(admin, AdminHomepage.class);
mount(admin/pages, PackageName.forClass(AdminHomepage.class));

Hope this helps,
Jeremy Thomerson


On Thu, Apr 24, 2008 at 5:25 PM, Mathias P.W Nilsson [EMAIL PROTECTED]
wrote:


 Hi!

 I want to create administration for a site. Site.se. The administration
 should reside in Site.se/administration

 How can I tell wicket to go to a BasePage when user types in
 Site.se/administration. The HomePage is
 already set for the Site.se. How can I set a HomePage for
 Site.se/administration?
 --
 View this message in context:
 http://www.nabble.com/Administration-in-wicket-tp16853893p16853893.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: Administration in wicket

2008-04-24 Thread Jeremy Thomerson
This made me think of an easy extension to
PackageRequestTargetUrlCodingStrategy... what does everyone think?

Where we see that there is nothing left after the mount path, here: (line 88
in 1.3.3)
// There is nothing after the mount path!
return null;

Why don't we return getDefaultPageClass() which could be an optional
constructor parameter?

Jeremy Thomerson

On Thu, Apr 24, 2008 at 7:54 PM, Jeremy Thomerson 
[EMAIL PROTECTED] wrote:

 I did it this way, although you may not want the extra path for other
 pages

 In WebApplication.init() :

 mountBookmarkablePage(admin, AdminHomepage.class);
 mount(admin/pages, PackageName.forClass(AdminHomepage.class));

 Hope this helps,
 Jeremy Thomerson



 On Thu, Apr 24, 2008 at 5:25 PM, Mathias P.W Nilsson [EMAIL PROTECTED]
 wrote:


 Hi!

 I want to create administration for a site. Site.se. The administration
 should reside in Site.se/administration

 How can I tell wicket to go to a BasePage when user types in
 Site.se/administration. The HomePage is
 already set for the Site.se. How can I set a HomePage for
 Site.se/administration?
 --
 View this message in context:
 http://www.nabble.com/Administration-in-wicket-tp16853893p16853893.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: Can't see progress in progressBar

2008-04-24 Thread liny



igor.vaynberg wrote:
 
 did you try uploading a reasonably big file ( a few MB ) so the upload
 takes more then a few seconds?
 
 -igor
 
 

Hi~
I wrote my own file upload web page based on upload - Single file upload.
in wicket-examples-1.3.3
and upload 3MB, even 22MB file.
But still can't see a bar from left to right.
-- 
View this message in context: 
http://www.nabble.com/Can%27t-see-progress-in-progressBar-tp16836320p16880141.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: Can't see progress in progressBar

2008-04-24 Thread Igor Vaynberg
make sure you use UploadWebRequest in your application subclass, see
its javadoc for details.

-igor


On Thu, Apr 24, 2008 at 6:54 PM, liny [EMAIL PROTECTED] wrote:



  igor.vaynberg wrote:
  
   did you try uploading a reasonably big file ( a few MB ) so the upload
   takes more then a few seconds?
  
   -igor
  
  

  Hi~
  I wrote my own file upload web page based on upload - Single file upload.

 in wicket-examples-1.3.3
  and upload 3MB, even 22MB file.
  But still can't see a bar from left to right.
  --


 View this message in context: 
 http://www.nabble.com/Can%27t-see-progress-in-progressBar-tp16836320p16880141.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: Can't see progress in progressBar

2008-04-24 Thread liny



adrienleroy wrote:
 
 if you look at the wicket extension javadoc  you will find the explanation
 : 
 
 in your class extending the WebApplication class you have to override the
 newWebRequest method
 
 @Override
 protected WebRequest newWebRequest(HttpServletRequest servletRequest)
 {
 return new UploadWebRequest(servletRequest);
 }
 
 

Hi~
I override the method you said.
But still can't see a bar running from left to right.

PS: I use wicket 1.3.3
-- 
View this message in context: 
http://www.nabble.com/Can%27t-see-progress-in-progressBar-tp16836320p16884112.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]



Class casting exception while using PageParameters

2008-04-24 Thread jianfei

Hi, I'm new to the wicket framework, and I have a problem while using the
PageParameters.

I want to add a class instance as the value of one of the page parameters,
so I did this:

MyClass instance = new MyClass();
PageParameters param = new PageParameters();
param.put(classInstance, instance);

Then I want to get back the parameter as the class instance, so I use:

MyClass theInstance = (MyClass) param.get(classInstance);

This works fine if I put it right after the param.put(...) statement.
However, when I tried to pass the param to another page as a parameter for
the constructor, it throws a class casting exception. I also tried to do
new PageParameters(new HashMapString, MyClass()), but that didn't work
as well.

So can anyone help me solve this problem? Thanks a lot!
-- 
View this message in context: 
http://www.nabble.com/Class-casting-exception-while-using-PageParameters-tp16884113p16884113.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: Class casting exception while using PageParameters

2008-04-24 Thread Igor Vaynberg
pageparameters represent url parameters, so they can only contain strings

-igor


On Thu, Apr 24, 2008 at 7:54 PM, jianfei [EMAIL PROTECTED] wrote:

  Hi, I'm new to the wicket framework, and I have a problem while using the
  PageParameters.

  I want to add a class instance as the value of one of the page parameters,
  so I did this:

  MyClass instance = new MyClass();
  PageParameters param = new PageParameters();
  param.put(classInstance, instance);

  Then I want to get back the parameter as the class instance, so I use:

  MyClass theInstance = (MyClass) param.get(classInstance);

  This works fine if I put it right after the param.put(...) statement.
  However, when I tried to pass the param to another page as a parameter for
  the constructor, it throws a class casting exception. I also tried to do
  new PageParameters(new HashMapString, MyClass()), but that didn't work
  as well.

  So can anyone help me solve this problem? Thanks a lot!
  --
  View this message in context: 
 http://www.nabble.com/Class-casting-exception-while-using-PageParameters-tp16884113p16884113.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]



External Error, Expiry , AccessDenied Pages

2008-04-24 Thread mfs

Guys,

I was wondering, if i were to redirect to external error, expiry and
access-denied page. Is there a better solution then to make individual
page-class for above and do a redirect to the corresponding pages in their
constructor? Since setAccessDeniedPage, setInternalErrorPage (in
ApplicationSettings) all take Class class as argument..

Thanks in advance


-- 
View this message in context: 
http://www.nabble.com/External-Error%2C-Expiry-%2C-AccessDenied-Pages-tp16885052p16885052.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]



Load Modal Window before the page loads

2008-04-24 Thread freak182

Hello,
Im having problem from a modal window loading before a page, is this
possible? because when try this:

public class BasePage extends WebPage {
 public BasePage(){
   if(_isLoadable) modalWindow.show(new AjaxRequestTarget(this));
}
}


ERROR - RequestCycle   - This component is not (yet) coupled to
a page. It has to be able to find the page it is supposed to operate in
before you can call this method (Component#getMarkupId)
org.apache.wicket.WicketRuntimeException: This component is not (yet)
coupled to a page. It has to be able to find the page it is supposed to
operate in before you can call this method (Component#getMarkupId)
at org.apache.wicket.Component.nextAutoIndex(Component.java:1380)
at org.apache.wicket.Component.getMarkupId(Component.java:1422)
at org.apache.wicket.Component.getMarkupId(Component.java:1468)
at
org.apache.wicket.ajax.AjaxRequestTarget.addComponent(AjaxRequestTarget.java:344)
at
org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.show(ModalWindow.java:278)
---

Thanks a lot..Cheers
-- 
View this message in context: 
http://www.nabble.com/Load-Modal-Window-before-the-page-loads-tp16890707p16890707.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]