Re: Extend AjaxFormComponentUpdatingBehavior functionality for required FormComponents

2011-02-18 Thread Daniel Stoch
 Maybe I should explain one of use-cases. Let's say we have a form to
 enter RSS feed information. There are two TextFields:
 - url for RSS feed (urlModel)
 - custom RSS feed name (nameModel).
 Both are required and both have OnChangeBehavior attached. When user
 enter url for RSS the name of it is retrieved and set into nameModel.
 But only when nameModel has null object or nameEdited (boolean flag)
 is false.
 Now user can edit name field (then nameEdited flag is set to true, to
 avoid changing this name when user change url).
 But when user clears name field nameModel should be updated to null,
 but behavior does not allow this (because of validation of required
 field).

 what you want can be done in a simple manner. do not mark your field
 as required, since it is not. write your own validator that allows
 setting the field value to null when the edit flag is set, and fails
 when it is not.

But this field is required - from user point of view. User cannot
submit form without filling the name.


 you can create your own updating behavior that calls
 setrequired(false) on the component prior to running validation/model
 update if that is what you want. but we will not ship something like
 this as part of core because it doesnt generally make sense.

 Probably I'll write my own behavior, because it seems this is the only
 solution :).
 Maybe it does not make sense from your point of view, but from mine it
 does. I think your point of view is sometimes too narrow.

 my point of view has to be narrow. as developers of the framework we
 try to make the 95% usecase as simple as possible, while leaving the
 door open for the other rare 5%. unfortunately for you, this is the
 other 5%.


My post was only a proposal, because it is not possible to easy extend
AjaxFormComponentUpdatingBehavior because onEvent() is final. I want
to avoid copy/paste code with only a little change. And I think this
change is very useful. But ok, I understand you, so I'll implement it
by myself.

But always is good to try convince you first :).

--
Daniel

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



Re: how to access component values within a dynamic table?

2011-02-18 Thread Hans Lesmeister 2


hrbaer wrote:
 
 In a fit of despair I tried to replace my ListView component with a
 RepeatingView component to access either my ListFragen or
 Frage/Input - unfortunatelly without success :(
 

If you use a RepeatingView you can add any Component to it (I think) so
erzeugeEingabeFeld(..) could then create the appropriate component.

Alternatively you could create a panel for each possible component and let
erzeugeEingabeFeld(..) return one of those panels (CheckboxPanel,
TextInputPanel, etc). This is an approach we followed ourselves. Initially a
lot of work, I know...



 I'm still wondering why I can't get the RepeatingView/ListView within the
 onSubmit method!? This component is defined the same way as e.g. the
 Textfield Vorname. But once I use getModelObject() within the onSubmit
 method I only see Vorname, Nachname and Email?!
 

Why do you want to have access to that component? You have access to your
katalog.getFragen() don't you? And that is where the entered data should be
landed after the user pressed Submit. That is, if you use your components
with the appropriate Models of course. PropertyModel is still your friend in
my opinion.

Instead of:
String htmlCodeInputfield = erzeugeEingabefeld( q );
you get something like:

FormComponent inputField = erzeugeEingabefeld(wicketId, q);
item.add(inputField);

private FormComponent erzeugeEingabefeld(id, Question q) {
  if (inputFieldNeeded()) {
 return new TextField(id, new PropertyModel(q, input));
  }

  if (checkboxNeede()) {
return new Checkbox(id, new PropertyModel(q, flag));
  }

  ... etc
}


-
-- 

Regards,

Hans


http://www.cantaa.de http://cantaa.de 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-access-component-values-within-a-dynamic-table-tp3310939p3312281.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Problem on wicket:message with components

2011-02-18 Thread Mike Mander

Hi,

i've copied the solution described in 
https://cwiki.apache.org/WICKET/wickets-xhtml-tags.html#Wicket%27sXHTMLtags-Elementwicket:message.


Wicket: 1.4.15

MyPage.java
public MyPage() {
final VatList vatList = new VatList(_vatExecutor.getVats());
add(new Label(vat1value, 
String.valueOf(vatList.getVatValueForParticularId(1;
add(new Label(vat2value, 
String.valueOf(vatList.getVatValueForParticularId(2;

}

MyPage.html
?xml version=1.0 encoding=UTF-8 ?
html 
xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;

body
wicket:extend
div id=pagebodymain
p
wicket:message key=item.pricedisclaimer1
[Disclaimer 1]
span wicket:id=vat1value[Vat1]/span.
span wicket:id=vat2value[Vat2]/span.
/wicket:message
wicket:message key=item.pricedisclaimer2[Disclaimer 2]/wicket:message
a href=ShowPage.html#vvk
wicket:message key=item.pricedisclaimer3[Disclaimer 3]/wicket:message
/a.
/p
/div
/wicket:extend
/body
/html

MyPage.properties
item.pricedisclaimer1=Alle Preise enthalten die gesetzliche MwSt. von 
${vat1value}% bzw. ${vat2value}%.



But i get following stacktrace.

ERROR - RequestCycle   - No get method defined for class: 
class 
org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer 
expression: vat1value
org.apache.wicket.WicketRuntimeException: No get method defined for 
class: class 
org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer 
expression: vat1value
at 
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:488)
at 
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:330)
at 
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:237)
at 
org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91)
at 
org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer$1.getValue(WicketMessageResolver.java:272)
at 
org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:138)
at 
org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer.renderMessage(WicketMessageResolver.java:245)
at 
org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer.onComponentTagBody(WicketMessageResolver.java:210)

at org.apache.wicket.Component.renderComponent(Component.java:2680)
at 
org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)

at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at 
org.apache.wicket.markup.resolver.WicketMessageResolver.resolve(WicketMessageResolver.java:148)
at 
org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at 
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at 
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)

at org.apache.wicket.Component.renderComponent(Component.java:2680)
at 
org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)

at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at 
org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:66)
at 
org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at 
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at 
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)

at org.apache.wicket.Component.renderComponent(Component.java:2680)
at 
org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)

at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at 
org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:73)
at 
org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at 
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at 
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)

at org.apache.wicket.Component.renderComponent(Component.java:2680)
at 
org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)

at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at 

Re: Error in snapshot

2011-02-18 Thread Martin Grigorov
I also use 1.5-SNAPSHOT and all is ok here.
If you can create a quickstart that reproduces then create a ticket in Jira.

On Fri, Feb 18, 2011 at 1:11 PM, Josh Kamau joshnet2...@gmail.com wrote:

 Hello there, i had an application that was working with snapshots but
 now am getting the below error:



 java.lang.NoSuchMethodError:
 org.apache.wicket.request.RequestHandlerStack: method init()V not
 found
at
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.init(RequestCycle.java:697)
at
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.init(RequestCycle.java:697)
at
 org.apache.wicket.request.cycle.RequestCycle.init(RequestCycle.java:124)
at
 org.apache.wicket.Application$DefaultRequestCycleProvider.get(Application.java:1499)
at
 org.apache.wicket.Application$DefaultRequestCycleProvider.get(Application.java:1495)
at
 org.apache.wicket.Application.createRequestCycle(Application.java:1514)
at
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:137)
at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at
 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322)
at
 org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:473)
at
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at
 org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:516)
at
 org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at
 org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929)
at
 org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403)
at
 org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184)
at
 org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864)
at
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
 org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247)
at
 org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:151)
at
 org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
at org.eclipse.jetty.server.Server.handle(Server.java:352)
at
 org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596)
at
 org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1051)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:590)
at
 org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:212)
at
 org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426)
at
 org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:508)
at
 org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)
at
 org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at
 org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451)
at java.lang.Thread.run(Thread.java:636)



Re: Problem on wicket:message with components

2011-02-18 Thread Martin Grigorov
Change

wicket:message key=item.pricedisclaimer1
   [Disclaimer 1]
span wicket:id=vat1value[Vat1]/span.
span wicket:id=vat2value[Vat2]/span.
/wicket:message

with

wicket:message key=item.pricedisclaimer1
   [Disclaimer 1]
/wicket:message
span wicket:id=vat1value[Vat1]/span.
span wicket:id=vat2value[Vat2]/span.


On Fri, Feb 18, 2011 at 1:13 PM, Mike Mander wicket-m...@gmx.de wrote:

 Hi,

 i've copied the solution described in 
 https://cwiki.apache.org/WICKET/wickets-xhtml-tags.html#Wicket%27sXHTMLtags-Elementwicket:message
 .

 Wicket: 1.4.15

 MyPage.java
 public MyPage() {
final VatList vatList = new VatList(_vatExecutor.getVats());
add(new Label(vat1value,
 String.valueOf(vatList.getVatValueForParticularId(1;
add(new Label(vat2value,
 String.valueOf(vatList.getVatValueForParticularId(2;
 }

 MyPage.html
 ?xml version=1.0 encoding=UTF-8 ?
 html xmlns:wicket=
 http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;
 body
 wicket:extend
 div id=pagebodymain
 p
 wicket:message key=item.pricedisclaimer1
[Disclaimer 1]
 span wicket:id=vat1value[Vat1]/span.
 span wicket:id=vat2value[Vat2]/span.
 /wicket:message
 wicket:message key=item.pricedisclaimer2[Disclaimer 2]/wicket:message
 a href=ShowPage.html#vvk
 wicket:message key=item.pricedisclaimer3[Disclaimer 3]/wicket:message
 /a.
 /p
 /div
 /wicket:extend
 /body
 /html

 MyPage.properties
 item.pricedisclaimer1=Alle Preise enthalten die gesetzliche MwSt. von
 ${vat1value}% bzw. ${vat2value}%.


 But i get following stacktrace.

 ERROR - RequestCycle   - No get method defined for class: class
 org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer
 expression: vat1value
 org.apache.wicket.WicketRuntimeException: No get method defined for class:
 class
 org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer
 expression: vat1value
at
 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:488)
at
 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:330)
at
 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:237)
at
 org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91)
at
 org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer$1.getValue(WicketMessageResolver.java:272)
at
 org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:138)
at
 org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer.renderMessage(WicketMessageResolver.java:245)
at
 org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer.onComponentTagBody(WicketMessageResolver.java:210)
at org.apache.wicket.Component.renderComponent(Component.java:2680)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at
 org.apache.wicket.markup.resolver.WicketMessageResolver.resolve(WicketMessageResolver.java:148)
at
 org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
at org.apache.wicket.Component.renderComponent(Component.java:2680)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at
 org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:66)
at
 org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
at org.apache.wicket.Component.renderComponent(Component.java:2680)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at
 org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:73)
at
 org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at
 

Re: Problem on wicket:message with components

2011-02-18 Thread Mike Mander

Hi Martin,

this isn't what i try to achieve. The wiki states Starting from Wicket 
1.4 you can nest components within a wicket:message element.. And i 
would like to exchange the placeholders with the 2 values on the label.


Btw. i tried your change solution and it gives me the same exception.

Thanks
Mike


Change

wicket:message key=item.pricedisclaimer1
[Disclaimer 1]
span wicket:id=vat1value[Vat1]/span.
span wicket:id=vat2value[Vat2]/span.
/wicket:message

with

wicket:message key=item.pricedisclaimer1
[Disclaimer 1]
/wicket:message
span wicket:id=vat1value[Vat1]/span.
span wicket:id=vat2value[Vat2]/span.


On Fri, Feb 18, 2011 at 1:13 PM, Mike Manderwicket-m...@gmx.de  wrote:


Hi,

i've copied the solution described in
https://cwiki.apache.org/WICKET/wickets-xhtml-tags.html#Wicket%27sXHTMLtags-Elementwicket:message

.

Wicket: 1.4.15

MyPage.java
public MyPage() {
final VatList vatList = new VatList(_vatExecutor.getVats());
add(new Label(vat1value,
String.valueOf(vatList.getVatValueForParticularId(1;
add(new Label(vat2value,
String.valueOf(vatList.getVatValueForParticularId(2;
}

MyPage.html
?xml version=1.0 encoding=UTF-8 ?
html xmlns:wicket=
http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;
body
wicket:extend
div id=pagebodymain
p
wicket:message key=item.pricedisclaimer1
[Disclaimer 1]
span wicket:id=vat1value[Vat1]/span.
span wicket:id=vat2value[Vat2]/span.
/wicket:message
wicket:message key=item.pricedisclaimer2[Disclaimer 2]/wicket:message
a href=ShowPage.html#vvk
wicket:message key=item.pricedisclaimer3[Disclaimer 3]/wicket:message
/a.
/p
/div
/wicket:extend
/body
/html

MyPage.properties
item.pricedisclaimer1=Alle Preise enthalten die gesetzliche MwSt. von
${vat1value}% bzw. ${vat2value}%.


But i get following stacktrace.

ERROR - RequestCycle   - No get method defined for class: class
org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer
expression: vat1value
org.apache.wicket.WicketRuntimeException: No get method defined for class:
class
org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer
expression: vat1value
at
org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:488)
at
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:330)
at
org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:237)
at
org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91)
at
org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer$1.getValue(WicketMessageResolver.java:272)
at
org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:138)
at
org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer.renderMessage(WicketMessageResolver.java:245)
at
org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer.onComponentTagBody(WicketMessageResolver.java:210)
at org.apache.wicket.Component.renderComponent(Component.java:2680)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at
org.apache.wicket.markup.resolver.WicketMessageResolver.resolve(WicketMessageResolver.java:148)
at
org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
at org.apache.wicket.Component.renderComponent(Component.java:2680)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at
org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:66)
at
org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
at org.apache.wicket.Component.renderComponent(Component.java:2680)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at

Re: Problem on wicket:message with components

2011-02-18 Thread Martin Grigorov
I didn't know about this feature until now ...

Create a ticket with a quickstart please.

On Fri, Feb 18, 2011 at 2:46 PM, Mike Mander wicket-m...@gmx.de wrote:

 Hi Martin,

 this isn't what i try to achieve. The wiki states Starting from Wicket 1.4
 you can nest components within a wicket:message element.. And i would like
 to exchange the placeholders with the 2 values on the label.

 Btw. i tried your change solution and it gives me the same exception.

 Thanks
 Mike


  Change

 wicket:message key=item.pricedisclaimer1
[Disclaimer 1]
 span wicket:id=vat1value[Vat1]/span.
 span wicket:id=vat2value[Vat2]/span.
 /wicket:message

 with

 wicket:message key=item.pricedisclaimer1
[Disclaimer 1]
 /wicket:message
 span wicket:id=vat1value[Vat1]/span.
 span wicket:id=vat2value[Vat2]/span.


 On Fri, Feb 18, 2011 at 1:13 PM, Mike Manderwicket-m...@gmx.de  wrote:

  Hi,

 i've copied the solution described in

 https://cwiki.apache.org/WICKET/wickets-xhtml-tags.html#Wicket%27sXHTMLtags-Elementwicket:message

 .

 Wicket: 1.4.15

 MyPage.java
 public MyPage() {
final VatList vatList = new VatList(_vatExecutor.getVats());
add(new Label(vat1value,
 String.valueOf(vatList.getVatValueForParticularId(1;
add(new Label(vat2value,
 String.valueOf(vatList.getVatValueForParticularId(2;
 }

 MyPage.html
 ?xml version=1.0 encoding=UTF-8 ?
 html xmlns:wicket=
 http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;
 body
 wicket:extend
 div id=pagebodymain
 p
 wicket:message key=item.pricedisclaimer1
[Disclaimer 1]
 span wicket:id=vat1value[Vat1]/span.
 span wicket:id=vat2value[Vat2]/span.
 /wicket:message
 wicket:message key=item.pricedisclaimer2[Disclaimer
 2]/wicket:message
 a href=ShowPage.html#vvk
 wicket:message key=item.pricedisclaimer3[Disclaimer
 3]/wicket:message
 /a.
 /p
 /div
 /wicket:extend
 /body
 /html

 MyPage.properties
 item.pricedisclaimer1=Alle Preise enthalten die gesetzliche MwSt. von
 ${vat1value}% bzw. ${vat2value}%.


 But i get following stacktrace.

 ERROR - RequestCycle   - No get method defined for class:
 class

 org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer
 expression: vat1value
 org.apache.wicket.WicketRuntimeException: No get method defined for
 class:
 class

 org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer
 expression: vat1value
at

 org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:488)
at

 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:330)
at

 org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:237)
at

 org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91)
at

 org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer$1.getValue(WicketMessageResolver.java:272)
at

 org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:138)
at

 org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer.renderMessage(WicketMessageResolver.java:245)
at

 org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer.onComponentTagBody(WicketMessageResolver.java:210)
at org.apache.wicket.Component.renderComponent(Component.java:2680)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at

 org.apache.wicket.markup.resolver.WicketMessageResolver.resolve(WicketMessageResolver.java:148)
at

 org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at

 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
at org.apache.wicket.Component.renderComponent(Component.java:2680)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at

 org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:66)
at

 org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at

 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at

 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
at org.apache.wicket.Component.renderComponent(Component.java:2680)
at
 

RepeatingView/RefreshingView: Inform children about being deleted

2011-02-18 Thread Benedikt Rothe

Hi

Are the existing children of a RepeatingView/RefreshingView being 
informed, when

the View is newly populated (RefreshingView.onPopulate).

I'd like to clean some internal references in this case.
I tried:
- aChild.onRemove is not called in this situation
- aChild.setParent(null) is called. I treid to override setParent it. 
But setParent is private.


Any suggestions?
Benedikt

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



Re: Problem on wicket:message with components

2011-02-18 Thread Mike Mander

Done. https://issues.apache.org/jira/browse/WICKET-3454

It seems to be a border or sub-page problem. Adding this feature to a 
plain simple page is working as expected.


Thanks for support
Mike


I didn't know about this feature until now ...

Create a ticket with a quickstart please.

On Fri, Feb 18, 2011 at 2:46 PM, Mike Manderwicket-m...@gmx.de  wrote:


Hi Martin,

this isn't what i try to achieve. The wiki states Starting from Wicket 1.4
you can nest components within a wicket:message element.. And i would like
to exchange the placeholders with the 2 values on the label.

Btw. i tried your change solution and it gives me the same exception.

Thanks
Mike


  Change

wicket:message key=item.pricedisclaimer1
[Disclaimer 1]
span wicket:id=vat1value[Vat1]/span.
span wicket:id=vat2value[Vat2]/span.
/wicket:message

with

wicket:message key=item.pricedisclaimer1
[Disclaimer 1]
/wicket:message
span wicket:id=vat1value[Vat1]/span.
span wicket:id=vat2value[Vat2]/span.


On Fri, Feb 18, 2011 at 1:13 PM, Mike Manderwicket-m...@gmx.de   wrote:

  Hi,

i've copied the solution described in

https://cwiki.apache.org/WICKET/wickets-xhtml-tags.html#Wicket%27sXHTMLtags-Elementwicket:message


.


Wicket: 1.4.15

MyPage.java
public MyPage() {
final VatList vatList = new VatList(_vatExecutor.getVats());
add(new Label(vat1value,
String.valueOf(vatList.getVatValueForParticularId(1;
add(new Label(vat2value,
String.valueOf(vatList.getVatValueForParticularId(2;
}

MyPage.html
?xml version=1.0 encoding=UTF-8 ?
html xmlns:wicket=
http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;
body
wicket:extend
div id=pagebodymain
p
wicket:message key=item.pricedisclaimer1
[Disclaimer 1]
span wicket:id=vat1value[Vat1]/span.
span wicket:id=vat2value[Vat2]/span.
/wicket:message
wicket:message key=item.pricedisclaimer2[Disclaimer
2]/wicket:message
a href=ShowPage.html#vvk
wicket:message key=item.pricedisclaimer3[Disclaimer
3]/wicket:message
/a.
/p
/div
/wicket:extend
/body
/html

MyPage.properties
item.pricedisclaimer1=Alle Preise enthalten die gesetzliche MwSt. von
${vat1value}% bzw. ${vat2value}%.


But i get following stacktrace.

ERROR - RequestCycle   - No get method defined for class:
class

org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer
expression: vat1value
org.apache.wicket.WicketRuntimeException: No get method defined for
class:
class

org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer
expression: vat1value
at

org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:488)
at

org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:330)
at

org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:237)
at

org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:91)
at

org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer$1.getValue(WicketMessageResolver.java:272)
at

org.apache.wicket.util.string.interpolator.VariableInterpolator.toString(VariableInterpolator.java:138)
at

org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer.renderMessage(WicketMessageResolver.java:245)
at

org.apache.wicket.markup.resolver.WicketMessageResolver$MessageContainer.onComponentTagBody(WicketMessageResolver.java:210)
at org.apache.wicket.Component.renderComponent(Component.java:2680)
at
org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at

org.apache.wicket.markup.resolver.WicketMessageResolver.resolve(WicketMessageResolver.java:148)
at

org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at

org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at

org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1527)
at org.apache.wicket.Component.renderComponent(Component.java:2680)
at
org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1538)
at org.apache.wicket.Component.render(Component.java:2511)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
at

org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:66)
at

org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81)
at
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1444)
at

org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1603)
at


wicket in action session Problems

2011-02-18 Thread xaver

Hi,

I'm really new to wicket and I'm trying to learn about with wicket in
action.
Now the problem: I've initialized a project trought maven quikstart version:
1.5rc1.

A first test with the jetty engine work as aspected. 

the session is implemented with the following class:

public class CheesrSession extends WebSession {

private Cart cart = new Cart();

public CheesrSession(Request request) {
super(request);
}

public Cart getCart(){

return cart;
}


}


and with the getHomePage method in the extended WebApplication:

 public Class getHomePage() {
return Index.class;
}


I call the index page:

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.PropertyModel;

/**
 *
 * @author saverioscavelli
 */
public class Index extends CheesrPage {

//private static final long serialVersionUID = 1L;


public Index() {

add(new ListView(cheeses, getCheeses()) {

@Override
protected void populateItem(ListItem item) {
//throw new UnsupportedOperationException(Not supported
yet.);
Cheese cheese = (Cheese) item.getModelObject();
item.add(new Label(name, cheese.getName()));
item.add(new Label(description, cheese.getDesciption()));
item.add(new Label(price, $ + cheese.getPrice()));
item.add(new Link(add, item.getModel()) {

@Override
public void onClick() {
//throw new UnsupportedOperationException(Not
supported yet.);
Cheese selected = (Cheese) getModelObject();
getCart().getCheeses().add(selected);
}
});
}
});


add(new ListView(cart, new PropertyModel(this, cart.cheeses)) {

@Override
protected void populateItem(ListItem item) {
//throw new UnsupportedOperationException(Not supported
yet.);
Cheese cheese = (Cheese) item.getModelObject();
item.add(new Label(name, cheese.getName()));
item.add(new Label(price, $+ cheese.getPrice()));

item.add(new Link(remove, item.getModel()) {

@Override
public void onClick() {
//throw new UnsupportedOperationException(Not
supported yet.);

Cheese selected = (Cheese) getModelObject();
getCart().getCheeses().remove(selected);
}
});

}
});
add(new Label(total, $+ getCart().getTotal()));


}



}

the index page extends the CheesrPage:

import java.util.List;
import org.apache.wicket.markup.html.WebPage;

/**
 *
 * @author saverioscavelli
 */
public abstract class CheesrPage extends WebPage {

public CheesrSession getCheesrSession(){

return  (CheesrSession) getSession();
}

public Cart getCart(){
return getCheesrSession().getCart();
}

public ListCheese getCheeses(){
return WicketApplication.get().getCheeses();
}

}

unfortunately I recive an Error that I dont really anderstand:

Unexpected RuntimeException

WicketMessage: Can't instantiate page using constructor public
babilo.cheeser.cheesr.Index()

Stacktrace

Root cause:

java.lang.ClassCastException: org.apache.wicket.protocol.http.WebSession
cannot be cast to babilo.cheeser.cheesr.CheesrSession
 at
babilo.cheeser.cheesr.CheesrPage.getCheesrSession(CheesrPage.java:31)
 at babilo.cheeser.cheesr.CheesrPage.getCart(CheesrPage.java:35)
 at babilo.cheeser.cheesr.Index.init(Index.java:81)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:155)
 at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:59)
 at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:43)
 at
org.apache.wicket.Application$2.newPageInstance(Application.java:1157)
 at
org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:259)
 at
org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:160)
 at
org.apache.wicket.request.handler.render.WebPageRenderer.getPage(WebPageRenderer.java:59)
 at
org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:212)
 at
org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:149)
 at
org.apache.wicket.request.RequestHandlerStack.executeRequestHandler(RequestHandlerStack.java:84)
 at

Storing and retrieving user uploaded images

2011-02-18 Thread Henrique Boregio
Hi, I'm having trouble storing user uploaded images.

In my WicketApplication class, I setup a folder to store users
pictures, so I end up with a folder structure similar to this:
ROOT FOLDER
- user1_folder (pic1.jpg, pic2.jpg, etc...)
- user2_folder ( ... )
- ...

The issue I am having is that this folder is created at
src/main/java (I am using maven). When I run the application, the
Root actually becomes the webapp folder, so the relative path
changes.

How can I unify this folder so that its absolute path remains the same
no matter where it is called from?

My current solutions is to hard-code it like: /src/main/java +
userFolderName, but that's no the best way I'm sure.

Thanks!

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



Re: wicket in action session Problems

2011-02-18 Thread Martin Grigorov
in CheesrApplication class you need to override newSession() method and
return new CheesrSession()

On Fri, Feb 18, 2011 at 3:56 PM, xaver saverio.scave...@googlemail.comwrote:


 Hi,

 I'm really new to wicket and I'm trying to learn about with wicket in
 action.
 Now the problem: I've initialized a project trought maven quikstart
 version:
 1.5rc1.

 A first test with the jetty engine work as aspected.

 the session is implemented with the following class:

 public class CheesrSession extends WebSession {

private Cart cart = new Cart();

public CheesrSession(Request request) {
super(request);
}

public Cart getCart(){

return cart;
}


 }


 and with the getHomePage method in the extended WebApplication:

  public Class getHomePage() {
return Index.class;
}


 I call the index page:

 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.Link;
 import org.apache.wicket.markup.html.list.ListItem;
 import org.apache.wicket.markup.html.list.ListView;
 import org.apache.wicket.model.PropertyModel;

 /**
  *
  * @author saverioscavelli
  */
 public class Index extends CheesrPage {

//private static final long serialVersionUID = 1L;


public Index() {

add(new ListView(cheeses, getCheeses()) {

@Override
protected void populateItem(ListItem item) {
//throw new UnsupportedOperationException(Not supported
 yet.);
Cheese cheese = (Cheese) item.getModelObject();
item.add(new Label(name, cheese.getName()));
item.add(new Label(description, cheese.getDesciption()));
item.add(new Label(price, $ + cheese.getPrice()));
item.add(new Link(add, item.getModel()) {

@Override
public void onClick() {
//throw new UnsupportedOperationException(Not
 supported yet.);
Cheese selected = (Cheese) getModelObject();
getCart().getCheeses().add(selected);
}
});
}
});


add(new ListView(cart, new PropertyModel(this, cart.cheeses)) {

@Override
protected void populateItem(ListItem item) {
//throw new UnsupportedOperationException(Not supported
 yet.);
Cheese cheese = (Cheese) item.getModelObject();
item.add(new Label(name, cheese.getName()));
item.add(new Label(price, $+ cheese.getPrice()));

item.add(new Link(remove, item.getModel()) {

@Override
public void onClick() {
//throw new UnsupportedOperationException(Not
 supported yet.);

Cheese selected = (Cheese) getModelObject();
getCart().getCheeses().remove(selected);
}
});

}
});
add(new Label(total, $+ getCart().getTotal()));


}



 }

 the index page extends the CheesrPage:

 import java.util.List;
 import org.apache.wicket.markup.html.WebPage;

 /**
  *
  * @author saverioscavelli
  */
 public abstract class CheesrPage extends WebPage {

public CheesrSession getCheesrSession(){

return  (CheesrSession) getSession();
}

public Cart getCart(){
return getCheesrSession().getCart();
}

public ListCheese getCheeses(){
return WicketApplication.get().getCheeses();
}

 }

 unfortunately I recive an Error that I dont really anderstand:

 Unexpected RuntimeException

 WicketMessage: Can't instantiate page using constructor public
 babilo.cheeser.cheesr.Index()

 Stacktrace

 Root cause:

 java.lang.ClassCastException: org.apache.wicket.protocol.http.WebSession
 cannot be cast to babilo.cheeser.cheesr.CheesrSession
 at
 babilo.cheeser.cheesr.CheesrPage.getCheesrSession(CheesrPage.java:31)
 at babilo.cheeser.cheesr.CheesrPage.getCart(CheesrPage.java:35)
 at babilo.cheeser.cheesr.Index.init(Index.java:81)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at

 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:155)
 at

 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:59)
 at

 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:43)
 at
 org.apache.wicket.Application$2.newPageInstance(Application.java:1157)
 at

 org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:259)
 at

 org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:160)
 at

 org.apache.wicket.request.handler.render.WebPageRenderer.getPage(WebPageRenderer.java:59)
 at

 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:212)
 at

 

Re: Storing and retrieving user uploaded images

2011-02-18 Thread Martin Grigorov
don't use . (current folder) in web apps
better user servletcontext.getAttribute(javax.servlet.context.tempdir) and
use that as root folder

if you need the uploads to be persistent (to be there after server restart)
then create your own folder (e.g. /apps/myapp/image-uploads)

On Fri, Feb 18, 2011 at 4:09 PM, Henrique Boregio hbore...@gmail.comwrote:

 Hi, I'm having trouble storing user uploaded images.

 In my WicketApplication class, I setup a folder to store users
 pictures, so I end up with a folder structure similar to this:
 ROOT FOLDER
 - user1_folder (pic1.jpg, pic2.jpg, etc...)
 - user2_folder ( ... )
 - ...

 The issue I am having is that this folder is created at
 src/main/java (I am using maven). When I run the application, the
 Root actually becomes the webapp folder, so the relative path
 changes.

 How can I unify this folder so that its absolute path remains the same
 no matter where it is called from?

 My current solutions is to hard-code it like: /src/main/java +
 userFolderName, but that's no the best way I'm sure.

 Thanks!

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




Re: wicket in action session Problems

2011-02-18 Thread Mike Mander
Have you overwriten the newSession(request, response) method in your 
WebApplication?

There you have to instantiate your ChesrSession.

Cheers
Mike

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



Re: Wicket Job Opportunity in Belgium (Leuven)

2011-02-18 Thread Josh Kamau
Hi,

Is this Open to people outside Belgium, Am in Nairobi.Kenya.Africa.

Kind regards.
Josh.

On Thu, Feb 17, 2011 at 11:10 PM, Maarten Bosteels
mbosteels@gmail.comwrote:

 Hi everyone,

 We are looking for a senior Java Developer, preferably with good knowledge
 of Wicket.

 You will join a team of 5 enthusiastic developers and are responsible for
 the implementation of
 new, challenging projects within our existing registration system.

 You support best practices such as TDD, continuous integration, design
 patterns and continuous refactoring, and you
 know how to apply them with the aim of guaranteeing the quality of the
 source code.

 For more details :
 http://www.dns.be/pdf/vacature-senior-developer-jan2011-en.pdf
 http://www.dns.be/pdf/vacature-senior-developer-jan2011-nl.pdf

 We offer

   - An interesting job with room for your own initiatives, responsibility
   and technical challenges in a
   financially healthy organisation.
   - A pleasant and stimulating work environment, with fun and professional
   colleagues in a great atmosphere.
   - Flexible working hours.
   - The opportunity to improve your knowledge and skills thanks to a
   personal development plan with 12 days of training a year.
   - A very attractive salary supplemented by extra legal benefits: group
   insurance, hospitalisation cover, meal vouchers, 32 holidays, laptop.

 Please send your resume to maarten.bosteels (at) dns.be

 *Maarten Bosteels*
 *Manager Software Development

 [image: dnsbe_logo.png]

 **DNS.be vzw/asbl*  · Ubicenter  · Philipssite 5 · bus 13 · 3001 Leuven

 www.dns.be



Re: Storing and retrieving user uploaded images

2011-02-18 Thread James Carman
On Fri, Feb 18, 2011 at 9:21 AM, Martin Grigorov mgrigo...@apache.org wrote:
 if you need the uploads to be persistent (to be there after server restart)
 then create your own folder (e.g. /apps/myapp/image-uploads)


Or a database.

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



Re: wicket in action session Problems

2011-02-18 Thread xaver

Thks.
 It works!!
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-in-action-session-Problems-tp3312697p3312794.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: EmailAddressValidator triggers on empty input field

2011-02-18 Thread hrbaer

Any idea?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/EmailAddressValidator-triggers-on-empty-input-field-tp3299464p3312795.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Erase Previous Error Messages in Feedback Panel after Download

2011-02-18 Thread eugenebalt

Hi Igor, the file isn't saved anywhere, it's immediately returned to the user
in the browser, as follows:

(in Form OnSubmit)

---
File f = generateExcelFile();  // generates a File object 
ResourceStreamRequestTarget target = new ResourceStreamRequestTarget(
new FileResourceStream(f));
target.setFileName(test.xls);
RequestCycle.get().setRequestTarget(target);
---

So I don't see how I can do a URL that points to it, unless we change our
whole architecture to store files somewhere. Would that be required? Or is
there an easier solution to do this Download/Refresh workaround?

Thanks
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Erase-Previous-Error-Messages-in-Feedback-Panel-after-Download-tp3311648p3312811.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: EmailAddressValidator triggers on empty input field

2011-02-18 Thread Mike Mander

Am 18.02.2011 15:39, schrieb hrbaer:

Any idea?
Did you check INullAcceptingValidatorT and 
AbstractValidatorT.validateOnNullValue() ?

They discribe what is to do.

Cheers
Mike

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



LoadableDetachableModel

2011-02-18 Thread Anna Simbirtsev
Hi,

I have a list view, and I am using  LoadableDetachableModel as the
model for the list view.

The only problem that I have is I also have add more button, that adds
extra rows to the list view using ajax.

Since the model is read only, I can't add any rows to it.


WebMarkupContainer myPanel = new WebMarkupContainer(
myPanel);
myPanel.setOutputMarkupId(true);
form.add(myPanel);

final ListViewObject lv = new ListViewObject(rows, (QueryModel)
getDefaultModel()) {

private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItemObject item)
{
Myrecord dR = (Myrecord) item.getModelObject();


item.add(new TextFieldInteger(value,
new PropertyModelInteger(dR, value),
Integer.class));
}

myPanel.add(lv);

AjaxSubmitLink addLink = new AjaxSubmitLink(addRow) {

private static final long serialVersionUID = 1L;

@Override
public void onSubmit(AjaxRequestTarget target, Form? 
form)
{
if (count  10)
{
lv.getModelObject().add(new Myrecord());

if (target != null)
{
target.addComponent(myPanel);
count++;

if (count = 10)
{

addLink.setVisible(false);

target.addComponent(addLink);
}
}
}
}
};
addLink.setDefaultFormProcessing(false);

if (count = 10)
addLink.setVisible(false);

form.add(addLink);


The QueryModel is a class extending LoadableDetachableModel

What other model can I use?

Thanks

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



Re: EmailAddressValidator triggers on empty input field

2011-02-18 Thread James Carman
Right, but for this validator you are forced to use the singleton,
which doesn't allow you to customize this feature.

On Fri, Feb 18, 2011 at 9:53 AM, Mike Mander wicket-m...@gmx.de wrote:
 Am 18.02.2011 15:39, schrieb hrbaer:

 Any idea?

 Did you check INullAcceptingValidatorT and
 AbstractValidatorT.validateOnNullValue() ?
 They discribe what is to do.

 Cheers
 Mike

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



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



Re: Extend AjaxFormComponentUpdatingBehavior functionality for required FormComponents

2011-02-18 Thread Daniel Stoch
On Thu, Feb 17, 2011 at 10:37 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 validation is there to make sure the user of the webapp cannot push an
 illegal value into a model. it doesnt matter if its just the component
 that is being submitted or the entire form. components decide whether
 or not a user can push null in by using their required flag. you want
 to push null, dont mark the component as required. it is as simple as
 that. you can create your own updating behavior that calls
 setrequired(false) on the component prior to running validation/model
 update if that is what you want. but we will not ship something like
 this as part of core because it doesnt generally make sense.

 -igor

I've found examples in Wicket core, which are very similar to my
use-cases, so it looks like sometimes it does make sense :).

Look at the classes which implements IOnChangeListener. There is a
method onSelectionChanged() which implementation in many cases looks
like:

public final void onSelectionChanged()
{
convertInput();
updateModel();
onSelectionChanged(getModelObject());
}

So as you can see here validation is bypassed and null values can be
push into the model even if FormComponent is required. Eg.
DropDownChoice: when I use non-ajax
wantOnSelectionChangedNotifications() I can push null into its model,
but the same thing does not work with OnChangeAjaxBehavior(). So there
is a small inconsistence between ajax and non-ajax functionality. My
case is to allow the same behavior for ajax calls.

--
Daniel

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



Re: EmailAddressValidator triggers on empty input field

2011-02-18 Thread Mike Mander

I checked a little example and it worked as expected:
- nothing in field ENTER results in All valid!
- wrong email in field ENTER results in oops
- valid email in field ENTER results in All valid!

public class HomePage extends WebPage {

public HomePage(final PageParameters parameters) {
FormVoid form = new FormVoid(form) {
@Override
protected void onSubmit() {
System.out.println(All valid!);
}

@Override
protected void onError() {
System.out.println(oops);
}
};
TextFieldString email = new TextFieldString(email, new 
ModelString());

email.add(EmailAddressValidator.getInstance());
email.setRequired(false);
form.add(email);
add(form);
}
}

html
?xml version=1.0 encoding=UTF-8 ?
html 
xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;

headtitleTitle/title/head
bodyform wicket:id=forminput type=text wicket:id=email 
//form/body

/html

Right, but for this validator you are forced to use the singleton,
which doesn't allow you to customize this feature.

On Fri, Feb 18, 2011 at 9:53 AM, Mike Manderwicket-m...@gmx.de  wrote:

Am 18.02.2011 15:39, schrieb hrbaer:

Any idea?

Did you check INullAcceptingValidatorT  and
AbstractValidatorT.validateOnNullValue() ?
They discribe what is to do.

Cheers
Mike

-
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



Re: Erase Previous Error Messages in Feedback Panel after Download

2011-02-18 Thread jcgarciam

Explore the option of having a Resource mounted at a Fixed URL that will
serves your file (It will create/load your file on demand) if you hit that
URL. In that way you can do what Igor's said.



On Fri, Feb 18, 2011 at 11:49 AM, eugenebalt [via Apache Wicket] 
ml-node+3312811-825428239-65...@n4.nabble.com wrote:

 Hi Igor, the file isn't saved anywhere, it's immediately returned to the
 user in the browser, as follows:

 (in Form OnSubmit)

 ---
 File f = generateExcelFile();  // generates a File object
 ResourceStreamRequestTarget target = new ResourceStreamRequestTarget(
 new FileResourceStream(f));

 target.setFileName(test.xls);
 RequestCycle.get().setRequestTarget(target);
 ---

 So I don't see how I can do a URL that points to it, unless we change our
 whole architecture to store files somewhere. Would that be required? Or is
 there an easier solution to do this Download/Refresh workaround?

 Thanks

 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://apache-wicket.1842946.n4.nabble.com/Erase-Previous-Error-Messages-in-Feedback-Panel-after-Download-tp3311648p3312811.html
  To start a new topic under Apache Wicket, email
 ml-node+1842946-398011874-65...@n4.nabble.com
 To unsubscribe from Apache Wicket, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=.





-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
--Anyone who has never made a mistake has never tried anything new.--

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Erase-Previous-Error-Messages-in-Feedback-Panel-after-Download-tp3311648p3312908.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Erase Previous Error Messages in Feedback Panel after Download

2011-02-18 Thread eugenebalt

That would introduce a whole new level of complexity. Such a resource service
would need to be thread-safe, it would have to have cleanup of old
documents, or maybe the documents would need to be stored in a database.

Is there a relatively easy way to take care of this problem, which is
thread-safe and won't require creating an entirely new module?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Erase-Previous-Error-Messages-in-Feedback-Panel-after-Download-tp3311648p3312921.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: LoadableDetachableModel

2011-02-18 Thread Sven Meier

Hi,

I assume your query model loads the records from a db? Then persist the new
Myrecord first (via a DAO and/or service layer) and then detach the model
explicitely to let it query a fresh state.

WebMarkupContainer myPanel = new WebMarkupContainer(myPanel);
myPanel.setOutputMarkupId(true);
form.add(myPanel);

final QueryModel model = (QueryModel)getDefaultModel();

final ListView lv = new ListView(rows, model) {
@Override
protected void populateItem(ListItem item) {
// don't pull anything out of models just to place it into 
another model,
// otherwise you're just increasing your session size
item.add(new TextFieldInteger(value,
new PropertyModelInteger(item.getModel(), value),
Integer.class));
}
}
myPanel.add(lv);

AjaxSubmitLink addLink = new AjaxSubmitLink(addRow) {
@Override
public void onSubmit(AjaxRequestTarget target, Form? form) {
// let you service layer persist the new record 
dao.persist(new Myrecord());
// let the model query a fresh state
model.detach();

if (target != null) {
target.addComponent(myPanel);
target.addComponent(addLink);
}
}
public boolean isVisible() {
// although disdained recently IMHO this is a perfect place to 
override
isVisible()
// and be always up-to-date
return super.isVisible()  model.getObject().size()  10
}
};
addLink.setDefaultFormProcessing(false);
form.add(addLink);

HTH

Sven
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/LoadableDetachableModel-tp3312829p3312947.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: LoadableDetachableModel

2011-02-18 Thread Anna Simbirtsev
No, it sends a request somewhere and gets a response, I can't change
the response. is there any other way? or maybe I need to change the
model?

On Fri, Feb 18, 2011 at 10:52 AM, Sven Meier s...@meiers.net wrote:

 Hi,

 I assume your query model loads the records from a db? Then persist the new
 Myrecord first (via a DAO and/or service layer) and then detach the model
 explicitely to let it query a fresh state.

 WebMarkupContainer myPanel = new WebMarkupContainer(myPanel);
 myPanel.setOutputMarkupId(true);
 form.add(myPanel);

 final QueryModel model = (QueryModel)getDefaultModel();

 final ListView lv = new ListView(rows, model) {
        @Override
        protected void populateItem(ListItem item) {
                // don't pull anything out of models just to place it into 
 another model,
                // otherwise you're just increasing your session size
                item.add(new TextFieldInteger(value,
                        new PropertyModelInteger(item.getModel(), value),
                        Integer.class));
        }
 }
 myPanel.add(lv);

 AjaxSubmitLink addLink = new AjaxSubmitLink(addRow) {
        @Override
        public void onSubmit(AjaxRequestTarget target, Form? form) {
                // let you service layer persist the new record
                dao.persist(new Myrecord());
                // let the model query a fresh state
                model.detach();

                if (target != null)     {
                        target.addComponent(myPanel);
                        target.addComponent(addLink);
                }
        }
        public boolean isVisible() {
                // although disdained recently IMHO this is a perfect place to 
 override
 isVisible()
                // and be always up-to-date
                return super.isVisible()  model.getObject().size()  10
        }
 };
 addLink.setDefaultFormProcessing(false);
 form.add(addLink);

 HTH

 Sven
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/LoadableDetachableModel-tp3312829p3312947.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





-- 
Anna Simbirtsev
(416) 729-7331

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



1.5RC1 url mounting/encoding

2011-02-18 Thread nimmy

Hi,

Using Wicket 1.5RC1, how do I mount a Page to root that is other than the
home page? E.g.:

www.myapp.com -IndexPage.class

www.myapp.com/${username} -OtherPage.class with ${username} as a
pageparameter

thanks,
Nim
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5RC1-url-mounting-encoding-tp3312989p3312989.html
Sent from the Users forum mailing list archive at Nabble.com.

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



dynamic tree model

2011-02-18 Thread Anna Simbirtsev
Hi,

I have a tree with ExternalLink as a leaf node. Is it possible to make
the tree dynamic? Like when the user clicks on a +, the model gets
reloaded and the tree rerendered?

Thanks
Anna

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



Re: 1.5RC1 url mounting/encoding

2011-02-18 Thread Christian Grobmeier
Hi,

 Using Wicket 1.5RC1, how do I mount a Page to root that is other than the
 home page? E.g.:

 www.myapp.com -IndexPage.class

can you try this?
mountPackage(/, IndexPage.class);
Not sure about - try mountPage if you don't want to mount the package
Christian


 www.myapp.com/${username} -OtherPage.class with ${username} as a
 pageparameter

 thanks,
 Nim
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/1-5RC1-url-mounting-encoding-tp3312989p3312989.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





-- 
http://www.grobmeier.de

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



Re: EmailAddressValidator triggers on empty input field

2011-02-18 Thread hrbaer

Finally I got it.

If you add setType( String.class ) to your TextField the
EmailAddressValidator triggers on null/empty input. If you leave this
everything works fine...

I thought it would be useful to declare my inputfields as a certain type.
Obviously it's not needed but also the outcome of this type is an error.

Can anybody provide the sense of setting the type?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/EmailAddressValidator-triggers-on-empty-input-field-tp3299464p3313014.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: dynamic tree model

2011-02-18 Thread Mike Mander

Am 18.02.2011 17:10, schrieb Anna Simbirtsev:

Hi,

I have a tree with ExternalLink as a leaf node. Is it possible to make
the tree dynamic? Like when the user clicks on a +, the model gets
reloaded and the tree rerendered?

Thanks
Anna

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


Checkout http://code.google.com/p/wicket-tree/ this is great for dynamic 
trees.


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



Re: Extend AjaxFormComponentUpdatingBehavior functionality for required FormComponents

2011-02-18 Thread Igor Vaynberg
that looks like a bug to me. the reason it has gone unnoticed for so
long is that someone would have to hack html to cause it. onchange
only fires in browsers when there is a value selected, so that code
would not typically be called with a null, and thus no need to check
required.

-igor

On Fri, Feb 18, 2011 at 7:22 AM, Daniel Stoch daniel.st...@gmail.com wrote:
 On Thu, Feb 17, 2011 at 10:37 PM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 validation is there to make sure the user of the webapp cannot push an
 illegal value into a model. it doesnt matter if its just the component
 that is being submitted or the entire form. components decide whether
 or not a user can push null in by using their required flag. you want
 to push null, dont mark the component as required. it is as simple as
 that. you can create your own updating behavior that calls
 setrequired(false) on the component prior to running validation/model
 update if that is what you want. but we will not ship something like
 this as part of core because it doesnt generally make sense.

 -igor

 I've found examples in Wicket core, which are very similar to my
 use-cases, so it looks like sometimes it does make sense :).

 Look at the classes which implements IOnChangeListener. There is a
 method onSelectionChanged() which implementation in many cases looks
 like:

        public final void onSelectionChanged()
        {
                convertInput();
                updateModel();
                onSelectionChanged(getModelObject());
        }

 So as you can see here validation is bypassed and null values can be
 push into the model even if FormComponent is required. Eg.
 DropDownChoice: when I use non-ajax
 wantOnSelectionChangedNotifications() I can push null into its model,
 but the same thing does not work with OnChangeAjaxBehavior(). So there
 is a small inconsistence between ajax and non-ajax functionality. My
 case is to allow the same behavior for ajax calls.

 --
 Daniel

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



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



Re: RepeatingView/RefreshingView: Inform children about being deleted

2011-02-18 Thread Igor Vaynberg
file a bug with a quickstart. onremove() should be called on all
removed components.

-igor

On Fri, Feb 18, 2011 at 5:38 AM, Benedikt Rothe benedikt.ro...@qleo.de wrote:
 Hi

 Are the existing children of a RepeatingView/RefreshingView being informed,
 when
 the View is newly populated (RefreshingView.onPopulate).

 I'd like to clean some internal references in this case.
 I tried:
 - aChild.onRemove is not called in this situation
 - aChild.setParent(null) is called. I treid to override setParent it. But
 setParent is private.

 Any suggestions?
 Benedikt

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



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



Re: 1.5RC1 url mounting/encoding

2011-02-18 Thread nimmy

Hi Christian,

Thanks for your reply. I have already set the Index page as the homepage. 

I was trying to figure out how to handle this: www.myapp.com/username where
username is variable

Cheers,
Nim
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5RC1-url-mounting-encoding-tp3312989p3313088.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Upload/Download FormComponent

2011-02-18 Thread msj121

Not exactly sure what the issue is. You can simply put the components into
panels (or other objects). Meaning make a Download Component, then an Upload
Component separate classes so they can be re-used in the future if you only
want to allow a download form... then put them in one form and decide which
panel to show (each panel holding 2 components). Then the onsubmit method
knows which is showing (since its the same component that decides which to
show) and in theory that is the least amount of code as far as I can
tell

More then that I am not sure what you are asking for I don't consider
myself a seasoned wicketeer though.

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Upload-Download-FormComponent-tp3310023p3313094.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: 1.5RC1 url mounting/encoding

2011-02-18 Thread Igor Vaynberg
try mountPage(${username}, MyPage.class) and access username through
pageparameters

-igor

On Fri, Feb 18, 2011 at 8:41 AM, nimmy nim_sa...@hotmail.com wrote:

 Hi Christian,

 Thanks for your reply. I have already set the Index page as the homepage.

 I was trying to figure out how to handle this: www.myapp.com/username where
 username is variable

 Cheers,
 Nim
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/1-5RC1-url-mounting-encoding-tp3312989p3313088.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



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



Re: Storing and retrieving user uploaded images

2011-02-18 Thread msj121

You can see how this works for you:

String path =  WebApplication.get().getServletContext().getRealPath();
Folder uploadFolder = new Folder(path+/uploads);

public String getURLFolder(){
return
getServletContext().getContextPath()+uploadFolder.getPath().replace(path,
);
}


I remember writing this a long time ago, looking at it now, not sure why or
what the difference is getRealPath() and getContextPath(), and not
sure if Wicket 1.5 changed this code, but this worked for me, though I hope
to migrate to a database that way there should be much much less issue in
regard to scaling to 20 servers... where sharing a database and backing up
is readily done and improved whereas sharing files probably not

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Storing-and-retrieving-user-uploaded-images-tp3312735p3313112.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Extend AjaxFormComponentUpdatingBehavior functionality for required FormComponents

2011-02-18 Thread Daniel Stoch
It can be called with null value when you set DropDownChoice.setNullValid(true).
You don't want to understand that this is a good behavior in many
cases, not a bug. But ok it is your framework, so you decide. But
maybe other Wicket commiters have a different feeling about it?

--
Daniel

On Fri, Feb 18, 2011 at 5:36 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 that looks like a bug to me. the reason it has gone unnoticed for so
 long is that someone would have to hack html to cause it. onchange
 only fires in browsers when there is a value selected, so that code
 would not typically be called with a null, and thus no need to check
 required.

 -igor

 On Fri, Feb 18, 2011 at 7:22 AM, Daniel Stoch daniel.st...@gmail.com wrote:
 On Thu, Feb 17, 2011 at 10:37 PM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 validation is there to make sure the user of the webapp cannot push an
 illegal value into a model. it doesnt matter if its just the component
 that is being submitted or the entire form. components decide whether
 or not a user can push null in by using their required flag. you want
 to push null, dont mark the component as required. it is as simple as
 that. you can create your own updating behavior that calls
 setrequired(false) on the component prior to running validation/model
 update if that is what you want. but we will not ship something like
 this as part of core because it doesnt generally make sense.

 -igor

 I've found examples in Wicket core, which are very similar to my
 use-cases, so it looks like sometimes it does make sense :).

 Look at the classes which implements IOnChangeListener. There is a
 method onSelectionChanged() which implementation in many cases looks
 like:

        public final void onSelectionChanged()
        {
                convertInput();
                updateModel();
                onSelectionChanged(getModelObject());
        }

 So as you can see here validation is bypassed and null values can be
 push into the model even if FormComponent is required. Eg.
 DropDownChoice: when I use non-ajax
 wantOnSelectionChangedNotifications() I can push null into its model,
 but the same thing does not work with OnChangeAjaxBehavior(). So there
 is a small inconsistence between ajax and non-ajax functionality. My
 case is to allow the same behavior for ajax calls.

 --
 Daniel

 -
 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



Re: 1.5RC1 url mounting/encoding

2011-02-18 Thread nimmy

Thanks for that Igor. I have another 1.5RC1 question - where do I set the
redirect flag? E.g. in 1.4, when the user logs out of the app I do the
following:

getSession().invalidate();
getRequestCycle().setRedirect(true);
setResponsePage(MyApplication.get().getHomePage());

The API has changed and I cannot find where to set the redirect flag.

Thanks for your help.

Nim
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5RC1-url-mounting-encoding-tp3312989p3313151.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Erase Previous Error Messages in Feedback Panel after Download

2011-02-18 Thread eugenebalt

One other question I have, how do I know what will happpen first? (Ajax or
Refresh)?

Suppose I add JavaScript to my Ajax Button Click; my file-generation happens
in the OnSubmit(), so I don't know whether I have the file already or not.
In fact, my output console shows that the Ajax Click always happens first.
It's possible that my file hasn't been generated due to errors, so I can't
always jump to a URL immediately.

Any thoughts on this? I would need to make the Ajax/JavaScript URL Download
*WAIT* until all the validators have kicked in and the form submission has
executed successfully, because the file is created in Form onSubmit() and
depends on validators. Thanks
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Erase-Previous-Error-Messages-in-Feedback-Panel-after-Download-tp3311648p3313200.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Output localized sentence text containing wicket link

2011-02-18 Thread Watter

I am trying to generate something like the following output:

This is a sentence with  something some text  that is linked.

The text of the sentence needs to be localized. The link needs to be normal
wicket Link. 

I think that if we were using the localization approach where the pages
themselves are localized (i.e. MyPage_fr.html) then this would be pretty
easy, but we're using properties files (actually one property file for the
entire application). It occurred to a colleague of mine that if I used a
property file entry like:

sentence.to.localize=This is a sentence with {0}some text{1} that is
linked.

I could then figure out a way to render the wicket link into a string and
then use that string as the replacement for the variables above; however, I
can't seem to figure out how to do that either.

This seems like a fairly basic need so I'm sure there's a straightforward
way to accomplish this, but after searching the mailing list archive and the
wiki, I haven't been able to figure it out yet. We're still on Wicket 1.3 if
it makes any difference.

Any advice?




-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Output-localized-sentence-text-containing-wicket-link-tp3313207p3313207.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Erase Previous Error Messages in Feedback Panel after Download

2011-02-18 Thread Gabriel Landon

You could try this : 

https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html 

That what I use to do what you want to do...
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Erase-Previous-Error-Messages-in-Feedback-Panel-after-Download-tp3311648p3313254.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: EmailAddressValidator triggers on empty input field

2011-02-18 Thread nino martinez wael
If you need anything else than string, integer for example its needed
On Feb 18, 2011 5:14 PM, hrbaer herber.m...@gmail.com wrote:

 Finally I got it.

 If you add setType( String.class ) to your TextField the
 EmailAddressValidator triggers on null/empty input. If you leave this
 everything works fine...

 I thought it would be useful to declare my inputfields as a certain type.
 Obviously it's not needed but also the outcome of this type is an error.

 Can anybody provide the sense of setting the type?
 --
 View this message in context:
http://apache-wicket.1842946.n4.nabble.com/EmailAddressValidator-triggers-on-empty-input-field-tp3299464p3313014.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Erase Previous Error Messages in Feedback Panel after Download

2011-02-18 Thread eugenebalt

Thanks for that example. How do I create an IResourceStream?

According to that example, I need to provide a custom
createResourceStream(). I have a File object returned to me as part of my
file generation, how do I convert the File into an IResourceStream? Thanks
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Erase-Previous-Error-Messages-in-Feedback-Panel-after-Download-tp3311648p3313366.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Extend AjaxFormComponentUpdatingBehavior functionality for required FormComponents

2011-02-18 Thread Daniel Stoch
On Fri, Feb 18, 2011 at 10:09 AM, Daniel Stoch daniel.st...@gmail.com wrote:


 My post was only a proposal, because it is not possible to easy extend
 AjaxFormComponentUpdatingBehavior because onEvent() is final. I want
 to avoid copy/paste code with only a little change. And I think this
 change is very useful. But ok, I understand you, so I'll implement it
 by myself.

I've tried to implement my own behavior (with an option to bypass
validation step). But unfortunately I cannot call
formComponent.convertInput() which is necessary to get value from
input. This is a protected method. Can you make it a public method?

--
Daniel

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



multiple markup files for on panel

2011-02-18 Thread fachhoch

its it possible to have multiple mark up files for one panel 

My panel has list view , in one place I want  to use an ordered list and in
other place I want to use a table ,I can achieve this if  my panel has
multiple markup files and my panel will  return the mark up based on
preferenece .
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/multiple-markup-files-for-on-panel-tp3313413p3313413.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: multiple markup files for on panel

2011-02-18 Thread splitshade

Hi, 

why dont you just extend your Panel and just add another Markup?
The extended Panel doesnt do anything, but can have another Markup. We 
have done this often.

Regards

Martin
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/multiple-markup-files-for-on-panel-tp3313413p3313427.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Erase Previous Error Messages in Feedback Panel after Download

2011-02-18 Thread eugenebalt

Gabriel Landon, I got it to work, but my Validators don't work any more.

I need the validators to check for empty fields etc. BEFORE downloading.
Before, the validator chain was working in Form onSubmit(). Now with this
AjaxDownload, no Validators get activated. Any ideas?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Erase-Previous-Error-Messages-in-Feedback-Panel-after-Download-tp3311648p3313435.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: multiple markup files for on panel

2011-02-18 Thread Per Newgro

Do you want to display ordered list and table alternativly?
Build two panels - one for the ordered list and one for the table.
Add this to a parent panel by preference. This panel simply has
a div or whatever and will be extended by markup of choosen panel.
So you don't have to provide one component with multiple markups.


HTH
Per


its it possible to have multiple mark up files for one panel

My panel has list view , in one place I want  to use an ordered list and in
other place I want to use a table ,I can achieve this if  my panel has
multiple markup files and my panel will  return the mark up based on
preferenece .



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



Re: multiple markup files for on panel

2011-02-18 Thread Scott Swank
Check out variations and styles.

https://cwiki.apache.org/WICKET/multiple-markups-per-page.html

Scott

On Fri, Feb 18, 2011 at 11:46 AM, splitshade
martin.dil...@googlemail.com wrote:

 Hi,

 why dont you just extend your Panel and just add another Markup?
 The extended Panel doesnt do anything, but can have another Markup. We
 have done this often.

 Regards

 Martin
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/multiple-markup-files-for-on-panel-tp3313413p3313427.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



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



Re: multiple markup files for on panel

2011-02-18 Thread Scott Swank
...and this too

https://cwiki.apache.org/WICKET/localization-and-skinning-of-applications.html

Scott

On Fri, Feb 18, 2011 at 11:52 AM, Scott Swank scott.sw...@gmail.com wrote:
 Check out variations and styles.

 https://cwiki.apache.org/WICKET/multiple-markups-per-page.html

 Scott

 On Fri, Feb 18, 2011 at 11:46 AM, splitshade
 martin.dil...@googlemail.com wrote:

 Hi,

 why dont you just extend your Panel and just add another Markup?
 The extended Panel doesnt do anything, but can have another Markup. We
 have done this often.

 Regards

 Martin
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/multiple-markup-files-for-on-panel-tp3313413p3313427.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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



Re: multiple markup files for on panel

2011-02-18 Thread splitshade

hi,

omg, thank you for the hint on variations, i did not know it could be so
simple!
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/multiple-markup-files-for-on-panel-tp3313413p3313461.html
Sent from the Users forum mailing list archive at Nabble.com.

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



wicket tree

2011-02-18 Thread mlabs

wicket noob question:
I'm trying to change the width of the simple Tree component .. it seems to
be defined in tree.css as 20em .. what's the correct way to override this? 
TIA
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-tree-tp3313498p3313498.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Wicket log4j configuration, log wicket errors to file

2011-02-18 Thread Brown, Berlin [GCG-PFS]
I think I was able to log wicket log4j messages (pre wicket verson
1.4.10) by specificying a log4j appender for the wicket package.
 
E.g. org.apache.wicket.*
 
But, I wonder with the recent version of wicket, do I have to use
org.slf4j.impl ... 
 
Basically, is there anything special to redirect wicket logging messages
through log4j?
 
 
[2/18/11 15:45:24:747 EST] 0024 RequestCycle E
org.slf4j.impl.JCLLoggerAdapter error
org.apache.wicket.WicketRuntimeException: Internal error parsing
wicket:interface = SDFSD

org.apache.wicket.protocol.http.request.InvalidUrlException:
org.apache.wicket.WicketRuntimeException: Internal error parsing
wicket:interface = SDFSD

at
org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.decode(
WebRequestCodingStrategy.java:235)

at org.apache.wicket.Request.getRequestParameters(Request.java:183)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)

at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)



Re: wicket tree

2011-02-18 Thread Moez BR
Just write your own style with the same id, it will override the other, isn't?

Sent from my iPhone

Le 18 févr. 2011 à 21:40, mlabs mlabs@gmail.com a écrit :

 
 wicket noob question:
 I'm trying to change the width of the simple Tree component .. it seems to
 be defined in tree.css as 20em .. what's the correct way to override this? 
 TIA
 -- 
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/wicket-tree-tp3313498p3313498.html
 Sent from the Users forum mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 

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



Re: wicket tree

2011-02-18 Thread mlabs

I tried adding this to the head on the page containing the tree:

style type=text/css
div.wicket-tree {
white-space: nowrap;
/*border: 1px solid #ccc;  remove border*/
width: 60em;   /* increase width to 60em*/
overflow: auto;
margin: 10px;
line-height: 1.5em;
}
/style

but it didn't seem to have any effect..? 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-tree-tp3313498p3313566.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket Job Opportunity in Belgium (Leuven)

2011-02-18 Thread Maarten Bosteels
Hi,

We are looking for a permanent, full-time position, not for a consultant.
We need someone who is able to work at our office at least 4 days a week.
So I am afraid that living in (or moving to) Belgium is a requirement

best regards
Maarten

On Fri, Feb 18, 2011 at 3:30 PM, Josh Kamau joshnet2...@gmail.com wrote:

 Hi,

 Is this Open to people outside Belgium, Am in Nairobi.Kenya.Africa.

 Kind regards.
 Josh.

 On Thu, Feb 17, 2011 at 11:10 PM, Maarten Bosteels
 mbosteels@gmail.comwrote:

  Hi everyone,
 
  We are looking for a senior Java Developer, preferably with good
 knowledge
  of Wicket.
 
  You will join a team of 5 enthusiastic developers and are responsible for
  the implementation of
  new, challenging projects within our existing registration system.
 
  You support best practices such as TDD, continuous integration, design
  patterns and continuous refactoring, and you
  know how to apply them with the aim of guaranteeing the quality of the
  source code.
 
  For more details :
  http://www.dns.be/pdf/vacature-senior-developer-jan2011-en.pdf
  http://www.dns.be/pdf/vacature-senior-developer-jan2011-nl.pdf
 
  We offer
 
- An interesting job with room for your own initiatives, responsibility
and technical challenges in a
financially healthy organisation.
- A pleasant and stimulating work environment, with fun and
 professional
colleagues in a great atmosphere.
- Flexible working hours.
- The opportunity to improve your knowledge and skills thanks to a
personal development plan with 12 days of training a year.
- A very attractive salary supplemented by extra legal benefits: group
insurance, hospitalisation cover, meal vouchers, 32 holidays, laptop.
 
  Please send your resume to maarten.bosteels (at) dns.be
 
  *Maarten Bosteels*
  *Manager Software Development
 
  [image: dnsbe_logo.png]
 
  **DNS.be vzw/asbl*  · Ubicenter  · Philipssite 5 · bus 13 · 3001 Leuven
 
  www.dns.be
 



Re: Extend AjaxFormComponentUpdatingBehavior functionality for required FormComponents

2011-02-18 Thread Pedro Santos
Do your use case needs to convert a null input? If the input is differs from
null FormComponent#validate will be just fine.


On Fri, Feb 18, 2011 at 5:20 PM, Daniel Stoch daniel.st...@gmail.comwrote:

 On Fri, Feb 18, 2011 at 10:09 AM, Daniel Stoch daniel.st...@gmail.com
 wrote:

 
  My post was only a proposal, because it is not possible to easy extend
  AjaxFormComponentUpdatingBehavior because onEvent() is final. I want
  to avoid copy/paste code with only a little change. And I think this
  change is very useful. But ok, I understand you, so I'll implement it
  by myself.

 I've tried to implement my own behavior (with an option to bypass
 validation step). But unfortunately I cannot call
 formComponent.convertInput() which is necessary to get value from
 input. This is a protected method. Can you make it a public method?

 --
 Daniel

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Extend AjaxFormComponentUpdatingBehavior functionality for required FormComponents

2011-02-18 Thread Pedro Santos
On Thu, Feb 17, 2011 at 8:32 PM, Daniel Stoch daniel.st...@gmail.comwrote:

 On Thu, Feb 17, 2011 at 10:37 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
  validation is there to make sure the user of the webapp cannot push an
  illegal value into a model. it doesnt matter if its just the component
  that is being submitted or the entire form. components decide whether
  or not a user can push null in by using their required flag. you want
  to push null, dont mark the component as required. it is as simple as
  that.

 But you ommit something: model can contains a null value on startup
 and event though a formcomponent has a valid state on the first
 render. So passing null to this model later is like resseting its
 state to original (null) value :).
 Another thing is than I can set null in code and bypass component
 validation. So I can push null into this model, but the final
 validation will still work.

 Maybe I should explain one of use-cases. Let's say we have a form to
 enter RSS feed information. There are two TextFields:
 - url for RSS feed (urlModel)
 - custom RSS feed name (nameModel).
 Both are required and both have OnChangeBehavior attached. When user
 enter url for RSS the name of it is retrieved and set into nameModel.
 But only when nameModel has null object or nameEdited (boolean flag)
 is false.
 Now user can edit name field (then nameEdited flag is set to true, to
 avoid changing this name when user change url).
 But when user clears name field nameModel should be updated to null,
 but behavior does not allow this (because of validation of required
 field).


Why user would clear the name field if in the related use case we expect an
edition? I still think that onError callback is the right place to code the
response to this input.


  you can create your own updating behavior that calls
  setrequired(false) on the component prior to running validation/model
  update if that is what you want. but we will not ship something like
  this as part of core because it doesnt generally make sense.

 Probably I'll write my own behavior, because it seems this is the only
 solution :).
 Maybe it does not make sense from your point of view, but from mine it
 does. I think your point of view is sometimes too narrow.

 --
 Daniel


  On Thu, Feb 17, 2011 at 1:33 PM, Daniel Stoch daniel.st...@gmail.com
 wrote:
  On Thu, Feb 17, 2011 at 10:01 PM, Igor Vaynberg 
 igor.vaynb...@gmail.com wrote:
  if you want to push a null value into a component you marked required
  then dont mark it as required.
 
  No, because then I must have my own customrequired flags instead of
  using the core mechanism. I think this is wrong way.
  There is a wrong assumption that when component is marked as required
  then I cannot push a null value to its model. Validation should not
  allow to submit a form (not allow to further processing). But during
  editing process when user fills the form and updates componenets
  (not submits whole form) it should be possible to push null in
  models (of course as an option).
  The current behavior leads to many boilerplate code which can be
 avoided.
 
  if you have inter-dependent validation
  use a formvalidator or override form's onsubmit.
 
  It is not this case here.
 
  --
  Daniel
 
  -
  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




-- 
Pedro Henrique Oliveira dos Santos


Re: wicket tree

2011-02-18 Thread msj121

Interestingly if the tree component has its own style unique to the component
I think it will or could override a css style applied for the page even
matching classes.

Perhaps you can also try on the component:

@Override
public void onComponentTag(ComponentTag tag){
   super.onComponentTag();
   tag.put(style, white-space: nowrap;width: 60em;overflow: auto;margin:
10px;line-height: 1.5em; );
}


The above is from memory but it should work... just put it inside the tree
component ie:
Tree tree = new Tree(...){
@Override public void onComponentTag(...){...}
};

I hope this helps, it will certainly narrow down the problem I think

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-tree-tp3313498p3313613.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: wicket tree

2011-02-18 Thread mlabs

that method puts the style on the enclosing div like so:

div wicket:id=test-tree style=... width:60em; ...
wicket:panel
div class=wicket-tree 
...

and the inner 'wicket-tree' style definition still seems to be taking
preference...

so still no joy  :(
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-tree-tp3313498p3313661.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Extend AjaxFormComponentUpdatingBehavior functionality for required FormComponents

2011-02-18 Thread Daniel Stoch
I need to pass any value (null or not null) to a model without
validation. So I cannot call validate() but only convertInput() (as
you can see for example in DropDownChoice). To do this inside a
behavior class convertInput() method must be public (or I need to hack
this using a reflection, but this is ugly solution).

--
Daniel

On Fri, Feb 18, 2011 at 10:50 PM, Pedro Santos pedros...@gmail.com wrote:
 Do your use case needs to convert a null input? If the input is differs from
 null FormComponent#validate will be just fine.


 On Fri, Feb 18, 2011 at 5:20 PM, Daniel Stoch daniel.st...@gmail.comwrote:

 On Fri, Feb 18, 2011 at 10:09 AM, Daniel Stoch daniel.st...@gmail.com
 wrote:

 
  My post was only a proposal, because it is not possible to easy extend
  AjaxFormComponentUpdatingBehavior because onEvent() is final. I want
  to avoid copy/paste code with only a little change. And I think this
  change is very useful. But ok, I understand you, so I'll implement it
  by myself.

 I've tried to implement my own behavior (with an option to bypass
 validation step). But unfortunately I cannot call
 formComponent.convertInput() which is necessary to get value from
 input. This is a protected method. Can you make it a public method?

 --
 Daniel

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




 --
 Pedro Henrique Oliveira dos Santos


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



Re: wicket tree

2011-02-18 Thread mlabs

well i'm beginning to get the impression that this particular tree isn't
intended for re-use .. and grepping around here I see that others have run
into this little chestnut too.. and that there is a better tree to use now
.. the LinkTree ? Ok so I tried that and no problems with sizing .. much
better.. so I guess the wicket examples are just out of date with respect to
trees..?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-tree-tp3313498p3313789.html
Sent from the Users forum mailing list archive at Nabble.com.

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