Extending DropDownChoice

2008-02-12 Thread Bruce McGuire
Hi.

I would like to save the result of a DropDownChoice in my custom session.
But, I am stumped about how to extend it. I had thought that I would
@Override the getChoices and onSelectionChanged methods, but Eclipse tells
me that "The method onSelectionChanged(Pool) of type PoolSelect must
override or implement a supertype method".

I am stumped on how to extend this, or even if I should. Any pointers to
tips or best practices would be greatly appreciated.

In case it is not obvious from the question, I am new to Wicket (but loving
it so far).

Thanks,

Bruce.


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



Re: [WicketStuff-Scriptaculous] DragNDrop problem in IE6/IE7.

2008-02-12 Thread Edward Yakop
Hi,

Thanx for the hints :)
The problem is solved, but I'm not sure whether Ryan has patched the
scriptaculous code in wicket-stuff svn.

Regards,
Edward Yakop

On Feb 13, 2008 2:10 PM, Ernesto Reinaldo Barreiro <[EMAIL PROTECTED]> wrote:
> Don't know if it is the same issue but I have found  the same problem a
> while ago (refreshing a component via Ajax) and the problem was
> scriptaculous requires to clean up the Droppables  if an element was
> removed from the DOM tree. So, all I did was add a a clearAll
> (JavaScript) method  that delete all the Droppables. something like
>
> var Droppables = {
>   drops: [],
>
>   removeAll: function(element) {
> this.drops = [];
>   },
>
> ..
>
> and then call it before any Ajax request that recreated the DOM tree. So
> that I could safely recreated my component and make them droppables
> again. This worked fine for IE7. For Firefox I never found those
> problems... There was a note on the web page explaining Droppables that
> suggested this idea...
>
> Hope this helps...
>
> Best,
>
> Ernesto
>
>
> Lan Boon Ping wrote:
> > Hi,
> >
> > I have encountered a DragNDrop problem using wicketStuff-scriptaculous
> > in IE6/IE7. The DragNDrop only work for the first time, but
> > subsequently, the draggable object is no longer draggable. FYI, this
> > problem doesn't exist in Firefox and it can be reproduced in
> > wicket-contrib-scriptaculous-examples.
> >
> > Any hints?
> >
> > Thanks in advance.
> >
> > Regards
> > Boon Ping.
> >
> > -
> > 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]



Reading selected radio in validator

2008-02-12 Thread Rik van der Kleij
Hi,

Does someone knows a solution for reading the selected radio button in the
validate() of a IFormValidator implementation? The problem I have is that
getOutput() on a form component gives the value out of the HTML because no
conversion to objects is yet done in the validation step. By the way, I'm
using this validation in a wizard step of wicket extensions.

Thanks for any help,
Rik


Re: problem using DataGridView

2008-02-12 Thread Araz
well it's done using DefaultDataTable... I think I should have used that in the 
first place...thnX anyway


- Original Message 
From: Igor Vaynberg <[EMAIL PROTECTED]>
To: users@wicket.apache.org
Sent: Tuesday, February 12, 2008 10:03:40 PM
Subject: Re: problem using DataGridView

can you set a debug point in arrayiteratoradapter and see why it is
getting null array passed in? the line numbers dont line up for my
source, but it looks like your columns var is actually a null array?

-igor


On Feb 12, 2008 4:52 AM, Araz <[EMAIL PROTECTED]> wrote:
> Hi There,
> I'm trying to add a DataGridView to my page with custom columns, here is what 
> I've done:
>
>  DataGridView table = new DataGridView("rows", columns, new 
> ReportDataProvider(values));
>
> with this html:
> 
>
>
>  cell content goes here
>
>
> 
>
>
> this is ReportDataProvider:
> public class ReportDataProvider implements IDataProvider
> {
>  Vector data;
>
>  public ReportDataProvider(Vector data)
>  {
>this.data = new Vector(data);
>  }
>
>  public IModel model(Object object)
>  {
>return new ReportModel((SystemReportBean) object);
>  }
>
>  public int size()
>  {
>return data.size();
>  }
>
>  public Iterator iterator(int first, int count)
>  {
>List vec = data.subList(first,first+count);
>return vec.iterator();
>  }
> }
>
>
> and ReportModel is a plain object with getter setter methods
>
>
> but I get this exception every time I try to view the page I get this 
> exception:
> WicketMessage: Error attaching this container for rendering: [MarkupContainer 
> [Component id = cells, page = com.laser.monitoring.gui.ReportResultPage, path 
> = 41:rows:1:cells.AbstractDataGridView$2, isVisible = true, isVersioned = 
> false]]
> Root cause:
> java.lang.NullPointerException
>  at 
> wicket.extensions.markup.html.repeater.util.ArrayIteratorAdapter.hasNext(ArrayIteratorAdapter.java:62)
>  at 
> wicket.extensions.markup.html.repeater.refreshing.DefaultItemReuseStrategy$1.hasNext(DefaultItemReuseStrategy.java:66)
>  at 
> wicket.extensions.markup.html.repeater.refreshing.RefreshingView.addItems(RefreshingView.java:189)
>  at 
> wicket.extensions.markup.html.repeater.refreshing.RefreshingView.internalOnAttach(RefreshingView.java:117)
> 
>
> I've done everything I thought that might help with no result
>
>
>
>
>
>
>
>
>
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com

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

Send instant messages to your online friends http://uk.messenger.yahoo.com 

Re: [WicketStuff-Scriptaculous] DragNDrop problem in IE6/IE7.

2008-02-12 Thread Ernesto Reinaldo Barreiro
Don't know if it is the same issue but I have found  the same problem a
while ago (refreshing a component via Ajax) and the problem was
scriptaculous requires to clean up the Droppables  if an element was
removed from the DOM tree. So, all I did was add a a clearAll
(JavaScript) method  that delete all the Droppables. something like

var Droppables = {
  drops: [],

  removeAll: function(element) {
this.drops = [];
  },

..  

and then call it before any Ajax request that recreated the DOM tree. So
that I could safely recreated my component and make them droppables
again. This worked fine for IE7. For Firefox I never found those
problems... There was a note on the web page explaining Droppables that
suggested this idea...

Hope this helps...

Best,

Ernesto   

Lan Boon Ping wrote:
> Hi,
>
> I have encountered a DragNDrop problem using wicketStuff-scriptaculous
> in IE6/IE7. The DragNDrop only work for the first time, but
> subsequently, the draggable object is no longer draggable. FYI, this
> problem doesn't exist in Firefox and it can be reproduced in
> wicket-contrib-scriptaculous-examples.
>
> Any hints?
>
> Thanks in advance.
>
> Regards
> Boon Ping.
>
> -
> 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: 2 process cant together in a same time - modal window and form in the same page constructor?

2008-02-12 Thread kenixwong

hi johan

How to use threadpool in a wicket. Can u explain it a bit..

thanks in advance 
-kenix


kenixwong wrote:
> 
> sorry for late reply. johan
> 
> i never use the threadpool even the thread as well... To start form the
> thread.. i tried for the simple thread program as below
> 
> package thread;
> 
> 
> import java.awt.event.MouseAdapter;
> import java.awt.event.MouseEvent;
> 
> import java.util.Date;
> 
> import javax.swing.JButton;
> import javax.swing.JFrame;
> import javax.swing.JLabel;
> import javax.swing.JPanel;
> 
> public class GuiThreadRunnable extends JFrame {
>  private JLabel lblTime = new JLabel();
>  private JButton btnStart = new JButton("Start");
>  private JButton btnStop = new JButton("Stop");
>  private Thread clock = null;
> 
>  public GuiThreadRunnable() {
>   initGui();
>  }
> 
> 
>  public void initGui() {
>   setTitle("Runnable");
>   setDefaultCloseOperation(EXIT_ON_CLOSE);
>   setBounds(200, 200, 400, 400);
> 
>   getContentPane().add(lblTime, "North");
>   JPanel p = new JPanel();
> 
>   btnStart.addMouseListener(new MouseAdapter() {
>  public void mouseClicked(MouseEvent e) {
>   if (clock == null) {
>clock = new Thread (new Clock());
>clock.start();
>System.out.println(" clock.start()" );
>   }
>  }
> });
> 
>   btnStop.addMouseListener(new MouseAdapter() {
>  public void mouseClicked(MouseEvent e) {
>   if (clock != null && clock.isAlive()) {
>clock.interrupt();
>clock = null;
>System.out.println(" clock end" );
>   }
>  }
> });
>   p.add(btnStart);
>   p.add(btnStop);
>   getContentPane().add(p, "Center");
>   setVisible(true);
>  }
> 
>  public static void main(String[] args) {
>   GuiThreadRunnable guiThread = new GuiThreadRunnable();
>  }
> 
>  class Clock implements Runnable{
>   public Clock() {
>super();
>   }
> 
>   public void run() {
>try {
> while (true) {
>  lblTime.setText("" + new Date());
>  System.out.println(" run()" );
> Thread.sleep(1000);
> }
>} catch (Exception e) {
> 
>}
>   }
>  }
> 
> }
> 
> Fine, it worked.  Is that the   public void run() part i need to move my
> report infor here?
> 
> Btw, can give me more guide how to implement for your solution given ? 
> 
> thanks in advance 
> - kenix
> 
> 
> Johan Compagner wrote:
>> 
>> no don't touch wicket pages/components in different thread
>> Just make a normal threadpool wilt a normal runnable that gets your
>> information from that report
>> so the page can use that to construct itself after that runnable is done
>> and
>> informed you about it
>> 
>> generate all the back end data in a thread
>> and then construct the report page in a normal request (poll with an ajax
>> timer when that data is ready)
>> 
>> There are numerous topics about this in on the wicket list please search.
>> 
>> johan
>> 
>> 
>> 
>> On Feb 5, 2008 11:04 AM, kenixwong <[EMAIL PROTECTED]> wrote:
>> 
>>>
>>> hi, johan
>>>
>>> Maybe i misunderstood this sentence << so just the parent page with the
>>> report link >>
>>>
>>> that why i moved the report modal component to the child page.
>>>
>>> Can ask one thing here? about the report thread, i need to implement the
>>> Runnable for the ReportPage or ReportForm ? is that any different ?
>>>
>>>
>>>
>>>
>>> Johan Compagner wrote:
>>> >
>>> > Please reread my previous email. The ajax report link only starts the
>>> > thread and shows the the modal window on the parent page, the report
>>> > page is only set whe the report thread is done
>>> >
>>> > On 2/5/08, kenixwong <[EMAIL PROTECTED]> wrote:
>>> >>
>>> >> thanks johan ,
>>> >>
>>> >> i make a summary here
>>> >>
>>> >>
>>> >>  1. report link an ajax link.
>>> >>==> add a reportAjaxLink  to the parentPage
>>> >>
>>> >>  ajaxLink = new AjaxLink("cancelReportLink"){
>>> >>  public void onClick(AjaxRequestTarget target) {
>>> >>  if (stopThread == null) {
>>> >>  stopThread = new Thread
>>> (ReportPage);
>>> >>  stopThread.setName
>>> ("ReportPageThread");
>>> >>  stopThread.setDaemon( true );
>>> >>  stopThread

RE: OutOfMemoryError on FilePageSerializingThread

2008-02-12 Thread Wang, Yuesong
It's sort of a known issue of Tomcat (or Sun JVM? Which one I can't
remember exactly). It happens when one does repeated hot redeployment.
Tomcat can't clear the permgen space, so the classes get accumulated and
eventually permgen space runs out. Something like that :) There's a lot
of dicussion about this on Hibernate and Spring forum. It's defintely
got nothing to do with Wicket. Passing the JVM option as Igor said is
the way to "fix" it.

Yuesong

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 12, 2008 5:24 PM
To: users@wicket.apache.org
Subject: Re: OutOfMemoryError on FilePageSerializingThread

as i said, what i have shown you is an oversimplification. certainly you
can try to load the wicket app first, in reality classes are loaded
lazily. so load the wicket app first, use it for a bit to make sure it
loads whatever classes it needs, then deploy the first and second ears.
that should most likely make it crap out when you start using the last
ear's app...

-igor


On Feb 12, 2008 2:03 PM, Vincenzo Vitale <[EMAIL PROTECTED]>
wrote:
> It means that if I want to "porove" that Wicket is not the problem, we

> can try to load Wicket as the first application and then the others. 
> Should the problem arise always on the last deployed application?
>
>
> V.
>
>
> On Feb 12, 2008 10:53 PM, Igor Vaynberg <[EMAIL PROTECTED]>
wrote:
>
> > not, this has nothing to do with load. look, your jvm has a preset 
> > permgen limit where bytecode is stored. lets say that permgen is 
> > allocated 60 megs, and all these numbers are arbitrary.
> >
> > first jboss loads all its jars, which arbitrarily takes 30mb. so 
> > after jboss is loaded you have 30mb permgen left.
> >
> > then you deploy the first ear that loads all its jars that take up 
> > 15 megs, now you have 30 jboss+15 ear = 15 megs left in permgen
> >
> > then you load your second ear whose jars take up 10 megs, so now you

> > only have 5 megs left in your permgen.
> >
> > then you try to load wicket whose jars need more then 5 megs, so you

> > get an out of permgen error.
> >
> > this is a gross simplification, but basically what happens.
> >
> > permgen is called perm(anent) so it is not cleaned up, once 
> > something is loaded it sticks.
> >
> > so really it has nothing to do with load, it has to do with the 
> > number of classes you try to load into that jvm. the more libs you 
> > use the more different classes are loaded, the more space you need.
> >
> > -igor
> >
> > On Feb 12, 2008 1:17 PM, Vincenzo Vitale <[EMAIL PROTECTED]>
> > wrote:
> > > Hi Igor,
> > >
> > > thanks for your fast answer (as usual)!!!
> > >
> > > So this also means that it's the high load on the bigger 
> > > applications
> > which
> > > is causing that *only* the smallest (and less used) Wicket app has

> > > at
> > the
> > > moment the problem. Do you agree?
> > >
> > > We will try to monitor the usage by all the application deployed. 
> > > I
> > don't
> > > know if Jboss has already something with this value available 
> > > (ideally
> > an
> > > Mbean).
> > >
> > >
> > > Ciao,
> > > V.
> > >
> > >
> > > On Feb 12, 2008 7:18 PM, Igor Vaynberg <[EMAIL PROTECTED]>
wrote:
> > >
> > > > this memory space is shared by all libs in the vm. so maybe your

> > > > ears are taking up a ton of space and only a small amount is 
> > > > left to the wicket app...its just not the right way to look at 
> > > > the problem. this is not heap space which is allocated for 
> > > > runtime stuff, this is the space used by VM to hold bytecode for

> > > > classes...it doesnt matter how small the app is or what load it
is under...
> > > >
> > > > -igor
> > > >
> > > >
> > > > On Feb 12, 2008 3:27 AM, Vincenzo Vitale 
> > > > <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > Hi Johan,
> > > > >
> > > > > we proposed the increased memory solution to our IT department

> > > > > but
> > the
> > > > > answer was:
> > > > >
> > > > > " Why this problem is occurring only with the small 
> > > > > application
> > using
> > > > > Wicket?".
> > > > >
> > > > > We have three ears deployed on the same Jboss instance. One is

> > > > > using
> > > > Spring
> > > > > MVC, one CXF and the admin module is using Wicket.
> > > > > Actually the admin module is used by only one person when the 
> > > > > other
> > ones
> > > > > have a high load.
> > > > > We are using wicket.1.3.0-beta2 and the wicketstuff-dojo 
> > > > > (1.3.0-dojo
> > ).
> > > > >
> > > > > We actually cannot reproduce the problem in an easy way and IT

> > > > > is
> > not
> > > > sure
> > > > > if it's caused by how we are using Wicket.
> > > > >
> > > > >
> > > > > Have you any glue or suggestions on that?
> > > > >
> > > > >
> > > > >
> > > > > Thanks,
> > > > > Vincenzo.
> > > > >
> > > > > On Feb 4, 2008 12:34 PM, Johan Compagner 
> > > > > <[EMAIL PROTECTED]>
> > wrote:
> > > > >
> > > > >
> > > > > > Its not a normal out of mem but a Perm generation out of
mem..
> > > > > > increase your perm 

Re: HybridURLCodingStrategies vs others

2008-02-12 Thread jpswain

mfs,

I'm not sure how it works, but the Wicket-based 
http://papernapkin.org/pastebin/home Pastebin  seems to handle URL Coding
perfectly clean, the way you describe.  The source code is available 
http://developer.berlios.de/projects/wicketpastebin/ here. 

It would be sweet if a more experienced programmer than me could explain why
and how this works, and possibly document how exactly to replicate the way
these smart guys did it.

Jamie
-- 
View this message in context: 
http://www.nabble.com/HybridURLCodingStrategies-vs-others-tp15171137p15446236.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 NaN

2008-02-12 Thread Brandon Fuller

Verified fixed in 1.3.1.
-- 
View this message in context: 
http://www.nabble.com/DatePicker-NaN-tp12759906p15446234.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]



model inheritence issues :S

2008-02-12 Thread Ballist1c

Hey guys, 

i got this strange issue, what I am doing at the moment is attempting to
pass an objectModel to a child panel thru panel.setModel() but i am getting
a null exception error.

I have run debugger and found that when i retrieve the ModelObject for
imageInfo in Csession, its not null. But when the ContentPanel renders, the
ModelObject IS null :S

any ideas??



public class csession extends Panel
{
   Panel content;

  public csession (String wicketId, MarkupContainer parent)
  {
super(wicketId, parent);

content = new ContentPanel("content", this);

TabModel mod = new TabSessionModel(this);
content.setModel(new PropertyModel(mod, "imageInfo"));
  }
 
}

public class ContentPanel extends Panel
{
  Label name;

  public ContentPanel (String wicketId, MarkupContainer parent)
  {
super(wicketId, parent);

name = new Label("name", this);
name.setModel(new PropertyModel(getModel(), "name"));
  }
}

-- 
View this message in context: 
http://www.nabble.com/model-inheritence-issues-%3AS-tp15445920p15445920.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: SortableListView and refresh. 2 questions

2008-02-12 Thread Fernando Wermus
It doesn't work because of the markup I've added. I need two list for my
case.

Any suggestion would help.

On Tue, Feb 12, 2008 at 9:12 PM, Fernando Wermus <[EMAIL PROTECTED]>
wrote:

> Hi all,
> I am using SortableListView. I can drag and drop and reorder the
> items in the list, but I cannot see any ajax message going around. I think I
> am missing something as newbie.
>
> SortableListView sortableFirst=crearSortableList("firstlist",
> "firstlist_firstlist", listData, "imagenDePerfil", "nombre");
> add(sortableFirst);
> 
> 
>
>
> private SortableListView crearSortableList(String itemList, String
> item, List jugadores, final String idImagen, final String idLink){
> return new SortableListView(itemList, item, jugadores) {
> private static final long serialVersionUID =
> 1592206924207801984L;
>
> @Override
> public void populateItemInternal(final ListItem item) {
> final Jugador jugador= (Jugador) item.getModelObject();
> RecursosWeb.establecerPerfil2(item, jugador,idImagen,
> idLink);
>   }
> };
> }
>
> Besides, I added this markup to have the chance to reorder in the list and
> with another one, like in this scriptaculous example,
> http://wiki.script.aculo.us/scriptaculous/page/print/SortableListsDemo.
> I think this already exists but I cant find it, (of course this class is a
> mess, I am just testing)
>
> public class MultipleSortableListView extends WebMarkupContainer {
> private static final long serialVersionUID = -61199328092575258L;
>
> private SortableListView sortable1;
> private SortableListView sortable2;
>
> public MultipleSortableListView(String id, SortableListView sortable1,
> SortableListView sortable2) {
>
> super(id);
> setSortable1(sortable1);
> setSortable2(sortable2);
> }
> public MultipleSortableListView(String id, String string2,String
> string3, List listData, String string4,String string5, List
> listData2) {
> super(id);
> //TODO
> }
> protected void onRender(MarkupStream markupStream)
> {
> super.onRender(markupStream);
> JavascriptBuilder builder = new JavascriptBuilder();
> builder.addLine("Sortable.create('" + getSortable1().getMarkupId()
> + "',{dropOnEmpty:true,containment:['" + getSortable1().getMarkupId() +
> "','" + getSortable2().getMarkupId() + "'],constraint:false});");
> builder.addLine("Sortable.create('" + getSortable2().getMarkupId()
> + "',{dropOnEmpty:true,handle:'handle',containment:['" +
> getSortable1().getMarkupId() + "','" + getSortable2().getMarkupId() +
> "'],constraint:false});");
> getResponse().write(builder.buildScriptTagString());
> }
> public SortableListView getSortable1() {
> return sortable1;
> }
> public void setSortable1(SortableListView sortable1) {
> this.sortable1 = sortable1;
> }
> public SortableListView getSortable2() {
> return sortable2;
> }
> public void setSortable2(SortableListView sortable2) {
> this.sortable2 = sortable2;
> }
>
>
> }
> But I got a bug because when one of the list is empty, I can't fill it
> with an item anymore.
>
>


-- 
Fernando Wermus.


SortableListView and refresh. 2 questions

2008-02-12 Thread Fernando Wermus
Hi all,
I am using SortableListView. I can drag and drop and reorder the
items in the list, but I cannot see any ajax message going around. I think I
am missing something as newbie.

SortableListView sortableFirst=crearSortableList("firstlist",
"firstlist_firstlist", listData, "imagenDePerfil", "nombre");
add(sortableFirst);




private SortableListView crearSortableList(String itemList, String item,
List jugadores, final String idImagen, final String idLink){
return new SortableListView(itemList, item, jugadores) {
private static final long serialVersionUID =
1592206924207801984L;

@Override
public void populateItemInternal(final ListItem item) {
final Jugador jugador= (Jugador) item.getModelObject();
RecursosWeb.establecerPerfil2(item, jugador,idImagen,
idLink);
  }
};
}

Besides, I added this markup to have the chance to reorder in the list and
with another one, like in this scriptaculous example,
http://wiki.script.aculo.us/scriptaculous/page/print/SortableListsDemo.
I think this already exists but I cant find it, (of course this class is a
mess, I am just testing)

public class MultipleSortableListView extends WebMarkupContainer {
private static final long serialVersionUID = -61199328092575258L;

private SortableListView sortable1;
private SortableListView sortable2;

public MultipleSortableListView(String id, SortableListView sortable1,
SortableListView sortable2) {

super(id);
setSortable1(sortable1);
setSortable2(sortable2);
}
public MultipleSortableListView(String id, String string2,String
string3, List listData, String string4,String string5, List
listData2) {
super(id);
//TODO
}
protected void onRender(MarkupStream markupStream)
{
super.onRender(markupStream);
JavascriptBuilder builder = new JavascriptBuilder();
builder.addLine("Sortable.create('" + getSortable1().getMarkupId() +
"',{dropOnEmpty:true,containment:['" + getSortable1().getMarkupId() + "','"
+ getSortable2().getMarkupId() + "'],constraint:false});");
builder.addLine("Sortable.create('" + getSortable2().getMarkupId() +
"',{dropOnEmpty:true,handle:'handle',containment:['" +
getSortable1().getMarkupId() + "','" + getSortable2().getMarkupId() +
"'],constraint:false});");
getResponse().write(builder.buildScriptTagString());
}
public SortableListView getSortable1() {
return sortable1;
}
public void setSortable1(SortableListView sortable1) {
this.sortable1 = sortable1;
}
public SortableListView getSortable2() {
return sortable2;
}
public void setSortable2(SortableListView sortable2) {
this.sortable2 = sortable2;
}


}
But I got a bug because when one of the list is empty, I can't fill it with
an item anymore.


Re: OutOfMemoryError on FilePageSerializingThread

2008-02-12 Thread Igor Vaynberg
as i said, what i have shown you is an oversimplification. certainly
you can try to load the wicket app first, in reality classes are
loaded lazily. so load the wicket app first, use it for a bit to make
sure it loads whatever classes it needs, then deploy the first and
second ears. that should most likely make it crap out when you start
using the last ear's app...

-igor


On Feb 12, 2008 2:03 PM, Vincenzo Vitale <[EMAIL PROTECTED]> wrote:
> It means that if I want to "porove" that Wicket is not the problem, we can
> try to load Wicket as the first application and then the others. Should the
> problem arise always on the last deployed application?
>
>
> V.
>
>
> On Feb 12, 2008 10:53 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>
> > not, this has nothing to do with load. look, your jvm has a preset
> > permgen limit where bytecode is stored. lets say that permgen is
> > allocated 60 megs, and all these numbers are arbitrary.
> >
> > first jboss loads all its jars, which arbitrarily takes 30mb. so after
> > jboss is loaded you have 30mb permgen left.
> >
> > then you deploy the first ear that loads all its jars that take up 15
> > megs, now you have 30 jboss+15 ear = 15 megs left in permgen
> >
> > then you load your second ear whose jars take up 10 megs, so now you
> > only have 5 megs left in your permgen.
> >
> > then you try to load wicket whose jars need more then 5 megs, so you
> > get an out of permgen error.
> >
> > this is a gross simplification, but basically what happens.
> >
> > permgen is called perm(anent) so it is not cleaned up, once something
> > is loaded it sticks.
> >
> > so really it has nothing to do with load, it has to do with the number
> > of classes you try to load into that jvm. the more libs you use the
> > more different classes are loaded, the more space you need.
> >
> > -igor
> >
> > On Feb 12, 2008 1:17 PM, Vincenzo Vitale <[EMAIL PROTECTED]>
> > wrote:
> > > Hi Igor,
> > >
> > > thanks for your fast answer (as usual)!!!
> > >
> > > So this also means that it's the high load on the bigger applications
> > which
> > > is causing that *only* the smallest (and less used) Wicket app has at
> > the
> > > moment the problem. Do you agree?
> > >
> > > We will try to monitor the usage by all the application deployed. I
> > don't
> > > know if Jboss has already something with this value available (ideally
> > an
> > > Mbean).
> > >
> > >
> > > Ciao,
> > > V.
> > >
> > >
> > > On Feb 12, 2008 7:18 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > >
> > > > this memory space is shared by all libs in the vm. so maybe your ears
> > > > are taking up a ton of space and only a small amount is left to the
> > > > wicket app...its just not the right way to look at the problem. this
> > > > is not heap space which is allocated for runtime stuff, this is the
> > > > space used by VM to hold bytecode for classes...it doesnt matter how
> > > > small the app is or what load it is under...
> > > >
> > > > -igor
> > > >
> > > >
> > > > On Feb 12, 2008 3:27 AM, Vincenzo Vitale <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > Hi Johan,
> > > > >
> > > > > we proposed the increased memory solution to our IT department but
> > the
> > > > > answer was:
> > > > >
> > > > > " Why this problem is occurring only with the small application
> > using
> > > > > Wicket?".
> > > > >
> > > > > We have three ears deployed on the same Jboss instance. One is using
> > > > Spring
> > > > > MVC, one CXF and the admin module is using Wicket.
> > > > > Actually the admin module is used by only one person when the other
> > ones
> > > > > have a high load.
> > > > > We are using wicket.1.3.0-beta2 and the wicketstuff-dojo (1.3.0-dojo
> > ).
> > > > >
> > > > > We actually cannot reproduce the problem in an easy way and IT is
> > not
> > > > sure
> > > > > if it's caused by how we are using Wicket.
> > > > >
> > > > >
> > > > > Have you any glue or suggestions on that?
> > > > >
> > > > >
> > > > >
> > > > > Thanks,
> > > > > Vincenzo.
> > > > >
> > > > > On Feb 4, 2008 12:34 PM, Johan Compagner <[EMAIL PROTECTED]>
> > wrote:
> > > > >
> > > > >
> > > > > > Its not a normal out of mem but a Perm generation out of mem..
> > > > > > increase your perm space
> > > > > > -XX:MaxPermSize=128M (sun jvms, 128MB or give it more)
> > > > > >
> > > > > > these kind of out of mems seems to be hitten java the most.
> > > > > > Sun should really fix this somehow and make the perm space much
> > more
> > > > > > flexable...
> > > > > > (that it is a shared size with the normal heap for example)
> > > > > >
> > > > > > johan
> > > > > >
> > > > > >
> > > > > > On Feb 4, 2008 12:24 PM, Vincenzo Vitale <
> > [EMAIL PROTECTED]>
> > > > > > wrote:
> > > > > >
> > > > > > > We are using Wicket in our Admin console and sometimes an
> > > > OutOfMemory
> > > > > > > problem occurs.
> > > > > > >
> > > > > > > Have you ever experienced such a problem?
> > > > > > >
> > > > > > > Here the stacktrace:
> > > > > > >
> > > > > > > 2008-02-01 09:19:0

Re: Store an object in session

2008-02-12 Thread Sergey Podatelev
Thanks Matej, I'll try that.

On Feb 13, 2008 1:21 AM, Matej Knopp <[EMAIL PROTECTED]> wrote:

> extend wicket's WebSession by your own session class.
>
> and add setUserProfile/getUserProvile methods to id.
>
> Override Application#newSession method and create your session insteance.
>
> Then in your app just do
> ((MySession)Session.get()).settUserProfile(profile).
>
> -Matej
> > The question is -- what is the best way to store this UserProfile?
>


-- 
sp


Re: Store an object in session

2008-02-12 Thread Matej Knopp
extend wicket's WebSession by your own session class.

and add setUserProfile/getUserProvile methods to id.

Override Application#newSession method and create your session insteance.

Then in your app just do ((MySession)Session.get()).settUserProfile(profile).

-Matej

On Feb 12, 2008 11:09 PM, Sergey Podatelev <[EMAIL PROTECTED]> wrote:
> Hello Wicket people,
>
> I've a bean containing user information, UserProfile. I want this bean to be
> accessible for all the pages during user's session, so I guess, I have to
> store it in the session somehow.
> There's also a UserProfilePage where UserBean is used as data object for
> CompoundPropertyModel. And I use Spring along with Wicket in my application.
>
> The question is -- what is the best way to store this UserProfile? Should I
> save it in HttpSessionStore directly through "setAttribute" or configure it
> as Spring's injected prototype-scoped bean? Or perhaps Wicket has other way
> to do this which I'm missing?
>
> Thanks.
>
> --
> sp
>



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

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



Store an object in session

2008-02-12 Thread Sergey Podatelev
Hello Wicket people,

I've a bean containing user information, UserProfile. I want this bean to be
accessible for all the pages during user's session, so I guess, I have to
store it in the session somehow.
There's also a UserProfilePage where UserBean is used as data object for
CompoundPropertyModel. And I use Spring along with Wicket in my application.

The question is -- what is the best way to store this UserProfile? Should I
save it in HttpSessionStore directly through "setAttribute" or configure it
as Spring's injected prototype-scoped bean? Or perhaps Wicket has other way
to do this which I'm missing?

Thanks.

-- 
sp


Re: OutOfMemoryError on FilePageSerializingThread

2008-02-12 Thread Vincenzo Vitale
It means that if I want to "porove" that Wicket is not the problem, we can
try to load Wicket as the first application and then the others. Should the
problem arise always on the last deployed application?


V.

On Feb 12, 2008 10:53 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:

> not, this has nothing to do with load. look, your jvm has a preset
> permgen limit where bytecode is stored. lets say that permgen is
> allocated 60 megs, and all these numbers are arbitrary.
>
> first jboss loads all its jars, which arbitrarily takes 30mb. so after
> jboss is loaded you have 30mb permgen left.
>
> then you deploy the first ear that loads all its jars that take up 15
> megs, now you have 30 jboss+15 ear = 15 megs left in permgen
>
> then you load your second ear whose jars take up 10 megs, so now you
> only have 5 megs left in your permgen.
>
> then you try to load wicket whose jars need more then 5 megs, so you
> get an out of permgen error.
>
> this is a gross simplification, but basically what happens.
>
> permgen is called perm(anent) so it is not cleaned up, once something
> is loaded it sticks.
>
> so really it has nothing to do with load, it has to do with the number
> of classes you try to load into that jvm. the more libs you use the
> more different classes are loaded, the more space you need.
>
> -igor
>
> On Feb 12, 2008 1:17 PM, Vincenzo Vitale <[EMAIL PROTECTED]>
> wrote:
> > Hi Igor,
> >
> > thanks for your fast answer (as usual)!!!
> >
> > So this also means that it's the high load on the bigger applications
> which
> > is causing that *only* the smallest (and less used) Wicket app has at
> the
> > moment the problem. Do you agree?
> >
> > We will try to monitor the usage by all the application deployed. I
> don't
> > know if Jboss has already something with this value available (ideally
> an
> > Mbean).
> >
> >
> > Ciao,
> > V.
> >
> >
> > On Feb 12, 2008 7:18 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> >
> > > this memory space is shared by all libs in the vm. so maybe your ears
> > > are taking up a ton of space and only a small amount is left to the
> > > wicket app...its just not the right way to look at the problem. this
> > > is not heap space which is allocated for runtime stuff, this is the
> > > space used by VM to hold bytecode for classes...it doesnt matter how
> > > small the app is or what load it is under...
> > >
> > > -igor
> > >
> > >
> > > On Feb 12, 2008 3:27 AM, Vincenzo Vitale <[EMAIL PROTECTED]>
> > > wrote:
> > > > Hi Johan,
> > > >
> > > > we proposed the increased memory solution to our IT department but
> the
> > > > answer was:
> > > >
> > > > " Why this problem is occurring only with the small application
> using
> > > > Wicket?".
> > > >
> > > > We have three ears deployed on the same Jboss instance. One is using
> > > Spring
> > > > MVC, one CXF and the admin module is using Wicket.
> > > > Actually the admin module is used by only one person when the other
> ones
> > > > have a high load.
> > > > We are using wicket.1.3.0-beta2 and the wicketstuff-dojo (1.3.0-dojo
> ).
> > > >
> > > > We actually cannot reproduce the problem in an easy way and IT is
> not
> > > sure
> > > > if it's caused by how we are using Wicket.
> > > >
> > > >
> > > > Have you any glue or suggestions on that?
> > > >
> > > >
> > > >
> > > > Thanks,
> > > > Vincenzo.
> > > >
> > > > On Feb 4, 2008 12:34 PM, Johan Compagner <[EMAIL PROTECTED]>
> wrote:
> > > >
> > > >
> > > > > Its not a normal out of mem but a Perm generation out of mem..
> > > > > increase your perm space
> > > > > -XX:MaxPermSize=128M (sun jvms, 128MB or give it more)
> > > > >
> > > > > these kind of out of mems seems to be hitten java the most.
> > > > > Sun should really fix this somehow and make the perm space much
> more
> > > > > flexable...
> > > > > (that it is a shared size with the normal heap for example)
> > > > >
> > > > > johan
> > > > >
> > > > >
> > > > > On Feb 4, 2008 12:24 PM, Vincenzo Vitale <
> [EMAIL PROTECTED]>
> > > > > wrote:
> > > > >
> > > > > > We are using Wicket in our Admin console and sometimes an
> > > OutOfMemory
> > > > > > problem occurs.
> > > > > >
> > > > > > Have you ever experienced such a problem?
> > > > > >
> > > > > > Here the stacktrace:
> > > > > >
> > > > > > 2008-02-01 09:19:04,460 [FilePageSerializingThread-Admin] ERROR
> > > STDERR -
> > > > > > Exception in thread "FilePageSerializingThread-Admin"
> > > > > > 2008-02-01 09:19:04,460 [FilePageSerializingThread-Admin] ERROR
> > > STDERR -
> > > > > > java.lang.OutOfMemoryError: PermGen space
> > > > > > 2008-02-01 09:48:40,189 [TP-Processor1] ERROR
> > > > > > org.apache.catalina.core.ContainerBase.[jboss.web
> > > > > > ].[localhost].[/admin].[default]
> > > > > > - Servlet.service() for servl
> > > > > > et default threw exception
> > > > > > java.lang.OutOfMemoryError: PermGen space
> > > > > > 2008-02-01 09:49:48,847 [TP-Processor24] ERROR
> > > > > > org.apache.catalina.core.ContainerBase.[jboss.web
> > > > > > ].[local

Call for presentations: Wicket Amsterdam Community Meetup 2008 part 1

2008-02-12 Thread Martijn Dashorst
It is meetup time again! Our last Amsterdam Meetup was a big success
and we want to make that a tradition. More than 80 Wicket developers
attended the meetup. If you have missed the previous meetup from Nov
30th, 2007 you can see the pictures online [1], or enjoy the
presentations [2].

Our next meetup needs presentations to become as successful as the
previous one, and we need your help! If you have a nice component
library, a business idea, a successful project, written a book or just
want to share some ideas concerning Wicket, claim a 30 minute window
and share your thoughts!

A presentation takes no longer than 30 minutes, and is given in English.

Submit your proposal here:

http://cwiki.apache.org/confluence/display/WICKET/Wicket+Community+meetups+-+Amsterdam#WicketCommunitymeetups-Amsterdam-program

We hope to see you in Amsterdam!

[1] Photos from previous meetup http://flickr.com/tags/wicketmeetup
[2] Slides from previous meetup http://www.slideshare.net/tag/wicket

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



Re: OutOfMemoryError on FilePageSerializingThread

2008-02-12 Thread Igor Vaynberg
not, this has nothing to do with load. look, your jvm has a preset
permgen limit where bytecode is stored. lets say that permgen is
allocated 60 megs, and all these numbers are arbitrary.

first jboss loads all its jars, which arbitrarily takes 30mb. so after
jboss is loaded you have 30mb permgen left.

then you deploy the first ear that loads all its jars that take up 15
megs, now you have 30 jboss+15 ear = 15 megs left in permgen

then you load your second ear whose jars take up 10 megs, so now you
only have 5 megs left in your permgen.

then you try to load wicket whose jars need more then 5 megs, so you
get an out of permgen error.

this is a gross simplification, but basically what happens.

permgen is called perm(anent) so it is not cleaned up, once something
is loaded it sticks.

so really it has nothing to do with load, it has to do with the number
of classes you try to load into that jvm. the more libs you use the
more different classes are loaded, the more space you need.

-igor

On Feb 12, 2008 1:17 PM, Vincenzo Vitale <[EMAIL PROTECTED]> wrote:
> Hi Igor,
>
> thanks for your fast answer (as usual)!!!
>
> So this also means that it's the high load on the bigger applications which
> is causing that *only* the smallest (and less used) Wicket app has at the
> moment the problem. Do you agree?
>
> We will try to monitor the usage by all the application deployed. I don't
> know if Jboss has already something with this value available (ideally an
> Mbean).
>
>
> Ciao,
> V.
>
>
> On Feb 12, 2008 7:18 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>
> > this memory space is shared by all libs in the vm. so maybe your ears
> > are taking up a ton of space and only a small amount is left to the
> > wicket app...its just not the right way to look at the problem. this
> > is not heap space which is allocated for runtime stuff, this is the
> > space used by VM to hold bytecode for classes...it doesnt matter how
> > small the app is or what load it is under...
> >
> > -igor
> >
> >
> > On Feb 12, 2008 3:27 AM, Vincenzo Vitale <[EMAIL PROTECTED]>
> > wrote:
> > > Hi Johan,
> > >
> > > we proposed the increased memory solution to our IT department but the
> > > answer was:
> > >
> > > " Why this problem is occurring only with the small application using
> > > Wicket?".
> > >
> > > We have three ears deployed on the same Jboss instance. One is using
> > Spring
> > > MVC, one CXF and the admin module is using Wicket.
> > > Actually the admin module is used by only one person when the other ones
> > > have a high load.
> > > We are using wicket.1.3.0-beta2 and the wicketstuff-dojo (1.3.0-dojo).
> > >
> > > We actually cannot reproduce the problem in an easy way and IT is not
> > sure
> > > if it's caused by how we are using Wicket.
> > >
> > >
> > > Have you any glue or suggestions on that?
> > >
> > >
> > >
> > > Thanks,
> > > Vincenzo.
> > >
> > > On Feb 4, 2008 12:34 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > > > Its not a normal out of mem but a Perm generation out of mem..
> > > > increase your perm space
> > > > -XX:MaxPermSize=128M (sun jvms, 128MB or give it more)
> > > >
> > > > these kind of out of mems seems to be hitten java the most.
> > > > Sun should really fix this somehow and make the perm space much more
> > > > flexable...
> > > > (that it is a shared size with the normal heap for example)
> > > >
> > > > johan
> > > >
> > > >
> > > > On Feb 4, 2008 12:24 PM, Vincenzo Vitale <[EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > We are using Wicket in our Admin console and sometimes an
> > OutOfMemory
> > > > > problem occurs.
> > > > >
> > > > > Have you ever experienced such a problem?
> > > > >
> > > > > Here the stacktrace:
> > > > >
> > > > > 2008-02-01 09:19:04,460 [FilePageSerializingThread-Admin] ERROR
> > STDERR -
> > > > > Exception in thread "FilePageSerializingThread-Admin"
> > > > > 2008-02-01 09:19:04,460 [FilePageSerializingThread-Admin] ERROR
> > STDERR -
> > > > > java.lang.OutOfMemoryError: PermGen space
> > > > > 2008-02-01 09:48:40,189 [TP-Processor1] ERROR
> > > > > org.apache.catalina.core.ContainerBase.[jboss.web
> > > > > ].[localhost].[/admin].[default]
> > > > > - Servlet.service() for servl
> > > > > et default threw exception
> > > > > java.lang.OutOfMemoryError: PermGen space
> > > > > 2008-02-01 09:49:48,847 [TP-Processor24] ERROR
> > > > > org.apache.catalina.core.ContainerBase.[jboss.web
> > > > > ].[localhost].[/admin].[default]
> > > > > - Servlet.service() for serv
> > > > > let default threw exception
> > > > > java.lang.OutOfMemoryError: PermGen space
> > > > > 2008-02-01 09:53:49,550 [TP-Processor31] ERROR
> > > > > org.apache.wicket.RequestCycle -
> > > > > java.lang.NullPointerException
> > > > >at java.io.FilterInputStream.close(FilterInputStream.java
> > :159)
> > > > >at
> > > > > sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream.close
> > > > > (JarURLConnection.java:88)
> > > > >at org.apache.wicket.Re

[ann] Wicket Amsterdam Meetup 2008 part 1

2008-02-12 Thread Martijn Dashorst
It is meetup time again! Our last Amsterdam Meetup was a big success
and we want to continue that tradition. Over 80 Wicket developers
attended the previous meetup and we had a blast. If you have missed
the previous meetup from Nov 30th, 2007 you can see the pictures
online [1], or enjoy the presentations [2].

Join us at the Wicket meetup in Amsterdam prior to ApacheCon EU.
Impress your boss with a deeper understanding of Wicket, or the new
treasure chest of components that have been unveiled at the meetup.
Meet other Wicket developers and share your hopes, victories and
frustrations. Expand your network of Wicket developers!

A final date has not been set yet, and we ask everyone to fill in
their preference.The possible dates for our meetup are:

 * Friday April 4th,
 * Monday April 7th, and
 * Tuesday April 8th.

Sign up for the meetup here and show us your preference:

http://cwiki.apache.org/confluence/display/WICKET/Wicket+Community+meetups+-+Amsterdam#WicketCommunitymeetups-Amsterdam-attendance

We hope to see you in Amsterdam!

Arjé Cahn
Martijn Dashorst

[1] Photos from previous meetup http://flickr.com/tags/wicketmeetup
[2] Slides from previous meetup http://www.slideshare.net/tag/wicket

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



Re: a wizard + a comboBox

2008-02-12 Thread Fernando Wermus
Igor,
  Thanks. It was my fault. I have the setter modifier as private.

On Tue, Feb 12, 2008 at 4:46 PM, Igor Vaynberg <[EMAIL PROTECTED]>
wrote:

> please provide a quickstart in a jira issue, or at least show us some code
>
> -igor
>
>
> On Feb 12, 2008 9:53 AM, Fernando Wermus <[EMAIL PROTECTED]>
> wrote:
> > I have a wizard which have 2 wizard steps. I have a model  where  wicket
> > sets  the values. Actually,  it is setting well the value in  comboBoxs.
> > But  when  I  go to the next steps, this exception arise.  I am  really
> > confuse with this behavior.
> >
> >
> >
> > WicketMessage: no set method defined for value: key =futbol 5
> value=futbol 5
> > on object:
> > [EMAIL PROTECTED]
> >
> > Root cause:
> >
> > org.apache.wicket.WicketRuntimeException: no set method defined for
> value:
> > key =futbol 5 value=futbol 5 on object:
> > [EMAIL PROTECTED]
> > at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue
> (
> > PropertyResolver.java:1101)
> > at
> org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(
> > PropertyResolver.java:576)
> > at org.apache.wicket.util.lang.PropertyResolver.setValue(
> > PropertyResolver.java:130)
> > at org.apache.wicket.model.AbstractPropertyModel.setObject(
> > AbstractPropertyModel.java:164)
> > at org.apache.wicket.Component.setModelObject(Component.java:2834)
> > at org.apache.wicket.markup.html.form.FormComponent.updateModel(
> > FormComponent.java:992)
> > at org.apache.wicket.markup.html.form.Form$14.validate(Form.java:1615)
> > at
> org.apache.wicket.markup.html.form.Form$ValidationVisitor.formComponent(
> > Form.java:152)
> > at
> >
> org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
> > (FormComponent.java:400)
> > at
> >
> org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
> > (FormComponent.java:387)
> > at
> >
> org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
> > (FormComponent.java:387)
> > at
> >
> org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder
> > (FormComponent.java:365)
> > at org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(
> > Form.java:982)
> > at org.apache.wicket.markup.html.form.Form.updateFormComponentModels(
> > Form.java:1610)
> > at org.apache.wicket.markup.html.form.Form.process(Form.java:817)
> > at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java
> :766)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at org.apache.wicket.RequestListenerInterface.invoke(
> > RequestListenerInterface.java:183)
> > at
> >
> org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents
> > (ListenerInterfaceRequestTarget.java:73)
> > at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents
> (
> > AbstractRequestCycleProcessor.java:90)
> > at org.apache.wicket.RequestCycle.processEventsAndRespond(
> RequestCycle.java
> > :1094)
> > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1169)
> > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245)
> > at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
> > at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java
> :354)
> > 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)
> > at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java
> :181)
> > at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java
> :726)
> > at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
> > at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java
> :139)
> > at org.mortbay.jetty.Server.handle(Server.java:320)
> > at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java
> :505)
> > at org.mortbay.jetty.HttpConnection$RequestHandler.content(
> > HttpConnection.java:842)
> > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
> > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
> > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
> > at org.mortbay.jetty.bio.SocketConnector$Connection.run(
> SocketConnector.java
> > :228)
> > at org.mortbay.thread.BoundedThreadPool$PoolThread.run(
> > BoundedThreadPool.java:450)
> >
> >
> > --
> > Fernando Wermus.
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Fernando Wermus.


RE: StringResourceModel - how to pass method call instead of bean

2008-02-12 Thread Michael Mehrle
Wow, that is cool - excellent, excellent input - that's exactly what I
need. Roland - you're the man :-)

Thanks!

Michael

-Original Message-
From: Roland Huss [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 12, 2008 12:19 PM
To: users@wicket.apache.org
Subject: RE: StringResourceModel - how to pass method call instead of
bean



Michael Mehrle wrote:
> 
> One more question - what do you refer to with 'late binding' - I
assume
> the value would be computed 'late' in the process? Please elaborate or
> send me a pointer.
> ...
> 
>> Alternatively, I you need late binding put 
>> 
>> new AbstractReadOnlyModel() {
>>public Object getObject() { return getTotalAlbums(); }
>> }
> 
> 

You got it. ('late binding' is probably the wrong synonym here, but it's
a
good metaphor anyway. 
At least for me ;-) Instead of showing only the number of total albums
which
existed 
at creation time of your component, by using this extra indirection step
you
get
your method evaluated each time the component is rendered (which can
happen
quite later 
when your album collection changes, e.g. when you use this label on a
page
where you
manage your stuff).

...roland
-- 
View this message in context:
http://www.nabble.com/TabbedPanel-and-model-load...-tp15385787p15441970.
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: OutOfMemoryError on FilePageSerializingThread

2008-02-12 Thread Vincenzo Vitale
Hi Igor,

thanks for your fast answer (as usual)!!!

So this also means that it's the high load on the bigger applications which
is causing that *only* the smallest (and less used) Wicket app has at the
moment the problem. Do you agree?

We will try to monitor the usage by all the application deployed. I don't
know if Jboss has already something with this value available (ideally an
Mbean).


Ciao,
V.

On Feb 12, 2008 7:18 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:

> this memory space is shared by all libs in the vm. so maybe your ears
> are taking up a ton of space and only a small amount is left to the
> wicket app...its just not the right way to look at the problem. this
> is not heap space which is allocated for runtime stuff, this is the
> space used by VM to hold bytecode for classes...it doesnt matter how
> small the app is or what load it is under...
>
> -igor
>
>
> On Feb 12, 2008 3:27 AM, Vincenzo Vitale <[EMAIL PROTECTED]>
> wrote:
> > Hi Johan,
> >
> > we proposed the increased memory solution to our IT department but the
> > answer was:
> >
> > " Why this problem is occurring only with the small application using
> > Wicket?".
> >
> > We have three ears deployed on the same Jboss instance. One is using
> Spring
> > MVC, one CXF and the admin module is using Wicket.
> > Actually the admin module is used by only one person when the other ones
> > have a high load.
> > We are using wicket.1.3.0-beta2 and the wicketstuff-dojo (1.3.0-dojo).
> >
> > We actually cannot reproduce the problem in an easy way and IT is not
> sure
> > if it's caused by how we are using Wicket.
> >
> >
> > Have you any glue or suggestions on that?
> >
> >
> >
> > Thanks,
> > Vincenzo.
> >
> > On Feb 4, 2008 12:34 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:
> >
> >
> > > Its not a normal out of mem but a Perm generation out of mem..
> > > increase your perm space
> > > -XX:MaxPermSize=128M (sun jvms, 128MB or give it more)
> > >
> > > these kind of out of mems seems to be hitten java the most.
> > > Sun should really fix this somehow and make the perm space much more
> > > flexable...
> > > (that it is a shared size with the normal heap for example)
> > >
> > > johan
> > >
> > >
> > > On Feb 4, 2008 12:24 PM, Vincenzo Vitale <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > We are using Wicket in our Admin console and sometimes an
> OutOfMemory
> > > > problem occurs.
> > > >
> > > > Have you ever experienced such a problem?
> > > >
> > > > Here the stacktrace:
> > > >
> > > > 2008-02-01 09:19:04,460 [FilePageSerializingThread-Admin] ERROR
> STDERR -
> > > > Exception in thread "FilePageSerializingThread-Admin"
> > > > 2008-02-01 09:19:04,460 [FilePageSerializingThread-Admin] ERROR
> STDERR -
> > > > java.lang.OutOfMemoryError: PermGen space
> > > > 2008-02-01 09:48:40,189 [TP-Processor1] ERROR
> > > > org.apache.catalina.core.ContainerBase.[jboss.web
> > > > ].[localhost].[/admin].[default]
> > > > - Servlet.service() for servl
> > > > et default threw exception
> > > > java.lang.OutOfMemoryError: PermGen space
> > > > 2008-02-01 09:49:48,847 [TP-Processor24] ERROR
> > > > org.apache.catalina.core.ContainerBase.[jboss.web
> > > > ].[localhost].[/admin].[default]
> > > > - Servlet.service() for serv
> > > > let default threw exception
> > > > java.lang.OutOfMemoryError: PermGen space
> > > > 2008-02-01 09:53:49,550 [TP-Processor31] ERROR
> > > > org.apache.wicket.RequestCycle -
> > > > java.lang.NullPointerException
> > > >at java.io.FilterInputStream.close(FilterInputStream.java
> :159)
> > > >at
> > > > sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream.close
> > > > (JarURLConnection.java:88)
> > > >at org.apache.wicket.Response.write(Response.java:323)
> > > >at
> > > >
> > > >
> > >
> org.apache.wicket.request.target.resource.ResourceStreamRequestTarget.respond
> > > > (ResourceStreamRequestTarget.java:127)
> > > >at
> > > org.apache.wicket.request.AbstractRequestCycleProcessor.respond(
> > > > AbstractRequestCycleProcessor.java:103)
> > > >at org.apache.wicket.RequestCycle.respond(RequestCycle.java
> :1046)
> > > >at org.apache.wicket.RequestCycle.step(RequestCycle.java
> :1112)
> > > >at org.apache.wicket.RequestCycle.steps(RequestCycle.java
> :1176)
> > > >at org.apache.wicket.RequestCycle.request(RequestCycle.java
> :499)
> > > >at org.apache.wicket.protocol.http.WicketFilter.doGet(
> > > > WicketFilter.java:257)
> > > >at org.apache.wicket.protocol.http.WicketFilter.doFilter(
> > > > WicketFilter.java:138)
> > > >at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > > (
> > > > ApplicationFilterChain.java:202)
> > > >at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > > > ApplicationFilterChain.java:173)
> > > >at
> > > >
> > > >
> > >
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
> > > > (OpenSessionInViewFilter.j

RE: StringResourceModel - how to pass method call instead of bean

2008-02-12 Thread Roland Huss


Michael Mehrle wrote:
> 
> One more question - what do you refer to with 'late binding' - I assume
> the value would be computed 'late' in the process? Please elaborate or
> send me a pointer.
> ...
> 
>> Alternatively, I you need late binding put 
>> 
>> new AbstractReadOnlyModel() {
>>public Object getObject() { return getTotalAlbums(); }
>> }
> 
> 

You got it. ('late binding' is probably the wrong synonym here, but it's a
good metaphor anyway. 
At least for me ;-) Instead of showing only the number of total albums which
existed 
at creation time of your component, by using this extra indirection step you
get
your method evaluated each time the component is rendered (which can happen
quite later 
when your album collection changes, e.g. when you use this label on a page
where you
manage your stuff).

...roland
-- 
View this message in context: 
http://www.nabble.com/TabbedPanel-and-model-load...-tp15385787p15441970.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: StringResourceModel - how to pass method call instead of bean

2008-02-12 Thread Michael Mehrle
Well, the reason why was I didn't know that call existed ;-) Of course I
looked at the JavaDoc, but the examples there didn't show this scenario.
Thanks a LOT for your reply - this addresses exactly what I'm looking
for :-)

One more question - what do you refer to with 'late binding' - I assume
the value would be computed 'late' in the process? Please elaborate or
send me a pointer.

Michael


** 

Why dont you simple use MessageFormat's parameter substitution as
desribed
in the JavaDoc, i.e.

 .. new StringResourceModel("label.getTotalAlbums",this,null,new
Object[] {
getTotalAlbums() });

with 

label.getTotalAlbums=All Albums: ${0}

Alternatively, I you need late binding put 

new AbstractReadOnlyModel() {
public Object getObject() { return getTotalAlbums(); }
}

in the object array (instead of getTotalAlbums() directly)

bye ...

...roland
-- 
View this message in context:
http://www.nabble.com/TabbedPanel-and-model-load...-tp15385787p15440668.
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: StringResourceModel - how to pass method call instead of bean

2008-02-12 Thread Roland Huss


Michael Mehrle wrote:
> 
> Now, if I want to call a method that returns a String instead, like
> so...
> 
> add(new Label("greetings", new StringResourceModel("label.allAlbums",
> this, new Model(getTotalAlbums(;
> ^^^
> 
> ...with my properties file having this entry:
> 
> label.getTotalAlbums = All Albums: ${someReference}
> 
> Obviously, this doesn't work, since the new Model(xxx) call expects a
> bean to be passed in. How can I do this with a simple method call? And
> what would my someReference var be?
> 

Why dont you simple use MessageFormat's parameter substitution as desribed
in the JavaDoc, i.e.

 .. new StringResourceModel("label.getTotalAlbums",this,null,new Object[] {
getTotalAlbums() });

with 

label.getTotalAlbums=All Albums: ${0}

Alternatively, I you need late binding put 

new AbstractReadOnlyModel() {
public Object getObject() { return getTotalAlbums(); }
}

in the object array (instead of getTotalAlbums() directly)

bye ...

...roland
-- 
View this message in context: 
http://www.nabble.com/TabbedPanel-and-model-load...-tp15385787p15440668.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



wicket-security Custom Access Denied Page

2008-02-12 Thread Warren
How do you set-up a custom "access denied page" that has a message on it
like "Users in group xxx do not have access to yyy"? I also want to have
this page return to the previous page the user was on. I am using
wicket-security (wasp and swarm).

Thanks,

Warren Bell


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



Re: a wizard + a comboBox

2008-02-12 Thread Igor Vaynberg
please provide a quickstart in a jira issue, or at least show us some code

-igor


On Feb 12, 2008 9:53 AM, Fernando Wermus <[EMAIL PROTECTED]> wrote:
> I have a wizard which have 2 wizard steps. I have a model  where  wicket
> sets  the values. Actually,  it is setting well the value in  comboBoxs.
> But  when  I  go to the next steps, this exception arise.  I am  really
> confuse with this behavior.
>
>
>
> WicketMessage: no set method defined for value: key =futbol 5 value=futbol 5
> on object:
> [EMAIL PROTECTED]
>
> Root cause:
>
> org.apache.wicket.WicketRuntimeException: no set method defined for value:
> key =futbol 5 value=futbol 5 on object:
> [EMAIL PROTECTED]
> at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(
> PropertyResolver.java:1101)
> at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(
> PropertyResolver.java:576)
> at org.apache.wicket.util.lang.PropertyResolver.setValue(
> PropertyResolver.java:130)
> at org.apache.wicket.model.AbstractPropertyModel.setObject(
> AbstractPropertyModel.java:164)
> at org.apache.wicket.Component.setModelObject(Component.java:2834)
> at org.apache.wicket.markup.html.form.FormComponent.updateModel(
> FormComponent.java:992)
> at org.apache.wicket.markup.html.form.Form$14.validate(Form.java:1615)
> at org.apache.wicket.markup.html.form.Form$ValidationVisitor.formComponent(
> Form.java:152)
> at
> org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
> (FormComponent.java:400)
> at
> org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
> (FormComponent.java:387)
> at
> org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
> (FormComponent.java:387)
> at
> org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder
> (FormComponent.java:365)
> at org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(
> Form.java:982)
> at org.apache.wicket.markup.html.form.Form.updateFormComponentModels(
> Form.java:1610)
> at org.apache.wicket.markup.html.form.Form.process(Form.java:817)
> at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:766)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.wicket.RequestListenerInterface.invoke(
> RequestListenerInterface.java:183)
> at
> org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents
> (ListenerInterfaceRequestTarget.java:73)
> at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
> AbstractRequestCycleProcessor.java:90)
> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
> :1094)
> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1169)
> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245)
> at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
> 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)
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
> at org.mortbay.jetty.Server.handle(Server.java:320)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
> at org.mortbay.jetty.HttpConnection$RequestHandler.content(
> HttpConnection.java:842)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
> at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java
> :228)
> at org.mortbay.thread.BoundedThreadPool$PoolThread.run(
> BoundedThreadPool.java:450)
>
>
> --
> Fernando Wermus.
>

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



Re: Switching locales with the same link

2008-02-12 Thread Igor Vaynberg
see

http://wicketstuff.org/wicket13/pub/

and

http://wicketstuff.org/wicket13/pub2

source is available in wicket-examples project

-igor


On Feb 12, 2008 8:01 AM, Korsten, Peter, VF-MT
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've just started with Wicket, and I'm struggling a bit with the
> documentation. Google hasn't helped either to provide an answer.
>
> What I'm after is to have a 'switch locale' link in a different
> language. Suppose you have an English (default) and a Dutch version, you
> would have 'Nederlandse versie' on the English page, and 'English
> version' on the Dutch page.
>
> The page is a single HTML page, with the different text labels in
> properties files. The locale code that you'd want to switch to ('en' for
> English, 'nl' for Dutch) is stored in the properties files as well.
>
> Now, I don't want to make two HTML pages, because this one is going to
> be used for the navigation structure, and having two pages is
> undesirable because of the maintenance aspect.
>
> I did manage to switch languages, but only by hard-coding the locales in
> the Java file, checking what the current locale is, and switching to the
> other one. Whilst it works, it's a clumsy solution. I've considered
> panels and separate HTML files for the link, but that too looks
> needlessly complex.
>
> So, is it possible to make a link that takes the language code from the
> properties file as a parameter, and does something along the lines of
> getSession().setLocale(new Locale(lc)), where lc is the language code
> from the link?
>
> Thanks,
>
> - Peter
>
>
> There is only one of you for all time.  Fearlessly be yourself.
> Life is Now!
> ---
>
> This email is intended only for the use of individuals to whom it is 
> addressed, as it may contain confidential or privileged information. If you 
> are not a named addressee, intended recipient, or the person responsible for 
> delivering the message to the named addressee, be advised that you have 
> received this email in error and that you should not disseminate, distribute, 
> print, copy this mail or otherwise divulge its contents. In such instances, 
> please notify Vodafone Malta Limited on telephone number +356 9247 and 
> delete this email from your system. Since this transmission was affected via 
> email, Vodafone Malta Limited cannot guarantee that it is secure or 
> error-free as information could be intercepted, corrupted, lost, destroyed, 
> arrive late or incomplete, or contain viruses. Vodafone Malta Limited does 
> not accept liability for any errors or omissions in the contents of this 
> message which arise as a result of email transmission.
>
> Save the environment for our children - Print e-mail only when necessary.
>
> -
> 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: Hook into RequestCycle ?

2008-02-12 Thread Roland Huss



Martijn Dashorst wrote:
> 
> The auth-roles project is basically an example, so the fact that you
> copied
> it, is a good thing (tm). Even though it is sufficient for a lot of
> projects, if you need anything beyond the current capabilities, then
> rolling
> your own is the way to go. Or use Swarm/Wasp from Wicket Stuff
> 

Well, auth-roles meets nearly perfectly my current needs and I use it, but
had to 
*duplicate* quite some code in a subclass (i.e. overriding a method, 
copying the original code except one line or so). That's a bad thing IMO. 

I agree that auth-role is an add on and I could do it my own way. 
The core wicket extensions points are more than sufficient for that.
But even a good example like auth-roles could be improved sometimes ;-)
 
Don't get me wrong, the current situation is ok for me because it works.

bye ...

...roland
  

-- 
View this message in context: 
http://www.nabble.com/Hook-into-RequestCycle---tp15428634p15439750.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: Override external .properties for localization

2008-02-12 Thread Igor Vaynberg
yes, you can subclass a page and put the resource next to it. another
alternative is to put the package into the same package as the
original page. yet another alternative is to add those keys to your
myapplicaiton.properties

-igor


On Feb 12, 2008 7:49 AM, Wang, Yuesong <[EMAIL PROTECTED]> wrote:
> Maybe you can extend the page, or duplicate the external package in your
> own code base, and put your localized properties file there? WARNING:
> I'm a newbie to wicket, so my suggestions might not work at all ;)
>
> Yuesong
>
>
> -Original Message-
> From: Thomas Kappler [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 12, 2008 9:32 AM
> To: users@wicket.apache.org
> Subject: Override external .properties for localization
>
> Hi,
>
> my question seems trivial, but I just can't find anything: how to
> localize a page or panel that's not my own, but is in a referenced
> library (like Wicket itself)?  For instance, I'd like to have a German
> version of UserAdminPage in databinder (which provides String
> resources), so I would write a UserAdminPage_de.properties, but where
> should I put it and what do I have to do so that it's picked up and
> used?
>
> Thanks,
> Thomas
>
> -
> 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: panel doesn't see page which it create?

2008-02-12 Thread Igor Vaynberg
add(new CheckBox("openLocationPanelLink") {
  oncomponenttag(tag) {
tag.put("onclick", "var panel=document.getElementById('" +
addLocationPanel.getMarkupId() +
 "');panel.style.display=this.checked?'block':'none';")));
}

that way your code will execute during render time at which markupid
is available.

-igor


On Feb 12, 2008 6:10 AM, Java Programmer <[EMAIL PROTECTED]> wrote:
> Hello,
> I have Panel on which in constructor I put nested Panel:
> public class RegisterUserPanel extends Panel {
>
> public RegisterUserPanel(String id) {
> ...
> final Panel addLocationPanel = new AddLocationPanel("addLocationPanel");
> addLocationPanel.add(new SimpleAttributeModifier("style", "display:none;"));
> add(addLocationPanel);
> add(new CheckBox("openLocationPanelLink").add(new
> SimpleAttributeModifier("onclick", "var
> panel=document.getElementById('" + addLocationPanel.getMarkupId() +
> "');panel.style.display=this.checked?'block':'none';")));
> ..
> }
>
> It's as you see another panel, and the exception is thrown:
> WicketMessage: 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)
>
> It means for me that addLocationPanel.getMarkupId() is not setup yet
> (it could be quite obvious, because it's constructor and I haven't
> send any info about page to it, and probably it's send after creating
> instance). But what can i do in such situation? What is best pattern?
>
> Best regards,
> Adr
>
> -
> 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: Updating a Dynamic Image with AJAX (and JFreeChart)

2008-02-12 Thread scottomni

I have been unable to get the JFreeChart ToolTips to work in Wicket (NetBeans
6.0).

The wiki example sets the tooltips flag to true, but the resulting web page
contains no image map... thus, no tooltips.

Should this work?

Thanks,

Scott

-- 
View this message in context: 
http://www.nabble.com/Updating-a-Dynamic-Image-with-AJAX-%28and-JFreeChart%29-tp12884455p15439692.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: Harnessing Data From Components

2008-02-12 Thread Igor Vaynberg
or you can bind the model to a property, and then when a component is
rendered it will use the value in that property, when it is submitted
it will set the value to that property - that way it is all completely
transparent.

see PropertyModel, the wiki has a great page that explains how models work...

-igor


On Feb 12, 2008 7:02 AM, Maurice Marrink <[EMAIL PROTECTED]> wrote:
> Data in wicket components is wrapped in models.
> You can ask a component for its model: getModel() and then ask the
> model for its data: getObject().
> Or you can use the shortcut getModelObject() on a component.
> Setting data is done in a similar way.
>
> Maurice
>
>
> On Feb 12, 2008 3:11 PM, carloc <[EMAIL PROTECTED]> wrote:
> >
> > hi everyone,
> >
> > I would like to ask how I could actually get data from the different
> > components in the wicket examples...
> > For example in the YUI selection or in the RatingPanel...
> >
> > What will my code look like if I have a submit button and I want to know the
> > rating?
> > (e.g. how many stars were pressed)
> >
> > I can display the components properly but I can't get data from them...
> > Same as with the other examples...
> >
> > What is the best way to do this?
> > --
> > View this message in context: 
> > http://www.nabble.com/Harnessing-Data-From-Components-tp15433918p15433918.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]



Re: problem using DataGridView

2008-02-12 Thread Igor Vaynberg
can you set a debug point in arrayiteratoradapter and see why it is
getting null array passed in? the line numbers dont line up for my
source, but it looks like your columns var is actually a null array?

-igor


On Feb 12, 2008 4:52 AM, Araz <[EMAIL PROTECTED]> wrote:
> Hi There,
> I'm trying to add a DataGridView to my page with custom columns, here is what 
> I've done:
>
>   DataGridView table = new DataGridView("rows", columns, new 
> ReportDataProvider(values));
>
> with this html:
> 
> 
> 
>   cell content goes here
> 
> 
> 
>
>
> this is ReportDataProvider:
> public class ReportDataProvider implements IDataProvider
> {
>   Vector data;
>
>   public ReportDataProvider(Vector data)
>   {
> this.data = new Vector(data);
>   }
>
>   public IModel model(Object object)
>   {
> return new ReportModel((SystemReportBean) object);
>   }
>
>   public int size()
>   {
> return data.size();
>   }
>
>   public Iterator iterator(int first, int count)
>   {
> List vec = data.subList(first,first+count);
> return vec.iterator();
>   }
> }
>
>
> and ReportModel is a plain object with getter setter methods
>
>
> but I get this exception every time I try to view the page I get this 
> exception:
> WicketMessage: Error attaching this container for rendering: [MarkupContainer 
> [Component id = cells, page = com.laser.monitoring.gui.ReportResultPage, path 
> = 41:rows:1:cells.AbstractDataGridView$2, isVisible = true, isVersioned = 
> false]]
> Root cause:
> java.lang.NullPointerException
>  at 
> wicket.extensions.markup.html.repeater.util.ArrayIteratorAdapter.hasNext(ArrayIteratorAdapter.java:62)
>  at 
> wicket.extensions.markup.html.repeater.refreshing.DefaultItemReuseStrategy$1.hasNext(DefaultItemReuseStrategy.java:66)
>  at 
> wicket.extensions.markup.html.repeater.refreshing.RefreshingView.addItems(RefreshingView.java:189)
>  at 
> wicket.extensions.markup.html.repeater.refreshing.RefreshingView.internalOnAttach(RefreshingView.java:117)
> 
>
> I've done everything I thought that might help with no result
>
>
>
>
>
>
>
>
>
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com

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



RE: StringResourceModel - how to pass method call instead of bean

2008-02-12 Thread Michael Mehrle
Didn't see a response - does anyone know how to do this?

-Original Message-
From: Michael Mehrle [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 11, 2008 5:53 PM
To: users@wicket.apache.org
Subject: StringResourceModel - how to pass method call instead of bean

I actually have a follow up question regarding StringResourceModel - the
tutorial shows this example, which makes sense:

add(new Label("greetings", new StringResourceModel("label.greetings",
this, new Model(user;

Now, if I want to call a method that returns a String instead, like
so...

add(new Label("greetings", new StringResourceModel("label.allAlbums",
this, new Model(getTotalAlbums(;
^^^

...with my properties file having this entry:

label.getTotalAlbums = All Albums: ${someReference}

Obviously, this doesn't work, since the new Model(xxx) call expects a
bean to be passed in. How can I do this with a simple method call? And
what would my someReference var be?

Hope this makes sense - I just want to avoid passing in/creating a bean.

Michael


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of James Carman
Sent: Monday, February 11, 2008 12:04 PM
To: users@wicket.apache.org
Subject: Re: TabbedPanel tab names

Oops.  That's what I meant. I had to use StringResourceModel in my
case because I had to supply parameters.

On 2/11/08, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> or just ResourceModel
>
> -igor
>
>
> On Feb 11, 2008 11:59 AM, James Carman <[EMAIL PROTECTED]>
wrote:
> > Have you tried StringResourceModel?
> >
> >
> > On 2/11/08, Michael Mehrle <[EMAIL PROTECTED]> wrote:
> > > Assuming the typical tabbed panel example below - is there a good
way to
> > > grab the tab name from the page's properties file? What I need to
do is
> > > to internationalize the tab name. I guess I could do my own call
to grab
> > > it from the classpath + the property file name. Was hoping
> > >
> > > List tabs = new ArrayList();
> > > tabs.add(new AbstractTab(new Model("first tab"))
> > > { ^^
> > > public Panel getPanel(String panelId)
> > > {
> > > return new TabPanel1(panelId);
> > > }
> > > });
> > >
> > >
-
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
-
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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


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


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



Re: OutOfMemoryError on FilePageSerializingThread

2008-02-12 Thread Igor Vaynberg
this memory space is shared by all libs in the vm. so maybe your ears
are taking up a ton of space and only a small amount is left to the
wicket app...its just not the right way to look at the problem. this
is not heap space which is allocated for runtime stuff, this is the
space used by VM to hold bytecode for classes...it doesnt matter how
small the app is or what load it is under...

-igor


On Feb 12, 2008 3:27 AM, Vincenzo Vitale <[EMAIL PROTECTED]> wrote:
> Hi Johan,
>
> we proposed the increased memory solution to our IT department but the
> answer was:
>
> " Why this problem is occurring only with the small application using
> Wicket?".
>
> We have three ears deployed on the same Jboss instance. One is using Spring
> MVC, one CXF and the admin module is using Wicket.
> Actually the admin module is used by only one person when the other ones
> have a high load.
> We are using wicket.1.3.0-beta2 and the wicketstuff-dojo (1.3.0-dojo).
>
> We actually cannot reproduce the problem in an easy way and IT is not sure
> if it's caused by how we are using Wicket.
>
>
> Have you any glue or suggestions on that?
>
>
>
> Thanks,
> Vincenzo.
>
> On Feb 4, 2008 12:34 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:
>
>
> > Its not a normal out of mem but a Perm generation out of mem..
> > increase your perm space
> > -XX:MaxPermSize=128M (sun jvms, 128MB or give it more)
> >
> > these kind of out of mems seems to be hitten java the most.
> > Sun should really fix this somehow and make the perm space much more
> > flexable...
> > (that it is a shared size with the normal heap for example)
> >
> > johan
> >
> >
> > On Feb 4, 2008 12:24 PM, Vincenzo Vitale <[EMAIL PROTECTED]>
> > wrote:
> >
> > > We are using Wicket in our Admin console and sometimes an OutOfMemory
> > > problem occurs.
> > >
> > > Have you ever experienced such a problem?
> > >
> > > Here the stacktrace:
> > >
> > > 2008-02-01 09:19:04,460 [FilePageSerializingThread-Admin] ERROR STDERR -
> > > Exception in thread "FilePageSerializingThread-Admin"
> > > 2008-02-01 09:19:04,460 [FilePageSerializingThread-Admin] ERROR STDERR -
> > > java.lang.OutOfMemoryError: PermGen space
> > > 2008-02-01 09:48:40,189 [TP-Processor1] ERROR
> > > org.apache.catalina.core.ContainerBase.[jboss.web
> > > ].[localhost].[/admin].[default]
> > > - Servlet.service() for servl
> > > et default threw exception
> > > java.lang.OutOfMemoryError: PermGen space
> > > 2008-02-01 09:49:48,847 [TP-Processor24] ERROR
> > > org.apache.catalina.core.ContainerBase.[jboss.web
> > > ].[localhost].[/admin].[default]
> > > - Servlet.service() for serv
> > > let default threw exception
> > > java.lang.OutOfMemoryError: PermGen space
> > > 2008-02-01 09:53:49,550 [TP-Processor31] ERROR
> > > org.apache.wicket.RequestCycle -
> > > java.lang.NullPointerException
> > >at java.io.FilterInputStream.close(FilterInputStream.java:159)
> > >at
> > > sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream.close
> > > (JarURLConnection.java:88)
> > >at org.apache.wicket.Response.write(Response.java:323)
> > >at
> > >
> > >
> > org.apache.wicket.request.target.resource.ResourceStreamRequestTarget.respond
> > > (ResourceStreamRequestTarget.java:127)
> > >at
> > org.apache.wicket.request.AbstractRequestCycleProcessor.respond(
> > > AbstractRequestCycleProcessor.java:103)
> > >at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1046)
> > >at org.apache.wicket.RequestCycle.step(RequestCycle.java:1112)
> > >at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1176)
> > >at org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
> > >at org.apache.wicket.protocol.http.WicketFilter.doGet(
> > > WicketFilter.java:257)
> > >at org.apache.wicket.protocol.http.WicketFilter.doFilter(
> > > WicketFilter.java:138)
> > >at
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > (
> > > ApplicationFilterChain.java:202)
> > >at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > > ApplicationFilterChain.java:173)
> > >at
> > >
> > >
> > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
> > > (OpenSessionInViewFilter.java:198)
> > >at org.springframework.web.filter.OncePerRequestFilter.doFilter(
> > > OncePerRequestFilter.java:75)
> > >at
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > (
> > > ApplicationFilterChain.java:202)
> > >at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > > ApplicationFilterChain.java:173)
> > >at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
> > > ReplyHeaderFilter.java:96)
> > >at
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > > (
> > > ApplicationFilterChain.java:202)
> > >at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > > ApplicationFilterChain.java:173)
> > > 

Re: Multiple panels and back button

2008-02-12 Thread Igor Vaynberg
then you are not using the proper model, you should use a detachable
model to feed your repeater. see LoadableDetachableModel. paste your
code if you have more questions.

-igor


On Feb 12, 2008 12:34 AM, Constantin Y <[EMAIL PROTECTED]> wrote:
>
> Hi Igor,
>
> The problem with the back button is that if i dont setResponsePage(), after
> updating (or removing) a record from the list and pressing the back button,
> the system displays the exact previous data entry form with the old values
> of each record(!).
> If i had made, lets say 10 updates, the system will display all previous 10
> forms.
> I noticed that the url parameters have a format like
> "?wicket:interface=:1:8:::" where the second number changes every time i
> save (or remove) a record. If i press the back button then the second count
> decrements by 1 and the previous form is displayed with obsolete of course
> data.
> What the user expects by pressing the back button is to return to the menu
> (or whichever the caller page was) and not to the previous data entry form
> which is quite dangerous.
> This somehow is achieved by setting setResponsePage() inside the onClick
> code.
> I am quite sure that it is not wicket's "problem" and maybe i have to setup
> the whole page in a different way to achieve the behavior i want but i cant
> figure it out.
>
> Thanks again
>
>
>
> igor.vaynberg wrote:
> >
> > On Feb 8, 2008 7:44 AM, Constantin Y <[EMAIL PROTECTED]> wrote:
> >> Everything is ok except the "back" button.
> >
> > how is the back button broken exactly?
> >
> >> If i dont setResponsePage(..) in
> >> the onClick() method of the save button (btnSave) then wicket starts
> >> versioning(?) of the data entry form.
> >
> > a) you shouldnt call setresponsepage in onclick
> > b) wicket will version the page, whats wrong with that?
> >
> >> On the other hand i dont want to
> >> reconstruct the while page whenever i edit (or remove) a record.
> >> What am i missing?
> >
> > like i said, not sure what is not working...and whatever you posted
> > didnt make it
> >
> > -igor
> >
> >> Thanks a lot
> >>   http://www.nabble.com/file/p15357597/DataPanels.java DataPanels.java
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Multiple-panels-and-back-button-tp15357597p15357597.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/Multiple-panels-and-back-button-tp15357597p15428648.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: PageExpired while ordering DataTable

2008-02-12 Thread Federico Fanton
On Mon, 11 Feb 2008 13:01:47 +0100
"Johan Compagner" <[EMAIL PROTECTED]> wrote:

> i guess we could up the level a bit yes
> Because in 1.3 it is pretty serious error if we cant save the page.

Great! Should I open a JIRA issue to track this?


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



a wizard + a comboBox

2008-02-12 Thread Fernando Wermus
I have a wizard which have 2 wizard steps. I have a model  where  wicket
sets  the values. Actually,  it is setting well the value in  comboBoxs.
But  when  I  go to the next steps, this exception arise.  I am  really
confuse with this behavior.



WicketMessage: no set method defined for value: key =futbol 5 value=futbol 5
on object:
[EMAIL PROTECTED]

Root cause:

org.apache.wicket.WicketRuntimeException: no set method defined for value:
key =futbol 5 value=futbol 5 on object:
[EMAIL PROTECTED]
at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(
PropertyResolver.java:1101)
at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(
PropertyResolver.java:576)
at org.apache.wicket.util.lang.PropertyResolver.setValue(
PropertyResolver.java:130)
at org.apache.wicket.model.AbstractPropertyModel.setObject(
AbstractPropertyModel.java:164)
at org.apache.wicket.Component.setModelObject(Component.java:2834)
at org.apache.wicket.markup.html.form.FormComponent.updateModel(
FormComponent.java:992)
at org.apache.wicket.markup.html.form.Form$14.validate(Form.java:1615)
at org.apache.wicket.markup.html.form.Form$ValidationVisitor.formComponent(
Form.java:152)
at
org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
(FormComponent.java:400)
at
org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
(FormComponent.java:387)
at
org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrderHelper
(FormComponent.java:387)
at
org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder
(FormComponent.java:365)
at org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(
Form.java:982)
at org.apache.wicket.markup.html.form.Form.updateFormComponentModels(
Form.java:1610)
at org.apache.wicket.markup.html.form.Form.process(Form.java:817)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:766)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.wicket.RequestListenerInterface.invoke(
RequestListenerInterface.java:183)
at
org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents
(ListenerInterfaceRequestTarget.java:73)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
AbstractRequestCycleProcessor.java:90)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
:1094)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1169)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
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)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:320)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(
HttpConnection.java:842)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java
:228)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(
BoundedThreadPool.java:450)


-- 
Fernando Wermus.


Re: Hook into RequestCycle ?

2008-02-12 Thread Martijn Dashorst
The auth-roles project is basically an example, so the fact that you copied
it, is a good thing (tm). Even though it is sufficient for a lot of
projects, if you need anything beyond the current capabilities, then rolling
your own is the way to go. Or use Swarm/Wasp from Wicket Stuff.
Martijn

On 2/12/08, Roland Huss <[EMAIL PROTECTED]> wrote:
>
>
> Hi Martijn,
>
>
> Martijn Dashorst wrote:
> >
> > Take a look at wicket-auth-roles. This provides the usual security
> stuff,
> > and you can easily also check for a set cookie. Just implement your own
> > authorisation scheme.
> >
>
> Thanks, this was exactly the pointer I was looking for
> (i.e. the hook via IUnauthorizedComponentInstantiationListener as used in
> AuthenticatedWebApplication)
>
> However, there is a slight glitch.  There is not way to provide a
> automatic sign in since this can be only be done via
> signIn(username,password) on AuthenticatedWebSession. It would be
> possible if AWS.isSignedIn() wouldn't be final, so one could
> dynamically check for the cookie (and not only for a previous occured
> manual authentication).
>
> The solution I've chosen right now is to set an own
> UnauthorizedComponentInstantiationListener in my
> AuthenticatedWebApplication which copies over 90% of the existing
> functionality. This is certainly not an ideal solution.
>
> In general, I'm a fan of final methods, too in order to restrict
> unwanted extension points, but for AWS.isSignedIn() it would be
> probably a good idea to allow overriding or at least to provide and
> additional hook to relax the restriction to work with manual
> authentication via AWS.signIn() only.
>
> If you don't mind, I would like to open a JIRA issue for an RFE
> (with some more code examples).
>
> Thanx again for the hint (and for this great framework in general ;-) ...
>
> ... roland
>
>
> --
> View this message in context:
> http://www.nabble.com/Hook-into-RequestCycle---tp15428634p15435618.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.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1


Re: Hook into RequestCycle ?

2008-02-12 Thread Roland Huss

Hi Martijn,


Martijn Dashorst wrote:
> 
> Take a look at wicket-auth-roles. This provides the usual security stuff,
> and you can easily also check for a set cookie. Just implement your own
> authorisation scheme.
> 

Thanks, this was exactly the pointer I was looking for 
(i.e. the hook via IUnauthorizedComponentInstantiationListener as used in 
AuthenticatedWebApplication)

However, there is a slight glitch.  There is not way to provide a
automatic sign in since this can be only be done via
signIn(username,password) on AuthenticatedWebSession. It would be
possible if AWS.isSignedIn() wouldn't be final, so one could
dynamically check for the cookie (and not only for a previous occured
manual authentication).

The solution I've chosen right now is to set an own
UnauthorizedComponentInstantiationListener in my
AuthenticatedWebApplication which copies over 90% of the existing
functionality. This is certainly not an ideal solution.

In general, I'm a fan of final methods, too in order to restrict
unwanted extension points, but for AWS.isSignedIn() it would be
probably a good idea to allow overriding or at least to provide and
additional hook to relax the restriction to work with manual
authentication via AWS.signIn() only.

If you don't mind, I would like to open a JIRA issue for an RFE 
(with some more code examples).

Thanx again for the hint (and for this great framework in general ;-) ...

... roland


-- 
View this message in context: 
http://www.nabble.com/Hook-into-RequestCycle---tp15428634p15435618.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]



Switching locales with the same link

2008-02-12 Thread Korsten, Peter, VF-MT
Hi,
 
I've just started with Wicket, and I'm struggling a bit with the
documentation. Google hasn't helped either to provide an answer.
 
What I'm after is to have a 'switch locale' link in a different
language. Suppose you have an English (default) and a Dutch version, you
would have 'Nederlandse versie' on the English page, and 'English
version' on the Dutch page.

The page is a single HTML page, with the different text labels in
properties files. The locale code that you'd want to switch to ('en' for
English, 'nl' for Dutch) is stored in the properties files as well.

Now, I don't want to make two HTML pages, because this one is going to
be used for the navigation structure, and having two pages is
undesirable because of the maintenance aspect.

I did manage to switch languages, but only by hard-coding the locales in
the Java file, checking what the current locale is, and switching to the
other one. Whilst it works, it's a clumsy solution. I've considered
panels and separate HTML files for the link, but that too looks
needlessly complex.

So, is it possible to make a link that takes the language code from the
properties file as a parameter, and does something along the lines of
getSession().setLocale(new Locale(lc)), where lc is the language code
from the link?

Thanks,

- Peter


There is only one of you for all time.  Fearlessly be yourself.
Life is Now!
---

This email is intended only for the use of individuals to whom it is addressed, 
as it may contain confidential or privileged information. If you are not a 
named addressee, intended recipient, or the person responsible for delivering 
the message to the named addressee, be advised that you have received this 
email in error and that you should not disseminate, distribute, print, copy 
this mail or otherwise divulge its contents. In such instances, please notify 
Vodafone Malta Limited on telephone number +356 9247 and delete this email 
from your system. Since this transmission was affected via email, Vodafone 
Malta Limited cannot guarantee that it is secure or error-free as information 
could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or 
contain viruses. Vodafone Malta Limited does not accept liability for any 
errors or omissions in the contents of this message which arise as a result of 
email transmission.

Save the environment for our children - Print e-mail only when necessary.

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



RE: Override external .properties for localization

2008-02-12 Thread Wang, Yuesong
Maybe you can extend the page, or duplicate the external package in your
own code base, and put your localized properties file there? WARNING:
I'm a newbie to wicket, so my suggestions might not work at all ;)

Yuesong

-Original Message-
From: Thomas Kappler [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 12, 2008 9:32 AM
To: users@wicket.apache.org
Subject: Override external .properties for localization

Hi,

my question seems trivial, but I just can't find anything: how to
localize a page or panel that's not my own, but is in a referenced
library (like Wicket itself)?  For instance, I'd like to have a German
version of UserAdminPage in databinder (which provides String
resources), so I would write a UserAdminPage_de.properties, but where
should I put it and what do I have to do so that it's picked up and
used?

Thanks,
Thomas

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


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



Re: panel doesn't see page which it create?

2008-02-12 Thread Michael O'Cleirigh

Hi Adr,

The markupid of any component is only assigned when the containing 
component is actually added into the page.


The way around this is that the AttributeModifier (and most other 
behaviours I believe) class actually renders the "onclick" event during 
the onComponentTag(..) method of the panel being rendered at which point 
the markup id's are set.


You can just wrap the javascript in a model that will generate the 
correct text string when getObject() is called.


My helper class for this case takes in a string and replaces a 
placeholder with the desired markupid when the getObject() method of 
IModel is called.


e.g. panel.add (new AttributeModifier ("onClick", new 
MarkupIDInStringModel ("var panel=document.getElementById('" + 
MarkupIDInStringModel.MARKUP_ID_PLACEHOLDER + 
"');panel.style.display=this.checked?'block':'none';", addLocationPanel));


so when the onComponentTag method is called the model inserts 
addLocationPanel.getMarkupID() into the placeholder value.


Regards,

Mike

I have moved my objects in Pnale to fields eg.:
public class RegisterUserPanel extends Panel {

final CheckBox openClosePanelCheckBox;

final Panel addLocationPanel;
...
}
and from Page I setup attributes:
RegisterUserPanel registerUserPanel = new
RegisterUserPanel("register_user_panel");
add(registerUserPanel);
registerUserPanel.openClosePanelCheckBox.add(new
SimpleAttributeModifier("onclick", "var
panel=document.getElementById('" +
registerUserPanel.addLocationPanel.getMarkupId() +
"');panel.style.display=this.checked?'block':'none';"));

But is this good way to follow? Any other pattern to use?

best regards,
Adr

-
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: Harnessing Data From Components

2008-02-12 Thread Maurice Marrink
Data in wicket components is wrapped in models.
You can ask a component for its model: getModel() and then ask the
model for its data: getObject().
Or you can use the shortcut getModelObject() on a component.
Setting data is done in a similar way.

Maurice

On Feb 12, 2008 3:11 PM, carloc <[EMAIL PROTECTED]> wrote:
>
> hi everyone,
>
> I would like to ask how I could actually get data from the different
> components in the wicket examples...
> For example in the YUI selection or in the RatingPanel...
>
> What will my code look like if I have a submit button and I want to know the
> rating?
> (e.g. how many stars were pressed)
>
> I can display the components properly but I can't get data from them...
> Same as with the other examples...
>
> What is the best way to do this?
> --
> View this message in context: 
> http://www.nabble.com/Harnessing-Data-From-Components-tp15433918p15433918.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: panel doesn't see page which it create?

2008-02-12 Thread Java Programmer
I have moved my objects in Pnale to fields eg.:
public class RegisterUserPanel extends Panel {

final CheckBox openClosePanelCheckBox;

final Panel addLocationPanel;
...
}
and from Page I setup attributes:
RegisterUserPanel registerUserPanel = new
RegisterUserPanel("register_user_panel");
add(registerUserPanel);
registerUserPanel.openClosePanelCheckBox.add(new
SimpleAttributeModifier("onclick", "var
panel=document.getElementById('" +
registerUserPanel.addLocationPanel.getMarkupId() +
"');panel.style.display=this.checked?'block':'none';"));

But is this good way to follow? Any other pattern to use?

best regards,
Adr

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



Override external .properties for localization

2008-02-12 Thread Thomas Kappler
Hi,

my question seems trivial, but I just can't find anything: how to
localize a page or panel that's not my own, but is in a referenced
library (like Wicket itself)?  For instance, I'd like to have a German
version of UserAdminPage in databinder (which provides String
resources), so I would write a UserAdminPage_de.properties, but where
should I put it and what do I have to do so that it's picked up and
used?

Thanks,
Thomas

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



Harnessing Data From Components

2008-02-12 Thread carloc

hi everyone,

I would like to ask how I could actually get data from the different
components in the wicket examples...
For example in the YUI selection or in the RatingPanel...

What will my code look like if I have a submit button and I want to know the
rating?
(e.g. how many stars were pressed)

I can display the components properly but I can't get data from them...
Same as with the other examples...

What is the best way to do this?
-- 
View this message in context: 
http://www.nabble.com/Harnessing-Data-From-Components-tp15433918p15433918.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



panel doesn't see page which it create?

2008-02-12 Thread Java Programmer
Hello,
I have Panel on which in constructor I put nested Panel:
public class RegisterUserPanel extends Panel {

public RegisterUserPanel(String id) {
...
final Panel addLocationPanel = new AddLocationPanel("addLocationPanel");
addLocationPanel.add(new SimpleAttributeModifier("style", "display:none;"));
add(addLocationPanel);
add(new CheckBox("openLocationPanelLink").add(new
SimpleAttributeModifier("onclick", "var
panel=document.getElementById('" + addLocationPanel.getMarkupId() +
"');panel.style.display=this.checked?'block':'none';")));
..
}

It's as you see another panel, and the exception is thrown:
WicketMessage: 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)

It means for me that addLocationPanel.getMarkupId() is not setup yet
(it could be quite obvious, because it's constructor and I haven't
send any info about page to it, and probably it's send after creating
instance). But what can i do in such situation? What is best pattern?

Best regards,
Adr

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



RE: wicket-security, everybodyprincipal and only securepages

2008-02-12 Thread Hoover, William
ldap project has been put on hold for a more pressing project :(

I plan on getting something in place to address the ldap and mounting strategy 
as soon as I complete the current project I am working on :o)

You have done a great job with Wasp/Swarm and I think that it is worth me 
spending the extra time/effort to add these features!

-Will

-Original Message-
From: Maurice Marrink [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 12, 2008 8:29 AM
To: users@wicket.apache.org
Subject: Re: wicket-security, everybodyprincipal and only securepages


Hey William,
How is the ldap integration comming along?

Like i said then, i don't have a solution ready for how you would do
such a thing, and frankly it doesn't bother me enough if sometimes i
have to implement ISecurePage myself.
But i welcome a contribution that could do it :)

Maurice

On Feb 12, 2008 1:29 PM, Hoover, William <[EMAIL PROTECTED]> wrote:
> I still think that a more elegant and non-obtrusive solution would be
>
> mountSecurePage(MySecureWebPage.class)
>
> discussed previously in: 
> http://www.mail-archive.com/users@wicket.apache.org/msg09129.html
> That way you could have one basepage because they would not have to extend 
> SecureWebPage
>
>
> -Original Message-
> From: Maurice Marrink [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 12, 2008 4:24 AM
> To: users@wicket.apache.org
> Subject: Re: wicket-security, everybodyprincipal and only securepages
>
>
> If i add an extra method isUserAuthenticated to my
> WaspAuthorizationStrategy, then yeah i probably could let wasp handle
> everything in the WaspSession class.
> I need to know if a user is logged in before i force the session to bind.
>
> Thnx Johan.
>
> Maurice
>
> On Feb 12, 2008 10:13 AM, Johan Compagner <[EMAIL PROTECTED]> wrote:
> > About stackoverflow, cant you do that code in attach() of the session?
> > (test ofcourse if you want to do it once)
> >
> >
> > On 2/12/08, Michael Sparer <[EMAIL PROTECTED]> wrote:
> > >
> > > hi maurice,
> > >
> > > thanks for your answers. The reason why I want to avoid to have two
> > > basepages (one implementing ISecurePage) is that if I wanted to change
> > > something, such as markup, in the basepage I'd have to change it at two
> > > places. Even worse if I extend my extended basepages further, there would
> > > always have to be one version that does implement ISecurePage and one that
> > > doesn't. So I'd end up adding two pages with the same markup everytime 
> > > when
> > > I'd like to add a page.
> > >
> > > As you might have noticed my app can't be compared to an app such as an
> > > online-banking-app where you have one loginpage and the rest is behind the
> > > big door on secure pages. In my application there are some pages that are
> > > for registered members only but which do (or at least should) extend the
> > > same basepage as a regular page. So I thought I'll sign any visitor in by
> > > default, without any roles sothat they're able to access and render any
> > > component inside of
> > >
> > > grant { ... }
> > >
> > > and then if a user logs in with username and password, I'll give 'em a
> > > different role such as user and let them access and render anything inside
> > >
> > > grant user { ... }
> > >
> > > makes sense?
> > >
> > > ah yes, creating a stackoverflow: just call the 
> > > session.login(LoginContext)
> > > method inside the session's constructor (or inside your application's
> > > newSession method) and let it return a subject, then line 84 of the
> > > logincontainer class calls Session.get() that in turn calls findAndCreate
> > > that in turn calls the session's constructor that in turn calls
> > > Session.get() ... and so on
> > >
> > > regards
> > > Michael
> > >
> > >
> > > Mr Mean wrote:
> > > >
> > > >>also the
> > > >> first page a user hits after logging in (usually the home page) is a
> > > >> candidate.
> > > > Sorry this is not correct, usually that page (the home page) is a
> > > > secure page to trigger the automatic login.
> > > > I was trying to find more examples of pages typically not secure but i
> > > > guess besides public pages on your app / site only the login page has
> > > > a valid reason to not be secure.
> > > >
> > > > Maurice
> > > >
> > > > -
> > > > 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/wicket-security%2C-everybodyprincipal-and-only-securepages-tp15413102p15428636.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-security, everybodyprincipal and only securepages

2008-02-12 Thread Maurice Marrink
Hey William,
How is the ldap integration comming along?

Like i said then, i don't have a solution ready for how you would do
such a thing, and frankly it doesn't bother me enough if sometimes i
have to implement ISecurePage myself.
But i welcome a contribution that could do it :)

Maurice

On Feb 12, 2008 1:29 PM, Hoover, William <[EMAIL PROTECTED]> wrote:
> I still think that a more elegant and non-obtrusive solution would be
>
> mountSecurePage(MySecureWebPage.class)
>
> discussed previously in: 
> http://www.mail-archive.com/users@wicket.apache.org/msg09129.html
> That way you could have one basepage because they would not have to extend 
> SecureWebPage
>
>
> -Original Message-
> From: Maurice Marrink [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 12, 2008 4:24 AM
> To: users@wicket.apache.org
> Subject: Re: wicket-security, everybodyprincipal and only securepages
>
>
> If i add an extra method isUserAuthenticated to my
> WaspAuthorizationStrategy, then yeah i probably could let wasp handle
> everything in the WaspSession class.
> I need to know if a user is logged in before i force the session to bind.
>
> Thnx Johan.
>
> Maurice
>
> On Feb 12, 2008 10:13 AM, Johan Compagner <[EMAIL PROTECTED]> wrote:
> > About stackoverflow, cant you do that code in attach() of the session?
> > (test ofcourse if you want to do it once)
> >
> >
> > On 2/12/08, Michael Sparer <[EMAIL PROTECTED]> wrote:
> > >
> > > hi maurice,
> > >
> > > thanks for your answers. The reason why I want to avoid to have two
> > > basepages (one implementing ISecurePage) is that if I wanted to change
> > > something, such as markup, in the basepage I'd have to change it at two
> > > places. Even worse if I extend my extended basepages further, there would
> > > always have to be one version that does implement ISecurePage and one that
> > > doesn't. So I'd end up adding two pages with the same markup everytime 
> > > when
> > > I'd like to add a page.
> > >
> > > As you might have noticed my app can't be compared to an app such as an
> > > online-banking-app where you have one loginpage and the rest is behind the
> > > big door on secure pages. In my application there are some pages that are
> > > for registered members only but which do (or at least should) extend the
> > > same basepage as a regular page. So I thought I'll sign any visitor in by
> > > default, without any roles sothat they're able to access and render any
> > > component inside of
> > >
> > > grant { ... }
> > >
> > > and then if a user logs in with username and password, I'll give 'em a
> > > different role such as user and let them access and render anything inside
> > >
> > > grant user { ... }
> > >
> > > makes sense?
> > >
> > > ah yes, creating a stackoverflow: just call the 
> > > session.login(LoginContext)
> > > method inside the session's constructor (or inside your application's
> > > newSession method) and let it return a subject, then line 84 of the
> > > logincontainer class calls Session.get() that in turn calls findAndCreate
> > > that in turn calls the session's constructor that in turn calls
> > > Session.get() ... and so on
> > >
> > > regards
> > > Michael
> > >
> > >
> > > Mr Mean wrote:
> > > >
> > > >>also the
> > > >> first page a user hits after logging in (usually the home page) is a
> > > >> candidate.
> > > > Sorry this is not correct, usually that page (the home page) is a
> > > > secure page to trigger the automatic login.
> > > > I was trying to find more examples of pages typically not secure but i
> > > > guess besides public pages on your app / site only the login page has
> > > > a valid reason to not be secure.
> > > >
> > > > Maurice
> > > >
> > > > -
> > > > 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/wicket-security%2C-everybodyprincipal-and-only-securepages-tp15413102p15428636.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]
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---

problem using DataGridView

2008-02-12 Thread Araz
Hi There,
I'm trying to add a DataGridView to my page with custom columns, here is what 
I've done:

  DataGridView table = new DataGridView("rows", columns, new 
ReportDataProvider(values));

with this html:



  cell content goes here





this is ReportDataProvider:
public class ReportDataProvider implements IDataProvider
{
  Vector data;

  public ReportDataProvider(Vector data)
  {
this.data = new Vector(data);
  }

  public IModel model(Object object)
  {
return new ReportModel((SystemReportBean) object);
  }

  public int size()
  {
return data.size();
  }

  public Iterator iterator(int first, int count)
  {
List vec = data.subList(first,first+count);
return vec.iterator();
  }
}


and ReportModel is a plain object with getter setter methods


but I get this exception every time I try to view the page I get this exception:
WicketMessage: Error attaching this container for rendering: [MarkupContainer 
[Component id = cells, page = com.laser.monitoring.gui.ReportResultPage, path = 
41:rows:1:cells.AbstractDataGridView$2, isVisible = true, isVersioned = false]]
Root cause:
java.lang.NullPointerException
 at 
wicket.extensions.markup.html.repeater.util.ArrayIteratorAdapter.hasNext(ArrayIteratorAdapter.java:62)
 at 
wicket.extensions.markup.html.repeater.refreshing.DefaultItemReuseStrategy$1.hasNext(DefaultItemReuseStrategy.java:66)
 at 
wicket.extensions.markup.html.repeater.refreshing.RefreshingView.addItems(RefreshingView.java:189)
 at 
wicket.extensions.markup.html.repeater.refreshing.RefreshingView.internalOnAttach(RefreshingView.java:117)


I've done everything I thought that might help with no result 










Send instant messages to your online friends http://uk.messenger.yahoo.com 

Re: Form/Enter Key Problem

2008-02-12 Thread Juan Gabriel Arias
My workaround was this. The idea is to add a submit behavior to the text
field, and it fires that only when user hits enter.

This code is inside the form's constructor.

searchCriteria = new TextField("searchCriteria", new Model(""));
searchCriteria.add(new AjaxFormSubmitBehavior(this, "onkeypress") {

protected void onSubmit(AjaxRequestTarget target) {
//submit code
}

protected CharSequence getEventHandler() {
CharSequence handler = super.getEventHandler();

String check = "javascript: if (event.keyCode == 13) { ";
String endCheck = " return false; }";

return StringUtils.join(new Object[] { check, handler, endCheck });
}

});

What do you think?

Regards!
Juan


RE: wicket-security, everybodyprincipal and only securepages

2008-02-12 Thread Hoover, William
I still think that a more elegant and non-obtrusive solution would be 

mountSecurePage(MySecureWebPage.class)

discussed previously in: 
http://www.mail-archive.com/users@wicket.apache.org/msg09129.html
That way you could have one basepage because they would not have to extend 
SecureWebPage

-Original Message-
From: Maurice Marrink [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 12, 2008 4:24 AM
To: users@wicket.apache.org
Subject: Re: wicket-security, everybodyprincipal and only securepages


If i add an extra method isUserAuthenticated to my
WaspAuthorizationStrategy, then yeah i probably could let wasp handle
everything in the WaspSession class.
I need to know if a user is logged in before i force the session to bind.

Thnx Johan.

Maurice

On Feb 12, 2008 10:13 AM, Johan Compagner <[EMAIL PROTECTED]> wrote:
> About stackoverflow, cant you do that code in attach() of the session?
> (test ofcourse if you want to do it once)
>
>
> On 2/12/08, Michael Sparer <[EMAIL PROTECTED]> wrote:
> >
> > hi maurice,
> >
> > thanks for your answers. The reason why I want to avoid to have two
> > basepages (one implementing ISecurePage) is that if I wanted to change
> > something, such as markup, in the basepage I'd have to change it at two
> > places. Even worse if I extend my extended basepages further, there would
> > always have to be one version that does implement ISecurePage and one that
> > doesn't. So I'd end up adding two pages with the same markup everytime when
> > I'd like to add a page.
> >
> > As you might have noticed my app can't be compared to an app such as an
> > online-banking-app where you have one loginpage and the rest is behind the
> > big door on secure pages. In my application there are some pages that are
> > for registered members only but which do (or at least should) extend the
> > same basepage as a regular page. So I thought I'll sign any visitor in by
> > default, without any roles sothat they're able to access and render any
> > component inside of
> >
> > grant { ... }
> >
> > and then if a user logs in with username and password, I'll give 'em a
> > different role such as user and let them access and render anything inside
> >
> > grant user { ... }
> >
> > makes sense?
> >
> > ah yes, creating a stackoverflow: just call the session.login(LoginContext)
> > method inside the session's constructor (or inside your application's
> > newSession method) and let it return a subject, then line 84 of the
> > logincontainer class calls Session.get() that in turn calls findAndCreate
> > that in turn calls the session's constructor that in turn calls
> > Session.get() ... and so on
> >
> > regards
> > Michael
> >
> >
> > Mr Mean wrote:
> > >
> > >>also the
> > >> first page a user hits after logging in (usually the home page) is a
> > >> candidate.
> > > Sorry this is not correct, usually that page (the home page) is a
> > > secure page to trigger the automatic login.
> > > I was trying to find more examples of pages typically not secure but i
> > > guess besides public pages on your app / site only the login page has
> > > a valid reason to not be secure.
> > >
> > > Maurice
> > >
> > > -
> > > 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/wicket-security%2C-everybodyprincipal-and-only-securepages-tp15413102p15428636.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]



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



Re: Including dynamic JSP content in Wicket page

2008-02-12 Thread Declan

Thanks, I'll try these two options.

The user object is set in the session by another JSP before getting into the
Wicket application.

Declan


Jonas-21 wrote:
> 
> I think you should be able to get into the same session by including a
> JSESSIONID
> parameter in your jsp url, like "user/include.jsp;jsessionid= session id here>"
> 
> Another possibility would be to have the browser call the jsp url,
> maybe with an iframe
> or something like that...
> 

-- 
View this message in context: 
http://www.nabble.com/Including-dynamic-JSP-content-in-Wicket-page-tp15430548p15432082.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: OutOfMemoryError on FilePageSerializingThread

2008-02-12 Thread Vincenzo Vitale
Hi Johan,

we proposed the increased memory solution to our IT department but the
answer was:

" Why this problem is occurring only with the small application using
Wicket?".

We have three ears deployed on the same Jboss instance. One is using Spring
MVC, one CXF and the admin module is using Wicket.
Actually the admin module is used by only one person when the other ones
have a high load.
We are using wicket.1.3.0-beta2 and the wicketstuff-dojo (1.3.0-dojo).

We actually cannot reproduce the problem in an easy way and IT is not sure
if it's caused by how we are using Wicket.


Have you any glue or suggestions on that?



Thanks,
Vincenzo.

On Feb 4, 2008 12:34 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:

> Its not a normal out of mem but a Perm generation out of mem..
> increase your perm space
> -XX:MaxPermSize=128M (sun jvms, 128MB or give it more)
>
> these kind of out of mems seems to be hitten java the most.
> Sun should really fix this somehow and make the perm space much more
> flexable...
> (that it is a shared size with the normal heap for example)
>
> johan
>
>
> On Feb 4, 2008 12:24 PM, Vincenzo Vitale <[EMAIL PROTECTED]>
> wrote:
>
> > We are using Wicket in our Admin console and sometimes an OutOfMemory
> > problem occurs.
> >
> > Have you ever experienced such a problem?
> >
> > Here the stacktrace:
> >
> > 2008-02-01 09:19:04,460 [FilePageSerializingThread-Admin] ERROR STDERR -
> > Exception in thread "FilePageSerializingThread-Admin"
> > 2008-02-01 09:19:04,460 [FilePageSerializingThread-Admin] ERROR STDERR -
> > java.lang.OutOfMemoryError: PermGen space
> > 2008-02-01 09:48:40,189 [TP-Processor1] ERROR
> > org.apache.catalina.core.ContainerBase.[jboss.web
> > ].[localhost].[/admin].[default]
> > - Servlet.service() for servl
> > et default threw exception
> > java.lang.OutOfMemoryError: PermGen space
> > 2008-02-01 09:49:48,847 [TP-Processor24] ERROR
> > org.apache.catalina.core.ContainerBase.[jboss.web
> > ].[localhost].[/admin].[default]
> > - Servlet.service() for serv
> > let default threw exception
> > java.lang.OutOfMemoryError: PermGen space
> > 2008-02-01 09:53:49,550 [TP-Processor31] ERROR
> > org.apache.wicket.RequestCycle -
> > java.lang.NullPointerException
> >at java.io.FilterInputStream.close(FilterInputStream.java:159)
> >at
> > sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream.close
> > (JarURLConnection.java:88)
> >at org.apache.wicket.Response.write(Response.java:323)
> >at
> >
> >
> org.apache.wicket.request.target.resource.ResourceStreamRequestTarget.respond
> > (ResourceStreamRequestTarget.java:127)
> >at
> org.apache.wicket.request.AbstractRequestCycleProcessor.respond(
> > AbstractRequestCycleProcessor.java:103)
> >at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1046)
> >at org.apache.wicket.RequestCycle.step(RequestCycle.java:1112)
> >at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1176)
> >at org.apache.wicket.RequestCycle.request(RequestCycle.java:499)
> >at org.apache.wicket.protocol.http.WicketFilter.doGet(
> > WicketFilter.java:257)
> >at org.apache.wicket.protocol.http.WicketFilter.doFilter(
> > WicketFilter.java:138)
> >at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > (
> > ApplicationFilterChain.java:202)
> >at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > ApplicationFilterChain.java:173)
> >at
> >
> >
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
> > (OpenSessionInViewFilter.java:198)
> >at org.springframework.web.filter.OncePerRequestFilter.doFilter(
> > OncePerRequestFilter.java:75)
> >at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > (
> > ApplicationFilterChain.java:202)
> >at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > ApplicationFilterChain.java:173)
> >at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
> > ReplyHeaderFilter.java:96)
> >at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> > (
> > ApplicationFilterChain.java:202)
> >at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> > ApplicationFilterChain.java:173)
> >at org.apache.catalina.core.StandardWrapperValve.invoke(
> > StandardWrapperValve.java:213)
> >at org.apache.catalina.core.StandardContextValve.invoke(
> > StandardContextValve.java:178)
> >at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
> > SecurityAssociationValve.java:175)
> >at org.jboss.web.tomcat.security.JaccContextValve.invoke(
> > JaccContextValve.java:74)
> >at org.apache.catalina.core.StandardHostValve.invoke(
> > StandardHostValve.java:126)
> >at org.apache.catalina.valves.ErrorReportValve.invoke(
> > ErrorReportValve.java:105)
> >at org.apache.catalina.core.StandardEngineValve.invoke(
> > StandardE

Re: Including dynamic JSP content in Wicket page

2008-02-12 Thread Jonas
> add(new Include("includedJSP", "user/include.jsp"));
>
> Using the this form always returns a null user object because the underlying
> code in the Include class opens a new URL connection that has a different
> session, so my user object is not available.

I think you should be able to get into the same session by including a
JSESSIONID
parameter in your jsp url, like "user/include.jsp;jsessionid="

Another possibility would be to have the browser call the jsp url,
maybe with an iframe
or something like that...

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



Re: Hook into RequestCycle ?

2008-02-12 Thread Martijn Dashorst
Take a look at wicket-auth-roles. This provides the usual security stuff,
and you can easily also check for a set cookie. Just implement your own
authorisation scheme.
Martijn

On 2/12/08, Roland Huss <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> what is the best place to hook into the request cycle
> before a page gets processed ? I looked through
> http://cwiki.apache.org/WICKET/lifecycle-of-a-wicket-application.html but
> the
> information there seems to be a bit outdated ("the Session returned by the
> Application
> is asked  to create a RequestCycle object using the Session's request
> cycle
> factory",
> but there's nothing like a request cycle factory which can be obtained
> from
> a Session in 1.3)
>
> Is there a more accurate documentation of a request's lifecycle somewhere
> else ?
>
> My use case is as follows: Before any page is processed I want to look up
> in
> the Session,
> whether a user is authenticated. If not, it is checked wheter a certain
> hash
> stored in a Cookie
> (if any) is stored in the DB and the associated user then is put into the
> session, providing some sort
> of 'keep me logged in' functionality. (The 'remember me' feature of the
> SignInPanel is not enough for
> me, since I want a transparent login without moving over the login page).
> Of
> course, if there is already
> support for this kind of feature out of the box somewhere, I would be
> happy
> for getting a pointer, too.
>
> thanx ...
>
> ... roland
> --
> View this message in context:
> http://www.nabble.com/Hook-into-RequestCycle---tp15428634p15428634.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.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1


Re: Hook into RequestCycle ?

2008-02-12 Thread Timo Rantalaiho
On Tue, 12 Feb 2008, Roland Huss wrote:
> what is the best place to hook into the request cycle 
> before a page gets processed ? I looked through 
> http://cwiki.apache.org/WICKET/lifecycle-of-a-wicket-application.html but
> the 
> information there seems to be a bit outdated ("the Session returned by the
> Application 
> is asked  to create a RequestCycle object using the Session's request cycle
> factory", 
> but there's nothing like a request cycle factory which can be obtained from
> a Session in 1.3)

Application.newRequestCycle() ?

Quite easily found by searching references to RequestCycle.

Best wishes,
Timo

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

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



Re: Including dynamic JSP content in Wicket page

2008-02-12 Thread Martin Grigorov
Can you attach with debugger to see what is in the Session actually?

Because if you set the User object via Wicket's Session then it prepends
a prefix to the key of all objects in the session. See
o.a.w.protocol.http.WebApplication.getSessionAttributePrefix(WebRequest) 

On Tue, 2008-02-12 at 02:28 -0800, Declan wrote:
> I'm trying to include JSP content in my Wicket page. The JSP content depends
> on some data that is stored in the HttpSession - in this case the data is a
> user object.
> 
> I have tried to use the Wicket Include like this:
> 
> add(new Include("includedJSP", "user/include.jsp"));
> 
> Using the this form always returns a null user object because the underlying
> code in the Include class opens a new URL connection that has a different
> session, so my user object is not available.
> 
> Can anyone suggest a way of getting around this?
> Thanks,
> Declan
> 
> JSP file:
> <[EMAIL PROTECTED] import="sg.com.mps.demo.model.persistence.User" %>
> 
>  class="sg.com.mps.demo.web.RequestHandler"/>
> <%
> 
> System.out.println("Session ID: " + session.getId()); // every call
> returns a different session ID
> User user = reqHandler.getLoggedInUser(session); // always returns null
> 
> System.out.println(null==user?"null":user.toString());
> if (user == null) {
> return;
> }
> 
> %>
> 
>   
> 
>   
> Logged in as: <%= user.getLoginName() %>
> 
> Logout
>   
> 
>   
> 
> 
> HTML:
> 
> included JSP goes here
> 
> 


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



Including dynamic JSP content in Wicket page

2008-02-12 Thread Declan

I'm trying to include JSP content in my Wicket page. The JSP content depends
on some data that is stored in the HttpSession - in this case the data is a
user object.

I have tried to use the Wicket Include like this:

add(new Include("includedJSP", "user/include.jsp"));

Using the this form always returns a null user object because the underlying
code in the Include class opens a new URL connection that has a different
session, so my user object is not available.

Can anyone suggest a way of getting around this?
Thanks,
Declan

JSP file:
<[EMAIL PROTECTED] import="sg.com.mps.demo.model.persistence.User" %>


<%

System.out.println("Session ID: " + session.getId()); // every call
returns a different session ID
User user = reqHandler.getLoggedInUser(session); // always returns null

System.out.println(null==user?"null":user.toString());
if (user == null) {
return;
}

%>

  

  
Logged in as: <%= user.getLoginName() %>

Logout
  

  


HTML:

included JSP goes here


-- 
View this message in context: 
http://www.nabble.com/Including-dynamic-JSP-content-in-Wicket-page-tp15430548p15430548.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-security, everybodyprincipal and only securepages

2008-02-12 Thread Maurice Marrink
If i add an extra method isUserAuthenticated to my
WaspAuthorizationStrategy, then yeah i probably could let wasp handle
everything in the WaspSession class.
I need to know if a user is logged in before i force the session to bind.

Thnx Johan.

Maurice

On Feb 12, 2008 10:13 AM, Johan Compagner <[EMAIL PROTECTED]> wrote:
> About stackoverflow, cant you do that code in attach() of the session?
> (test ofcourse if you want to do it once)
>
>
> On 2/12/08, Michael Sparer <[EMAIL PROTECTED]> wrote:
> >
> > hi maurice,
> >
> > thanks for your answers. The reason why I want to avoid to have two
> > basepages (one implementing ISecurePage) is that if I wanted to change
> > something, such as markup, in the basepage I'd have to change it at two
> > places. Even worse if I extend my extended basepages further, there would
> > always have to be one version that does implement ISecurePage and one that
> > doesn't. So I'd end up adding two pages with the same markup everytime when
> > I'd like to add a page.
> >
> > As you might have noticed my app can't be compared to an app such as an
> > online-banking-app where you have one loginpage and the rest is behind the
> > big door on secure pages. In my application there are some pages that are
> > for registered members only but which do (or at least should) extend the
> > same basepage as a regular page. So I thought I'll sign any visitor in by
> > default, without any roles sothat they're able to access and render any
> > component inside of
> >
> > grant { ... }
> >
> > and then if a user logs in with username and password, I'll give 'em a
> > different role such as user and let them access and render anything inside
> >
> > grant user { ... }
> >
> > makes sense?
> >
> > ah yes, creating a stackoverflow: just call the session.login(LoginContext)
> > method inside the session's constructor (or inside your application's
> > newSession method) and let it return a subject, then line 84 of the
> > logincontainer class calls Session.get() that in turn calls findAndCreate
> > that in turn calls the session's constructor that in turn calls
> > Session.get() ... and so on
> >
> > regards
> > Michael
> >
> >
> > Mr Mean wrote:
> > >
> > >>also the
> > >> first page a user hits after logging in (usually the home page) is a
> > >> candidate.
> > > Sorry this is not correct, usually that page (the home page) is a
> > > secure page to trigger the automatic login.
> > > I was trying to find more examples of pages typically not secure but i
> > > guess besides public pages on your app / site only the login page has
> > > a valid reason to not be secure.
> > >
> > > Maurice
> > >
> > > -
> > > 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/wicket-security%2C-everybodyprincipal-and-only-securepages-tp15413102p15428636.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]



Re: wicket-security, everybodyprincipal and only securepages

2008-02-12 Thread Johan Compagner
About stackoverflow, cant you do that code in attach() of the session?
(test ofcourse if you want to do it once)

On 2/12/08, Michael Sparer <[EMAIL PROTECTED]> wrote:
>
> hi maurice,
>
> thanks for your answers. The reason why I want to avoid to have two
> basepages (one implementing ISecurePage) is that if I wanted to change
> something, such as markup, in the basepage I'd have to change it at two
> places. Even worse if I extend my extended basepages further, there would
> always have to be one version that does implement ISecurePage and one that
> doesn't. So I'd end up adding two pages with the same markup everytime when
> I'd like to add a page.
>
> As you might have noticed my app can't be compared to an app such as an
> online-banking-app where you have one loginpage and the rest is behind the
> big door on secure pages. In my application there are some pages that are
> for registered members only but which do (or at least should) extend the
> same basepage as a regular page. So I thought I'll sign any visitor in by
> default, without any roles sothat they're able to access and render any
> component inside of
>
> grant { ... }
>
> and then if a user logs in with username and password, I'll give 'em a
> different role such as user and let them access and render anything inside
>
> grant user { ... }
>
> makes sense?
>
> ah yes, creating a stackoverflow: just call the session.login(LoginContext)
> method inside the session's constructor (or inside your application's
> newSession method) and let it return a subject, then line 84 of the
> logincontainer class calls Session.get() that in turn calls findAndCreate
> that in turn calls the session's constructor that in turn calls
> Session.get() ... and so on
>
> regards
> Michael
>
>
> Mr Mean wrote:
> >
> >>also the
> >> first page a user hits after logging in (usually the home page) is a
> >> candidate.
> > Sorry this is not correct, usually that page (the home page) is a
> > secure page to trigger the automatic login.
> > I was trying to find more examples of pages typically not secure but i
> > guess besides public pages on your app / site only the login page has
> > a valid reason to not be secure.
> >
> > Maurice
> >
> > -
> > 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/wicket-security%2C-everybodyprincipal-and-only-securepages-tp15413102p15428636.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: wicket-security, everybodyprincipal and only securepages

2008-02-12 Thread Maurice Marrink
On Feb 12, 2008 9:24 AM, Michael Sparer <[EMAIL PROTECTED]> wrote:
>
> hi maurice,
>
> thanks for your answers. The reason why I want to avoid to have two
> basepages (one implementing ISecurePage) is that if I wanted to change
> something, such as markup, in the basepage I'd have to change it at two
> places.

I don't think this is true, consider the following class hierarchy
BasePage extends WebPage (has own markup file, probably containing
wicket:child tag)
MySecurePage extends BasePage implements ISecurePage (has no markup file)
Every other page either extends BasePage or MySecurePage

This way you only need to modify BasePage if you want to make some
layout changes to all your pages

>Even worse if I extend my extended basepages further, there would
> always have to be one version that does implement ISecurePage and one that
> doesn't. So I'd end up adding two pages with the same markup everytime when
> I'd like to add a page.

Maybe i am missing the point but why would you have 2 versions of a
page one secure and the other not.
If you are trying to build a page that contains both secure an
insecure content, you have 2 options
-let your page extend BasePage (as designed above) and place all
content on it (both secure and insecure)
 If you have a lot of content that needs to be secure (in effect
wicket components) you might want to consider grouping it together in
a Panel.
 I'll asume you have a Panel with all you secure content but the same
goes for any type or number of components
 Add a ComponentSecurityCheck (or any check you like) to the component
(using SecureComponentHelper)
 Then add permissions for the secure part to your policy file
 grant org.MyPrincipal "regular user"
 {
  permission ${ComponentPermission} "org.MyPage:mySecureContent",
"inherit, render";
  //the part after the : represents the wicket path to the component
as seen from the page, all components are separated by : so you might
get something like org.MyPage:mypanel:mytextfield
 }
 Because the page itself is not secure it is always rendered, and
because a ComponentSecurityCheck typically does not check for
authentication a guest will always see the page without the secure
content, a logged in user however (with the correct principals) always
sees all content.

-let your page extend MySecurePage (as designed above), like the
previous option you add a check to content you want to secure.
 you add the same permission to your policy file and in addition you
add the page to the general grant block
 grant
 {
  permission ${ComponentPermission} "org.MyPage", "render"; //do not
use inherit here
 }
 This way the user is required to log in but all user will be able to
see the nonsecure content of the page, only users with sufficient
permissions will see the secure content

>
> As you might have noticed my app can't be compared to an app such as an
> online-banking-app where you have one loginpage and the rest is behind the
> big door on secure pages. In my application there are some pages that are
> for registered members only but which do (or at least should) extend the
> same basepage as a regular page.

If you want a site with a public and restricted area, all you have to
do is let the public pages extend BasePage and the restricted pages
MySecurePage as shown above. All you pages will share the same
(single) markup.

> So I thought I'll sign any visitor in by
> default, without any roles sothat they're able to access and render any
> component inside of
>
> grant { ... }
>
> and then if a user logs in with username and password, I'll give 'em a
> different role such as user and let them access and render anything inside
>
> grant user { ... }
>
> makes sense?

Yep i get where you are going but i would not do it by automatically
signing in people as guests.

>
> ah yes, creating a stackoverflow: just call the session.login(LoginContext)
> method inside the session's constructor (or inside your application's
> newSession method) and let it return a subject, then line 84 of the
> logincontainer class calls Session.get() that in turn calls findAndCreate
> that in turn calls the session's constructor that in turn calls
> Session.get() ... and so on

Yeah i found those lines. The thing is i added those lines to support
clustering. And the only way you are going to get there is if your
LoginContext specifies multiple logins are allowed, which is probably
what you are doing after reading your story :)
I'll see if i can come up with an elegant solution for this.
In the mean time, i think i have given you a couple of ideas on how to
proceed without automatically logging someone in.

Let me know if you have any more questions.

Maurice

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



Re: Multiple panels and back button

2008-02-12 Thread Constantin Y

Hi Igor,

The problem with the back button is that if i dont setResponsePage(), after
updating (or removing) a record from the list and pressing the back button,
the system displays the exact previous data entry form with the old values
of each record(!).
If i had made, lets say 10 updates, the system will display all previous 10
forms.
I noticed that the url parameters have a format like
"?wicket:interface=:1:8:::" where the second number changes every time i
save (or remove) a record. If i press the back button then the second count
decrements by 1 and the previous form is displayed with obsolete of course
data. 
What the user expects by pressing the back button is to return to the menu
(or whichever the caller page was) and not to the previous data entry form
which is quite dangerous.
This somehow is achieved by setting setResponsePage() inside the onClick
code.
I am quite sure that it is not wicket's "problem" and maybe i have to setup
the whole page in a different way to achieve the behavior i want but i cant
figure it out.

Thanks again


igor.vaynberg wrote:
> 
> On Feb 8, 2008 7:44 AM, Constantin Y <[EMAIL PROTECTED]> wrote:
>> Everything is ok except the "back" button.
> 
> how is the back button broken exactly?
> 
>> If i dont setResponsePage(..) in
>> the onClick() method of the save button (btnSave) then wicket starts
>> versioning(?) of the data entry form.
> 
> a) you shouldnt call setresponsepage in onclick
> b) wicket will version the page, whats wrong with that?
> 
>> On the other hand i dont want to
>> reconstruct the while page whenever i edit (or remove) a record.
>> What am i missing?
> 
> like i said, not sure what is not working...and whatever you posted
> didnt make it
> 
> -igor
> 
>> Thanks a lot
>>   http://www.nabble.com/file/p15357597/DataPanels.java DataPanels.java
>> --
>> View this message in context:
>> http://www.nabble.com/Multiple-panels-and-back-button-tp15357597p15357597.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/Multiple-panels-and-back-button-tp15357597p15428648.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-security, everybodyprincipal and only securepages

2008-02-12 Thread Michael Sparer

hi maurice, 

thanks for your answers. The reason why I want to avoid to have two
basepages (one implementing ISecurePage) is that if I wanted to change
something, such as markup, in the basepage I'd have to change it at two
places. Even worse if I extend my extended basepages further, there would
always have to be one version that does implement ISecurePage and one that
doesn't. So I'd end up adding two pages with the same markup everytime when
I'd like to add a page.

As you might have noticed my app can't be compared to an app such as an
online-banking-app where you have one loginpage and the rest is behind the
big door on secure pages. In my application there are some pages that are
for registered members only but which do (or at least should) extend the
same basepage as a regular page. So I thought I'll sign any visitor in by
default, without any roles sothat they're able to access and render any
component inside of

grant { ... }

and then if a user logs in with username and password, I'll give 'em a
different role such as user and let them access and render anything inside

grant user { ... }

makes sense?

ah yes, creating a stackoverflow: just call the session.login(LoginContext)
method inside the session's constructor (or inside your application's
newSession method) and let it return a subject, then line 84 of the
logincontainer class calls Session.get() that in turn calls findAndCreate
that in turn calls the session's constructor that in turn calls
Session.get() ... and so on

regards
Michael


Mr Mean wrote:
> 
>>also the
>> first page a user hits after logging in (usually the home page) is a
>> candidate.
> Sorry this is not correct, usually that page (the home page) is a
> secure page to trigger the automatic login.
> I was trying to find more examples of pages typically not secure but i
> guess besides public pages on your app / site only the login page has
> a valid reason to not be secure.
> 
> Maurice
> 
> -
> 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/wicket-security%2C-everybodyprincipal-and-only-securepages-tp15413102p15428636.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: TabbedPanel and model load...

2008-02-12 Thread Martijn Lindhout
ok, so the memento's are not incremental? Then only one memento should be
enough to restore the order back to the state the user created. That sound
good. I'll try that.

thanx

2008/2/11, Scott Swank <[EMAIL PROTECTED]>:
>
> The order has methods createMemento():Memento and applyMemento(Memento
> m).  These are used to get objects that contain state.  They can in
> turn be applied to the order to set it back to that state at a later
> point.  So yes, you fetch the Order, detach it, call applyMemento() if
> you have unsaved work, make additional changes to the order, call
> createMemento(), and then put that in the session.
>
>
> On Feb 11, 2008 11:44 AM, Martijn Lindhout <[EMAIL PROTECTED]>
> wrote:
> > ok. never used memento, so I picked the book and read about it. I'm not
> sure
> > how to implement this. When do I retrieve a memento from the order? And
> in
> > the meantime, while adding and removing lines, is the Order updated and
> > saved in the DB? If someone reads the database, will he see the
> intermediate
> > changes?
> >
> > Or do I for each add/remove/change the user makes:
> > - load the original order,
> > - apply any memento's present in a temp space (session)
> > - apply new changes
> > - create a memento
> > - discard changes to DB
> >
> >
> > 2008/2/11, Scott Swank <[EMAIL PROTECTED]>:
> > >
> > > The order has one or more order mementos (pre/post editing) and each
> > > order memento has a collection of orderline mementos.  The mementos
> > > are completely opaque, and only the Order & OrderLine are able to
> > > inspect them and extract their content -- perhaps by implementing them
> > > a static inner classes with private mutators.
> > >
> > > On Feb 11, 2008 10:36 AM, Martijn Lindhout <[EMAIL PROTECTED]>
> > > wrote:
> > > > sounds interesting. Can you explain a bit more? How does this work
> for
> > > > example in an Order-OrderLine situation where you edit an existing
> order
> > > by
> > > > adding and removing orderlines and finally do a commit or rollback?
> > > >
> > > > 2008/2/11, Scott Swank <[EMAIL PROTECTED]>:
> > > >
> > > > >
> > > > > I suggest using the GoF memento pattern here.  You keep your
> changes
> > > > > in one or more mementos, which can be kept in the session.  Then
> you
> > > > > push the changes back to the domain model when you are happy with
> > > > > them.  We use this approach for modifying hotel reservations --
> > > > > particularly because we need to see the price before the change as
> > > > > well as with the change to generate e-mails, faxes, etc.
> > > > >
> > > > >
> > > > > On Feb 11, 2008 10:06 AM, Martijn Lindhout <
> [EMAIL PROTECTED]>
> > > > > wrote:
> > > > > > I agree that it is *easier*, but I got bored by duplicating my
> > > domain
> > > > > model
> > > > > > in a DTO like structure. And that's cumbersome.
> > > > > > I saw this hapening in several projects, and in the end we had
> two
> > > > > almost
> > > > > > equals object structures, one with rich behavior, and one with
> just
> > > data
> > > > > and
> > > > > > structure.
> > > > > >
> > > > > > that's sad or not?
> > > > > >
> > > > > >
> > > > > > 2008/2/11, Igor Vaynberg <[EMAIL PROTECTED]>:
> > > > > > >
> > > > > > > well, you will have to disconnect the hibernate session, and
> store
> > > it
> > > > > > > in the http session - or some other place. then your model
> would
> > > have
> > > > > > > to reconnect the session and pull the entity out of it. its
> much
> > > > > > > easier to create a bean imho.
> > > > > > >
> > > > > > > -igor
> > > > > > >
> > > > > > >
> > > > > > > On Feb 11, 2008 12:13 AM, Martijn Lindhout <
> > > [EMAIL PROTECTED]>
> > > > > > > wrote:
> > > > > > > > because I use the domain objects directly,. without any
> DTO's, I
> > > > > have to
> > > > > > > use
> > > > > > > > the long conversation pattern. That means I have to store
> the
> > > domain
> > > > > > > object
> > > > > > > > somewhere in the session and let the loadabledetachable
> model
> > > > > retrieve
> > > > > > > it
> > > > > > > > from there?
> > > > > > > >
> > > > > > > > 2008/2/11, Igor Vaynberg <[EMAIL PROTECTED]>:
> > > > > > > >
> > > > > > > > >
> > > > > > > > > then you have to use a bean, and on confirm apply changes
> from
> > > the
> > > > > > > > > bean to the persistent entity. the only other alternative
> i
> > > know
> > > > > of is
> > > > > > > > > to use the long conversation pattern which i am not really
> a
> > > fan
> > > > > of.
> > > > > > > > >
> > > > > > > > > -igor
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On Feb 10, 2008 11:25 PM, Martijn Lindhout <
> > > > > [EMAIL PROTECTED]>
> > > > > > > > > wrote:
> > > > > > > > > > ok, that makes sense.
> > > > > > > > > >
> > > > > > > > > > But what if I have a Hibernate persisted entity that I
> want
> > > to
> > > > > edit
> > > > > > > in
> > > > > > > > > > multiple actions? Say I have an order with orderlines,
> and I
> > > > > want to
> > > > > > > add
> > > > > > > > > and
> > > 

Hook into RequestCycle ?

2008-02-12 Thread Roland Huss

Hi,

what is the best place to hook into the request cycle 
before a page gets processed ? I looked through 
http://cwiki.apache.org/WICKET/lifecycle-of-a-wicket-application.html but
the 
information there seems to be a bit outdated ("the Session returned by the
Application 
is asked  to create a RequestCycle object using the Session's request cycle
factory", 
but there's nothing like a request cycle factory which can be obtained from
a Session in 1.3)

Is there a more accurate documentation of a request's lifecycle somewhere
else ? 

My use case is as follows: Before any page is processed I want to look up in
the Session,
whether a user is authenticated. If not, it is checked wheter a certain hash
stored in a Cookie 
(if any) is stored in the DB and the associated user then is put into the
session, providing some sort 
of 'keep me logged in' functionality. (The 'remember me' feature of the
SignInPanel is not enough for
me, since I want a transparent login without moving over the login page). Of
course, if there is already
support for this kind of feature out of the box somewhere, I would be happy
for getting a pointer, too.

thanx ...

... roland
-- 
View this message in context: 
http://www.nabble.com/Hook-into-RequestCycle---tp15428634p15428634.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]