Re: load properties file from extrnal path

2012-08-06 Thread oliver.stef
Thanks Martin and Sandor!!
That was really helping!!!

I did it both - changed the Init() and added an external folder.
WORKS GREAT!!

Thanks again.
Oliver.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/load-properties-file-from-extrnal-path-tp4650944p4651007.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: Update two fields with AjaxFormComponentUpdatingBehavior

2012-08-06 Thread Sandor Feher
Hi,

Just for the archives the following do the trick.

helyseg.add(new AjaxFormComponentUpdatingBehavior(onchange) {

@Override
protected void onUpdate(AjaxRequestTarget art) {
try {
int irszam =
TelepulesIrszam.get(helyseg.getDefaultModelObjectAsString());   
 
bbsir_irszam_output.setDefaultModelObject(irszam);
bbsir_irszam.setDefaultModelObject(irszam); 
 
   * art.add(bbsir_irszam);*
art.add(bbsir_irszam_output);
} catch (NullPointerException e) {
error(Hibás helységnév!);
art.add(container);
}
}
});


Regards, Sandor



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Update-two-fields-with-AjaxFormComponentUpdatingBehavior-tp4650954p4651008.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: Repeating TextFields

2012-08-06 Thread vineet semwal
actually with quickview you can add/remove any number of items but i
might have overread/misunderstood what martin is saying..

On Thu, Aug 2, 2012 at 12:37 PM, Martin Grigorov mgrigo...@apache.org wrote:
 On Thu, Aug 2, 2012 at 3:25 AM, Benjamin Heiskell
 ben.heisk...@gmail.com wrote:
 Hi,

 I have a ListString that I want to represent with TextFields. I need
 to be able to dynamically add and remove them via AJAX.

 For dynamic add/remove of a single item see :
 https://github.com/vineetsemwal/quickview/wiki


 From what I’ve read online (and experienced firsthand) ListViews do
 not seem to be designed for this.

 What is the best way to approach this problem?

 Thanks!
 Ben

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




-- 
regards,

Vineet Semwal

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



Re: Repeating TextFields

2012-08-06 Thread Martin Grigorov
On Mon, Aug 6, 2012 at 12:52 PM, vineet semwal vineetsemwa...@gmail.com wrote:
 actually with quickview you can add/remove any number of items but i
 might have overread/misunderstood what martin is saying..

Correct!
I meant to add/remove just items without the need to repaint the
parent of the repeater.


 On Thu, Aug 2, 2012 at 12:37 PM, Martin Grigorov mgrigo...@apache.org wrote:
 On Thu, Aug 2, 2012 at 3:25 AM, Benjamin Heiskell
 ben.heisk...@gmail.com wrote:
 Hi,

 I have a ListString that I want to represent with TextFields. I need
 to be able to dynamically add and remove them via AJAX.

 For dynamic add/remove of a single item see :
 https://github.com/vineetsemwal/quickview/wiki


 From what I’ve read online (and experienced firsthand) ListViews do
 not seem to be designed for this.

 What is the best way to approach this problem?

 Thanks!
 Ben

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




 --
 regards,

 Vineet Semwal

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Repeating TextFields

2012-08-06 Thread vineet semwal
quickview *can* add/remove any number of items without the need to
repaint the parent of repeater,check the examples in the quickview ;)
,AjaxItemsNavigator and other new onscroll behaviors which i have
added recently would not have been possible if quickview was not
capable of that,they work like click/onscroll to see new rows added
like what you see in social networking applications...

On Mon, Aug 6, 2012 at 3:34 PM, Martin Grigorov mgrigo...@apache.org wrote:
 On Mon, Aug 6, 2012 at 12:52 PM, vineet semwal vineetsemwa...@gmail.com 
 wrote:
 actually with quickview you can add/remove any number of items but i
 might have overread/misunderstood what martin is saying..

 Correct!
 I meant to add/remove just items without the need to repaint the
 parent of the repeater.


 On Thu, Aug 2, 2012 at 12:37 PM, Martin Grigorov mgrigo...@apache.org 
 wrote:
 On Thu, Aug 2, 2012 at 3:25 AM, Benjamin Heiskell
 ben.heisk...@gmail.com wrote:
 Hi,

 I have a ListString that I want to represent with TextFields. I need
 to be able to dynamically add and remove them via AJAX.

 For dynamic add/remove of a single item see :
 https://github.com/vineetsemwal/quickview/wiki


 From what I’ve read online (and experienced firsthand) ListViews do
 not seem to be designed for this.

 What is the best way to approach this problem?

 Thanks!
 Ben

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




 --
 regards,

 Vineet Semwal

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




-- 
regards,

Vineet Semwal

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



Re: Repeating TextFields

2012-08-06 Thread vineet semwal
sorry i misread again :),i assumed you meant for more than one item
the parent has to be repainted .

On Mon, Aug 6, 2012 at 3:45 PM, vineet semwal vineetsemwa...@gmail.com wrote:
 quickview *can* add/remove any number of items without the need to
 repaint the parent of repeater,check the examples in the quickview ;)
 ,AjaxItemsNavigator and other new onscroll behaviors which i have
 added recently would not have been possible if quickview was not
 capable of that,they work like click/onscroll to see new rows added
 like what you see in social networking applications...

 On Mon, Aug 6, 2012 at 3:34 PM, Martin Grigorov mgrigo...@apache.org wrote:
 On Mon, Aug 6, 2012 at 12:52 PM, vineet semwal vineetsemwa...@gmail.com 
 wrote:
 actually with quickview you can add/remove any number of items but i
 might have overread/misunderstood what martin is saying..

 Correct!
 I meant to add/remove just items without the need to repaint the
 parent of the repeater.


 On Thu, Aug 2, 2012 at 12:37 PM, Martin Grigorov mgrigo...@apache.org 
 wrote:
 On Thu, Aug 2, 2012 at 3:25 AM, Benjamin Heiskell
 ben.heisk...@gmail.com wrote:
 Hi,

 I have a ListString that I want to represent with TextFields. I need
 to be able to dynamically add and remove them via AJAX.

 For dynamic add/remove of a single item see :
 https://github.com/vineetsemwal/quickview/wiki


 From what I’ve read online (and experienced firsthand) ListViews do
 not seem to be designed for this.

 What is the best way to approach this problem?

 Thanks!
 Ben

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




 --
 regards,

 Vineet Semwal

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




 --
 regards,

 Vineet Semwal



-- 
regards,

Vineet Semwal

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



ComponentNotFound exception question

2012-08-06 Thread Serban.Balamaci
Hi guys, I'm asking for an opinion on how to approach the following:

Wicket 1.5.7, browser Chrome, Firefox.

I have a FormTestPanel with 
TextField and AjaxFormComponentUpdatingBehavior attached:

AjaxFormComponentUpdatingBehavior formUpdate = new
AjaxFormComponentUpdatingBehavior(onblur) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
 //do nothing just want to update the textfield model on
leaving it
}

The Form also has an AjaxButton:
AjaxButton btnSend = new AjaxButton(sendMessage) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form? form)
{
//replace through ajax FormTestPanel with Empty panel
let's say
}
   }


My view on this was that the flow would be to queue events in this order:
Blur
Submit

somehow it gets to 
Submit
Blur

This causes a ComponentNotFoundException: Could not find component
'content-panel:form:textMessage'.

Shouldn't page versioning help with ComponentNotFound in this case? Sure
the component hierarchy changed after the form submit but that blur event
should have the older version of the page which had a different component
hierarchy?

I tried putting a Channel 0 type Drop on both behavior and AjaxButton:
@Override
protected AjaxChannel getChannel() {
return new AjaxChannel(0, AjaxChannel.Type.DROP);
}
but it doesn't seem to cancel any of them, anyway I wouldn't have expected
this to work as it would have probably canceled the submit button event but
it was reminiscent of the times when I thought the blur event gets triggered
twice.


My current solution was so far to setResponsePage which I think might work
as it will clearly target another version but I didn't want to have to give
up on the SinglePage setup.

Any other idea how I can handle this?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ComponentNotFound-exception-question-tp4651013.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: ComponentNotFound exception question

2012-08-06 Thread Martin Grigorov
Hi Serban,

This problem happens because after typing something in the text field
you click with the mouse on the button. This way the browser first
fires 'click' event for the button and then 'blur' event for the text
field.

DROP doesn't help because this is part of its design. The first Ajax
request fires and then all following requests in the same channel
should wait. With type QUEUE all scheduled requests are executed one
by one. With DROP - only the last one of the scheduled ones, i.e. only
the first and the last are executed, all in the middle are dropped. In
Wicket 6 there is a new type - ACTIVE, this one drops all requests if
there is currently running request in this channel. It would help you
only if you are 100% certain that 'blur' wont happen right before
'click'.

How to solve it? I see a workaround with AjaxCallDecorator - wrap the
script for the button in setTimeout() with some small value for the
delay. This way it will wait for 'blur' to be processed.

On Mon, Aug 6, 2012 at 2:11 PM, Serban.Balamaci thespamtr...@gmail.com wrote:
 Hi guys, I'm asking for an opinion on how to approach the following:

 Wicket 1.5.7, browser Chrome, Firefox.

 I have a FormTestPanel with
 TextField and AjaxFormComponentUpdatingBehavior attached:

 AjaxFormComponentUpdatingBehavior formUpdate = new
 AjaxFormComponentUpdatingBehavior(onblur) {
 @Override
 protected void onUpdate(AjaxRequestTarget target) {
  //do nothing just want to update the textfield model on
 leaving it
 }

 The Form also has an AjaxButton:
 AjaxButton btnSend = new AjaxButton(sendMessage) {
 @Override
 protected void onSubmit(AjaxRequestTarget target, Form? form)
 {
 //replace through ajax FormTestPanel with Empty panel
 let's say
 }
}


 My view on this was that the flow would be to queue events in this order:
 Blur
 Submit

 somehow it gets to
 Submit
 Blur

 This causes a ComponentNotFoundException: Could not find component
 'content-panel:form:textMessage'.

 Shouldn't page versioning help with ComponentNotFound in this case? Sure
 the component hierarchy changed after the form submit but that blur event
 should have the older version of the page which had a different component
 hierarchy?

 I tried putting a Channel 0 type Drop on both behavior and AjaxButton:
 @Override
 protected AjaxChannel getChannel() {
 return new AjaxChannel(0, AjaxChannel.Type.DROP);
 }
 but it doesn't seem to cancel any of them, anyway I wouldn't have expected
 this to work as it would have probably canceled the submit button event but
 it was reminiscent of the times when I thought the blur event gets triggered
 twice.


 My current solution was so far to setResponsePage which I think might work
 as it will clearly target another version but I didn't want to have to give
 up on the SinglePage setup.

 Any other idea how I can handle this?



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/ComponentNotFound-exception-question-tp4651013.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: ComponentNotFound exception question

2012-08-06 Thread Serban.Balamaci
Thanks Martin, I think it will work as the delay need be small enough for the
click event to enter the ajax queue after the blur so not much delay would
be introduced.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ComponentNotFound-exception-question-tp4651013p4651015.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



Paste Behaviour

2012-08-06 Thread saschisch87
Hi, I´m trying to accomplish the following Behaviour. 

I have a tree of Textareas. each one of them is modifiable. When you click
into one of them you can open a modal window where you can choose from
predefined textblocks. on confirmation of the selected block it should be
pasted where the cursor was in the last selected window. 

I´ve tried to do some javascript to accomplish that and it works like: 
(Pseudocode) take text from
document.forms[formName].elements[insertName].value

and put it into
document.forms[formName].elements[inputName];

The problem is that I can´t figure out how to execute the js on an event or
even avoid js and get the info directly in wicket.

Any Suggestions?



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

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



[1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form

2012-08-06 Thread heapifyman
Hello,

I've been struggling for a while now with a problem that a Cancel
AjaxButton (with setDefaultFormProcessing(false)) calling form.clearInput()
would not reset my form to original values.
The problem seems to be that I have AjaxFormComponentUpdatingBehavior
(onchange event) for validation added to a few Textfields of the form.
Am I right, that the behaviour updates the model and thus the Cancel button
cannot restore the original value?

And if that really is the problem, is there a best practice how to combine
the two functionalities?

Thanks in advance.


What exactly is IWrapModel used for?

2012-08-06 Thread Matthias Keller

Hi

I'm having some trouble porting a 1.4 application to 1.5 since we're 
using our own subclass of a StringResourceModel implementing load() in a 
special way.
However, in some cases this does not work as our subclass might get 
wrapped in a AssignmentWrapper and since we do not provide the component 
instance (since it's not relevant for this model), load() is never 
called on our model but instead the load() method of the 
AssignmentWrapper calls the private getString() directly.


I don't see why a model should behave so differently whether it knows 
its component or not, and where's the point to do something like:

label = new Label(id);
model=new OurStringResourceModel(..., label);
label.setDefaultModel(model);

just to have load() called on our own model?

Could someone with some insight shed some light on it?

Thanks

Matt



smime.p7s
Description: S/MIME Cryptographic Signature


Help migrating page mounts to 1.5

2012-08-06 Thread Emmanouil Batsis (Manos)

Hello,

I've spent a couple of days migrating 1.4 code to compile with 1.5. The 
docs have been helpfull but I'm stuck and would appreciate if someone 
could point out what i am missing tryint ot migrate this:


//-
mount(new IndexedParamUrlCodingStrategy(/item, ItemViewPage.class));
mount(new IndexedParamUrlCodingStrategy(/itemreport,
 ItemTemplateViewPage.class));
MixedParamUrlCodingStrategy newItemUrls =
new MixedParamUrlCodingStrategy(/newItem,
NewItemPage.class,
new String[]{spaceCode}
);
mount(newItemUrls);


into this:
//-
mountPage(/item/${0}, ItemViewPage.class);
mountPage(/itemreport/${0}, ItemTemplateViewPage.class);
mountPage(/newItem/${spaceCode}, NewItemPage.class);

The exceptions I get are NPEs when looking for a constructor with a 
single param's argument that however exists and is public:


org.apache.wicket.WicketRuntimeException: Can't instantiate page using 
constructor 'public 
gr.abiss.calipso.wicket.NewItemPage(org.apache.wicket.request.mapper.parameter.PageParameters)' 
and argument 'spaceCode=[TTAOS]'. Might be it doesn't exist, may be it 
is not visible (public).
	at 
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:196)
	at 
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:99)
	at 
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:47)
	at 
org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:107)
	at 
org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:264)
	at 
org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
	at 
org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
	at 
org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
	at 
org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
	at 
org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
	at 
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
	at 
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
	at 
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
	at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
	at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
	at 
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
	at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
	at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
	at 
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
	at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)

at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
	at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)

at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
	at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at 
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)

at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
	at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at 
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:173)


Re: [1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form

2012-08-06 Thread Bertrand Guay-Paquet

Hi,

form.clearInput() only clears the raw input (what is received in the 
current request) of the form components. That is, it doesn't modify the 
underlying models. With setDefaultFormProcessing(false), this means that 
your FormComponent models are not updated at all.


The AjaxFormComponentUpdatingBehavior should only be triggered when 
input changes on the text fields. It plays no part otherwise when 
clicking a button.


As a sidenote, why do you use a Button? This component causes the form 
to be submitted but apparently you don't need the values for this 
action. A link would save a bit of processing and transfer.


Bertrand

On 06/08/2012 12:33 PM, heapifyman wrote:

Hello,

I've been struggling for a while now with a problem that a Cancel
AjaxButton (with setDefaultFormProcessing(false)) calling form.clearInput()
would not reset my form to original values.
The problem seems to be that I have AjaxFormComponentUpdatingBehavior
(onchange event) for validation added to a few Textfields of the form.
Am I right, that the behaviour updates the model and thus the Cancel button
cannot restore the original value?

And if that really is the problem, is there a best practice how to combine
the two functionalities?

Thanks in advance.




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



Re: Paste Behaviour

2012-08-06 Thread Bertrand Guay-Paquet

Hi,

How about:

Attach a ajax onclick behavior to your TextAreas. This behavior opens 
the modalwindow and registers an onclose callback. In the callback:
-update the model of the text area according to which textblock the user 
chose

-add the TextArea to the ajax request for a refresh.

On 06/08/2012 8:58 AM, saschisch87 wrote:

Hi, I´m trying to accomplish the following Behaviour.

I have a tree of Textareas. each one of them is modifiable. When you click
into one of them you can open a modal window where you can choose from
predefined textblocks. on confirmation of the selected block it should be
pasted where the cursor was in the last selected window.

I´ve tried to do some javascript to accomplish that and it works like:
(Pseudocode) take text from
document.forms[formName].elements[insertName].value

and put it into
document.forms[formName].elements[inputName];

The problem is that I can´t figure out how to execute the js on an event or
even avoid js and get the info directly in wicket.

Any Suggestions?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Paste-Behaviour-tp4651016.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: Help migrating page mounts to 1.5

2012-08-06 Thread Martin Grigorov
On Mon, Aug 6, 2012 at 7:52 PM, Emmanouil Batsis (Manos) ma...@abiss.gr wrote:
 Hello,

 I've spent a couple of days migrating 1.4 code to compile with 1.5. The docs
 have been helpfull but I'm stuck and would appreciate if someone could point
 out what i am missing tryint ot migrate this:

 //-
 mount(new IndexedParamUrlCodingStrategy(/item, ItemViewPage.class));
 mount(new IndexedParamUrlCodingStrategy(/itemreport,
  ItemTemplateViewPage.class));
 MixedParamUrlCodingStrategy newItemUrls =
 new MixedParamUrlCodingStrategy(/newItem,
 NewItemPage.class,
 new String[]{spaceCode}
 );
 mount(newItemUrls);


 into this:
 //-
 mountPage(/item/${0}, ItemViewPage.class);
 mountPage(/itemreport/${0}, ItemTemplateViewPage.class);

Remove the ${0}s above. Just read the parameter with
pageParameters.get(0). Note this is #get(int)
${0} is a named parameter with a name '0'. By mounting just /item
your page will be used for requests with urls like:
/item
/item/1 // '1' is the value of indexed 0
/item/1/2  // '1' is the value of indexed 0,
'2' is the value of indexed 1
/item/1/2/3?name=value// '1' is the value of indexed 0, '2' is the
value of indexed 1, '3' is 2, and name/value are normal named
parameters in the query string

 mountPage(/newItem/${spaceCode}, NewItemPage.class);

This is OK. Read it with parameters.get(spaceCode). Note, this is #get(String)


 The exceptions I get are NPEs when looking for a constructor with a single
 param's argument that however exists and is public:

 org.apache.wicket.WicketRuntimeException: Can't instantiate page using
 constructor 'public
 gr.abiss.calipso.wicket.NewItemPage(org.apache.wicket.request.mapper.parameter.PageParameters)'
 and argument 'spaceCode=[TTAOS]'. Might be it doesn't exist, may be it is
 not visible (public).
 at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:196)
 at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:99)
 at
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:47)
 at
 org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:107)
 at
 org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:264)
 at
 org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
 at
 org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
 at
 org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
 at
 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
 at
 org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
 at
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
 at
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
 at
 org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
 at
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
 at
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
 at
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
 at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
 at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
 at
 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
 at
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
 at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
 at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
 at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
 at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
 at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
 at
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
 at
 org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
 at
 org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
 at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
 at org.mortbay.jetty.Server.handle(Server.java:326)
 at
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
 at
 

Re: What exactly is IWrapModel used for?

2012-08-06 Thread Sven Meier

Hi Matt,

I don't know about your example but the following makes perfect sense:

new Label(id, new StringResourceModel(foo));

This way the message is resolved relative to the label.

If the StringResourceModel's constructor is given a component argument, 
it doesn't make sense to pass it to other components as model, since it 
will be reassigned anyway.
AFAIK this variant is meant to be used ad-hoc without passing it to a 
component.


Maybe it would be better for your OurStringResourceModel *not* to extend 
StringResourceModel?


Sven


On 08/06/2012 06:38 PM, Matthias Keller wrote:

Hi

I'm having some trouble porting a 1.4 application to 1.5 since we're 
using our own subclass of a StringResourceModel implementing load() in 
a special way.
However, in some cases this does not work as our subclass might get 
wrapped in a AssignmentWrapper and since we do not provide the 
component instance (since it's not relevant for this model), load() is 
never called on our model but instead the load() method of the 
AssignmentWrapper calls the private getString() directly.


I don't see why a model should behave so differently whether it knows 
its component or not, and where's the point to do something like:

label = new Label(id);
model=new OurStringResourceModel(..., label);
label.setDefaultModel(model);

just to have load() called on our own model?

Could someone with some insight shed some light on it?

Thanks

Matt




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



MountedMapper and CryptoMapper

2012-08-06 Thread jchappelle
Currently I am using CryptoMapper for my application. It is installed in the
init method of my application like this: setRootRequestMapper(new
CryptoMapper(getRootRequestMapper(), this));. I need some of my pages to be
bookmarkable with a url like /abc. I was able to accomplish this by doing
this in my init method: getRootRequestMapperAsCompound().add(new
MountedMapper(/abc, AbcPage.class));

My problem is that if I do it like that then the url's generated for any
clicks on that page are not encrypted. Ideally I would like the urls to be
encrypted. Is there any way around this? I'm sure it is possible to write an
IRequestMapper or extend MountedMapper but I'm not really sure how to go
about it.

Any ideas?

Thanks,

Josh



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/MountedMapper-and-CryptoMapper-tp4651024.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: urgent-help.. how to click a specific tree node at the default

2012-08-06 Thread Sven Meier
Just override LinkTree#onNodeLinkClicked()

Sven

On 08/06/2012 02:57 AM, swwa...@tsmc.com wrote:

 Hello:

 I have seen this article.
 http://www.wicket-library.com/wicket-examples/ajax/

 It only select the node but can't trigger the on-click event.

 Any one could help?

 Joan



 |-
 |Paul Bors p...@bors.ws |
 | |
 | |
 | |
 |2012/08/06 上午 01:17|
 | |
 | |
 |Please respond to|
 | users@wicket.apache.org |
 | |
 |-
   
 --|
   |   
|
   |   
|
   |   
  To|
   |users@wicket.apache.org users@wicket.apache.org
|
   |   
  cc|
   |   
|
   |   
 Subject|
   |Re: urgent-help.. how to click a specific tree node at the default 
|
   |   
|
   |   
|
   |   
|
   |   
|
   |   
|
   
 --|




 See the Wicket Ajax examples section on Tree and Table:

 http://www.wicket-library.com/wicket-examples/ajax/

 Tree and TreeTable: shows ajax tree and ajax tree table.

 ~ Thank you,
Paul C Bors

 On Aug 4, 2012, at 23:52, swwa...@tsmc.com wrote:

 Hello:
I am new to wicket..please help to give suggestion to this
 requirment.
 I will expand the tree at the default. But I need to start(click) the
 first
 node at the default.

 Do anyone could help me how to implement this??
 I have use selectNode to select the first node but it can not start to
 trigger the onclick event..


 Joan

 ---

 TSMC PROPERTY
 This email communication (and any attachments) is proprietary information
 for the sole use of its
 intended recipient. Any unauthorized review, use or distribution by
 anyone
 other than the intended
 recipient is strictly prohibited.  If you are not the intended recipient,
 please notify the sender by
 replying to this email, and then delete this email and any copies of it
 immediately. Thank you.
 ---





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


  --- 
  TSMC PROPERTY   
  This email communication (and any attachments) is proprietary information   
  for the sole use of its 
  intended recipient. Any unauthorized review, use or distribution by anyone  
  other than the intended 
  recipient is 

Re: AutocompleteTextField and object (not just String)

2012-08-06 Thread Per
Hi Daniele,

while I don't have the answer to your question, here's a recent blogpost
about how we implemented a reusable wicket autocomplete field. We were not
entirely satisfied by the solutions we found about a year ago, so we cooked
our own. There might be better solutions by now, and it's not a 100% native
solution (uses jQuery UI, and a JSON action), but we keep using it a lot in
our application for various use-cases, and it's been a huge help. 

Check out the screenshot and the explanation over here:
http://www.small-improvements.com/blog/technical/wicket-autocomplete-component

It requires some work to adapt, but it may be worth it, depending on your
usecase.

Cheers,
Per



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AutocompleteTextField-and-object-not-just-String-tp4650911p4651026.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: AutocompleteTextField and object (not just String)

2012-08-06 Thread Igor Vaynberg
probably easier to use

https://github.com/ivaynberg/wicket-select2

which integrates

http://ivaynberg.github.com/select2/

rather then writing your own from scratch...

-igor

On Mon, Aug 6, 2012 at 3:36 PM, Per p...@hamburg.de wrote:
 Hi Daniele,

 while I don't have the answer to your question, here's a recent blogpost
 about how we implemented a reusable wicket autocomplete field. We were not
 entirely satisfied by the solutions we found about a year ago, so we cooked
 our own. There might be better solutions by now, and it's not a 100% native
 solution (uses jQuery UI, and a JSON action), but we keep using it a lot in
 our application for various use-cases, and it's been a huge help.

 Check out the screenshot and the explanation over here:
 http://www.small-improvements.com/blog/technical/wicket-autocomplete-component

 It requires some work to adapt, but it may be worth it, depending on your
 usecase.

 Cheers,
 Per



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/AutocompleteTextField-and-object-not-just-String-tp4650911p4651026.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: MountedMapper and CryptoMapper

2012-08-06 Thread Jesse Long

Hi Josh,

On 06/08/2012 22:10, jchappelle wrote:

Currently I am using CryptoMapper for my application. It is installed in the
init method of my application like this: setRootRequestMapper(new
CryptoMapper(getRootRequestMapper(), this));. I need some of my pages to be
bookmarkable with a url like /abc. I was able to accomplish this by doing
this in my init method: getRootRequestMapperAsCompound().add(new
MountedMapper(/abc, AbcPage.class));


It may be easier to just do this:
mountPage(/abc, AbcPage.class);

It does the same thing with less typing.


My problem is that if I do it like that then the url's generated for any
clicks on that page are not encrypted. Ideally I would like the urls to be
encrypted. Is there any way around this? I'm sure it is possible to write an
IRequestMapper or extend MountedMapper but I'm not really sure how to go
about it.

Any ideas?


That is strange behaviour. Mounting pages should not affect the URLs 
generated for pages not handled by the MountedMapper for those mounted 
pages. I have tested, and 1.5.7 and 6.0.0-beta3 do not have this 
behaviour. Which version are you using?


It is very likely that links to mounted pages will be unencrypted, but 
link to other pages served from within a mounted page should be 
encrypted (unless those other pages are also mounted of course).


Do you perhaps have any other custom IRequestMappers installed, possibly 
overriding mapHandler()?


Cheers,
Jesse



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



contributing external javascript resources

2012-08-06 Thread mlabs
I have a page that renders a googleapi map in a wicket panel. Works great. I
thought I would optimize things a bit by having the panel contribute the
googleapi javascript reference to the header, instead of having it
permanently referenced in the page header irrespective of whether the map
panel is visible or not... so I override renderHead() in my panel like so:

public void renderHead(IHeaderResponse response){
   
response.renderJavascriptReference(http://maps.googleapis.com/maps/api/js?sensor=false;,
gmap-api);
}

however, this doesn't work.. and in the browser javascript debugger I see
this:
Warning: A call to document.write() from an asynchronously-loaded external
script was ignored.
Source File: http://maps.googleapis.com/maps/api/js?sensor=false

Q:what is the correct way to contribute external javascript references to
the header?
TIA 





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/contributing-external-javascript-resources-tp4651029.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