Re: SSL Links and buttons

2010-10-26 Thread sonxurxo

Hi Ernesto and others,

Yes that's what I mentioned before, I'm able to do what you say, or to
redirect to the HTTP page but not showing the validation errors, but not
both HTTP and show errors. 
By the way, if you check for secureForm.hasError(), will it catch a
situation where there's not literally a validation error but a
business-logic error? (e.g. when, in the onSubmit() method of your login
form, you check that the password is incorrect, it's not a wicket-validation
error, and then you invoke manually the error() method of the panel
containing the form to show the message but not the error() method of the
form itself). Will it detect those situations? I'm trying and
secureForm.hasError() always return false, no matter there are even
wicket-validation errors or not.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/SSL-Links-and-buttons-tp3001634p3013201.html
Sent from the Users forum 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: Fwd: Nested CompoundModel

2010-10-26 Thread Jan Ferko

Thanks a lot everyone



On 10/26/2010 03:17 AM, Pedro Santos wrote:

If you have n MyPanelData on a page, you will be fine with the
RepeatingView. Otherwise use the Listview to generate the correct number of
items with MyPanel each render.

On Mon, Oct 25, 2010 at 8:19 PM, Jan Ferkojulyl...@gmail.com  wrote:

   

  well, I have all fields which have to be create dynamicaly grouped in one
panel. So whole panel is

2010/10/25 Jeremy Thomersonjer...@wickettraining.com

 

What part is dynamic / dependent on the form?

On Sun, Oct 24, 2010 at 3:59 PM, Jan Ferkojulyl...@gmail.com  wrote:

   

Thanks a lot, it worked great.

I have one more question. I have to create same panel multiple times ,
based
on user output into the form and i have list of panel data model object
inside my form data object. Is it better to generate panels in page
 

class
 

and then passed list of panels into form constructor and use ListView
 

or
 

generate it inside form with RepeatingView and create new instance of
PanelData in Cycle and setting it on Panel and saving it to list like
this...

RepeatingView rp = new RepeatingView();
for(int i =0; i  n; i++){
   WebMarkupContainer parent = new WebMarkupContainer(rp.newChildID());

}

2010/10/22 Jeremy Thomersonjer...@wickettraining.com

 

On Fri, Oct 22, 2010 at 11:38 AM, Sven Meiers...@meiers.net
   

wrote:
 
   

Hi Jan,

when are data2 and data3 initialized? They seems to be null when
 

you
 

put
 

up
   

your models.

Most of the time it's a bad idea to pull something out of a model
 

and
 

put
 

it back into another model.
Do this instead:

this.add(new MyPanel(id2, new PropertyModel(model, data2)));

Then in MyPanel:

public MyPanel(id, model){
 super(id, new CompoundPropertyModel(model));

This has the following advantages:
- MyPanel's model is always in sync with the model of MyForm.
- MyPanel's usage of CompoundPropertyModel is hidden from the
 

outside.
   

If
 

MyPanel want's to utilize a CompoundPropertyModel (because it
 

doesn't
 

set
 

the model on its contained components), it should set it up by
 

itself.
   

HTH

Sven
 


Sven is spot-on, and this method he showed you above will absolutely
   

save
   

you some bugs down the road!

Thanks Sven!!

--
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

   



--
Jan Ferko,
julyl...@gmail.com

 



--
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

   



--
Jan Ferko,
julyl...@gmail.com

 



   



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



Re: SSL Links and buttons

2010-10-26 Thread Ernesto Reinaldo Barreiro
Hi,

What I'm trying to do is:

1-Override

protected IRequestTarget checkSecureIncoming(IRequestTarget target)
{

if (target != null  target instanceof 
SwitchProtocolRequestTarget)
{
return target;
}
if (portConfig == null)
{
return target;
}

Class? pageClass = getPageClass(target);  


if (pageClass != null)  
{
if(hasSecureSemiSecureAnnotation(pageClass)) {
if (target instanceof 
IListenerInterfaceRequestTarget) {
Component c = 
((IListenerInterfaceRequestTarget) target).getTarget();

if(SecureForm.class.isAssignableFrom(c.getClass())) {
return target;
}
}
}

IRequestTarget redirect = null;
if (hasSecureAnnotation(pageClass))
{
redirect = 
SwitchProtocolRequestTarget.requireProtocol(Protocol.HTTPS);
}
else
{
redirect = 
SwitchProtocolRequestTarget.requireProtocol(Protocol.HTTP);
}
if (redirect != null)
{
return redirect;
}

}
return target;
}

I have created a SemiSecure annotation to mark pages where I use
SecureForm so that I do not have to check for every
IListenerInterfaceRequestTarget on my application. I return the same
target as this request already comes via HTTPs (so no redirects are
needed).

My problem (and your problems I guess) are on

protected IRequestTarget checkSecureOutgoing(IRequestTarget target)
{
  

  if(hasSecureSemiSecureAnnotation(pageClass)) {
if (target instanceof 
IListenerInterfaceRequestTarget) {
IListenerInterfaceRequestTarget 
interfaceRequestTarget =
(IListenerInterfaceRequestTarget) target;
Component c = 
interfaceRequestTarget.getTarget();

if(SecureForm.class.isAssignableFrom(c.getClass())) {
// WHAT DO HERE
}
}
}
}

Here the page has been processed and the form actually has errors
(secureForm.hasError() returns true) if there are any... But the
request is over HTTPS and

1- We can cannot redirect to HTTP because this will generate a GET
request and you will loose POST parameters and will process page
again.
2- If we return the target then normal request processing will
continue and a redirect will be generated the the new version of the
page, but this will be done using a relative URL so the page will
switch to HTTPs (and you want it to stay on HTTP) . This is done on
PageRequestTarget,

/**
 * @see 
org.apache.wicket.IRequestTarget#respond(org.apache.wicket.RequestCycle)
 */
public void respond(RequestCycle requestCycle)
{
// Should page be redirected to?
if (requestCycle.isRedirect())
{
// Redirect to the page
requestCycle.redirectTo(page);
}
else
{
// Let page render itself
page.renderPage();
}
}

which delegates on the final method WebRequestCycle.redirectTo(page)
which generates a redirect to a relative URL (over HTTPs).

Regards,

Ernesto



On Tue, Oct 26, 2010 at 8:52 AM, sonxurxo sonxu...@gmail.com wrote:

 Hi Ernesto and others,

 Yes that's what I mentioned before, I'm able to do what you say, or to
 redirect to the HTTP page but not showing the validation errors, but not
 both HTTP and show errors.
 By the way, if you check for secureForm.hasError(), will it catch a
 situation where there's not literally a validation error but a
 business-logic error? (e.g. when, in the onSubmit() method of your login
 form, you check that the password is incorrect, it's not a wicket-validation
 error, and then you invoke manually the error() method of the panel
 containing the form to show the message but not the error() method of the
 form itself). Will it detect those situations? I'm trying and
 secureForm.hasError() always return false, no matter there are even
 wicket-validation 

Re: Error After 1 minute the Pagemap null is still locked

2010-10-26 Thread Martijn Dashorst
It appears that your pages have not been properly detached from their
request threads. Wicket still thinks that TP-Processor1 has the
pagemap locked, whereas that thread is waiting for mod_jk to deliver a
new request.

I'd look back in the history of what TP-Processor1 has done to get in
that state.

Martijn

On Tue, Oct 26, 2010 at 2:52 AM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 Our production server stopped processing AJAX requests today. I looked
 in the log files and noticed a After 1 minute the Pagemap null is
 still locked.
 The exception stack trace is shown below followed by a dump of the
 thread that was blocking the page.

 We are using Wicket 1.4.2, Tomcat 6.0 and Java 6.

 Could anybody help troubleshoot this problem?

 Thanks,

 Alec

 EXCEPTION

 2010-10-25 21:55:32,501 GMT ERROR [TP-Processor12]
 org.apache.wicket.RequestCycle -
 org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
 null is still locked by: Thread[TP-Processor1,5,main], giving up
 trying to get the page for path: 4:offersForm:offers:1:editOfferLink
        Begin of stack trace of Thread[TP-Processor1,5,main]
        java.net.SocketInputStream.socketRead0(Native Method)
        java.net.SocketInputStream.read(SocketInputStream.java:129)
        java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
        java.io.BufferedInputStream.read(BufferedInputStream.java:317)
        org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621)
        org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:559)
        
 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686)
        
 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
        
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        java.lang.Thread.run(Thread.java:619)
        End of stack trace of Thread[TP-Processor1,5,main]
 org.apache.wicket.protocol.http.request.InvalidUrlException:
 org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
 null is still locked by: Thread[TP-Processor1,5,main], giving up
 trying to get the page for path: 4:offersForm:offers:1:editOfferLink
        Begin of stack trace of Thread[TP-Processor1,5,main]
        java.net.SocketInputStream.socketRead0(Native Method)
        java.net.SocketInputStream.read(SocketInputStream.java:129)
        java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
        java.io.BufferedInputStream.read(BufferedInputStream.java:317)
        org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621)
        org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:559)
        
 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686)
        
 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
        
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        java.lang.Thread.run(Thread.java:619)
        End of stack trace of Thread[TP-Processor1,5,main]
        at 
 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
        at 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
        at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at 
 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
        at 
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at 
 

problem with Dropdown List

2010-10-26 Thread Mehmet.Kaplankiran
Hello,

I have a problem with dropdown list.
Even if I select values in the Dropdown list (see picture below), the member 
variable docType is always null .
Unfortunately I have found no error. I hope you can see why this is.
Best regards, Mehmet



//## class DocSearchPage ##
...
public class DocSearchPage extends MainTemplate
{
private TDokar docType;
...
public DocSearchPage()
{
add(getDocTypeDropDown(docType));
...
add(executeLink(execute));
}

private TDokarDocTypeDropDownChoice getDocTypeDropDown(String id)
{
return new TDokarDocTypeDropDownChoice(id)
{
@Override
protected ListTDokar getTDokarList()
{
return getDocTypeList();
}

@Override
protected TDokar getTDokar()
{
return docType;
}

@Override
protected void setTDokar(TDokar dokart)
{
dokar = docType;
}
};
}

private Link executeLink(String id)
{
return new Link(id)
{
@Override
public void onClick()
{
disItemList = 
session().getUser().getUserDao().searchDIS(docType.getDokar(), ..);   
//docType is null
}
};
}

}

// end DocSearchPage 




## class TDokarDocTypeDropDownChoice  #
package de.t_systems.dks.eba.pages.docsearch;

import de.t_systems.dks.eba.beans.basedata.TDokar;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

import java.util.List;

public abstract class TDokarDocTypeDropDownChoice extends DropDownChoice
{

public TDokarDocTypeDropDownChoice(String id)
{
super(id);
setModel(model());
setChoices(getTDokarList());
setChoiceRenderer(RENDERER);
}

private IModel model()
{
return new Model()
{
@Override
public Object getObject()
{
return getTDokar();
}

@Override
public void setObject(Object object)
{
setTDokar((TDokar) object);
}
};
}

private static final IChoiceRenderer RENDERER = new IChoiceRenderer()
{
@Override
public Object getDisplayValue(final Object object)
{
TDokar dokar = (TDokar) object;
return dokar.getDokar();
}

@Override
public String getIdValue(final Object object, final int index)
{
return ((TDokar) object).getDokar();
}
};

protected abstract TDokar getTDokar();
protected abstract void setTDokar(TDokar tDokar);
protected abstract ListTDokar getTDokarList();
}


## TDokarDocTypeDropDownChoice  
#''



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

Re: problem with Dropdown List

2010-10-26 Thread Pedro Santos
Hi Mehmet, I think you need change this line:

@Override
protected void setTDokar(TDokar dokart)
{
dokar = *docType*; --
DocSearchPage.this.*docType
*=* *dokart;
}

anyway, why are you delegating the set/get model calls to
TDokarDocTypeDropDownChoice
? Won't be interest only use the parameter model to maintain the TDokar?

On Tue, Oct 26, 2010 at 7:55 AM, mehmet.kaplanki...@t-systems.com wrote:

  Hello,
 I have a problem with dropdown list.
 Even if I select values in the Dropdown list (see picture below), the
 member variable *docType* is always null .
 Unfortunately I have found no error. I hope you can see why this is.
 Best regards, Mehmet


 //## class DocSearchPage
 ##
 ...
 public class DocSearchPage extends MainTemplate
 {
 private TDokar *docType*;
 ...
 public DocSearchPage()
 {
 add(*getDocTypeDropDown*(docType));
 ...
 add(executeLink(execute));
 }

 private *TDokarDocTypeDropDownChoice* *getDocTypeDropDown*(String
 id)
 {
 return new TDokarDocTypeDropDownChoice(id)
 {
 @Override
 protected ListTDokar getTDokarList()
 {
 return getDocTypeList();
 }

 @Override
 protected TDokar getTDokar()
 {
 return *docType*;
 }

 @Override
 protected void setTDokar(TDokar dokart)
 {
 dokar = *docType*;
 }
 };
 }

 private Link executeLink(String id)
 {
 return new Link(id)
 {
 @Override
 public void onClick()
 {
 disItemList =
 session().getUser().getUserDao().searchDIS(*docType*.getDokar(),
 ..);*//docType** **is null*
 }
 };
 }

 }

 // end DocSearchPage
 



 ## class TDokarDocTypeDropDownChoice  #
 package de.t_systems.dks.eba.pages.docsearch;

 import de.t_systems.dks.eba.beans.basedata.TDokar;
 import org.apache.wicket.markup.html.form.DropDownChoice;
 import org.apache.wicket.markup.html.form.IChoiceRenderer;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;

 import java.util.List;

 public abstract class TDokarDocTypeDropDownChoice extends DropDownChoice
 {

 public TDokarDocTypeDropDownChoice(String id)
 {
 super(id);
 setModel(model());
 setChoices(getTDokarList());
 setChoiceRenderer(RENDERER);
 }

 private IModel model()
 {
 return new Model()
 {
 @Override
 public Object getObject()
 {
 return getTDokar();
 }

 @Override
 public void setObject(Object object)
 {
 setTDokar((TDokar) object);
 }
 };
 }

 private static final IChoiceRenderer RENDERER = new
 IChoiceRenderer()
 {
 @Override
 public Object getDisplayValue(final Object object)
 {
 TDokar dokar = (TDokar) object;
 return dokar.getDokar();
 }

 @Override
 public String getIdValue(final Object object, final int
 index)
 {
 return ((TDokar) object).getDokar();
 }
 };

 protected abstract TDokar getTDokar();
 protected abstract void setTDokar(TDokar tDokar);
 protected abstract ListTDokar getTDokarList();
 }


 ## TDokarDocTypeDropDownChoice
 #''




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




-- 
Pedro Henrique Oliveira dos Santos


AW: problem with Dropdown List

2010-10-26 Thread Mehmet.Kaplankiran
sorry, in my Email is the folow method incorrect:
   @Override
protected void setTDokar(TDokar dokart)
{
dokar = docType;
}

in source cod is in code looks like this:
@Override 
protected void setTDokar(TDokar dokart)
{
docType = dokart;
}

docType is still null. 

-Ursprüngliche Nachricht-
Von: Pedro Santos [mailto:pedros...@gmail.com] 
Gesendet: Dienstag, 26. Oktober 2010 12:37
An: users@wicket.apache.org
Betreff: Re: problem with Dropdown List

Hi Mehmet, I think you need change this line:

@Override
protected void setTDokar(TDokar dokart)
{
dokar = *docType*; -- 
DocSearchPage.this.*docType
*=* *dokart;
}

anyway, why are you delegating the set/get model calls to 
TDokarDocTypeDropDownChoice ? Won't be interest only use the parameter model to 
maintain the TDokar?

On Tue, Oct 26, 2010 at 7:55 AM, mehmet.kaplanki...@t-systems.com wrote:

  Hello,
 I have a problem with dropdown list.
 Even if I select values in the Dropdown list (see picture below), the 
 member variable *docType* is always null .
 Unfortunately I have found no error. I hope you can see why this is.
 Best regards, Mehmet


 //## class DocSearchPage 
 ##
 ...
 public class DocSearchPage extends MainTemplate {
 private TDokar *docType*;
 ...
 public DocSearchPage()
 {
 add(*getDocTypeDropDown*(docType));
 ...
 add(executeLink(execute));
 }

 private *TDokarDocTypeDropDownChoice* 
 *getDocTypeDropDown*(String
 id)
 {
 return new TDokarDocTypeDropDownChoice(id)
 {
 @Override
 protected ListTDokar getTDokarList()
 {
 return getDocTypeList();
 }

 @Override
 protected TDokar getTDokar()
 {
 return *docType*;
 }

 @Override
 protected void setTDokar(TDokar dokart)
 {
 dokar = *docType*;
 }
 };
 }

 private Link executeLink(String id)
 {
 return new Link(id)
 {
 @Override
 public void onClick()
 {
 disItemList = 
 session().getUser().getUserDao().searchDIS(*docType*.getDokar(),
 ..);*//docType** **is null*
 }
 };
 }

 }

 // end DocSearchPage 
 



 ## class TDokarDocTypeDropDownChoice  
 # package de.t_systems.dks.eba.pages.docsearch;

 import de.t_systems.dks.eba.beans.basedata.TDokar;
 import org.apache.wicket.markup.html.form.DropDownChoice;
 import org.apache.wicket.markup.html.form.IChoiceRenderer;
 import org.apache.wicket.model.IModel; import 
 org.apache.wicket.model.Model;

 import java.util.List;

 public abstract class TDokarDocTypeDropDownChoice extends 
 DropDownChoice {

 public TDokarDocTypeDropDownChoice(String id)
 {
 super(id);
 setModel(model());
 setChoices(getTDokarList());
 setChoiceRenderer(RENDERER);
 }

 private IModel model()
 {
 return new Model()
 {
 @Override
 public Object getObject()
 {
 return getTDokar();
 }

 @Override
 public void setObject(Object object)
 {
 setTDokar((TDokar) object);
 }
 };
 }

 private static final IChoiceRenderer RENDERER = new
 IChoiceRenderer()
 {
 @Override
 public Object getDisplayValue(final Object object)
 {
 TDokar dokar = (TDokar) object;
 return dokar.getDokar();
 }

 @Override
 public String getIdValue(final Object object, final 
 int
 index)
 {
 return ((TDokar) object).getDokar();
 }

Wicket Web Beans

2010-10-26 Thread Josh Kamau
Hi Guys,

Is wicket web beans project still being developed? There is somewhere in the
docs where its indicated that it supports wicket 1.3RC1?

Is someone using it?

regards.
Josh


Re: problem with Dropdown List

2010-10-26 Thread Pedro Santos
If you are not submitting an form to send the selected TDokar from browser
to server, you can add an AjaxFormChoiceComponentUpdatingBehavior at
TDokarDocTypeDropDownChoice. Than when the user click the executeLink, the
selected TDokar will be at the DocSearchPage field.

On Tue, Oct 26, 2010 at 8:58 AM, mehmet.kaplanki...@t-systems.com wrote:

 sorry, in my Email is the folow method incorrect:
@Override
protected void setTDokar(TDokar dokart)
{
dokar = docType;
}

 in source cod is in code looks like this:
 @Override
protected void setTDokar(TDokar dokart)
{
 docType = dokart;
}

 docType is still null.

 -Ursprüngliche Nachricht-
 Von: Pedro Santos [mailto:pedros...@gmail.com]
 Gesendet: Dienstag, 26. Oktober 2010 12:37
 An: users@wicket.apache.org
 Betreff: Re: problem with Dropdown List

 Hi Mehmet, I think you need change this line:

@Override
protected void setTDokar(TDokar dokart)
{
dokar = *docType*; --
 DocSearchPage.this.*docType
 *=* *dokart;
}

 anyway, why are you delegating the set/get model calls to
 TDokarDocTypeDropDownChoice ? Won't be interest only use the parameter model
 to maintain the TDokar?

 On Tue, Oct 26, 2010 at 7:55 AM, mehmet.kaplanki...@t-systems.com wrote:

   Hello,
  I have a problem with dropdown list.
  Even if I select values in the Dropdown list (see picture below), the
  member variable *docType* is always null .
  Unfortunately I have found no error. I hope you can see why this is.
  Best regards, Mehmet
 
 
  //## class DocSearchPage
  ##
  ...
  public class DocSearchPage extends MainTemplate {
  private TDokar *docType*;
  ...
  public DocSearchPage()
  {
  add(*getDocTypeDropDown*(docType));
  ...
  add(executeLink(execute));
  }
 
  private *TDokarDocTypeDropDownChoice*
  *getDocTypeDropDown*(String
  id)
  {
  return new TDokarDocTypeDropDownChoice(id)
  {
  @Override
  protected ListTDokar getTDokarList()
  {
  return getDocTypeList();
  }
 
  @Override
  protected TDokar getTDokar()
  {
  return *docType*;
  }
 
  @Override
  protected void setTDokar(TDokar dokart)
  {
  dokar = *docType*;
  }
  };
  }
 
  private Link executeLink(String id)
  {
  return new Link(id)
  {
  @Override
  public void onClick()
  {
  disItemList =
  session().getUser().getUserDao().searchDIS(*docType*.getDokar(),
  ..);*//docType** **is null*
  }
  };
  }
 
  }
 
  // end DocSearchPage
  
 
 
 
  ## class TDokarDocTypeDropDownChoice
  # package de.t_systems.dks.eba.pages.docsearch;
 
  import de.t_systems.dks.eba.beans.basedata.TDokar;
  import org.apache.wicket.markup.html.form.DropDownChoice;
  import org.apache.wicket.markup.html.form.IChoiceRenderer;
  import org.apache.wicket.model.IModel; import
  org.apache.wicket.model.Model;
 
  import java.util.List;
 
  public abstract class TDokarDocTypeDropDownChoice extends
  DropDownChoice {
 
  public TDokarDocTypeDropDownChoice(String id)
  {
  super(id);
  setModel(model());
  setChoices(getTDokarList());
  setChoiceRenderer(RENDERER);
  }
 
  private IModel model()
  {
  return new Model()
  {
  @Override
  public Object getObject()
  {
  return getTDokar();
  }
 
  @Override
  public void setObject(Object object)
  {
  setTDokar((TDokar) object);
  }
  };
  }
 
  private static final IChoiceRenderer RENDERER = new
  IChoiceRenderer()
  

Re: Should nested form be multipart if parent is multipart?

2010-10-26 Thread Martin Grigorov
On HTML level nested form is just div.
Give more details

On Tue, Oct 26, 2010 at 2:05 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

 Should nested form become multipart if parent is multipart? Because it
 is on html level...

 **
 Martin

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




flot examples

2010-10-26 Thread Ivana

Hi,
Is anyone using Flot from Wicketstuff? Im looking for a simple example to
get me started. 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/flot-examples-tp3013635p3013635.html
Sent from the Users forum 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



[1.5]Current number of users (sessions) in a wicket app

2010-10-26 Thread nino martinez wael
Hi

Im wondering if 1.5 brings new possibilities towards counting current users/
sessions? Or if I still need to make my own HttpSessionListener for this?

regards Nino


Re: [1.5]Current number of users (sessions) in a wicket app

2010-10-26 Thread Martin Grigorov
You can provide implementation
of org.apache.wicket.session.HttpSessionStore.onBind(Request, Session) which
is being called for each Session.bind(), i.e. non-temporary sessions.
And #onUnbind() of course.

On Tue, Oct 26, 2010 at 3:40 PM, nino martinez wael 
nino.martinez.w...@gmail.com wrote:

 Hi

 Im wondering if 1.5 brings new possibilities towards counting current
 users/
 sessions? Or if I still need to make my own HttpSessionListener for this?

 regards Nino



Re: SSL Links and buttons

2010-10-26 Thread Ernesto Reinaldo Barreiro
Hi,

I think I managed to solve it: at least after an hour of testing it
haven't found a leak on my solution. The solution is as follows:

1-Create a secure form class as follows:

import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.IModel;
import org.apache.wicket.protocol.http.RequestUtils;

/**
 *
 * Form that does submit via HTTPs.
 *
 * @author Igor Vaynberg (ivaynberg)
 *
 */
public class SecureFormT extends FormT
{

private static final long serialVersionUID = 1L;

/**
 * Constructor.
 *
 * @param id See Component
 */
public SecureForm(String id)
{
super(id);
}

/**
 * @param id See Component
 * @param model See Component
 *
 * @see org.apache.wicket.Component#Component(String, IModel)
 */
public SecureForm(String id, IModelT model)
{
super(id, model);
}
/*
 * (non-Javadoc)
 * @see 
org.apache.wicket.markup.html.form.Form#onComponentTag(org.apache.wicket.markup.ComponentTag)
 */
@Override
protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);  
String action = tag.getAttribute(action);
action = RequestUtils.toAbsolutePath(action);
// rewrite action to use HTTPs
if(!action.startsWith(https))
action = https+action.substring(4);
tag.put(action, action);

}
}

2-Make a local copy of SwitchProtocolRequestTarget (this class is only
package visible)
3-Copy SecureHttpsRequestCycleProcessor and modify it as follows:

import javax.servlet.http.HttpServletRequest;

import org.apache.wicket.Component;
import org.apache.wicket.IRequestTarget;
import org.apache.wicket.RequestCycle;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebRequest;
import org.apache.wicket.protocol.http.WebRequestCycleProcessor;
import org.apache.wicket.protocol.https.HttpsConfig;
import org.apache.wicket.protocol.https.RequireHttps;
import org.apache.wicket.request.RequestParameters;
import 
org.apache.wicket.request.target.component.IBookmarkablePageRequestTarget;
import org.apache.wicket.request.target.component.IPageRequestTarget;
import 
org.apache.wicket.request.target.component.listener.IListenerInterfaceRequestTarget;

import *your package*.SemiSecurePage;
import *your package*.SwitchProtocolRequestTarget.Protocol;

/**
 * Request cycle processor that can switch between http and https
protocols based on the
 * {...@link RequireHttps} annotation.
 *
 * Once this processor is installed, any page annotated with the
{...@link RequireHttps} annotation
 * will be served over https, while any page lacking the annotation
will be served over http. The
 * annotation can be placed on a super class or an interface that a
page implements.
 *
 * To install this processor:
 *
 * pre
 * class MyApplication extends WebApplication
 * {
 *  #064;Override
 *  protected IRequestCycleProcessor newRequestCycleProcessor()
 *  {
 *  return new HttpsRequestCycleProcessor(config);
 *  }
 * }
 * /pre
 *
 * bNotes/b: According to servlet spec a cookie created on an
https request is marked as secure,
 * such cookies are not available for http requests. What this means
is that a session started over
 * https will not be propagated to further http calls because
JSESSIONID cookie will be marked as
 * secure and not available to http requests. This entails that unless
a session is created and
 * bound on http prior to using an https request any wicket pages or
session values stored in the
 * https session will not be available to further http requests. If
your application requires a
 * http-gt;https-gt;http interactions (such as the case where only a
login page and my account
 * pages are secure) you must make sure a session is created and
stored in the http request prior to
 * the first http-gt;https redirect.
 */
public class SecureHttpsRequestCycleProcessor extends WebRequestCycleProcessor
{
private final HttpsConfig portConfig;

/**
 * Constructor
 *
 * @param httpsConfig
 *configuration
 */
public SecureHttpsRequestCycleProcessor(HttpsConfig httpsConfig)
{
portConfig = httpsConfig;
}

/**
 * @return configuration
 */
public HttpsConfig getConfig()
{
return portConfig;
}

/**
 * Checks if the class has a {...@link RequireHttps} annotation
 *
 * @param klass
 * @return true if klass has the annotation
 */
private boolean hasSecureAnnotation(Class? klass)
{
for (Class? c : 

Re: [1.5]Current number of users (sessions) in a wicket app

2010-10-26 Thread geissbock
Hi Nino,

 Or if I still need to make my own HttpSessionListener for this?

Why don't you just turn on the RequestLogger like this:

Application.getRequestLoggerSettings().setRequestLoggerEnabled(true)

Then you can get quite some information about the current sessions, see the 
interface IRequestLogger for this.

Or is there a catch about the RequestLogger that I am missing? Performance 
maybe?

Cheers,

Michael

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



Re: Error After 1 minute the Pagemap null is still locked

2010-10-26 Thread Alec Swan
How do I properly detach pages from request threads? What could have
caused them not to be properly detached?

I saw this error only once in months, so I don't even know how to
reproduce it. However, even though it is rare this problem is critical
because it made the web site unresponsive.

I added an AjaxSelfUpdatingTimerBehavior to one of the pages a while
ago to make sure that guest sessions do not expire. Could this cause
the problem?
this.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(refreshSeconds)));

Thanks,

Alec

On Tue, Oct 26, 2010 at 3:38 AM, Martijn Dashorst
martijn.dasho...@gmail.com wrote:
 It appears that your pages have not been properly detached from their
 request threads. Wicket still thinks that TP-Processor1 has the
 pagemap locked, whereas that thread is waiting for mod_jk to deliver a
 new request.

 I'd look back in the history of what TP-Processor1 has done to get in
 that state.

 Martijn

 On Tue, Oct 26, 2010 at 2:52 AM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 Our production server stopped processing AJAX requests today. I looked
 in the log files and noticed a After 1 minute the Pagemap null is
 still locked.
 The exception stack trace is shown below followed by a dump of the
 thread that was blocking the page.

 We are using Wicket 1.4.2, Tomcat 6.0 and Java 6.

 Could anybody help troubleshoot this problem?

 Thanks,

 Alec

 EXCEPTION

 2010-10-25 21:55:32,501 GMT ERROR [TP-Processor12]
 org.apache.wicket.RequestCycle -
 org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
 null is still locked by: Thread[TP-Processor1,5,main], giving up
 trying to get the page for path: 4:offersForm:offers:1:editOfferLink
        Begin of stack trace of Thread[TP-Processor1,5,main]
        java.net.SocketInputStream.socketRead0(Native Method)
        java.net.SocketInputStream.read(SocketInputStream.java:129)
        java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
        java.io.BufferedInputStream.read(BufferedInputStream.java:317)
        org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621)
        org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:559)
        
 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686)
        
 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
        
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        java.lang.Thread.run(Thread.java:619)
        End of stack trace of Thread[TP-Processor1,5,main]
 org.apache.wicket.protocol.http.request.InvalidUrlException:
 org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
 null is still locked by: Thread[TP-Processor1,5,main], giving up
 trying to get the page for path: 4:offersForm:offers:1:editOfferLink
        Begin of stack trace of Thread[TP-Processor1,5,main]
        java.net.SocketInputStream.socketRead0(Native Method)
        java.net.SocketInputStream.read(SocketInputStream.java:129)
        java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
        java.io.BufferedInputStream.read(BufferedInputStream.java:317)
        org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621)
        org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:559)
        
 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686)
        
 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
        
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        java.lang.Thread.run(Thread.java:619)
        End of stack trace of Thread[TP-Processor1,5,main]
        at 
 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
        at 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
        at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at 
 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
        at 
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     

Re: Error After 1 minute the Pagemap null is still locked

2010-10-26 Thread Martijn Dashorst
I saw that you are running wicket 1.4.2, I'd upgrade to 1.4.12. Thread
detach logic in Wicket has been improved in the releases between iirc.

This is not common enough for us to guess what is wrong. You should go
back in your logs and see what happened in the thread that keeps the
page map locked. If your logging doesn't show anything wrong, at least
try to see what type of request (and to which page/component it was
targeted). This might leed to more information.

Page map locked issues are normally an anxious user double clicking
actions while a server is already processing a request. Often a long
running request will be the cause, and dispatching the logic into a
separate thread helps. But in your situation the thread keeping the
lock is already waiting for a new request, so something went wrong in
that instance.

Martijn

On Tue, Oct 26, 2010 at 5:48 PM, Alec Swan alecs...@gmail.com wrote:
 How do I properly detach pages from request threads? What could have
 caused them not to be properly detached?

 I saw this error only once in months, so I don't even know how to
 reproduce it. However, even though it is rare this problem is critical
 because it made the web site unresponsive.

 I added an AjaxSelfUpdatingTimerBehavior to one of the pages a while
 ago to make sure that guest sessions do not expire. Could this cause
 the problem?
 this.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(refreshSeconds)));

 Thanks,

 Alec

 On Tue, Oct 26, 2010 at 3:38 AM, Martijn Dashorst
 martijn.dasho...@gmail.com wrote:
 It appears that your pages have not been properly detached from their
 request threads. Wicket still thinks that TP-Processor1 has the
 pagemap locked, whereas that thread is waiting for mod_jk to deliver a
 new request.

 I'd look back in the history of what TP-Processor1 has done to get in
 that state.

 Martijn

 On Tue, Oct 26, 2010 at 2:52 AM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 Our production server stopped processing AJAX requests today. I looked
 in the log files and noticed a After 1 minute the Pagemap null is
 still locked.
 The exception stack trace is shown below followed by a dump of the
 thread that was blocking the page.

 We are using Wicket 1.4.2, Tomcat 6.0 and Java 6.

 Could anybody help troubleshoot this problem?

 Thanks,

 Alec

 EXCEPTION

 2010-10-25 21:55:32,501 GMT ERROR [TP-Processor12]
 org.apache.wicket.RequestCycle -
 org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
 null is still locked by: Thread[TP-Processor1,5,main], giving up
 trying to get the page for path: 4:offersForm:offers:1:editOfferLink
        Begin of stack trace of Thread[TP-Processor1,5,main]
        java.net.SocketInputStream.socketRead0(Native Method)
        java.net.SocketInputStream.read(SocketInputStream.java:129)
        java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
        java.io.BufferedInputStream.read(BufferedInputStream.java:317)
        org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621)
        org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:559)
        
 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686)
        
 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
        
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        java.lang.Thread.run(Thread.java:619)
        End of stack trace of Thread[TP-Processor1,5,main]
 org.apache.wicket.protocol.http.request.InvalidUrlException:
 org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap
 null is still locked by: Thread[TP-Processor1,5,main], giving up
 trying to get the page for path: 4:offersForm:offers:1:editOfferLink
        Begin of stack trace of Thread[TP-Processor1,5,main]
        java.net.SocketInputStream.socketRead0(Native Method)
        java.net.SocketInputStream.read(SocketInputStream.java:129)
        java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
        java.io.BufferedInputStream.read(BufferedInputStream.java:317)
        org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621)
        org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:559)
        
 org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686)
        
 org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
        
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        java.lang.Thread.run(Thread.java:619)
        End of stack trace of Thread[TP-Processor1,5,main]
        at 
 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
        at 

Re: Should nested form be multipart if parent is multipart?

2010-10-26 Thread Martin Makundi
I mean: should nested form internally return ismultipart=true if its
parent form is a multipart form?

**
Martin

2010/10/26 Martin Grigorov mgrigo...@apache.org:
 On HTML level nested form is just div.
 Give more details

 On Tue, Oct 26, 2010 at 2:05 PM, Martin Makundi 
 martin.maku...@koodaripalvelut.com wrote:

 Hi!

 Should nested form become multipart if parent is multipart? Because it
 is on html level...

 **
 Martin

 -
 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: Accessing the cells in a row of a DataTable

2010-10-26 Thread Mark Doyle
I suppose this is related so I'll keep the thread going.

As part of the above use case I have created a custom PropertyColumn that
uses a DropDownChoice.

Everything seems to be working except for the initial display, this is
always set to Choose One.

The code that builds the dropdown is in the populateItem method of the
custom Property Column.  As you can see it has a model set (propertyModel)
which wraps a String.

PropertyModelString propertyModel = new PropertyModelString(rowModel,
getPropertyExpression());
System.out.println(propertyModel value =  + propertyModel.getObject());
AjaxDropDownChoicePanel cp = new AjaxDropDownChoicePanel(componentId,
propertyModel, selectionOptionsModel);

The AjaxDropDownChoicePanel is simply a panel that wraps the DropDown in a
some select tags.  It instantiates a DropDownChoice with the passed in
parameters.  The DropDownChoice is instantiated is of type String, that
is, DropDownChoiceString.

NOTE: The syso is printing the expected value.



On Sat, Oct 23, 2010 at 10:18 PM, James Carman
ja...@carmanconsulting.comwrote:

 Use a fragment.  Search this list for my FragmentColumn.  I think I've
 posted it before
 On Oct 23, 2010 4:04 PM, Mark Doyle markjohndo...@googlemail.com
 wrote:
  Ok, I've nearly got this finished.
 
  Does anybody know how to add a link in populateItem() that doesn't render
 as
  [cell]? I could create a customised Panel I suppose but it seems like
  overkill.
 
  Maybe a fragment...hmmm
 
 
  On Fri, Oct 22, 2010 at 11:56 AM, Mark Doyle
  markjohndo...@googlemail.comwrote:
 
  Oh and the table isn't the parent:
 
  // get the table to rerender
  target.addComponent(this.getParent());
 
  I had to do a six step parental grab; I'm sure there is a better way!
 :D
 
 
 
  On Fri, Oct 22, 2010 at 11:54 AM, Mark Doyle 
 markjohndo...@googlemail.com
   wrote:
 
  Thanks Mike, this was definitely a great pointer in the right
 direction;
  I'm beginning to grasp the column system now.
 
  I do have some issues though as detailed below.
 
  Firstly, my business model is out of my control so I had to wrap that
 in
 a
  class that contains the editable state. I don't like doing that it but
 it's
  useful to see if I can get it to work and it shouldn't effect the
 process on
  the whole.
 
  The main difference is I'm attempting to do this using different
 columns,
  that is, not having a custom column that takes a type and switches. The
  problem is that the models for each column seem to wrap different
 instances
  of the business object.
 
  The code below shows how I'm creating the columns. The link in the
  AbstractColumn grabs the business object and toggles editable.
  The EditablePropertyColumn's populateItem method then get's it's
 rowModel
  object (the business object) and checks the editable state. This is
 where
  it goes wrong as each column seems to have it's own copy of the rows
  business model object. I guess this is how the columns with with
 datagrid.
 
  /**
  * Creates the columns for the synonym data table
  *
  * @return
  */
  @SuppressWarnings(serial)
  private ListIColumnEditStateSynonymWrapper createColumns() {
  ListIColumnEditStateSynonymWrapper columns = new
  ArrayListIColumnEditStateSynonymWrapper();
 
  columns.add(new AbstractColumnEditStateSynonymWrapper(new
  ModelString(Edit)) {
  public void populateItem(ItemICellPopulatorEditStateSynonymWrapper
  cellItem, String componentId, IModelEditStateSynonymWrapper model) {
  AjaxFallbackLinkEditStateSynonymWrapper editLink = new
  AjaxFallbackLinkEditStateSynonymWrapper(componentId, model) {
  @Override
  public void onClick(AjaxRequestTarget target) {
  EditStateSynonymWrapper selected = (EditStateSynonymWrapper)
  getDefaultModelObject();
  System.out.println(selected value =  +
 selected.wrappedSynonym.value);
  selected.setEditing(!selected.isEditing());
 
  // FIXME WHAT!? There must be a better way than this to get the parent
  table. :D
  MarkupContainer dataTable =
 
 getParent().getParent().getParent().getParent().getParent().getParent();
  target.addComponent(dataTable);
  }
  };
  cellItem.add(editLink);
  // cellItem.add(new EditLinkFragment(componentId,
 SynonymAdminPanel.this,
  model));
  }
  });
 
  columns.add(new PropertyColumnEditStateSynonymWrapper(new
  ModelString(Category), wrappedSynonym.category));
  // columns.add(new EditablePropertyColumnEditStateSynonymWrapper(new
  ModelString(State),
  // wrappedSynonym.state, new PropertyModelSynonym(this,
 selected)));
  columns.add(new EditablePropertyColumnEditStateSynonymWrapper(new
  ModelString(State), wrappedSynonym.state));
  columns.add(new PropertyColumnEditStateSynonymWrapper(new
  ModelString(Root), wrappedSynonym.root));
  columns.add(new PropertyColumnEditStateSynonymWrapper(new
  ModelString(Value), wrappedSynonym.value));
  columns.add(new PropertyColumnEditStateSynonymWrapper(new
  ModelString(Rational), wrappedSynonym.rational));
  columns.add(new PropertyColumnEditStateSynonymWrapper(new
  

Re: Accessing the cells in a row of a DataTable

2010-10-26 Thread Jeremy Thomerson
Show the code for the dropdownchoice creation (in your panel)

On Tue, Oct 26, 2010 at 6:14 PM, Mark Doyle markjohndo...@googlemail.comwrote:

 I suppose this is related so I'll keep the thread going.

 As part of the above use case I have created a custom PropertyColumn that
 uses a DropDownChoice.

 Everything seems to be working except for the initial display, this is
 always set to Choose One.

 The code that builds the dropdown is in the populateItem method of the
 custom Property Column.  As you can see it has a model set (propertyModel)
 which wraps a String.

 PropertyModelString propertyModel = new PropertyModelString(rowModel,
 getPropertyExpression());
 System.out.println(propertyModel value =  + propertyModel.getObject());
 AjaxDropDownChoicePanel cp = new AjaxDropDownChoicePanel(componentId,
 propertyModel, selectionOptionsModel);

 The AjaxDropDownChoicePanel is simply a panel that wraps the DropDown in a
 some select tags.  It instantiates a DropDownChoice with the passed in
 parameters.  The DropDownChoice is instantiated is of type String, that
 is, DropDownChoiceString.

 NOTE: The syso is printing the expected value.



 On Sat, Oct 23, 2010 at 10:18 PM, James Carman
 ja...@carmanconsulting.comwrote:

  Use a fragment.  Search this list for my FragmentColumn.  I think I've
  posted it before
  On Oct 23, 2010 4:04 PM, Mark Doyle markjohndo...@googlemail.com
  wrote:
   Ok, I've nearly got this finished.
  
   Does anybody know how to add a link in populateItem() that doesn't
 render
  as
   [cell]? I could create a customised Panel I suppose but it seems like
   overkill.
  
   Maybe a fragment...hmmm
  
  
   On Fri, Oct 22, 2010 at 11:56 AM, Mark Doyle
   markjohndo...@googlemail.comwrote:
  
   Oh and the table isn't the parent:
  
   // get the table to rerender
   target.addComponent(this.getParent());
  
   I had to do a six step parental grab; I'm sure there is a better
 way!
  :D
  
  
  
   On Fri, Oct 22, 2010 at 11:54 AM, Mark Doyle 
  markjohndo...@googlemail.com
wrote:
  
   Thanks Mike, this was definitely a great pointer in the right
  direction;
   I'm beginning to grasp the column system now.
  
   I do have some issues though as detailed below.
  
   Firstly, my business model is out of my control so I had to wrap that
  in
  a
   class that contains the editable state. I don't like doing that it
 but
  it's
   useful to see if I can get it to work and it shouldn't effect the
  process on
   the whole.
  
   The main difference is I'm attempting to do this using different
  columns,
   that is, not having a custom column that takes a type and switches.
 The
   problem is that the models for each column seem to wrap different
  instances
   of the business object.
  
   The code below shows how I'm creating the columns. The link in the
   AbstractColumn grabs the business object and toggles editable.
   The EditablePropertyColumn's populateItem method then get's it's
  rowModel
   object (the business object) and checks the editable state. This is
  where
   it goes wrong as each column seems to have it's own copy of the rows
   business model object. I guess this is how the columns with with
  datagrid.
  
   /**
   * Creates the columns for the synonym data table
   *
   * @return
   */
   @SuppressWarnings(serial)
   private ListIColumnEditStateSynonymWrapper createColumns() {
   ListIColumnEditStateSynonymWrapper columns = new
   ArrayListIColumnEditStateSynonymWrapper();
  
   columns.add(new AbstractColumnEditStateSynonymWrapper(new
   ModelString(Edit)) {
   public void
 populateItem(ItemICellPopulatorEditStateSynonymWrapper
   cellItem, String componentId, IModelEditStateSynonymWrapper model)
 {
   AjaxFallbackLinkEditStateSynonymWrapper editLink = new
   AjaxFallbackLinkEditStateSynonymWrapper(componentId, model) {
   @Override
   public void onClick(AjaxRequestTarget target) {
   EditStateSynonymWrapper selected = (EditStateSynonymWrapper)
   getDefaultModelObject();
   System.out.println(selected value =  +
  selected.wrappedSynonym.value);
   selected.setEditing(!selected.isEditing());
  
   // FIXME WHAT!? There must be a better way than this to get the
 parent
   table. :D
   MarkupContainer dataTable =
  
  getParent().getParent().getParent().getParent().getParent().getParent();
   target.addComponent(dataTable);
   }
   };
   cellItem.add(editLink);
   // cellItem.add(new EditLinkFragment(componentId,
  SynonymAdminPanel.this,
   model));
   }
   });
  
   columns.add(new PropertyColumnEditStateSynonymWrapper(new
   ModelString(Category), wrappedSynonym.category));
   // columns.add(new
 EditablePropertyColumnEditStateSynonymWrapper(new
   ModelString(State),
   // wrappedSynonym.state, new PropertyModelSynonym(this,
  selected)));
   columns.add(new EditablePropertyColumnEditStateSynonymWrapper(new
   ModelString(State), wrappedSynonym.state));
   columns.add(new PropertyColumnEditStateSynonymWrapper(new
   ModelString(Root), wrappedSynonym.root));
 

Re: Wicket Web Beans

2010-10-26 Thread Daniel Toffetti

Hi Josh,

The last downloadable release (v 1.1) supports Wicket 1.3, and current
trunk (1.2) supports Wicket 1.4. Some days ago Dan created a branch in which
I'll try to migrate to Wicket 1.5 in the near future.
From time to time, a new issue pops in the issue tracker, so I can say
some people is using it. The project is only receiving migration updates and
maintenance fixes. In case you don't know, the SourceForge site is not used
anymore, please go to the Google Code site:

  http://code.google.com/p/wicket-web-beans/

Cheers,

Daniel


Josh Kamau wrote:
 
 Hi Guys,
 
 Is wicket web beans project still being developed? There is somewhere in
 the
 docs where its indicated that it supports wicket 1.3RC1?
 Is someone using it?
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Web-Beans-tp3013497p3014807.html
Sent from the Users forum 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