Re: bug in TableComponentAsXlsHandler

2013-06-12 Thread Martin Grigorov
Hi,


On Wed, Jun 12, 2013 at 5:24 AM, grazia grazia.russolass...@gmail.comwrote:



 I am using the wicket poi api to generate an excel file from a
 PageableListView.
 I just run into a bug in lines 67-76 of TableComponentAsXlsHandler.java:
 cellExplorer becomes null already at the second iteration of the for loop
 (see below)

 TableParser parser = new TableParser(newSheet(), cellExporter);
 if (tableComponent instanceof IPageable)
 {
 IPageable pageable = (IPageable)tableComponent;
 for (int i = 0; i  pageable.getPageCount(); i++)
 {
 pageable.setCurrentPage(i);
 parser.parse(tableComponent);
 }
 }

 and we get  a NullPointerException  on line
 org.wicketstuff.poi.excel.TableParser.doParse(TableParser.java:152) (see
 below)

 Do you have any suggestions on how to solve this problem ?
 I am using wicket-poi-1.5-RC5.1.jar


You may try with a newer version. The last is 1.5.10





 SEVERE: Unexpected error occurred
 java.lang.RuntimeException: Error while generating a xls file to table
 component
 at

 org.wicketstuff.poi.excel.TableComponentAsXlsHandler.respond(TableComponentAsXlsHandler.java:91)
 at

 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
 at

 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
 at

 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:97)
 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:162)
 at

 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
 at

 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 at

 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at

 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
 at

 org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:123)
 at

 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
 at

 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
 at

 org.apache.catalina.core.StandardHostValve.__invoke(StandardHostValve.java:171)
 at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
 at

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
 at
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
 at

 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
 at

 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
 at

 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
 at

 org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
 at

 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at

 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:722)
 Caused by: java.lang.NullPointerException
 at org.wicketstuff.poi.excel.TableParser.doParse(TableParser.java:152)
 at org.wicketstuff.poi.excel.TableParser.parse(TableParser.java:76)
 at

 org.wicketstuff.poi.excel.TableComponentAsXlsHandler.respond(TableComponentAsXlsHandler.java:74)
 ... 26 more



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/bug-in-TableComponentAsXlsHandler-tp4659409.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




migrate to 1.5 setResponsePage-problem

2013-06-12 Thread terjeeit
In trying to migrate from wicket 1.4 to 1.5, all my setResponsePage calls
get red in Eclipse. e.g:

setResponsePage(WelcomePage.class, parameters);

gets the error message:
The method setResponsePage(ClassC, PageParameters) in the type Component
is not applicable for the arguments (ClassWelcomePage, PageParameters)

I can change the call to:
setResponsePage(new WelcomePage(parameters));

, but this is quite some work for all the calls in the whole project. Why
doesn`t the old method work?

Cheers
Terje Eithun, Norway



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/migrate-to-1-5-setResponsePage-problem-tp4659413.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: migrate to 1.5 setResponsePage-problem

2013-06-12 Thread Martin Grigorov
Hi,

The method is still there:
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/Component.java?source=cc#L3168
Try to build with javac/Maven or any other tool but Eclipse.


On Wed, Jun 12, 2013 at 2:22 PM, terjeeit terje.eit...@gmail.com wrote:

 In trying to migrate from wicket 1.4 to 1.5, all my setResponsePage calls
 get red in Eclipse. e.g:

 setResponsePage(WelcomePage.class, parameters);

 gets the error message:
 The method setResponsePage(ClassC, PageParameters) in the type Component
 is not applicable for the arguments (ClassWelcomePage, PageParameters)

 I can change the call to:
 setResponsePage(new WelcomePage(parameters));

 , but this is quite some work for all the calls in the whole project. Why
 doesn`t the old method work?

 Cheers
 Terje Eithun, Norway



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/migrate-to-1-5-setResponsePage-problem-tp4659413.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: Can i display a WepPage in a PDF (How to get the rendered markup)?

2013-06-12 Thread harmoniaa
I created a quickstart but didn't create a ticket yet, because I found out
that ComponentRenderer expects to get a component whose markupId equals to
ComponentRenderer.COMP_ID.

Is this a bug or a feature? Is there some way to render the markup of an
existing component that has an arbitrary markupId using ComponentRenderer?

I tried calling #setMarkupId and wrapping the existing component to a new
component with expected markupId but both ways failed. Would it be easy to
enhance ComponentRenderer to work with any markupIds?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Can-i-display-a-WepPage-in-a-PDF-How-to-get-the-rendered-markup-tp4659290p4659415.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: Can i display a WepPage in a PDF (How to get the rendered markup)?

2013-06-12 Thread Martin Grigorov
Hi,

This can be relaxed. Please file a ticket.


On Wed, Jun 12, 2013 at 2:55 PM, harmoniaa 
edvard.fons...@nitorcreations.com wrote:

 I created a quickstart but didn't create a ticket yet, because I found out
 that ComponentRenderer expects to get a component whose markupId equals to
 ComponentRenderer.COMP_ID.

 Is this a bug or a feature? Is there some way to render the markup of an
 existing component that has an arbitrary markupId using ComponentRenderer?

 I tried calling #setMarkupId and wrapping the existing component to a new
 component with expected markupId but both ways failed. Would it be easy to
 enhance ComponentRenderer to work with any markupIds?



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Can-i-display-a-WepPage-in-a-PDF-How-to-get-the-rendered-markup-tp4659290p4659415.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: migrate to 1.5 setResponsePage-problem

2013-06-12 Thread terjeeit
Thanks, yeah I figured it was still there. It was the packet-structure that
didin`t update correctly. What before was:org.apache.wicket.PageParameters
is now: org.apache.wicket.request.mapper.parameter.PageParameters
appearently.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/migrate-to-1-5-setResponsePage-problem-tp4659413p4659418.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: RadioChoice AjaxFormChoiceComponentUpdatingBehavior and validation

2013-06-12 Thread divad91
Anyone notice the same problem ?
AjaxFormChoiceComponentUpdatingBehavior seems to unbind onclick event.

David




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioChoice-AjaxFormChoiceComponentUpdatingBehavior-and-validation-tp4659216p4659419.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: RadioChoice AjaxFormChoiceComponentUpdatingBehavior and validation

2013-06-12 Thread Sven Meier
Have you tried changing AjaxRequestAttributes#setAllowDefault(true) and 
#setEventPropagation(BUBBLE) ?


Otherwise please create a quickstart so we can debug the problem.

Regards
Sven

On 06/12/2013 03:43 PM, divad91 wrote:

Anyone notice the same problem ?
AjaxFormChoiceComponentUpdatingBehavior seems to unbind onclick event.

David




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioChoice-AjaxFormChoiceComponentUpdatingBehavior-and-validation-tp4659216p4659419.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: disable attribute escaping

2013-06-12 Thread Alfonso Quiroga
Martin, thanks but I've already try that, and it does not work because
when ComponentTagwriteOutput() finally writes the attribute, it will
escape characters. Thanks anyway

On Tue, Jun 11, 2013 at 3:11 PM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 textField.setEscapeModelStrings(false)


 On Tue, Jun 11, 2013 at 7:33 PM, Alfonso Quiroga 
 alfonsose...@gmail.comwrote:

 Hi, looking at ComponentTag class, method writeOutput()... I suspect
 that is *impossible* to disable attribute escaping.

 I'm needing this because I use a read-only textfield, with values like
 iacute;, etc. where I don't want escaping.

 Any solution?

 thanks in advance

 -
 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: Unit testing a repeater or data table by mocking its data

2013-06-12 Thread Paul Bors
I like the simplicity of Mockito and got it working in my unit tests, but now I 
find myself mocking more services than I wanted.

Wicket Page Teste allows you to inject your mocks on top of the SpringBeans, is 
that possible with Mockito?
http://WicketPageTest.sourceforge.net/

In other words I want to have my normal XML mapped beans context have some 
beans be overridden only for some tests (talk about being lazy).

~ Thank you,
  Paul Bors

-Original Message-
From: heikki [mailto:tropic...@gmail.com] 
Sent: Tuesday, June 11, 2013 11:14 AM
To: users@wicket.apache.org
Subject: Re: Unit testing a repeater or data table by mocking its data

dear Paul,

I've recently used Mockito and am quite happy with it. You can easily mock any 
class and make it behave as you need.

Best regards
Heikki Doeleman


On Tue, Jun 11, 2013 at 5:08 PM, Paul Bors p...@bors.ws wrote:

 Up to recently we got away with running our unit tests fully 
 integrated with the back end db by performing live queries via our 
 DAOs.

 Due to recent changes to our product schema we run into the inevitable 
 high cost of having to spend too much time on maintain our mocked unit 
 test data straight into the db. To cut down on that cost I would like 
 to start mocking most of our DAOs that back-up the data tables in our 
 product (gradually over time).



 Which brings me to my question, what's the recommended approach from 
 Wicket's team (or users) on mocking the DAOs that are used by the data 
 providers of your data tables?



 Our advantage is that we are using Spring and thus we could rely on 
 spring-test, its ReflectionTestUtils but I also took a look at 
 Mockito, EasyMock and such.

 I'm more curious as to what has been your experience in the past and 
 what would you consider to be the best approach?



 ~ Thank you,

 Paul Bors








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



Re: Unit testing a repeater or data table by mocking its data

2013-06-12 Thread Andreas Kuhtz
Hi Paul,

Not sure if I got you right but you might check out:
https://bitbucket.org/kubek2k/springockito/wiki/Home

Best regards
Andi

2013/6/12 Paul Bors p...@bors.ws:
 I like the simplicity of Mockito and got it working in my unit tests, but now 
 I find myself mocking more services than I wanted.

 Wicket Page Teste allows you to inject your mocks on top of the SpringBeans, 
 is that possible with Mockito?
 http://WicketPageTest.sourceforge.net/

 In other words I want to have my normal XML mapped beans context have some 
 beans be overridden only for some tests (talk about being lazy).

 ~ Thank you,
   Paul Bors

 -Original Message-
 From: heikki [mailto:tropic...@gmail.com]
 Sent: Tuesday, June 11, 2013 11:14 AM
 To: users@wicket.apache.org
 Subject: Re: Unit testing a repeater or data table by mocking its data

 dear Paul,

 I've recently used Mockito and am quite happy with it. You can easily mock 
 any class and make it behave as you need.

 Best regards
 Heikki Doeleman


 On Tue, Jun 11, 2013 at 5:08 PM, Paul Bors p...@bors.ws wrote:

 Up to recently we got away with running our unit tests fully
 integrated with the back end db by performing live queries via our
 DAOs.

 Due to recent changes to our product schema we run into the inevitable
 high cost of having to spend too much time on maintain our mocked unit
 test data straight into the db. To cut down on that cost I would like
 to start mocking most of our DAOs that back-up the data tables in our
 product (gradually over time).



 Which brings me to my question, what's the recommended approach from
 Wicket's team (or users) on mocking the DAOs that are used by the data
 providers of your data tables?



 Our advantage is that we are using Spring and thus we could rely on
 spring-test, its ReflectionTestUtils but I also took a look at
 Mockito, EasyMock and such.

 I'm more curious as to what has been your experience in the past and
 what would you consider to be the best approach?



 ~ Thank you,

 Paul Bors








 -
 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: RadioChoice AjaxFormChoiceComponentUpdatingBehavior and validation

2013-06-12 Thread divad91
Thanks Sven, I had not tested the setEventPropagation(BUBBLE), only the
setAllowDefault(true).

It's working perfectly right now !

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
  attributes.setAllowDefault(true);
  attributes.setEventPropagation(EventPropagation.BUBBLE);
  super.updateAjaxAttributes(attributes);
}

Thanks
David



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioChoice-AjaxFormChoiceComponentUpdatingBehavior-and-validation-tp4659216p4659426.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



form GET and POST getting mixed up

2013-06-12 Thread Daniel Watrous
Hello,

I created a single page that shows some data using DataView. I then added a
form and allow a filter argument to be passed in. The problem I'm getting
is that the first time a search is done, the search value is added to the
URL for the page. Subsequent searches are ignored due to the query string.

I have looked for some way to change it to GET, but couldn't find that. I
also looked for some way to prevent the URL from being modified, but I'm
not clear on why that is happening either.

Any idea how to fix this?

Here's my Page code

public CnavDisplay(PageParameters parameters) {
super(parameters);

final TextFieldString search = new TextFieldString(search,
Model.of());
Form? form = new FormVoid(searchForm) {

@Override
protected void onSubmit() {

final String searchValue = search.getModelObject();

PageParameters pageParameters = new PageParameters();
pageParameters.add(search, searchValue);
setResponsePage(CnavDisplay.class, pageParameters);

}

};

add(form);
form.add(search);

CnavUrlDataProvider dataProvider = new CnavUrlDataProvider();
if (!parameters.get(search).isEmpty()) {
dataProvider.setSearch(parameters.get(search).toString());
}

DataViewCnavUrl dataView = new DataViewCnavUrl(repeating,
dataProvider) {
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(final ItemCnavUrl item)
{
CnavUrl cnavUrl = item.getModelObject();
//item.add(new Label(cnavid,
String.valueOf(((MorphiaCnavUrl)cnavUrl).getId(;
item.add(new Label(url, cnavUrl.getURL()));
item.add(new Label(type, cnavUrl.getType()));

item.add(AttributeModifier.replace(class, new
AbstractReadOnlyModelString()
{
private static final long serialVersionUID = 1L;

@Override
public String getObject()
{
return (item.getIndex() % 2 == 1) ? even : odd;
}
}));
}
};

Here's my application where I mount the page

mountPage(/cnavlink, CnavDisplay.class);

Any ideas?

Thanks,
Daniel


Re: disable attribute escaping

2013-06-12 Thread Sven Meier

Hi,

you can use #setEscapeModelStrings(false) to write non-escaped values 
into the body of tags.


Why do you want to produce invalid XML/HTML?

Sven

On 06/12/2013 04:28 PM, Alfonso Quiroga wrote:

Martin, thanks but I've already try that, and it does not work because
when ComponentTagwriteOutput() finally writes the attribute, it will
escape characters. Thanks anyway

On Tue, Jun 11, 2013 at 3:11 PM, Martin Grigorov mgrigo...@apache.org wrote:

Hi,

textField.setEscapeModelStrings(false)


On Tue, Jun 11, 2013 at 7:33 PM, Alfonso Quiroga alfonsose...@gmail.comwrote:


Hi, looking at ComponentTag class, method writeOutput()... I suspect
that is *impossible* to disable attribute escaping.

I'm needing this because I use a read-only textfield, with values like
iacute;, etc. where I don't want escaping.

Any solution?

thanks in advance

-
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



Getting Form Data Without Submitting Form

2013-06-12 Thread Richard W. Adams
I have a FormComponentPanel with an AjaxLink. The link's onClick() method 
runs a database search based on criteria that are found in a half dozen 
form fields (string, drop downs, etc.). My problem is that the form's 
model is not updated because the link does not submit the form. And I 
can't submit the form because then OTHER data is saved which should NOT 
be. In other words, the full form data should be saved only when user 
presses another, separate, Save button, NOT the lookup link..

How can I access the current form field values that make up my search 
criteria, without submitting the form? Ideally, I'm looking for some 
technique that would update the model in a way that where I can tell it's 
just a search request, not a save request. I looked at the Javadocs for 
AjaxFormChoiceComponentUpdatingBehavior, because its name implied that it 
MIGHT be a solution, but I couldn't figure to how to use it.

I'm using Wicket 1.4.17 (using a later version is not an option due to our 
a corporate framework).

**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**


Re: Getting Form Data Without Submitting Form

2013-06-12 Thread Sven Meier
Why not use two different forms, one for searching and the other for the 
save fields?

You can even nest the first one into the other.

Sven

On 06/12/2013 09:09 PM, Richard W. Adams wrote:

I have a FormComponentPanel with an AjaxLink. The link's onClick() method
runs a database search based on criteria that are found in a half dozen
form fields (string, drop downs, etc.). My problem is that the form's
model is not updated because the link does not submit the form. And I
can't submit the form because then OTHER data is saved which should NOT
be. In other words, the full form data should be saved only when user
presses another, separate, Save button, NOT the lookup link..

How can I access the current form field values that make up my search
criteria, without submitting the form? Ideally, I'm looking for some
technique that would update the model in a way that where I can tell it's
just a search request, not a save request. I looked at the Javadocs for
AjaxFormChoiceComponentUpdatingBehavior, because its name implied that it
MIGHT be a solution, but I couldn't figure to how to use it.

I'm using Wicket 1.4.17 (using a later version is not an option due to our
a corporate framework).

**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**




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



Re: Getting Form Data Without Submitting Form

2013-06-12 Thread Richard W. Adams
Well, first, HTML doesn't allow nested forms, per the w3.org site. Second, 
the search fields need to be part of the overall form, because they (along 
with the other fields) are persisted if the user presses the Save button.




From:   Sven Meier s...@meiers.net
To: users@wicket.apache.org
Date:   06/12/2013 02:15 PM
Subject:Re: Getting Form Data Without Submitting Form



Why not use two different forms, one for searching and the other for the 
save fields?
You can even nest the first one into the other.

Sven

On 06/12/2013 09:09 PM, Richard W. Adams wrote:
 I have a FormComponentPanel with an AjaxLink. The link's onClick() 
method
 runs a database search based on criteria that are found in a half dozen
 form fields (string, drop downs, etc.). My problem is that the form's
 model is not updated because the link does not submit the form. And I
 can't submit the form because then OTHER data is saved which should NOT
 be. In other words, the full form data should be saved only when user
 presses another, separate, Save button, NOT the lookup link..

 How can I access the current form field values that make up my search
 criteria, without submitting the form? Ideally, I'm looking for some
 technique that would update the model in a way that where I can tell 
it's
 just a search request, not a save request. I looked at the Javadocs for
 AjaxFormChoiceComponentUpdatingBehavior, because its name implied that 
it
 MIGHT be a solution, but I couldn't figure to how to use it.

 I'm using Wicket 1.4.17 (using a later version is not an option due to 
our
 a corporate framework).

 **

 This email and any attachments may contain information that is 
confidential and/or privileged for the sole use of the intended recipient. 
 Any use, review, disclosure, copying, distribution or reliance by others, 
and any forwarding of this email or its contents, without the express 
permission of the sender is strictly prohibited by law.  If you are not 
the intended recipient, please contact the sender immediately, delete the 
e-mail and destroy all copies.
 **



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




**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**


Re: Getting Form Data Without Submitting Form

2013-06-12 Thread Jeremy Thomerson
On Wed, Jun 12, 2013 at 3:26 PM, Richard W. Adams rwada...@up.com wrote:

 Well, first, HTML doesn't allow nested forms, per the w3.org site. Second,
 the search fields need to be part of the overall form, because they (along
 with the other fields) are persisted if the user presses the Save button.


Be careful about the tone of your email.  You may not have meant it this
way, but it sounds a bit snarky and disrespectful.  Sven knows what he's
talking about, and it would be rude if you meant to imply that he doesn't.

To your points:

1) HTML may not allow nested forms, but Wicket does.  It handles this
automatically for you.  Try it some time.
2) Okay, Sven didn't know that because it wasn't mentioned in your first
email.

Solution for your problem:

Use two buttons - one for save, one for search.  Move your onSubmit
logic out of your form and into each button.


-- 
Jeremy Thomerson
http://wickettraining.com
*Ask me about our plans for on-line training lessons.*


Introduction and some questions about Wicket

2013-06-12 Thread Michael Pence
Hi guys,

My name is Mike Pence. I think that I have dipped into this list a time or two 
in the past, but I am here, this time, with serious intent to use Wicket for a 
very big project -- big both in terms of how many users it will have, and big 
in its impact.

I have been doing Rails for the last 7 or 8 years (spoke at Ruby and Rails 
conferences about rich web apps), after coming from a Delphi and Java 
background (and Microsoft stuff, but I leave that out).

So, Rails is great but does not give me the modularity and component re-use in 
the UI that I loved in Delphi. I am making some assumptions about Wicket, and 
would appreciate your feedback on these assumptions:

1. That wicket lets you model rich and highly interactive web apps that can 
feel like desktop apps, but in the browser. (Examples?)
2. That building complex UI widgets -- grids, trees, custom components like 
timelines or graphs or calendars -- is comparatively painless.
3. That you can largely leave the markup and styling to the people who like 
doing that kind of thing (why they would, I don't get…)

I would love to do Scala with Wicket but I can't raise the bar that high, right 
now. If there was a JRuby version of wicket…that would be awesome. JVM runtime 
is a big win for this, because the project definitely will have many, many 
users.

Has anyone done any work with wicket focused on mobile devices?

Appreciate your thoughts.

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



Re: Introduction and some questions about Wicket

2013-06-12 Thread Cedric Gatay
Hi,
I am a Wicket user since v1.3. The main application I develop using it is
SRMvision (free trial available at demo.srmvision.com, slow because of the
virtual machine that sits under). We have leveraged the component nature of
Wicket to apply good practices and it has proven being a very good choice
until now.

Anyway, if you want to build rich ui components you will need to write them
with Javascript and bind it with your Wicket components, this is fairly
easy and you will be able to unit test it on the Java side and javascript
side.

For the design part, the size of our structure did not allowed us to
experiment working with dedicated people.  However, I guess designers
understanding html will be able to produce great gui ;-)

Regarding mobile devices, as long as it's html, it is easy, bootstrap,
fundation, and others made writing responsive Web applications a breeze.

Regards
__
Cedric Gatay (@Cedric_Gatay)
http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr
Hi guys,

My name is Mike Pence. I think that I have dipped into this list a time or
two in the past, but I am here, this time, with serious intent to use
Wicket for a very big project -- big both in terms of how many users it
will have, and big in its impact.

I have been doing Rails for the last 7 or 8 years (spoke at Ruby and Rails
conferences about rich web apps), after coming from a Delphi and Java
background (and Microsoft stuff, but I leave that out).

So, Rails is great but does not give me the modularity and component re-use
in the UI that I loved in Delphi. I am making some assumptions about
Wicket, and would appreciate your feedback on these assumptions:

1. That wicket lets you model rich and highly interactive web apps that can
feel like desktop apps, but in the browser. (Examples?)
2. That building complex UI widgets -- grids, trees, custom components like
timelines or graphs or calendars -- is comparatively painless.
3. That you can largely leave the markup and styling to the people who like
doing that kind of thing (why they would, I don't get…)

I would love to do Scala with Wicket but I can't raise the bar that high,
right now. If there was a JRuby version of wicket…that would be awesome.
JVM runtime is a big win for this, because the project definitely will have
many, many users.

Has anyone done any work with wicket focused on mobile devices?

Appreciate your thoughts.

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


Re: form GET and POST getting mixed up

2013-06-12 Thread Daniel Watrous
I found a solution that worked.

I didn't realize that by adding the value passed in to a PageParameters
object and then setting the response page I was telling Wicket to add that
to the URL. I got rid of that.

I changed my form to this use the CompoundPropertyModel:
Form? form = new FormCnavDisplay(searchForm, new
CompoundPropertyModelCnavDisplay(this));

I also added a class attribute for search and moved my onsubmit into a
Button declaration.

final CnavUrlDataProvider dataProvider = new CnavUrlDataProvider();

final TextFieldString searchField = new
TextFieldString(search, new PropertyModel(this,search));
Form? form = new FormCnavDisplay(searchForm, new
CompoundPropertyModelCnavDisplay(this));
Button submitButton = new Button(searchButton) {  // (4)
@Override
public void onSubmit() {
if (search != null  !search.isEmpty()) {
dataProvider.setSearch(search);
}
}
};

add(form);
form.add(searchField);
form.add(submitButton);

Thanks,
Daniel



On Wed, Jun 12, 2013 at 9:39 AM, Daniel Watrous dwmaill...@gmail.comwrote:

 Hello,

 I created a single page that shows some data using DataView. I then added
 a form and allow a filter argument to be passed in. The problem I'm getting
 is that the first time a search is done, the search value is added to the
 URL for the page. Subsequent searches are ignored due to the query string.

 I have looked for some way to change it to GET, but couldn't find that. I
 also looked for some way to prevent the URL from being modified, but I'm
 not clear on why that is happening either.

 Any idea how to fix this?

 Here's my Page code

 public CnavDisplay(PageParameters parameters) {
 super(parameters);

 final TextFieldString search = new TextFieldString(search,
 Model.of());
 Form? form = new FormVoid(searchForm) {

 @Override
 protected void onSubmit() {

 final String searchValue = search.getModelObject();

 PageParameters pageParameters = new PageParameters();
 pageParameters.add(search, searchValue);
  setResponsePage(CnavDisplay.class, pageParameters);

 }

 };

 add(form);
 form.add(search);

 CnavUrlDataProvider dataProvider = new CnavUrlDataProvider();
 if (!parameters.get(search).isEmpty()) {
 dataProvider.setSearch(parameters.get(search).toString());
 }

 DataViewCnavUrl dataView = new DataViewCnavUrl(repeating,
 dataProvider) {
 private static final long serialVersionUID = 1L;

 @Override
 protected void populateItem(final ItemCnavUrl item)
 {
 CnavUrl cnavUrl = item.getModelObject();
 //item.add(new Label(cnavid,
 String.valueOf(((MorphiaCnavUrl)cnavUrl).getId(;
 item.add(new Label(url, cnavUrl.getURL()));
 item.add(new Label(type, cnavUrl.getType()));

 item.add(AttributeModifier.replace(class, new
 AbstractReadOnlyModelString()
 {
 private static final long serialVersionUID = 1L;

 @Override
 public String getObject()
 {
 return (item.getIndex() % 2 == 1) ? even : odd;
 }
 }));
 }
 };

 Here's my application where I mount the page

 mountPage(/cnavlink, CnavDisplay.class);

 Any ideas?

 Thanks,
 Daniel



Re: Wicket context menu component

2013-06-12 Thread bronius
Ok thanks again for helping out! :)
Well I found that 'options.$trigger.attr(id)' from parameters returns id
of link pressed (did not try yet on wicket side, but I think it should work)
and 'key' returns which context menu was pressed. Now my links represents
users and context menu some actions to do on users (say view profile). So
now I kinda can set user id as link id and then retrieve link id from
'options.$trigger.attr(id)'  and load user and do action from context menu
on it. But for some reason it does not feel right :) Is it ok to implement
it like that? What do you think? I don't have much wicket experience, but
wicketish way for me seems that context menu behavior could be added to link
component and then from that behavior I could invoke link's onClick lets
say. How would you would go forward from here for that kind of use case?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306p4659436.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 Context Menu using wicket-jquery-ui

2013-06-12 Thread Colin Rogers
Wicketeers,

I'm attempting to develop a reusable context menu component. I'm nearly there, 
but having a few issues, and thought I might share in the hope I might get some 
help. I realise that another person (bronius) is also having a go at this, but 
his implementation isn't using wicket-jquery-ui, which I am using and want to 
utilise.

http://www.otbcs.co.uk/wicketmenu.zip

The link above includes a zip to a quick start that contains the code. There 
isn't a lot to it, that isn't already done by wicket-jquery-ui.

Requirements;

* Open Menu on right click - menus to appear near or in relation to 
what was clicked. (done)

* Menus are dynamically defined - they are not created or rendered 
initially, on page creation, but are defined dynamically on button event and 
returned via Ajax for rendering. (done)

* Must allow multiple, different, menus on same page. (done)

* Must clear down intelligently - when another click elsewhere or 
escape etc., is pressed.

The issue I have at the moment is;

* Closing the menu only happens on another context-menu, successfully. 
I can have it close on an 'onclick' event, which is added to the page, but this 
in turn disables/ breaks standard links. In the example above, this is the case 
- the menu behaves nicely, but breaks the standard link.

* How would I close the menu on an 'escape' key press?

* While not that important; you can't reuse a menu and have it appear 
where it's clicked. At the moment, they just appear where they are placed. As 
'items' can be re-used, this isn't so much of an issue.

Any help, advice or suggestions welcome!

Cheers,
Col.


EMAIL DISCLAIMER This email message and its attachments are confidential and 
may also contain copyright or privileged material. If you are not the intended 
recipient, you may not forward the email or disclose or use the information 
contained in it. If you have received this email message in error, please 
advise the sender immediately by replying to this email and delete the message 
and any associated attachments. Any views, opinions, conclusions, advice or 
statements expressed in this email message are those of the individual sender 
and should not be relied upon as the considered view, opinion, conclusions, 
advice or statement of this company except where the sender expressly, and with 
authority, states them to be the considered view, opinion, conclusions, advice 
or statement of this company. Every care is taken but we recommend that you 
scan any attachments for viruses.