Re: Only the first TextField in a repetition gets correct OnChangeAjaxBehavior with 1.5.1

2011-12-16 Thread Anders Peterson

Hello again, I still have this problem... (been working on other things)

I've tracked the problem back to the request parameters simply not containing 
the expected values.


This input name seems correct since I changed the market weight attribute of 
the second instrument:

instruments:1:marketWeight

But the HashMap containing parameter values ONLY contain this:
{instruments:0:marketWeight=[17.602]}

This results in me getting null as FormComponent input.

Anyone know what I've done wrong?

/Anders


On 2011-10-13 13:46, Anders Peterson wrote:

Here the (simplified) code that creates the ListViev, TextFields and Label. 
/Anders






On 13 okt 2011, at 12:40, Anders Peterson wrote:


Hi,

Upgrading to wicket 1.5.1 from 1.4.18 my ajax updates stopped working.

I have a page with a form. Inside the form there is a repetition (ListView) 
that among other things creates a text field for each item (ListItem). Each of 
those text fields has an OnChangeAjaxBehavior set that should update a label. 
The label should continously display the total sum of the numbers in the text 
fields.

With wicket 1.4.18 (and previous versions) this worked fine.

With 1.5.1 only the first text field in the repetition gets the correct ajax behavior - 
it works the way I want it, and the way it worked with 1.4.*. The other text fields are 
dead, except for focus set/removed. While typing in any of the other text 
fields nothing is updated (the ajax debug window shows no activity). When focus is 
removed I get a NullPointerException regardless of what I've changed.

Is this a (known) bug, or is there a difference between 1.4 and 1.5 that I've 
missed?

/Anders






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




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



Solved: Only the first TextField in a repetition gets correct OnChangeAjaxBehavior with 1.5.1

2011-12-16 Thread Anders Peterson

The problem was in the html file.

I used to have this:

input name=marketWeight type=text id=marketWeight size=6 maxlength=6 
wicket:id=marketWeight /


Needed to change that to:

input type=text size=6 maxlength=6 wicket:id=marketWeight /


marketWeight is the component with the ajax behaviour, and it was in a 
ListView so I had several of them.



I guess something related to replacing the name/id of a component changed from 
1.4 to 1.5.



/Anders


On 2011-12-16 14:15, Anders Peterson wrote:

Hello again, I still have this problem... (been working on other things)

I've tracked the problem back to the request parameters simply not containing 
the expected values.


This input name seems correct since I changed the market weight attribute of 
the second instrument:

instruments:1:marketWeight

But the HashMap containing parameter values ONLY contain this:
{instruments:0:marketWeight=[17.602]}

This results in me getting null as FormComponent input.

Anyone know what I've done wrong?

/Anders


On 2011-10-13 13:46, Anders Peterson wrote:
Here the (simplified) code that creates the ListViev, TextFields and Label. 
/Anders







On 13 okt 2011, at 12:40, Anders Peterson wrote:


Hi,

Upgrading to wicket 1.5.1 from 1.4.18 my ajax updates stopped working.

I have a page with a form. Inside the form there is a repetition (ListView) 
that among other things creates a text field for each item (ListItem). Each 
of those text fields has an OnChangeAjaxBehavior set that should update a 
label. The label should continously display the total sum of the numbers in 
the text fields.


With wicket 1.4.18 (and previous versions) this worked fine.

With 1.5.1 only the first text field in the repetition gets the correct ajax 
behavior - it works the way I want it, and the way it worked with 1.4.*. The 
other text fields are dead, except for focus set/removed. While typing in 
any of the other text fields nothing is updated (the ajax debug window shows 
no activity). When focus is removed I get a NullPointerException regardless 
of what I've changed.


Is this a (known) bug, or is there a difference between 1.4 and 1.5 that 
I've missed?


/Anders






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




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






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



Only the first TextField in a repetition gets correct OnChangeAjaxBehavior with 1.5.1

2011-10-13 Thread Anders Peterson
Hi,

Upgrading to wicket 1.5.1 from 1.4.18 my ajax updates stopped working.

I have a page with a form. Inside the form there is a repetition (ListView) 
that among other things creates a text field for each item (ListItem). Each of 
those text fields has an OnChangeAjaxBehavior set that should update a label. 
The label should continously display the total sum of the numbers in the text 
fields.

With wicket 1.4.18 (and previous versions) this worked fine.

With 1.5.1 only the first text field in the repetition gets the correct ajax 
behavior - it works the way I want it, and the way it worked with 1.4.*. The 
other text fields are dead, except for focus set/removed. While typing in any 
of the other text fields nothing is updated (the ajax debug window shows no 
activity). When focus is removed I get a NullPointerException regardless of 
what I've changed.

Is this a (known) bug, or is there a difference between 1.4 and 1.5 that I've 
missed?

/Anders



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



Re: Only the first TextField in a repetition gets correct OnChangeAjaxBehavior with 1.5.1

2011-10-13 Thread Anders Peterson
Here the (simplified) code that creates the ListViev, TextFields and Label. 
/Anders

final MyPageForm tmpForm = new MyPageForm(ID.FORM);
this.add(tmpForm);

final ContextLabelNumber tmpTotalWeightsLabel = new 
ContextLabelNumber(ID.TOTAL_WEIGHTS, new 
PropertyModelNumber(this.getPortfolio(), ID.TOTAL_WEIGHTS), 
StandardType.PERCENT);
tmpTotalWeightsLabel.setOutputMarkupId(true);

final ListViewBLMarketInstrument tmpMarketInstrumentListView = new 
ListViewBLMarketInstrument(ID.INSTRUMENTS, 
this.getPortfolio().getMarketInstruments()) {

@Override
public void populateItem(final ListItemBLMarketInstrument 
aListItem) {
final BLMarketInstrument tmpMarketInstrument = 
aListItem.getModelObject();
final ContextTextFieldNumber tmpMarketWeightTextField = new 
ContextTextFieldNumber(ID.MARKET_WEIGHT, tmpMarketInstrument, 
StandardType.PERCENT);
aListItem.add(tmpMarketWeightTextField);
tmpMarketWeightTextField.add(new OnChangeAjaxBehavior() {
@Override
protected void onUpdate(final AjaxRequestTarget someTarget) 
{
someTarget.add(tmpTotalWeightsLabel);
}
});
}
};
tmpMarketInstrumentListView.setReuseItems(true);


tmpForm.add(tmpMarketInstrumentListView);
tmpForm.add(tmpTotalWeightsLabel);




On 13 okt 2011, at 12:40, Anders Peterson wrote:

 Hi,
 
 Upgrading to wicket 1.5.1 from 1.4.18 my ajax updates stopped working.
 
 I have a page with a form. Inside the form there is a repetition (ListView) 
 that among other things creates a text field for each item (ListItem). Each 
 of those text fields has an OnChangeAjaxBehavior set that should update a 
 label. The label should continously display the total sum of the numbers in 
 the text fields.
 
 With wicket 1.4.18 (and previous versions) this worked fine.
 
 With 1.5.1 only the first text field in the repetition gets the correct ajax 
 behavior - it works the way I want it, and the way it worked with 1.4.*. The 
 other text fields are dead, except for focus set/removed. While typing in 
 any of the other text fields nothing is updated (the ajax debug window shows 
 no activity). When focus is removed I get a NullPointerException regardless 
 of what I've changed.
 
 Is this a (known) bug, or is there a difference between 1.4 and 1.5 that I've 
 missed?
 
 /Anders
 
 



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

org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = login]]

2009-05-11 Thread Anders Peterson

What exactly does this stacktrace (below) mean?

In development, eclipse  jetty, the application works fine. When  
deployed (tomcat) the app cannot render login page (I suppose it can't  
render anything).


/Anders

WicketMessage: Exception in rendering component: [MarkupContainer  
[Component id = login]]


Root cause:

java.security.AccessControlException: access denied  
(java.lang.reflect.ReflectPermission suppressAccessChecks)
at  
java 
.security 
.AccessControlContext.checkPermission(AccessControlContext.java:342)
at  
java.security.AccessController.checkPermission(AccessController.java: 
553)

at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at  
java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java: 
125)
at org.apache.wicket.util.lang.PropertyResolver 
$MethodGetAndSet.init(PropertyResolver.java:1044)
at  
org 
.apache 
.wicket 
.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:459)
at  
org 
.apache 
.wicket 
.util 
.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:281)
at  
org 
.apache 
.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:90)
at  
org 
.apache 
.wicket 
.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:117)
at org.apache.wicket.Component.getDefaultModelObject(Component.java: 
1653)
at  
org 
.apache.wicket.Component.getDefaultModelObjectAsString(Component.java: 
1675)
at  
org 
.apache 
.wicket 
.markup.html.form.FormComponent.getModelValue(FormComponent.java:1367)
at  
org 
.apache 
.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:869)
at  
org 
.apache 
.wicket.markup.html.form.TextField.onComponentTag(TextField.java:106)

at org.apache.wicket.Component.renderComponent(Component.java:2600)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1525)
at org.apache.wicket.Component.render(Component.java:2454)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java: 
1403)
at  
org 
.apache 
.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java: 
1590)
at  
org 
.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java: 
1514)
at  
org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java: 
1897)

at org.apache.wicket.Component.renderComponent(Component.java:2629)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1525)
at org.apache.wicket.markup.html.form.Form.onRender(Form.java:1968)
at org.apache.wicket.Component.render(Component.java:2454)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java: 
1403)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java: 
1541)

at org.apache.wicket.Page.onRender(Page.java:1547)
at org.apache.wicket.Component.render(Component.java:2454)
at org.apache.wicket.Page.renderPage(Page.java:914)
at  
org 
.apache 
.wicket 
.request 
.target 
.component 
.BookmarkablePageRequestTarget 
.respond(BookmarkablePageRequestTarget.java:262)
at  
org 
.apache 
.wicket 
.request 
.AbstractRequestCycleProcessor 
.respond(AbstractRequestCycleProcessor.java:105)
at  
org 
.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java: 
1248)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1319)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1418)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:544)
at  
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java: 
456)
at  
org 
.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java: 
289)

at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java: 
244)

at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:537)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java: 
276)
at  
org 
.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java: 
218)
at  
org 
.apache 
.catalina 
.core 
.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 
230)
at org.apache.catalina.core.ApplicationFilterChain.access 
$000(ApplicationFilterChain.java:56)
at org.apache.catalina.core.ApplicationFilterChain 
$1.run(ApplicationFilterChain.java:189)

at java.security.AccessController.doPrivileged(Native Method)
at  
org 
.apache 
.catalina 
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
at  
org 
.apache 
.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 
233)
at  
org 
.apache 
.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 
191)
at  
org 
.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: 
128)
at  
org 
.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 
102)
at  
org 
.apache 
.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at  
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 
286)
at  

Re: org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = login]]

2009-05-11 Thread Anders Peterson

Thank you, it was the security manager.

On Ubuntu Server it is turned on as a default. I turned it off by  
editing the file /etc/default/tomcat6. Set TOMCAT6_SECURITY=no.


/Anders

On 11 maj 2009, at 10.24, Anders Peterson wrote:


What exactly does this stacktrace (below) mean?

In development, eclipse  jetty, the application works fine. When  
deployed (tomcat) the app cannot render login page (I suppose it  
can't render anything).


/Anders

WicketMessage: Exception in rendering component: [MarkupContainer  
[Component id = login]]


Root cause:

java.security.AccessControlException: access denied  
(java.lang.reflect.ReflectPermission suppressAccessChecks)
at  
java 
.security 
.AccessControlContext.checkPermission(AccessControlContext.java:342)
at  
java.security.AccessController.checkPermission(AccessController.java: 
553)

at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at  
java 
.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java: 
125)
at org.apache.wicket.util.lang.PropertyResolver 
$MethodGetAndSet.init(PropertyResolver.java:1044)
at  
org 
.apache 
.wicket 
.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:459)
at  
org 
.apache 
.wicket 
.util 
.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java: 
281)
at  
org 
.apache 
.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:90)
at  
org 
.apache 
.wicket 
.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:117)
at org.apache.wicket.Component.getDefaultModelObject(Component.java: 
1653)
at  
org 
.apache 
.wicket.Component.getDefaultModelObjectAsString(Component.java:1675)
at  
org 
.apache 
.wicket 
.markup.html.form.FormComponent.getModelValue(FormComponent.java:1367)
at  
org 
.apache 
.wicket.markup.html.form.FormComponent.getValue(FormComponent.java: 
869)
at  
org 
.apache 
.wicket.markup.html.form.TextField.onComponentTag(TextField.java:106)

at org.apache.wicket.Component.renderComponent(Component.java:2600)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java: 
1525)

at org.apache.wicket.Component.render(Component.java:2454)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java: 
1403)
at  
org 
.apache 
.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java: 
1590)
at  
org 
.apache 
.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1514)
at  
org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java: 
1897)

at org.apache.wicket.Component.renderComponent(Component.java:2629)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java: 
1525)

at org.apache.wicket.markup.html.form.Form.onRender(Form.java:1968)
at org.apache.wicket.Component.render(Component.java:2454)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java: 
1403)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java: 
1541)

at org.apache.wicket.Page.onRender(Page.java:1547)
at org.apache.wicket.Component.render(Component.java:2454)
at org.apache.wicket.Page.renderPage(Page.java:914)
at  
org 
.apache 
.wicket 
.request 
.target 
.component 
.BookmarkablePageRequestTarget 
.respond(BookmarkablePageRequestTarget.java:262)
at  
org 
.apache 
.wicket 
.request 
.AbstractRequestCycleProcessor 
.respond(AbstractRequestCycleProcessor.java:105)
at  
org 
.apache 
.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1248)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1319)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1418)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:544)
at  
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java: 
456)
at  
org 
.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java: 
289)

at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java: 
244)

at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:537)
at  
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java: 
276)
at  
org 
.apache 
.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:218)
at  
org 
.apache 
.catalina 
.core 
.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 
230)
at org.apache.catalina.core.ApplicationFilterChain.access 
$000(ApplicationFilterChain.java:56)
at org.apache.catalina.core.ApplicationFilterChain 
$1.run(ApplicationFilterChain.java:189)

at java.security.AccessController.doPrivileged(Native Method)
at  
org 
.apache 
.catalina 
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
at  
org 
.apache 
.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 
233)
at  
org 
.apache 
.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 
191)
at  
org 
.apache 
.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at  
org 
.apache

Re: setOutputMarkupId and Ajax

2008-10-04 Thread Anders Peterson
Why can't all components always output that id? Or can't it be a global 
option to turn it on/off for all components? Is there some situation 
where you do not want that id? /Anders


Igor Vaynberg wrote:

like which ones?

-igor

On Fri, Oct 3, 2008 at 12:44 PM, Rob Sonke [EMAIL PROTECTED] wrote:

I understand that but why not adding it by default to the constructor of all
ajax components?

Rob


Igor Vaynberg wrote:

wicket only knows that the component needs it when you add it to the
ajax request target. by the time you add it to the ART the component
has already been rendered into the browser during the previous
request, and so its too late at this point - all we can do is warn
you.

-igor

On Fri, Oct 3, 2008 at 11:01 AM, Mathias P.W Nilsson
[EMAIL PROTECTED] wrote:


Hi!

I don't know if this has already been answered but here it goes.

When use Ajax with wicket you have to set the the component to output
it's
markup id or else wicket framework complains about not having it set. Now
Why isn't the components markup set automatically
when wicket knows about it? Why not skip this, for ajax anyway. If you
want
to do some other javascript the output it but otherwise wicket could take
care of it or maybe I'm missing something.

// Mathias
--
View this message in context:
http://www.nabble.com/setOutputMarkupId-and-Ajax-tp19802839p19802839.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]





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



Re: OnChangeAjaxBehavior in ListView

2008-10-04 Thread Anders Peterson

Just browsed through my new copy of Wicket in Action. There are
warnings to use Wicket/Ajax with tables and ListView - I have both.

However the discussed problems seems to be mainly related to refreshing. 
My problem is that several component models get updated when only one 
'TextField' was edited; therefore the refreshed components gets an 
incorrect value. When/if I submit the form the usual (non ajax) way 
everything is corrected.


/Anders

Anders Peterson wrote:

Here the code, html and Java fragments, for the tr. /Anders

Timo Rantalaiho wrote:

On Mon, 29 Sep 2008, Anders Peterson wrote:
  
I'm using OnChangeAjaxBehavior with a TextField. The TextField is in a 
table cell that is repeated using a ListView. When I change the value of 
one of the TextFields more than one of the underlying models get updated 
- the one that was supposed to be updated and all following in the list. 
If I modify the first TextField then all underlying models get the same 
value. If I modify the second then all except the first...



Hello,

It sounds like all your TextFields models would be connected
to each other. Show us the code and we'll see.

Best wishes,
Timo





-
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: OnChangeAjaxBehavior in ListView

2008-09-30 Thread Anders Peterson

Here the code, html and Java fragments, for the tr. /Anders

Timo Rantalaiho wrote:

On Mon, 29 Sep 2008, Anders Peterson wrote:
  
I'm using OnChangeAjaxBehavior with a TextField. The TextField is in a 
table cell that is repeated using a ListView. When I change the value of 
one of the TextFields more than one of the underlying models get updated 
- the one that was supposed to be updated and all following in the list. 
If I modify the first TextField then all underlying models get the same 
value. If I modify the second then all except the first...



Hello,

It sounds like all your TextFields models would be connected
to each other. Show us the code and we'll see.

Best wishes,
Timo


ListViewBLView tmpViews = new ListViewBLView(ID.VIEWS, 
this.getPortfolio().getViews()) {

@Override
public void populateItem(ListItemBLView aViewsListItem) {

final BLView tmpView = aViewsListItem.getModelObject();

final ContextLabelNumber tmpTotalWeightLabel = new 
ContextLabelNumber(ID.TOTAL_WEIGHTS, new PropertyModelNumber(tmpView, 
ID.TOTAL_WEIGHTS), StandardType.PERCENT);
tmpTotalWeightLabel.setOutputMarkupId(true);

aViewsListItem.add(new TextFieldString(ID.NAME, new 
PropertyModelString(tmpView, ID.NAME)));
aViewsListItem.add(new DeleteView(ID.DELETE, new 
ModelBLView(tmpView)));
LoadableDetachableModelNumber tmpMarketReturnModel = new 
LoadableDetachableModelNumber() {

@Override
protected BigDecimal load() {
return 
myPage.getBlackLittermanModel().calculatePortfolioReturn(tmpView.getWeightList());
}
};
aViewsListItem.add(new 
ContextLabelNumber(ID.PORTFOLIO_RETURN, tmpMarketReturnModel, 
StandardType.PERCENT));
aViewsListItem.add(new ContextTextFieldNumber(ID.RETURN, new 
PropertyModelNumber(tmpView, ID.RETURN), StandardType.PERCENT));

ListViewViewWeight tmpViewWeightTextFields = new 
ListViewViewWeight(ID.WEIGHTS, tmpView.getViewWeights()) {

@Override
protected void populateItem(ListItemViewWeight 
aViewWeightsListItem) {

final ViewWeight tmpViewWeight = 
aViewWeightsListItem.getModelObject();

ContextTextFieldNumber tmpWeightTextField = new 
ContextTextFieldNumber(ID.WEIGHT, new PropertyModelNumber(tmpViewWeight, 
ID.WEIGHT), StandardType.PERCENT);
aViewWeightsListItem.add(tmpWeightTextField);
tmpWeightTextField.add(new OnChangeAjaxBehavior() {

@Override
protected void onUpdate(AjaxRequestTarget 
aWeightTextFieldChangeTarget) {
System.out.println(AJAX!);
System.out.println(THIS ViewWeight:  + 
tmpViewWeight);
for (ViewWeight tmpVW : 
tmpViewWeight.getView().getViewWeights()) {
System.out.println(LOOP ALL ViewWeights:  
+ tmpVW);
}
System.out.println();

aWeightTextFieldChangeTarget.addComponent(tmpTotalWeightLabel);
}
});
}
};

aViewsListItem.add(tmpViewWeightTextFields);
aViewsListItem.add(tmpTotalWeightLabel);
};
};
tr wicket:id=views
  td scope=colinput name=name type=text id=name size=16 
wicket:id=name //td
  td scope=cola wicket:id=delete 
href=/se/optimatika/blapp/gui/PgInputViews.htmlimg src=images/minus.gif 
alt=Delete View width=14 height=14 hspace=1 vspace=3 border=0 
//a/td
  td scope=coldiv align=rightspan 
wicket:id=portfolioReturn1.2%/span/div/td
  td scope=coldiv align=center
  div align=right
input name=return type=text id=return size=8 
wicket:id=return /
  /div
/div/td
  th scope=col@/th
  td wicket:id=weights scope=coldiv align=right
  input name=weight type=text id=weight size=7 maxlength=8 
wicket:id=weight /
/div/td
  th scope=col=/th
  td scope=coldiv align=rightspan 
wicket:id=totalWeights100.00%/span/div/td
/tr-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

OnChangeAjaxBehavior in ListView

2008-09-29 Thread Anders Peterson

Hi,

I'm using OnChangeAjaxBehavior with a TextField. The TextField is in a 
table cell that is repeated using a ListView. When I change the value of 
one of the TextFields more than one of the underlying models get updated 
- the one that was supposed to be updated and all following in the list. 
If I modify the first TextField then all underlying models get the same 
value. If I modify the second then all except the first...


Anyone else seen this?

Wicket 1.4M3

/Anders

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



Problem with DropDownChoice on 1.4M3

2008-09-17 Thread Anders Peterson
My DropDownChoice always displays as if nothing is selected. Using it 
works fine, but every time the page is (re)loaded the selection is reset.


wantOnSelectionChangedNotifications return true.

I have an older version of my app deployed (using an older version of 
Wicket) that works as expected.


Is this a known problem or could I be doing something wrong?

/Anders


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



Re: Problem with DropDownChoice on 1.4M3

2008-09-17 Thread Anders Peterson

This is the code that creates the DropDownChoice:

myForm.add(new DropDownChoiceBLView(views, 
this.getPortfolio().getViews(), new 
ChoiceRendererBLView(toDisplayString)) {


@Override
protected void onSelectionChanged(BLView newSelection) {

super.onSelectionChanged(newSelection);

...;
}

@Override
protected boolean wantOnSelectionChangedNotifications() {
return true;
}

});


Nothing strange... /Anders


Daan van Etten wrote:

On 17 sep 2008, at 14:55, Anders Peterson wrote:

My DropDownChoice always displays as if nothing is selected. Using it 
works fine, but every time the page is (re)loaded the selection is reset.


wantOnSelectionChangedNotifications return true.

I have an older version of my app deployed (using an older version of 
Wicket) that works as expected.


Is this a known problem or could I be doing something wrong?


You could be doing something wrong. Do you set the model of the 
DropDownChoice?

Show us some code.

Regards,

Daan

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



SOLVED Re: Problem with DropDownChoice on 1.4M3

2008-09-17 Thread Anders Peterson
Isn't it always like this; as soon as you ask someone you start thinking 
about the problem differently. Or should I say you start thinking 
straight. The problem was, of course, with the equals-method of the 
listed objects (two instances of that class would never be equal).


Thanks for being there! /Anders

Anders Peterson wrote:

This is the code that creates the DropDownChoice:

myForm.add(new DropDownChoiceBLView(views, 
this.getPortfolio().getViews(), new 
ChoiceRendererBLView(toDisplayString)) {


@Override
protected void onSelectionChanged(BLView newSelection) {

super.onSelectionChanged(newSelection);

...;
}

@Override
protected boolean wantOnSelectionChangedNotifications() {
return true;
}

});


Nothing strange... /Anders


Daan van Etten wrote:

On 17 sep 2008, at 14:55, Anders Peterson wrote:

My DropDownChoice always displays as if nothing is selected. Using it 
works fine, but every time the page is (re)loaded the selection is 
reset.


wantOnSelectionChangedNotifications return true.

I have an older version of my app deployed (using an older version of 
Wicket) that works as expected.


Is this a known problem or could I be doing something wrong?


You could be doing something wrong. Do you set the model of the 
DropDownChoice?

Show us some code.

Regards,

Daan

-
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 1.4M3 migration

2008-07-23 Thread Anders Peterson
I used M2 and had no problem with it. When I heard talk about 
decoupling the components and the models, for M3, I thought that 
seemed a good idea.


Now I use M3. It works fine, but I think generics for components is 
implemented upside down. I think M3 should have been M2 with generics 
turned off where it wasn't needed.


/Anders


Ned Collyer wrote:

I've just converted over a project to 1.4-m3 from m1.  I skipped m2
because of the drastic changes between 1, 2 and 3.

I must say, I think generics at a component level - when I initially started
using it felt like unneeded overhead - but it became more and more useful.

now that I've changed to 1.4-m3 - Many parts of the project start to feel
like unneeded cast soup - even if it is just reimplementing getModel or
getModelObject over and over.

It's a change that I found a bit hard to visualise the impact until I made
the switch.

I must say m1 generics felt more powerful and appropriate for all the
circumstances i've come across... with the exception of having to generify
things like Label.

Anyway, 


Thats my feedback after the switch.



Timo Rantalaiho wrote:

On Fri, 18 Jul 2008, Stefan Lindner wrote:

Thank you all for your work on wicket! Maybe we can see Wicket 1.4.0
final in the near future?

Thanks for the feedback and the thanks!

There are still 30+ open issues for 1.4

 
https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=truepid=12310561fixfor=12313295resolution=-1sorter/field=issuekeysorter/order=DESC


and besides those, probably many places where raw versions 
of generic types are used and which should be fixed. So I 
wouldn't hold my breath :)


Best wishes,
Timo

--
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 


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



Just switched to 1.4-M3

2008-07-18 Thread Anders Peterson

Hi,

I've not been able to follow the discussion on generics (simply too 
much) but now that I've switched to 1.4-M3 I have a comment/question.


Generally I think wicket is going in the right direction regarding 
generics...


Another (great) web application framework that I've used doesn't have 
component at the root of the inheritance tree, but element - 
component extends element. The elements are the UI atoms, and 
components are complete or partial pages.


I think elements should be generified, but not components.

As it is now Component is not generified, but further down you introduce 
generics to some components that you feel benefit from it. I think you 
should do it the other way around. Have a root - Element - that is 
generified, and then have a Component class where you fix the type 
parameter to something suitable.


To me the elements - the basic building blocks -  are closely related to 
their models and converters, but complete or partial pages are not.



1) I think Label should be generified the way TextField is. (It would be 
if they both inherited from Element.)


2) I think think the Model and Converter of TextField should be 
generified with the same type parameter as TextField itself - the way it 
was in M2. (This could be defined in Element.)



/Anders


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



Re: Just switched to 1.4-M3

2008-07-18 Thread Anders Peterson

Sorry... I guess generics design has been discussed enough. /Anders


Igor Vaynberg wrote:

On Fri, Jul 18, 2008 at 4:52 AM, Anders Peterson wrote:

As it is now Component is not generified, but further down you introduce
generics to some components that you feel benefit from it. I think you
should do it the other way around. Have a root - Element - that is
generified, and then have a Component class where you fix the type parameter
to something suitable.

To me the elements - the basic building blocks -  are closely related to
their models and converters, but complete or partial pages are not.



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



Re: users, please give us your opinion: what is your take on generics with Wicket

2008-06-03 Thread Anders Peterson

Eelco Hillenius wrote:


1) Generifying* Wicket
   [x] Can best be done like currently in the 1.4 branch, where models
   [x] Can best be done in a limited fashion, where we only generify


Both are acceptable to me



2) How strongly do you feel about your choice above?
   [x] I definitively won't be using 1.4. if Wicket doesn't go for my


Not sure about definitely, but if IModel isn't generified I'll 
evaluate other frameworks for my next project.



/Anders

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



OutOfMemoryError when deploying (only)

2008-04-14 Thread Anders Peterson

Hi,

I've got a problem when deploying my wicket application. I deploy to 
Tomcat 5.5 on Linux.


The problem is that I get an OutOfMemoryError when viewing one 
particular page. I can go straight from starting Tomcat to accessing 
that page and get the error - there is no history. That kind of 
behavior would suggest that you've done something seriously/obviously 
wrong. But, when I run/debug the application in eclipse it behaves 
perfectly normal.


How can I get info from Tomcat regarding what's happening?


/Anders


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



Re: OutOfMemoryError when deploying (only)

2008-04-14 Thread Anders Peterson

Problem seems to be fixed...

I was building/deploying my application using wicket 1.3.3. Tomcat on 
the deployment server had wicket-examples-1.3.0 installed. When I 
removed that the problem disappeared.


/Anders

Anders Peterson wrote:

Hi,

I've got a problem when deploying my wicket application. I deploy to 
Tomcat 5.5 on Linux.


The problem is that I get an OutOfMemoryError when viewing one 
particular page. I can go straight from starting Tomcat to accessing 
that page and get the error - there is no history. That kind of 
behavior would suggest that you've done something seriously/obviously 
wrong. But, when I run/debug the application in eclipse it behaves 
perfectly normal.


How can I get info from Tomcat regarding what's happening?


/Anders



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



Re: [announce] Wicket 1.3 has been branched, trunk is now 1.4

2008-04-09 Thread Anders Peterson

How far away is wicket with generics? /Anders

Martijn Dashorst wrote:

If you are depending on trunk and build your own Wicket versions,
please note that trunk is now Wicket 1.4 and will be used for the next
Wicket version.

If you wish to continue building 1.3 jars then switch your local checkout to:

svn switch https://svn.apache.org/repos/asf/wicket/branches/wicket-1.3.x

Martijn

-
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: Strange Exception

2008-02-27 Thread Anders Peterson

That wasn't it. Just happened again... /Anders

Anders Peterson wrote:

No (don't know what it is).

I think maybe this problem was caused by the RunJettyRun plugin 
picking up my wicket-1.3.0 jars that I had forgotten to delete from my 
project. I did not reference those jars, but the files where still in 
my project directory.


I did some general update all plugins and project cleaning. Then the 
problem disappeared. There wasn't much to clean, but I did have that 
older version of wicket still in the project directory. (Must have had 
it there since 1.3.1 was released.)


/Anders

Igor Vaynberg wrote:

are you using class reloading filter?

-igor




On Sun, Feb 24, 2008 at 7:57 AM, Anders Peterson 
[EMAIL PROTECTED] wrote:

Hi,

 I (sometimes) get a strange Exception. You can see the stacktrace 
in the

 attached file.

 The problem appears (sometimes) when I submit a form. Just displaying
 data/pages is never a problem.

 At first glance it seems I get a ClassCastException when doing

 public static BLAppSession getCurrent() {
 return (BLAppSession) Session.get();
 }

 Debugging the code I cannot see anything (obviously) wrong with my
 Session subclass. Something else must be the actual problem. What does
 this mean:

 SEVERE: there was an error cleaning up target
 [EMAIL PROTECTED] 


 class = se.optimatika.blapp.gui.PgEvaluateResults, id = 4, version =
 0]-image2-IResourceListener.


 Use Wicket 1.3.1.

 /Anders

Feb 24, 2008 3:54:00 PM sun.reflect.NativeMethodAccessorImpl invoke0
 INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) 
via org.mortbay.log.Slf4jLog

 Feb 24, 2008 3:54:00 PM sun.reflect.NativeMethodAccessorImpl invoke0
 INFO: jetty-6.1.6
 Feb 24, 2008 3:54:01 PM org.apache.wicket.Application callInitializers
 INFO: [BLApp] init: Wicket core library initializer
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IBehaviorListener, method=public abstract void 
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IBehaviorListener, method=public abstract void 
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IFormSubmitListener, method=public abstract void 
org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] 

 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IFormSubmitListener, method=public abstract void 
org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] 

 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=ILinkListener, method=public abstract void 
org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=ILinkListener, method=public abstract void 
org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IOnChangeListener, method=public abstract void 
org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()] 

 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IOnChangeListener, method=public abstract void 
org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()] 

 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IRedirectListener, method=public abstract void 
org.apache.wicket.IRedirectListener.onRedirect()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IRedirectListener, method=public abstract void 
org.apache.wicket.IRedirectListener.onRedirect()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IResourceListener, method=public abstract void 
org.apache.wicket.IResourceListener.onResourceRequested()]
 Feb 24, 2008 3:54:01 PM

Re: Strange Exception

2008-02-27 Thread Anders Peterson

No (don't know what it is).

I think maybe this problem was caused by the RunJettyRun plugin picking 
up my wicket-1.3.0 jars that I had forgotten to delete from my project. 
I did not reference those jars, but the files where still in my project 
directory.


I did some general update all plugins and project cleaning. Then the 
problem disappeared. There wasn't much to clean, but I did have that 
older version of wicket still in the project directory. (Must have had 
it there since 1.3.1 was released.)


/Anders

Igor Vaynberg wrote:

are you using class reloading filter?

-igor




On Sun, Feb 24, 2008 at 7:57 AM, Anders Peterson [EMAIL PROTECTED] wrote:

Hi,

 I (sometimes) get a strange Exception. You can see the stacktrace in the
 attached file.

 The problem appears (sometimes) when I submit a form. Just displaying
 data/pages is never a problem.

 At first glance it seems I get a ClassCastException when doing

 public static BLAppSession getCurrent() {
 return (BLAppSession) Session.get();
 }

 Debugging the code I cannot see anything (obviously) wrong with my
 Session subclass. Something else must be the actual problem. What does
 this mean:

 SEVERE: there was an error cleaning up target
 [EMAIL PROTECTED]
 class = se.optimatika.blapp.gui.PgEvaluateResults, id = 4, version =
 0]-image2-IResourceListener.


 Use Wicket 1.3.1.

 /Anders

Feb 24, 2008 3:54:00 PM sun.reflect.NativeMethodAccessorImpl invoke0
 INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via 
org.mortbay.log.Slf4jLog
 Feb 24, 2008 3:54:00 PM sun.reflect.NativeMethodAccessorImpl invoke0
 INFO: jetty-6.1.6
 Feb 24, 2008 3:54:01 PM org.apache.wicket.Application callInitializers
 INFO: [BLApp] init: Wicket core library initializer
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IBehaviorListener, method=public abstract void 
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IBehaviorListener, method=public abstract void 
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IFormSubmitListener, method=public abstract void 
org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IFormSubmitListener, method=public abstract void 
org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=ILinkListener, method=public abstract void 
org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=ILinkListener, method=public abstract void 
org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IOnChangeListener, method=public abstract void 
org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IOnChangeListener, method=public abstract void 
org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IRedirectListener, method=public abstract void 
org.apache.wicket.IRedirectListener.onRedirect()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IRedirectListener, method=public abstract void 
org.apache.wicket.IRedirectListener.onRedirect()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered listener interface [RequestListenerInterface 
name=IResourceListener, method=public abstract void 
org.apache.wicket.IResourceListener.onResourceRequested()]
 Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
 INFO: registered

Strange Exception

2008-02-24 Thread Anders Peterson

Hi,

I (sometimes) get a strange Exception. You can see the stacktrace in the 
attached file.


The problem appears (sometimes) when I submit a form. Just displaying 
data/pages is never a problem.


At first glance it seems I get a ClassCastException when doing

public static BLAppSession getCurrent() {
return (BLAppSession) Session.get();
}

Debugging the code I cannot see anything (obviously) wrong with my 
Session subclass. Something else must be the actual problem. What does 
this mean:


SEVERE: there was an error cleaning up target 
[EMAIL PROTECTED] 
class = se.optimatika.blapp.gui.PgEvaluateResults, id = 4, version = 
0]-image2-IResourceListener.



Use Wicket 1.3.1.

/Anders
Feb 24, 2008 3:54:00 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via 
org.mortbay.log.Slf4jLog
Feb 24, 2008 3:54:00 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: jetty-6.1.6
Feb 24, 2008 3:54:01 PM org.apache.wicket.Application callInitializers
INFO: [BLApp] init: Wicket core library initializer
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=IBehaviorListener, method=public abstract void 
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=IBehaviorListener, method=public abstract void 
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=IFormSubmitListener, method=public abstract void 
org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=IFormSubmitListener, method=public abstract void 
org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=ILinkListener, method=public abstract void 
org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=ILinkListener, method=public abstract void 
org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=IOnChangeListener, method=public abstract void 
org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=IOnChangeListener, method=public abstract void 
org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=IRedirectListener, method=public abstract void 
org.apache.wicket.IRedirectListener.onRedirect()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=IRedirectListener, method=public abstract void 
org.apache.wicket.IRedirectListener.onRedirect()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=IResourceListener, method=public abstract void 
org.apache.wicket.IResourceListener.onResourceRequested()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.RequestListenerInterface 
registerRequestListenerInterface
INFO: registered listener interface [RequestListenerInterface 
name=IResourceListener, method=public abstract void 
org.apache.wicket.IResourceListener.onResourceRequested()]
Feb 24, 2008 3:54:01 PM org.apache.wicket.Application callInitializers
INFO: [BLApp] init: Wicket extensions initializer
Feb 24, 2008 3:54:01 PM org.apache.wicket.protocol.http.WebApplication 
logStarted
INFO: [BLApp] Started Wicket version 1.3.1 in development mode

*** WARNING: Wicket is running in DEVELOPMENT mode.  ***
***   ^^^***
*** Do NOT deploy to your live server(s) without changing this.  ***
*** 

Re: How do you do this in wicket?

2008-01-14 Thread Anders Peterson

Anders Peterson wrote:


Is that the problem: Do I have to call

this.setResponsePage(LoginPage.class);

after

super.onClick();

?


Yes, that was it.

Thanks Martijn and Maurice!

/Anders

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



Re: How do you do this in wicket?

2008-01-13 Thread Anders Peterson
I have a related question. What should I do when the user logs out. 
Currently I just set username to null and redirect to the original 
login page. I feel I also should invalidate the session but that doesn't 
work.  Then I always end up with a Page Expired page. I'd like to 
still end up with the login page.


/Anders

Martijn Dashorst wrote:

Have one session that knows when authentication has happened...

public MySession extends WebSession {
private String username;

public void setUsername(){}

public boolean isAuthenticated() {
return username != null;
}
}

Then in your web page you can do:

if (!((MySession)getSession).isAuthenticated()) throw
restartrequestatinterceptpage(...);

Martijn
On Jan 13, 2008 7:21 AM, xdirewolfx [EMAIL PROTECTED] wrote:

Assume I have created 2 different sessions:
 - standard session
 - authenticated session

I have a class MyWebPage with this method:
 - MyWebPage(boolean isAuthenticated) : true = request authentication

how do I do this programmatically?
--
View this message in context: 
http://www.nabble.com/How-do-you-do-this-in-wicket--tp14782689p14782689.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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









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



Re: How do you do this in wicket?

2008-01-13 Thread Anders Peterson

Doesn't work for me...

I have a PageLink class with a onClick() method that looks like this:

public void onClick() {
super.onClick();
this.setRedirect(true);
this.getSession().invalidate();
}

super.onClick(); sets the response page.


I do not end up with the desired login page, but get Page Expired.

/Anders


Martijn Dashorst wrote:

iirc:

setResponsePage(LoginPage.class);
setRedirect(true);
getSession().invalidate();

Martijn

On 1/13/08, Anders Peterson [EMAIL PROTECTED] wrote:

I have a related question. What should I do when the user logs out.
Currently I just set username to null and redirect to the original
login page. I feel I also should invalidate the session but that doesn't
work.  Then I always end up with a Page Expired page. I'd like to
still end up with the login page.

/Anders

Martijn Dashorst wrote:

Have one session that knows when authentication has happened...

public MySession extends WebSession {
private String username;

public void setUsername(){}

public boolean isAuthenticated() {
return username != null;
}
}

Then in your web page you can do:

if (!((MySession)getSession).isAuthenticated()) throw
restartrequestatinterceptpage(...);

Martijn
On Jan 13, 2008 7:21 AM, xdirewolfx [EMAIL PROTECTED] wrote:

Assume I have created 2 different sessions:
 - standard session
 - authenticated session

I have a class MyWebPage with this method:
 - MyWebPage(boolean isAuthenticated) : true = request authentication

how do I do this programmatically?
--
View this message in context: 
http://www.nabble.com/How-do-you-do-this-in-wicket--tp14782689p14782689.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: How do you do this in wicket?

2008-01-13 Thread Anders Peterson

Then where do I call that invalidation code?

It's not possible to override onClick() with BookmarkablePageLink.

/Anders

Martijn Dashorst wrote:

You *MUST* redirect to a bookmarkable page, not a page instance. A
page instance is always relative to your current session, which you
just conveniently invalidated.

Martijn

On 1/13/08, Anders Peterson [EMAIL PROTECTED] wrote:

Doesn't work for me...

I have a PageLink class with a onClick() method that looks like this:

public void onClick() {
super.onClick();
this.setRedirect(true);
this.getSession().invalidate();
}

super.onClick(); sets the response page.


I do not end up with the desired login page, but get Page Expired.

/Anders


Martijn Dashorst wrote:

iirc:

setResponsePage(LoginPage.class);
setRedirect(true);
getSession().invalidate();

Martijn

On 1/13/08, Anders Peterson [EMAIL PROTECTED] wrote:

I have a related question. What should I do when the user logs out.
Currently I just set username to null and redirect to the original
login page. I feel I also should invalidate the session but that doesn't
work.  Then I always end up with a Page Expired page. I'd like to
still end up with the login page.

/Anders

Martijn Dashorst wrote:

Have one session that knows when authentication has happened...

public MySession extends WebSession {
private String username;

public void setUsername(){}

public boolean isAuthenticated() {
return username != null;
}
}

Then in your web page you can do:

if (!((MySession)getSession).isAuthenticated()) throw
restartrequestatinterceptpage(...);

Martijn
On Jan 13, 2008 7:21 AM, xdirewolfx [EMAIL PROTECTED] wrote:

Assume I have created 2 different sessions:
 - standard session
 - authenticated session

I have a class MyWebPage with this method:
 - MyWebPage(boolean isAuthenticated) : true = request authentication

how do I do this programmatically?
--
View this message in context: 
http://www.nabble.com/How-do-you-do-this-in-wicket--tp14782689p14782689.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]








--
http://ojalgo.org/

Mathematics, Linear Algebra and Optimisation with Java

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



Re: How do you do this in wicket?

2008-01-13 Thread Anders Peterson
I have never done new LoginPage(), and I never said I did - that's something 
you assumed. It has always been LoginPage.class.


In my original code the LoginPage.class was passed as an argument to the 
PageLink constructor and then I had an onClick method like this:


 public void onClick() {
 super.onClick();
 this.setRedirect(true);
 this.getSession().invalidate();
 }

Is that the problem: Do I have to call

this.setResponsePage(LoginPage.class);

after

super.onClick();

?

(Don't have access to the code at the moment.)

/Anders


Martijn Dashorst wrote:

If you read my previous message closely you would have seen:

setResponsePage(LoginPage.class);

LoginPage.class instead of new LoginPage()

That generates the difference between a bookmarkable URL and a session
relative URL.

Martijn

On 1/13/08, Anders Peterson [EMAIL PROTECTED] wrote:

Then where do I call that invalidation code?

It's not possible to override onClick() with BookmarkablePageLink.

/Anders

Martijn Dashorst wrote:

You *MUST* redirect to a bookmarkable page, not a page instance. A
page instance is always relative to your current session, which you
just conveniently invalidated.

Martijn

On 1/13/08, Anders Peterson [EMAIL PROTECTED] wrote:

Doesn't work for me...

I have a PageLink class with a onClick() method that looks like this:

public void onClick() {
super.onClick();
this.setRedirect(true);
this.getSession().invalidate();
}

super.onClick(); sets the response page.


I do not end up with the desired login page, but get Page Expired.

/Anders


Martijn Dashorst wrote:

iirc:

setResponsePage(LoginPage.class);
setRedirect(true);
getSession().invalidate();

Martijn

On 1/13/08, Anders Peterson [EMAIL PROTECTED] wrote:

I have a related question. What should I do when the user logs out.
Currently I just set username to null and redirect to the original
login page. I feel I also should invalidate the session but that doesn't
work.  Then I always end up with a Page Expired page. I'd like to
still end up with the login page.

/Anders

Martijn Dashorst wrote:

Have one session that knows when authentication has happened...

public MySession extends WebSession {
private String username;

public void setUsername(){}

public boolean isAuthenticated() {
return username != null;
}
}

Then in your web page you can do:

if (!((MySession)getSession).isAuthenticated()) throw
restartrequestatinterceptpage(...);

Martijn
On Jan 13, 2008 7:21 AM, xdirewolfx [EMAIL PROTECTED] wrote:

Assume I have created 2 different sessions:
 - standard session
 - authenticated session

I have a class MyWebPage with this method:
 - MyWebPage(boolean isAuthenticated) : true = request authentication

how do I do this programmatically?
--
View this message in context: 
http://www.nabble.com/How-do-you-do-this-in-wicket--tp14782689p14782689.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]






--
http://ojalgo.org/

Mathematics, Linear Algebra and Optimisation with Java

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








--
http://ojalgo.org/

Mathematics, Linear Algebra and Optimisation with Java

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



Re: JPA best-practices?

2007-11-13 Thread Anders Peterson

Chris Colman wrote:


The obvious benefit in such an approach is that your POJO model and the
services that you provide to implement business rules etc., remain
completely portable to different persistence engines - ie., no vendor
lock in.

well, i thought that was JPA was all about !?


No, definitely not! JPA was all about creating a standard that Hibernate could conform 
to. Remember there *already* was a standard for Java persistence: JDO. JDO 
implementations such as JPOX and others implement both JDO (obviously) and JPA but it is 
not possible for Hibernate to provide all the features of JDO and so it could never 
implement the JDO standard - hence a less powerful standard had to be created so that 
Hibernate could play the standards game.


It seems it's also possible for a few other ORM tools to conform to that 
standard. Apart from Hibernate and JPOX you've got TopLink, Cayenne and 
others.


Which would you rather depend on; exPOJO or JPA?

/Anders

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



Re: Apache Wicket 1.3.0-rc1 released!

2007-11-12 Thread Anders Peterson

Thanks, everyone who contributed!

Is Wicket 1.4 still planned to be a Java 5 version of Wicket 1.3? How 
far away is Wicket 1.4?


I have a small prototype application built using Wicket 1.2.6. I believe 
that little prototype may soon graduate to a real application, and when 
that happens I'd like it to be using a generified version of Wicket.


/Anders
---
http://ojalgo.org/

Martijn Dashorst wrote:

This is the first release candidate for Apache Wicket we have prepared
for your pleasure. It contains over 80 fixes to issues with previous
releases and todo items we have cleared.

In this announcement:

* Apache Wicket
* This release
* Migrating from 1.2
* Downloading the release
* Validating the release
* Reporting bugs
* The distribution
* Release Notes - Wicket - Version 1.3.0-rc1

Eager people click here to download the distribution, others can read further:

http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1

We thank you for your patience and support.

The Wicket Team

-= Apache Wicket =-

Apache Wicket is a component oriented Java web application framework.
With proper mark-up/logic separation, a POJO data model, and a
refreshing lack of XML, Apache Wicket makes developing web-apps simple
and enjoyable again. Swap the boilerplate, complex debugging and
brittle code for powerful, reusable components written with plain Java
and HTML.

Our migration to a top level project is now completed and you can find
our website and documentation here:

http://wicket.apache.org

-= This release =-

This release is the first in a series of release candidates releases
until we feel confident to finalize Wicket 1.3. This is called a
release candidate because we strive for API freeze. This means only
bug fixes will be done on the 1.3 release from now on.

-= Migrating from 1.2 =-

If you are coming from Wicket 1.2, you really want to read our
migration guide, found on the wiki:

http://cwiki.apache.org/WICKET/migrate-13.html

-= Downloading the release =-

You can download the release from the official Apache mirror system,
and you can find it through the following link:

http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/

For the Maven and Ivy fans out there: update your pom's to the
following, and everything will be downloaded automatically:

dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket/artifactId
version1.3.0-rc1/version
/dependency

Substitute the artifact ID with the projects of your liking to get the
other projects.

Please note that we don't prescribe a Logging implementation for
SLF4J. You need to specify yourself which one you prefer. Read more
about SLF4J here: http://slf4j.org

-= Validating the release =-

The release has been signed by Frank Bille, your release manager for
today. The public key can be found in the KEYS file in the download
area. Download the KEYS file only from the Apache website.

http://www.apache.org/dist/wicket/1.3.0-rc1/KEYS

Instructions on how to validate the release can be found here:

http://www.apache.org/dev/release-signing.html#check-integrity

-= Reporting bugs =-

In case you do encounter a bug, we would appreciate a report in our JIRA:

http://issues.apache.org/jira/browse/WICKET

-= The distribution =-

In the distribution you will find a README. The README contains
instructions on how to build from source yourself and a list of all
things that have been fixed, added and/or removed since the first beta
release.

-= Release Notes - Wicket - Version 1.3.0-rc1 =-

Sub-task

* WICKET-1022 - Created new bug - ValueMap set to null

Bug

* WICKET-330 - CheckBox incorrectly converts its model value when a
custom Boolean converter is installed
* WICKET-336 - Inheritable model cannot be a wrap model
* WICKET-382 - Converter misusage/mangling in RadioChoice
* WICKET-487 - Buggy behaviour in PageMap.access(IPageMapEntry,int). Wicket1.2.4
* WICKET-588 - continueToOriginalDestination /
RestartResponseAtInterceptPageException with page parameters broken
* WICKET-605 - Stateless form skips page parameters
* WICKET-607 - Stateless forms don't work with QueryStringUrlCodingStrategy
* WICKET-642 - Need to escape select html option value
* WICKET-645 - Form with ajaxsubmitbutton won't submit after error
* WICKET-702 - MockWebApplication doesn't redirect  properly to
mounted pages under RestartResponseAtInterceptPageException
* WICKET-734 - Custom ILinkListener component causes error in cell on
mounted page
* WICKET-746 - Thread synchronization problems in FilePageStore
* WICKET-855 - ModalWindow makes Internet Explorer 6 show an security
warning dialog
* WICKET-901 - DatePicker#getConfigureYUIBasePath() is useless or never called
* WICKET-916 - inconsistent state after setting AjaxDebugModeEnabled
to true in an AjaxRequest
* WICKET-920 - ExternalLink produces invalid html
* WICKET-950 - StatelessForm + QueryStringUrlCodingStrategy problem
* WICKET-953 - Session invalidateNow() does not immediate remove the
session from disk
* 

Re: Wicket 1.4 expectations (was Re: Apache Wicket 1.3.0-rc1 released!)

2007-11-12 Thread Anders Peterson

Gwyn Evans wrote:

Does generification of the core make that much difference to a user of
the API?  I've been focused on JDK 1.4, so didn't have a change to
look at Wicket 2 in practice.


Don't want to exaggerate, but once you start using Java 5 you don't want 
to go back and you want all code you use to be up to date.


The Models is probably the part of Wicket that needs generification the 
most.


/Anders




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