Re: WicketTester - Problem submitting a form

2009-02-01 Thread Timo Rantalaiho
On Wed, 28 Jan 2009, Stephan Koch wrote:
> mountBookmarkablePage("/login", LoginPage.class);
> 
> When I remove that line, the test runs fine. Could be a bug in
> WicketTester? I'd like some opinions on that before I file a JIRA issue.

It could be, but you could still try replacing

> > tester.startPage(LoginPage.class);

with tester.starPage(new TestPageSource() { ... });

If you can add a failing quickstart or a patch containing a 
failing test, it would be great.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AjaxFallbackDefaultDataTable and AjaxLink

2009-02-01 Thread Timo Rantalaiho
On Tue, 27 Jan 2009, Mathias P.W Nilsson wrote:
> I have override the newRowItem for the AjaxFallbackDefaultDataTable to make
> the entire row clickable. ( return new ClickableItem ). Can anyone help me
> with some pointers in how to make the row open a model window for editing. 

ModalWindow is just JavaScript, so it cannot work sensibly 
if an AjaxFallback* must fall back to no Javascript.

But opening a ModalWindow shouldn't have anything special 

  
http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/modal/ModalContent1Page.java?revision=672603&view=markup

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

It sounds like a strange UI though :)

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Render other components

2009-02-01 Thread Timo Rantalaiho
On Tue, 27 Jan 2009, Philipp Daumke wrote:
> I think both of you mean similar things. So I need to attributes in my 
> custom panel, one for the referring instance (in my case an instance of 
> Class Index) and one for the component that I want to render (in my case 
> AjaxFallbackDefaultDataTable). So my new custom panel looks like the one 
> below. Agree?

Yep, another option is to use Component.IVisitor and/or 
findParent for the job. It has the additional advantage that 
it also works if the componentInstance gets replaced on the 
page, which easily happens e.g. with repeaters, and if you 
hold references directly to components they might get stale.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Performance question

2009-02-01 Thread Timo Rantalaiho
On Sun, 25 Jan 2009, Johan Compagner wrote:
> I guess wicket should dump the page serialized size in development
> mode. So that users see them when developing.

Yep, we have in one project debug logging doing just that so
you more or less notice right away when something starts to
hog memory.

I've also thought of fail-fast by making an assertion in a
DiskPageStore subclass or some such place that would crash
if the size is too big.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Budy indicator next to a checkbox

2009-02-01 Thread Philipp Daumke

Thanks Igor,

that was the point.

Philipp

ajaxcheckbox does not have a method  public String
getAjaxIndicatorMarkupId() so what are you trying to override? instead
let your panel implement see IAjaxIndicatorAware

-igor



On Sun, Feb 1, 2009 at 3:49 PM, Philipp Daumke  wrote:
  

Hi all,

I try to get a busy indicator next to a checkboxm, but it doesn't work. I
tried to use the standard AjaxIndicatorAppender as shown in
wicket-extensions. Does this class only work with extension-classes startign
with "Indicating.."? Do you have an example how to show an indicator next to
a checkbox?

All the best
Philipp


public class CriticalCheckboxActionPanel extends Panel
{
  Index index;
  private final AjaxIndicatorAppender indicatorAppender = new
AjaxIndicatorAppender();
  public MyCheckboxActionPanel(String id, final IModel model, final Item
item, Index index)
  {
  ...
  AjaxCheckBox chb = new AjaxCheckBox("too_critical",new
PropertyModel(to, "too_critical")) {
  @Override
  protected void onUpdate(AjaxRequestTarget target) {
  try {
  Thread.sleep(5000);
  } catch (InterruptedException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  }
  }
   public String getAjaxIndicatorMarkupId() {
  return indicatorAppender.getMarkupId();
}
};
  chb.add(indicatorAppender);
  add(chb);
  }
}
--

Averbis GmbH
c/o Klinikum der Albert-Ludwigs-Universität
Stefan-Meier-Strasse 26
D-79104 Freiburg

Fon: +49 (0) 761 - 203 6707
Fax: +49 (0) 761 - 203 6800
E-Mail: dau...@averbis.de

Geschäftsführer: Dr. med. Philipp Daumke, Kornél Markó
Sitz der Gesellschaft: Freiburg i. Br.
AG Freiburg i. Br., HRB 701080


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

  



--

Averbis GmbH
c/o Klinikum der Albert-Ludwigs-Universität
Stefan-Meier-Strasse 26
D-79104 Freiburg

Fon: +49 (0) 761 - 203 6707
Fax: +49 (0) 761 - 203 6800
E-Mail: dau...@averbis.de

Geschäftsführer: Dr. med. Philipp Daumke, Kornél Markó
Sitz der Gesellschaft: Freiburg i. Br.
AG Freiburg i. Br., HRB 701080


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Budy indicator next to a checkbox

2009-02-01 Thread Igor Vaynberg
ajaxcheckbox does not have a method  public String
getAjaxIndicatorMarkupId() so what are you trying to override? instead
let your panel implement see IAjaxIndicatorAware

-igor



On Sun, Feb 1, 2009 at 3:49 PM, Philipp Daumke  wrote:
> Hi all,
>
> I try to get a busy indicator next to a checkboxm, but it doesn't work. I
> tried to use the standard AjaxIndicatorAppender as shown in
> wicket-extensions. Does this class only work with extension-classes startign
> with "Indicating.."? Do you have an example how to show an indicator next to
> a checkbox?
>
> All the best
> Philipp
>
>
> public class CriticalCheckboxActionPanel extends Panel
> {
>   Index index;
>   private final AjaxIndicatorAppender indicatorAppender = new
> AjaxIndicatorAppender();
>   public MyCheckboxActionPanel(String id, final IModel model, final Item
> item, Index index)
>   {
>   ...
>   AjaxCheckBox chb = new AjaxCheckBox("too_critical",new
> PropertyModel(to, "too_critical")) {
>   @Override
>   protected void onUpdate(AjaxRequestTarget target) {
>   try {
>   Thread.sleep(5000);
>   } catch (InterruptedException e) {
>   // TODO Auto-generated catch block
>   e.printStackTrace();
>   }
>   }
>public String getAjaxIndicatorMarkupId() {
>   return indicatorAppender.getMarkupId();
> }
> };
>   chb.add(indicatorAppender);
>   add(chb);
>   }
> }
> --
>
> Averbis GmbH
> c/o Klinikum der Albert-Ludwigs-Universität
> Stefan-Meier-Strasse 26
> D-79104 Freiburg
>
> Fon: +49 (0) 761 - 203 6707
> Fax: +49 (0) 761 - 203 6800
> E-Mail: dau...@averbis.de
>
> Geschäftsführer: Dr. med. Philipp Daumke, Kornél Markó
> Sitz der Gesellschaft: Freiburg i. Br.
> AG Freiburg i. Br., HRB 701080
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: using Gmap2 for route planning

2009-02-01 Thread Andreas Petersson

hi again!
I just finished a rough draft of a GDirections  class for GMap2. this is 
a standalone class, no modifications at the existing resources/classes 
are necessary.

it seems to work in my simple setting - this can also be updated with ajax.
the implementation has to override getJSadd() , since it is not 
constructed with a constructor.
please have a look at the correctness, as this is my first custom 
component i've written for wicket.

open questions for me: is there a better way to access the core maps object?

   final String markupId = getParent().get("map").getMarkupId();
   String jsVar = "directions" + markupId;
   sb.append("var ").append(jsVar).append(" = new 
GDirections(Wicket.maps['").append(markupId).append("'].map");


i have two concerns here:
1) accessing the map id via getParent().get("map").getMarkupId() - 
unfortunately the "map" variable in GMap2 is private without an 
accessor. otherwise I could have written getParent().getMap().getMarkupId().
2) hardcoding the Wicket.maps[''].map javascript reference - is there a 
better way to obtain this from the parent?


possible features missing:
*) changing of markers via GEvent.addListener(jsVar,"load"...
*) somehow obtain the results (length) of routes. - any idea on this?
*) change the type of route (don't use highways, by foot, by public 
transport)


-

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import wicket.contrib.gmap.api.GEvent;
import wicket.contrib.gmap.api.GLatLng;
import wicket.contrib.gmap.api.GOverlay;
import wicket.contrib.gmap.js.Array;

public class GDirections extends GOverlay {
   private Component writeOutPutTo;
   private final GLatLng[] waypoints;
   private final boolean writeOutput;

   public GDirections(GLatLng... gLatLngs) {
   this(null, gLatLngs);
   }

   public GDirections(Component writeOutPutTo, GLatLng... gLatLngs) {
   this.writeOutPutTo = writeOutPutTo;
   waypoints = gLatLngs;
   writeOutput = writeOutPutTo != null;
   }

   @Override
   protected String getJSconstructor() {
   return null;
   }

   @Override
   public String getJSadd() {
   Array array = new Array();
   for (GLatLng gLatLng : waypoints) {
   array.add(gLatLng.getJSconstructor());
   }
   final StringBuffer sb = new StringBuffer();
   final String markupId = getParent().get("map").getMarkupId();
   String jsVar = "directions" + markupId;
   sb.append("var ").append(jsVar).append(" = new 
GDirections(Wicket.maps['").append(markupId).append("'].map");

   if (writeOutput) {
   sb.append(", document.getElementById('");
   sb.append(writeOutPutTo.getMarkupId());
   sb.append("')");
   }
   sb.append(");");
   sb.append(jsVar + ".loadFromWaypoints(");
   appendCoordArray(sb, waypoints);
   sb.append(");");
   sb.deleteCharAt(sb.length() - 1);
   return sb.toString();
   }

   /**
* produces a string like
* 
["37.600470,-122.384050","37.789010,-122.425420","38.029940,-122.255420","39.026450,-119.945700"]

*
* @param sbStringBuffer to write into
* @param array list of Waypoints
*/
   private void appendCoordArray(final StringBuffer sb, GLatLng[] array) {
   sb.append("[");
   for (GLatLng coord : array) {
   
sb.append("\"").append(coord.getLat()).append(",").append(coord.getLng()).append("\"");

   sb.append(",");
   }
   sb.deleteCharAt(sb.length() - 1);
   sb.append("]");
   }

   @Override
   protected void updateOnAjaxCall(AjaxRequestTarget target, GEvent 
overlayEvent) {

   //no clue
   }
}

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Budy indicator next to a checkbox

2009-02-01 Thread Philipp Daumke

Hi all,

I try to get a busy indicator next to a checkboxm, but it doesn't work. 
I tried to use the standard AjaxIndicatorAppender as shown in 
wicket-extensions. Does this class only work with extension-classes 
startign with "Indicating.."? Do you have an example how to show an 
indicator next to a checkbox?


All the best
Philipp


public class CriticalCheckboxActionPanel extends Panel
{
   Index index;
   private final AjaxIndicatorAppender indicatorAppender = new 
AjaxIndicatorAppender();
   public MyCheckboxActionPanel(String id, final IModel model, final 
Item item, Index index)

   {
   ...
   AjaxCheckBox chb = new AjaxCheckBox("too_critical",new 
PropertyModel(to, "too_critical")) {

   @Override
   protected void onUpdate(AjaxRequestTarget target) {
   try {
   Thread.sleep(5000);
   } catch (InterruptedException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
   }
   }

public String getAjaxIndicatorMarkupId() {

   return indicatorAppender.getMarkupId();
 }
  
   };

   chb.add(indicatorAppender);
   add(chb);
   }
}
--

Averbis GmbH
c/o Klinikum der Albert-Ludwigs-Universität
Stefan-Meier-Strasse 26
D-79104 Freiburg

Fon: +49 (0) 761 - 203 6707
Fax: +49 (0) 761 - 203 6800
E-Mail: dau...@averbis.de

Geschäftsführer: Dr. med. Philipp Daumke, Kornél Markó
Sitz der Gesellschaft: Freiburg i. Br.
AG Freiburg i. Br., HRB 701080


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Servlet container authentication in Wicket

2009-02-01 Thread Philipp Daumke

Hi Timm,

I also tried to add my application name in it (like you proposed), but 
no difference, still doesn't work.


Philipp

http://localhost:5080/j_security_check?j_username=test&j_password=test



Shouldn't there be an application named?

http://localhost:5080/MYAPP/j_security_check?j_username=test&j_password=test

Regards,
Timm


Am Sonntag, 1. Februar 2009 23:03:50 schrieb Philipp Daumke:
  

Hi all,

I followed the Servlet Container authentication as described in
http://cwiki.apache.org/WICKET/servlet-container-authentication.html,
but I do not get it working.

At the moment I get an error in firefox when invoking the
redirectToSecurityCheck() method:

http://localhost:5080/j_security_check?j_username=test&j_password=test
_The requested resource () is not available.

_I don't even know exactly what "j_security_check" is and don't find too
much on the web. Do I have to configure Tomcat properly?

Below is my full src. MyApp.java and web.xml look like in the example
(see link aboe). Thank you for your help!
Philipp


public final class LoginPage extends WebPage
{
private String username;
private String password;
public LoginPage()
{
redirectToSecurityCheck();
/*if( ( ( MySession )getSession() ).isUserLoggedIn())
{
// redirect to hide username and password from URL after
user is logged in
setRedirect( true );
setResponsePage( Index.class );
}
else
{
redirectToSecurityCheck();
}*/
}

/**
 * Common servlet login workaround
 */
private void redirectToSecurityCheck()
{
final Map parametersMap = ( ( WebRequestCycle
)RequestCycle.get()
).getWebRequest().getHttpServletRequest().getParameterMap();
if( parametersMap.containsKey( "username" ) &&
parametersMap.containsKey( "password" ) )
{
// getting parameters from POST request
final String userName = ( ( String[] )parametersMap.get(
"username" ) )[ 0 ];
final String userPassword = ( ( String[] )parametersMap.get(
"password" ) )[ 0 ];

// if POST parameters are ok, redirect them to j_security_check
if( ( userName != null ) && ( userPassword != null ) )
{
getRequestCycle().setRedirect( false );
getRequestCycle().setRequestTarget(
EmptyRequestTarget.getInstance() );

getResponse().redirect(
"/j_security_check?j_username=" + userName +
"&j_password=" + userPassword );
}
}
}

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}
}





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

  



--

Averbis GmbH
c/o Klinikum der Albert-Ludwigs-Universität
Stefan-Meier-Strasse 26
D-79104 Freiburg

Fon: +49 (0) 761 - 203 6707
Fax: +49 (0) 761 - 203 6800
E-Mail: dau...@averbis.de

Geschäftsführer: Dr. med. Philipp Daumke, Kornél Markó
Sitz der Gesellschaft: Freiburg i. Br.
AG Freiburg i. Br., HRB 701080


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Servlet container authentication in Wicket

2009-02-01 Thread Timm Helbig

> http://localhost:5080/j_security_check?j_username=test&j_password=test

Shouldn't there be an application named?

http://localhost:5080/MYAPP/j_security_check?j_username=test&j_password=test

Regards,
Timm


Am Sonntag, 1. Februar 2009 23:03:50 schrieb Philipp Daumke:
> Hi all,
>
> I followed the Servlet Container authentication as described in
> http://cwiki.apache.org/WICKET/servlet-container-authentication.html,
> but I do not get it working.
>
> At the moment I get an error in firefox when invoking the
> redirectToSecurityCheck() method:
>
> http://localhost:5080/j_security_check?j_username=test&j_password=test
> _The requested resource () is not available.
>
> _I don't even know exactly what "j_security_check" is and don't find too
> much on the web. Do I have to configure Tomcat properly?
>
> Below is my full src. MyApp.java and web.xml look like in the example
> (see link aboe). Thank you for your help!
> Philipp
>
>
> public final class LoginPage extends WebPage
> {
> private String username;
> private String password;
> public LoginPage()
> {
> redirectToSecurityCheck();
> /*if( ( ( MySession )getSession() ).isUserLoggedIn())
> {
> // redirect to hide username and password from URL after
> user is logged in
> setRedirect( true );
> setResponsePage( Index.class );
> }
> else
> {
> redirectToSecurityCheck();
> }*/
> }
>
> /**
>  * Common servlet login workaround
>  */
> private void redirectToSecurityCheck()
> {
> final Map parametersMap = ( ( WebRequestCycle
> )RequestCycle.get()
> ).getWebRequest().getHttpServletRequest().getParameterMap();
> if( parametersMap.containsKey( "username" ) &&
> parametersMap.containsKey( "password" ) )
> {
> // getting parameters from POST request
> final String userName = ( ( String[] )parametersMap.get(
> "username" ) )[ 0 ];
> final String userPassword = ( ( String[] )parametersMap.get(
> "password" ) )[ 0 ];
>
> // if POST parameters are ok, redirect them to j_security_check
> if( ( userName != null ) && ( userPassword != null ) )
> {
> getRequestCycle().setRedirect( false );
> getRequestCycle().setRequestTarget(
> EmptyRequestTarget.getInstance() );
>
> getResponse().redirect(
> "/j_security_check?j_username=" + userName +
> "&j_password=" + userPassword );
> }
> }
> }
>
> public String getUsername() {
> return username;
> }
>
> public void setUsername(String username) {
> this.username = username;
> }
>
> public String getPassword() {
> return password;
> }
>
> public void setPassword(String password) {
> this.password = password;
> }
> }



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Servlet container authentication in Wicket

2009-02-01 Thread Philipp Daumke

Hi all,

I followed the Servlet Container authentication as described in 
http://cwiki.apache.org/WICKET/servlet-container-authentication.html, 
but I do not get it working.


At the moment I get an error in firefox when invoking the 
redirectToSecurityCheck() method:


http://localhost:5080/j_security_check?j_username=test&j_password=test
_The requested resource () is not available.

_I don't even know exactly what "j_security_check" is and don't find too 
much on the web. Do I have to configure Tomcat properly?


Below is my full src. MyApp.java and web.xml look like in the example 
(see link aboe). Thank you for your help!

Philipp


public final class LoginPage extends WebPage
{
   private String username;
   private String password;
   public LoginPage()
   {
   redirectToSecurityCheck();
   /*if( ( ( MySession )getSession() ).isUserLoggedIn())
   {
   // redirect to hide username and password from URL after 
user is logged in

   setRedirect( true );
   setResponsePage( Index.class );
   }
   else
   {
   redirectToSecurityCheck();
   }*/
   }

   /**
* Common servlet login workaround
*/
   private void redirectToSecurityCheck()
   {
   final Map parametersMap = ( ( WebRequestCycle 
)RequestCycle.get() 
).getWebRequest().getHttpServletRequest().getParameterMap();
   if( parametersMap.containsKey( "username" ) && 
parametersMap.containsKey( "password" ) )

   {
   // getting parameters from POST request
   final String userName = ( ( String[] )parametersMap.get( 
"username" ) )[ 0 ];
   final String userPassword = ( ( String[] )parametersMap.get( 
"password" ) )[ 0 ];


   // if POST parameters are ok, redirect them to j_security_check
   if( ( userName != null ) && ( userPassword != null ) )
   {
   getRequestCycle().setRedirect( false );
   getRequestCycle().setRequestTarget( 
EmptyRequestTarget.getInstance() );


   getResponse().redirect(
   "/j_security_check?j_username=" + userName + 
"&j_password=" + userPassword );

   }
   }
   }

   public String getUsername() {
   return username;
   }

   public void setUsername(String username) {
   this.username = username;
   }

   public String getPassword() {
   return password;
   }

   public void setPassword(String password) {
   this.password = password;
   }
}
--

Averbis GmbH
c/o Klinikum der Albert-Ludwigs-Universität
Stefan-Meier-Strasse 26
D-79104 Freiburg

Fon: +49 (0) 761 - 203 6707
Fax: +49 (0) 761 - 203 6800
E-Mail: dau...@averbis.de

Geschäftsführer: Dr. med. Philipp Daumke, Kornél Markó
Sitz der Gesellschaft: Freiburg i. Br.
AG Freiburg i. Br., HRB 701080


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: best way to obtain component reference?

2009-02-01 Thread Timo Rantalaiho
On Thu, 22 Jan 2009, Phillip Rhodes wrote:
> I used the page.get("componentid") method, but it returns null.  While
> I could just store the reference to the label as a variable in my page
> class, I would like to understand how to obtain a reference to it
> using the wicket API.

If it's very simple, a straight get("path") may be OK, but 
generally it's better to use visitors and/or findParent to 
not depend so much on the exact component hierarchy.

> public AdminPage() {
> add(new Label("message", "If you see this message wicket is properly 
> configured and running"));

  class StatusMessage extends Label {
  public StatusMessage() {
  super("message", "If you see this message wicket is
  properly configured and running");
  }
  }

>   @Override
>   public void onSubmit()
>   {   
> Label lbl = new Label("message", "Deleted");
> this.get("message").replaceWith(lbl);

 getPage().visitChildren(StatusMessage.class, new
 IVisitor() {
 public Object component(Component component) {
 component.setDefaultModelObject("Deleted");
 }
 });

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Simulate processing of Page

2009-02-01 Thread Timo Rantalaiho
On Wed, 21 Jan 2009, Anton Veretennikov wrote:
> I would like to know is it possible to simulate processing of some
> PageA from some other PageB and get result as a String.
> I need to return as HTTP response only some div from PageA.

I think that something like this has been disussed on the 
list before (search in Nabble something like rendering the 
page to a string), and using or getting inspiration from 
WicketTester might be the path to pursue.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ModalWindow gotcha!

2009-02-01 Thread Timo Rantalaiho
On Sun, 18 Jan 2009, Phillip Rhodes wrote:
> Declaring the ModalWindow from a panel did not work.  The ModalWindow  
> would appear, but the ModalWindow contents (a panel) would be rendered  
> within the parent panel after the ModalWindow was closed.
> If I declare the ModalWindow in a page, everything was fine.  I can  
> still invoke the ModalWindow from a panel, all is good.  For now, I am  
> going to declare all my ModalWindows at the page level,and pass these  
> as constructor arguments to my panels.

This sounds very strange, I think that your problem must 
have been elsewhere. Please send a quickstart reproducing 
the problem if you're interested in finding out more.

Adding a ModalWindow in a panel should be OK.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: What are Behaviors in Wicket?

2009-02-01 Thread Timo Rantalaiho
On Sun, 18 Jan 2009, HHB wrote:
> In easy words, what are Wicket Behaviors? what is their role?

See how IBehavior interface is being implemented wicket core 
and -examples.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to test Ajax Submit Button on A form

2009-02-01 Thread Timo Rantalaiho

> rag...@directi schrieb:
> >Can any one please help me with testing an AjaxSubmitButton on a form.
> >
...
On Sat, 17 Jan 2009, Per Newgro wrote:
> You have to call submit at the end. Otherwise the call of 
> executeAjaxEvent has no data in form.

Nope, you can submit directly with executeAjaxEvent if it 
fires the submitting behavior.

I've thought that FormTester.submit() is just for non-ajax
forms.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: unit test for dropdownchoice with ajax

2009-02-01 Thread Timo Rantalaiho
On Tue, 23 Dec 2008, tbt wrote:
>   formTester.submit();

If you submit the form with Ajax, you should use 
WicketTester.executeAjaxEvent in the test instead. 

Anyway, it seems like there might be a bug. If you can debug 
some more and/or produce a quickstart that reproduces the 
problem, it would be good. Otherwise it's difficult to say 
what's the problem.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



using Gmap2 for route planning

2009-02-01 Thread Andreas Petersson

Hi!

I'm using wicket.contrib.gmap.Gmap2 to create maps. i browsed the 
source, and it does not appear as if there is any implementation ready 
to overlay routes.
hay anybody extended the Gmap2 stuff? my first guess would be to create 
a new type of GOveray,. similar to GMarker, but slightly more complex.

has anybody experience with that, or an example how to do it?

best regards,
andreas


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: where to find javadoc for wikcet 1.4

2009-02-01 Thread Timo Rantalaiho
On Tue, 13 Jan 2009, Jeremy Thomerson wrote:
> Do you use Maven?  If so, do "mvn eclipse:eclipse -DdownloadJavadocs=true"

Better yet,

-DdownloadSources=true

or the equivalent in pom.xml.

With open source, you shold always get the source (that also 
provides the javadocs in the IDE). It doesn't make sense to 
just read the javadocs and guess when you can navigate to 
the actual source code whenever necessary.

Best wishes,
Timo


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: brainstorming

2009-02-01 Thread Timo Rantalaiho
On Mon, 05 Jan 2009, Daniele Dellafiore wrote:
> Using wicket for a long time now, one of the most tedious task is
> "panel refactoring". I mean, often you start with some simple panel
> then it grows and you split in several panels.
> This operation is tedious becouse there is no IDE support for
> refactoring both java and html side.

I typically leave the HTML fragments more or less as they 
are, because for previewability and for the HTML guy it's
easier when they are in bigger pieces.

Splitting the contents of a Panel to WebMarkupContainers 
does not require changing the HTML code, just Java code.
Or maybe you need to add some new wicket:id to some div.

We have extensive developer tests (WicketTester "almost 
unit" tests :)) to see that the code and HTML are in sync,
and Wicket gives good error messages when they aren't, so 
the manual refactoring is pretty safe to do in the end.

That being said, of course more IDE support would be nice!

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: DropDownChoice onchange event with AjaxEventBehaviour

2009-02-01 Thread Timo Rantalaiho
On Wed, 07 Jan 2009, Yazeed Isaacs wrote:
> Yes, I want feedback text for a lengthy process and then update the
> table and remove the feedback text.

See IAjaxIndicatorAware. 

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: What are the consequences on sharing panels between pages?

2009-02-01 Thread Per Newgro

Hi Uwe,

until now i can do everything :-). All my experiments with ldm failed so 
far. I have to store the states. But in DB? It's heavyweight for me.

Maybe i should try a cookie based solution.

Thanks for your doubts
Cheers
Per

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



CSS Arrangement Order

2009-02-01 Thread TH Lim

Hi,

How do I arrange my CSS declaration order? For example, the current order is 

...

... some script tags removed





...

resources/com.acme/box.css and
resources/org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow/res/modal.css
are CSS included with the libraries / components I used in my web
application. How do I make my own CSS,css/style.css, to be placed after
these CSS in ?

Thanks

/lim/

-- 
View this message in context: 
http://www.nabble.com/CSS-Arrangement-Order-tp21776162p21776162.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Multi-module applications in Wicket

2009-02-01 Thread Daniel Lipski

Hi

Im working on web application divided into multiple 'modules' and Im
wondering how to use Wicket in such 
scenario. Because 'module' means a lot, I'll specify what I would like to
achive:
1)diffrent home pages for each module
2)diffrent session classes for each module (WebApplication.newSession)
3)diffrent authentications (ie. module A - SSO, module B - web form)

I can imagine two approaches:
1)one Wicket application 'handling' both modules.But...:
-because there is one appication I'll have to check logged user in
WebApplication.newSession & WebApplication.getHomePage and return proper
session object/home page class. Decision is taken on logged user, so in that
methods Ill have to know which user has logged in. Is it possible to check
logged user in this methods ? (arent they called before authentication ?)
The other way is to make a decission not on logged user but on accessed Page
(all pages in moduleA inherit from ModuleAWebPage and pages in moduleB
inherit from ModuleBWebPage). But I doubt if requested page is avaliable in
this two methods...
-module A uses SSO to authenticate user, module B uses usual page, where
should I choose how to authenticate user ? Which authenticating framework
should I choose for this purpose ? (auth-roles, WASP ?)

2)Two Wicket applications each 'handling' one module. Because there are two
WebApplications there is no problem with determinig which session
object/home page class return. There is no problem with diffrent
authentications either. 
But...:
-Is it possible  ? Can I map WicketFilter few times in web.xml ? I know that
Wicket does a lots internal and I dont know if multiple Wicket 'instances'
can be run in one classloader. Are there any caveats/limitations when
multiple Wicket instances work in parell (does Application.get() or other
static methods still work - I saw that they are implemened with ThreadLocal
but ...?)
-How running multiple Wicket instances influences session size and other
resources ?
-Ther is a lot of settings (DI, mounting startegies, 'global' converters,
global resources) that need to be shared beetweend this two modules. For
majority of them I can make super class for both ModuleAWebApplication and
ModuleBWebApplication and put common code there, but does moduleA can access
shared by moduleB resources ?
-It looks a little bit strange for me to create diffrent Wicket Web
applications for each module. From the 'outside'(servlet container) its
still one apllication (one war) so there is a little mismatch. Of course
this is the least siginificant reason but I would like to use proper
solutions rather then stretch the wrong one.

For now Im closer to solution 2), but I worry about things which I havnt
foreseen. Maybe there is general rule/pattern/solution for writing
multi-module web applciaions ? Im sure its common issue and many of you
could share some experience.

Thanks for any help.
Regards
Daniel 


-- 
View this message in context: 
http://www.nabble.com/Multi-module-applications-in-Wicket-tp21774998p21774998.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: What are the consequences on sharing panels between pages?

2009-02-01 Thread Uwe Schäfer

Per Newgro schrieb:

i would like to share (instance reuse) a navigation panel in my page 
flow. I try to achieve that so i can keep the current state of 
navigation components. It's a clone of the windows xp sidebar in system 
controls.


sounds awful. would not do that. being deserialized from the pagemap, 
you´ll end up with different instances if back navigation steps in, right?
couldn´t you extract your state into an appropriate object and reference 
it from both panels by using a LDM?


cu uwe

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Image Resource not loading

2009-02-01 Thread Nicolas Labrot
After some debug, it seems my firefox is bugging.

It's work perfectly on chrome, IE, opera and not with firefox. It works on
firefox when httpfox (a http header tracer) is running...




 wrote:
> Hello,
> 
> I'm glad to write my first message on the wicket ML. :)
> 
> I have a problem with resource loading.
> 
> I have create a GridView which display 12 images :
> 
> GridView gridView = new GridView("rows", dataProvider)
> 
> The populateItem :
> 
> Image randomImage = new NonCachinImage("randomImage");
> randomImage.setImageResource(new
> DynamicSilkImageResource((org.silk.modele.Image)imageModele));
> item.add(randomImage);
> 
> 
> And finaly the DynamicSilkImageResource which extend WebResource :
> 
> public IResourceStream getResourceStream() {
>   return new
> FileResourceStream(storageService.getThumbnailFile(media.getStorage()));
> }
> 
> 
> Here is my issue.
> 
> At loading in my browser only 9 of my 12 images are displayed, the 3 last
> have the broken link. After around 25s the 3 last images were displayed.
> 
> 
> Is there a misconfiguration, a bug in my code ?
> 
> 
> Could someone help me ?
> 
> Thanks!
> 
> 
> Nicolas
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



What are the consequences on sharing panels between pages?

2009-02-01 Thread Per Newgro

Hi,

i would like to share (instance reuse) a navigation panel in my page 
flow. I try to achieve that so i can keep the current state of 
navigation components. It's a clone of the windows xp sidebar in system 
controls.


But i don't know if sharing is a good idea. I will have many pages. What 
happens if i create a new page, add the navigation panel of one page to 
the next and redirect by using setResponsePage?
Will the last page be "garbage collected"? Normally java is only gc if 
no references are present to an object. Is wicket doing it similar?


Thanks 4 help
Per

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Image Resource not loading

2009-02-01 Thread Nicolas Labrot
Hello,

I'm glad to write my first message on the wicket ML. :)

I have a problem with resource loading.

I have create a GridView which display 12 images :

GridView gridView = new GridView("rows", dataProvider)

The populateItem :

Image randomImage = new NonCachinImage("randomImage");
randomImage.setImageResource(new
DynamicSilkImageResource((org.silk.modele.Image)imageModele));
item.add(randomImage);


And finaly the DynamicSilkImageResource which extend WebResource :

public IResourceStream getResourceStream() {
return new
FileResourceStream(storageService.getThumbnailFile(media.getStorage()));
}


Here is my issue.

At loading in my browser only 9 of my 12 images are displayed, the 3 last
have the broken link. After around 25s the 3 last images were displayed.


Is there a misconfiguration, a bug in my code ?


Could someone help me ?

Thanks!


Nicolas




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org