Re: wicket-jquery-ui menu item with client handler

2017-07-27 Thread Maxim Solodovnik
Hello Sebastien,

Just was able to check it
It works, unfortunately I was unable to abopt it for my needs ... :(
What I need is
1) some menu items should work via server round-trip
2) couple of menu items should be client-side only
I tried to "return true/false" from handler but it doesn't work

So the whole menu can be client-side or server-side :(

On Wed, Jul 12, 2017 at 6:21 PM, Sebastien  wrote:

> Hi Maxim,
>
> 8.0.0-SNAPSHOT is deploying; you should now be able to supply your own
> callback as follow:
>
> @Override
> public void onConfigure(JQueryBehavior behavior)
> {
> behavior.setOption("select", "function(...) { ... }");
> }
>
> Please refer to jQuery UI or Kendo UI doc for usage/arguments. Please also
> note that an ajax behavior is still bound to the component (but not used),
> that's ok if you have only one menu. But if you have dozen, you may
> consider having your own menu implementation...
>
> Thanks & best regards,
> Sebastien.
>
>


-- 
WBR
Maxim aka solomax


PropertyListView does not render the value from the html page to xml property

2017-07-27 Thread extraquoo
Hi I am creating a PropertyListView to dynamically populate rows to collect
data of contact information.
I am able to map the wicket id between html and panel class. However, when I
click save button , the value does not persist in the corresponding object.

The code is below  
*main class code:*

final WebMarkupContainer newPhone = new
WebMarkupContainer("newContactPhone");
final YesNoFormBorder s1Border = new YesNoFormBorder("sectionOne",
new PropertyModel(sectionOneModel, 
"yesorNo"),
new StringResourceModel("forms.mc216.section1", 
this, mc216Model));
PropertyModel sectionOneModel = new
PropertyModel(mc216Model, "section1");
final PropertyModel> contactPhoneList = new
PropertyModel>(sectionOneModel.getObject(),
"newContactPhone");
if (contactPhoneList.getObject() == null) {
contactPhoneList.setObject(new 
ArrayList());
}

  PartialUpdateLimitedListView phoneListView = new
PartialUpdateLimitedListView(
"section1.newContactPhone", contactPhoneList 
,ContactPhone.class){

private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem item 
) {

final FormComponent[] allFields = new 
FormComponent[3];

allFields[0] = new 
ReferenceTableDropDownChoice("contactPhone.type", new
Model(), new Model(), DOCUMENT_CATEGORY).setRequired(true);
allFields[1] = new
FormTextField("contactPhone.number").setRequired(true).add(new
PhoneValidator());
allFields[2] = new 
FormTextField("contactTime");
item.add(allFields);


item.add(getPartialRefreshDeleteButton("delete", item));
item.add(new StyledFeedback("feedback", item)); 

}

};  

s1Border.add(newPhone.setOutputMarkupPlaceholderTag(true));
newPhone.add(phoneListView.setReuseItems(true));

newPhone.add(phoneListView.getPartialRefreshAddButtonByListSize("addNewPhone",
ADD_MORE_LIMIT_TWO));

newPhone.add(phoneListView);

-
*PartialUpdateLimitedListView.java :*

public abstract class PartialUpdateLimitedListView extends
PropertyListView
 {
..
public PartialUpdateLimitedListView(String id,
IModel> model) {
super(id, model);
preserveRecord = true;
forceOneRow = true;
}

...
}

---
property : 
*MC216.java*


@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MC216", propOrder = {
"section1",
"section2",
"section3",
"section4",
"section5",
"section6",
"section7",
"certification"
})
public class MC216
extends BaseDocumentType
implements Serializable
{

private final static long serialVersionUID = 12343L;
@XmlElement(required = true)
protected ContactInformation section1;
@XmlElement(required = true)
protected HouseholdInformation section2;
@XmlElement(required = true)
protected IncomeInformation section3;
@XmlElement(required = true)
protected HealthInsuranceInformation section4;
@XmlElement(required = true)
protected IncarcerationInformation section5;
@XmlElement(required = true)
protected DeceasedInformation section6;
@XmlElement(required = true)
protected HouseholdChanges section7;
protected MC216 .Certification certification;

...

*ContactInformation.java*

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "contactInformation", propOrder = {
"caseNumber",
"name",
"currentHomeAddress",
"currentMailingAddress",
"currentContactPhone",
"newHomeAddress",
"newMailingAddress",
"newContactPhone",
"emailAddress"
})
public class ContactInformation
extends QuestionType
implements Serializable
{

private final static long serialVersionUID = 12343L;
@XmlElement(required = true)
protected String caseNumber;
@XmlElement(required = true)
protected String name;
@XmlElement(required = true)
protected AddressType currentHomeAddress;
@XmlElement(required = true)
protected AddressType currentMailingAddress;
@XmlElement(required = true)
protected List currentContactPhone;
protected AddressType newHomeAddress;
protected AddressType newMailingAddress;
protected List newContactPhone;
protected String emailAddress;

-

*ContactPhone.java*



Re: Toastr popups and Form's onSubmit

2017-07-27 Thread Vit Rozkovec
Would it work to add a behavior to the component, passing behavior's url 
to Toastr and calling this url via Wicket.Ajax?

In the behavior you would then redirect to the page you need.



On 07/27/2017 04:43 PM, Martin Grigorov wrote:

You will have to do some refactoring ...

Instead of using Wicket's setResponsePage() you will need to use Toastr's
callbacks

toastr.options.onHidden = function() { console.log('goodbye');
}toastr.options.onCloseClick = function() { console.log('close button
clicked'); }


and do the redirect with JavaScript: document.location='../the/next/page';

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jul 27, 2017 at 5:18 PM, ssamarin  wrote:


I probably don't need a label, problem is that onSubmit of the form
typically
calls redirect to another page.

I tried AjaxButton, but can't get redirect being called *after* toastr
popup
shows up. Ideally, I want popup, wait few seconds till it closes (or user
closes it) - do redirect.

--
View this message in context: http://apache-wicket.1842946.
n4.nabble.com/Toastr-popups-and-Form-s-onSubmit-tp4678320p4678329.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: Toastr popups and Form's onSubmit

2017-07-27 Thread Martin Grigorov
You will have to do some refactoring ...

Instead of using Wicket's setResponsePage() you will need to use Toastr's
callbacks

toastr.options.onHidden = function() { console.log('goodbye');
}toastr.options.onCloseClick = function() { console.log('close button
clicked'); }


and do the redirect with JavaScript: document.location='../the/next/page';

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jul 27, 2017 at 5:18 PM, ssamarin  wrote:

> I probably don't need a label, problem is that onSubmit of the form
> typically
> calls redirect to another page.
>
> I tried AjaxButton, but can't get redirect being called *after* toastr
> popup
> shows up. Ideally, I want popup, wait few seconds till it closes (or user
> closes it) - do redirect.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Toastr-popups-and-Form-s-onSubmit-tp4678320p4678329.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: NPE in org.apache.wicket.request.http.handler.RedirectRequestHandler.respond

2017-07-27 Thread Wayne W
Thanks Martin,

I've put logging everywhere but still can't track it down. Its just this
jetty instance causing not, not sure why. I'm going to side step the issue
and upgrade to 7.8.10 as I need that replication fix live asap.

Many thanks

On Wed, Jul 26, 2017 at 11:51 AM, Martin Grigorov 
wrote:

> I've added a check for 7.x and 8.x -
> https://git1-us-west.apache.org/repos/asf?p=wicket.git;a=
> commitdiff;h=5f3fc484;hp=3ec2c617f1e27f06df985032e233ca4799097b26
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jul 26, 2017 at 1:48 PM, Martin Grigorov 
> wrote:
>
> > https://github.com/apache/wicket/blob/wicket-6.17.0/
> > wicket-request/src/main/java/org/apache/wicket/request/http/handler/
> > RedirectRequestHandler.java#L99 says that getRedirectUrl() returns null.
> > So something calls RedirectRequestHandler's constructor with null url.
> > Wicket doesn't instantiate this class for its needs, so it should be your
> > application.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Wed, Jul 26, 2017 at 10:15 AM, Wayne W 
> > wrote:
> >
> >> Still on 6.17.0 Martin. Not had the time/resources to move to 6.18
> which I
> >> want because of that replication fix!!
> >>
> >> On Tue, Jul 25, 2017 at 7:55 PM, Martin Grigorov 
> >> wrote:
> >>
> >> > Which version of Wicket do you use ?
> >> >
> >> > Martin Grigorov
> >> > Wicket Training and Consulting
> >> > https://twitter.com/mtgrigorov
> >> >
> >> > On Tue, Jul 25, 2017 at 5:52 PM, Wayne W  >
> >> > wrote:
> >> >
> >> > > Hi,
> >> > >
> >> > > I've got a strange issue I cannot get to the bottom of. Basically we
> >> have
> >> > > our app deployed on jetty 9.2.1 with apache 2.4 in front. If I make
> >> calls
> >> > > to stateless pages its all good. However as soon as I try to make a
> >> call
> >> > to
> >> > > a stateful page it does a 302 to the login page for our app, but
> then
> >> > just
> >> > > gets stuck in a 302 loop redirection loop. Looking at the server
> logs
> >> its
> >> > > full of this with no other exception - each track trace corresponds
> to
> >> > > another 302 redirect. Each redirect is trying to get to our login
> >> page:
> >> > >
> >> > >
> >> > > 2017-07-25 14:40:18,989 ERROR -
> >> > > org.apache.wicket.DefaultExceptionMapper.internalMap(
> >> > > DefaultExceptionMapper.java:129)
> >> > > 129 DefaultExceptionMapper - Unexpected error occurred
> >> > > java.lang.NullPointerException
> >> > > at
> >> > > org.apache.wicket.request.http.handler.RedirectRequestHandle
> >> r.respond(
> >> > > RedirectRequestHandler.java:99)
> >> > > at
> >> > > org.apache.wicket.request.cycle.RequestCycle$
> HandlerExecutor.respond(
> >> > > RequestCycle.java:862)
> >> > > at
> >> > > org.apache.wicket.request.RequestHandlerStack.execute(
> >> > > RequestHandlerStack.java:64)
> >> > > at
> >> > > org.apache.wicket.request.RequestHandlerStack.execute(
> >> > > RequestHandlerStack.java:93)
> >> > > at
> >> > > org.apache.wicket.request.cycle.RequestCycle.execute(
> >> > > RequestCycle.java:261)
> >> > > at
> >> > > org.apache.wicket.request.cycle.RequestCycle.
> >> > processRequest(RequestCycle.
> >> > > java:218)
> >> > > at
> >> > > org.apache.wicket.request.cycle.RequestCycle.
> processRequestAndDetach(
> >> > > RequestCycle.java:289)
> >> > > at
> >> > > org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(
> >> > > WicketFilter.java:259)
> >> > > at
> >> > > org.apache.wicket.protocol.http.WicketFilter.
> >> > processRequest(WicketFilter.
> >> > > java:201)
> >> > > at
> >> > > org.apache.wicket.protocol.http.WicketFilter.doFilter(
> >> > > WicketFilter.java:282)
> >> > > at
> >> > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.
> >> > > doFilter(ServletHandler.java:1653)
> >> > > at
> >> > > hub.app.servlet.RelativeUrlFilter.doFilter(
> RelativeUrlFilter.java:54)
> >> > > at
> >> > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.
> >> > > doFilter(ServletHandler.java:1653)
> >> > > at
> >> > > com.wideplay.warp.persist.PersistenceFilter$3.run(
> >> > > PersistenceFilter.java:141)
> >> > > at
> >> > > com.wideplay.warp.persist.internal.Lifecycles.
> >> > > failEarlyAndLeaveNoOneBehind(Lifecycles.java:29)
> >> > > at
> >> > > com.wideplay.warp.persist.PersistenceFilter.doFilter(
> >> > > PersistenceFilter.java:155)
> >> > > at
> >> > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.
> >> > > doFilter(ServletHandler.java:1645)
> >> > > at
> >> > > org.eclipse.jetty.servlet.ServletHandler.doHandle(
> >> > ServletHandler.java:564)
> >> > > at
> >> > > org.eclipse.jetty.server.handler.ScopedHandler.handle(
> >> > > ScopedHandler.java:143)
> >> > 

Re: Toastr popups and Form's onSubmit

2017-07-27 Thread ssamarin
I probably don't need a label, problem is that onSubmit of the form typically
calls redirect to another page.

I tried AjaxButton, but can't get redirect being called *after* toastr popup
shows up. Ideally, I want popup, wait few seconds till it closes (or user
closes it) - do redirect. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Toastr-popups-and-Form-s-onSubmit-tp4678320p4678329.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: Toastr popups and Form's onSubmit

2017-07-27 Thread Martin Grigorov
Hi,

Do you really need a Label ?
I think you should be able to accomplish the same with:
target.appendJavaScript(Toastr.build(...));

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jul 27, 2017 at 3:28 PM, ssamarin  wrote:

> Hello,
> I'm integrating toastr popups (https://github.com/CodeSeven/toastr) into
> our
> application. For it to work properly, I need to add Behavior to Label and
> then add that label to AjaxRequestTarget.
>
> I'm wondering on how to wire this with Form's and onSubmit methods. Custom
> Ajax buttons everywhere could be a solution, but means quite a lot of
> rewrite.
>
> May be there's some best practice?
>
> Regards, Stepan.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Toastr-popups-and-Form-s-onSubmit-tp4678320.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
>
>


Toastr popups and Form's onSubmit

2017-07-27 Thread ssamarin
Hello,
I'm integrating toastr popups (https://github.com/CodeSeven/toastr) into our
application. For it to work properly, I need to add Behavior to Label and
then add that label to AjaxRequestTarget. 

I'm wondering on how to wire this with Form's and onSubmit methods. Custom
Ajax buttons everywhere could be a solution, but means quite a lot of
rewrite. 

May be there's some best practice? 

Regards, Stepan.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Toastr-popups-and-Form-s-onSubmit-tp4678320.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: how to implement resource bundle to get text from the xml file

2017-07-27 Thread Martin Grigorov
Then Component.getString(String) should work.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jul 26, 2017 at 8:00 PM, extraquoo  wrote:

> the current project use the i18n xml like below
>  2017-07-26_09_59_49-PDLVDAPP124.png>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/how-to-implement-resource-bundle-to-
> get-text-from-the-xml-file-tp4678278p4678312.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: Form Children values

2017-07-27 Thread Martin Grigorov
Hi,

You need to get a reference to the Checkboxes' models somehow.
The Form instantiates the Panel, and the Panel instantiates the Checkboxes.
So you have several options:
- pass the models from the form to the panel to the checkboxes
- introduce getter methods where needed so you can reach them
- use CompoundPropertyModel in the Form
- (not recommended) use get("panel:checkbox1").getDefaultModelObject()
...

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jul 27, 2017 at 11:49 AM, ASHU_JAVA  wrote:

> Hello All,
>
> I wanted to fetch the current value of 3 checkbox's on the submit button.
> The "Checkbox" is not part of my form, instead its part of a Wicket Panel
> called inside the form.
>
> The hierarchy of checkbox values inside form object is shown in below
> screenshot:-
>
> 
>
> On Submit button of my form, I wanted to fetch all checkbox values and
> update in database.
> Here's the onSubmit method
> @Override
> protected void onSubmit(final AjaxRequestTarget target, final Form
> form){
> }
>
> Can anyone please suggest how I can fetch these checkbox values inside
> onSubmit() method by form object?
>
> Thanks in advance.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Form-Children-values-tp4678317.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 Children values

2017-07-27 Thread ASHU_JAVA
Hello All,

I wanted to fetch the current value of 3 checkbox's on the submit button.
The "Checkbox" is not part of my form, instead its part of a Wicket Panel
called inside the form.

The hierarchy of checkbox values inside form object is shown in below
screenshot:-

 

On Submit button of my form, I wanted to fetch all checkbox values and
update in database.
Here's the onSubmit method
@Override
protected void onSubmit(final AjaxRequestTarget target, final Form form){
}

Can anyone please suggest how I can fetch these checkbox values inside
onSubmit() method by form object?

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Form-Children-values-tp4678317.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: Message Scroll Banner in Wickets

2017-07-27 Thread Martin Grigorov
Great!

I hope you have learnt something new while debugging this problem! :-)

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jul 27, 2017 at 11:21 AM, ASHU_JAVA  wrote:

> Hello All,
>
> I've resolved my issue by overriding the renderHead() method inside
> MyPanel.java as below:-
>
> @Override
> public void renderHead(IHeaderResponse response) {
>
> response.renderString("");
> response.renderOnDomReadyJavaScript("$(function () {
> $('.marquee').marquee({ duration: 15000,duplicate: false,
> delayBeforeStart:2000,  allowCss3Support: true, gap: 600, pauseOnCycle:
> true,
> pauseOnHover: true });});");
>
> }
>
> Thanks everyone.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Message-Scroll-Banner-in-Wickets-tp4678245p4678315.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: Message Scroll Banner in Wickets

2017-07-27 Thread ASHU_JAVA
Hello All,

I've resolved my issue by overriding the renderHead() method inside
MyPanel.java as below:-

@Override
public void renderHead(IHeaderResponse response) {

response.renderString("");
response.renderOnDomReadyJavaScript("$(function () { 
$('.marquee').marquee({ duration: 15000,duplicate: false,
delayBeforeStart:2000,  allowCss3Support: true, gap: 600, pauseOnCycle: true, 
pauseOnHover: true });});");

} 

Thanks everyone.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Message-Scroll-Banner-in-Wickets-tp4678245p4678315.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