AjaxFormSubmitBehavior and FilterForm problem

2014-02-13 Thread Sandor Feher
Hi,

I have a datatable inside a filterform. Everything works fine but I need to
filter table on every single typed characters in my filterform. To achieve
this I added an AjaxFormSubmitBehavior to my filterform.
There is one small problem with it. If I type one char it works fine but if
I type one and another then the first char always get selected and I can't
type other chars.
How can I get it work ?





Regards., Sandor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormSubmitBehavior-and-FilterForm-problem-tp4664422.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: AjaxFormSubmitBehavior and FilterForm problem

2014-02-13 Thread Martin Grigorov
Hi,

It seems the text input field is re-rendered with Ajax after typing a
character.
Try to not re-render the input field.
Or you can use target.appendJavaScript(...) and use something like
http://bytes.com/topic/javascript/answers/429209-how-unselect-text-input-box

Martin Grigorov
Wicket Training and Consulting


On Thu, Feb 13, 2014 at 9:00 AM, Sandor Feher sfe...@bluesystem.hu wrote:

 Hi,

 I have a datatable inside a filterform. Everything works fine but I need to
 filter table on every single typed characters in my filterform. To achieve
 this I added an AjaxFormSubmitBehavior to my filterform.
 There is one small problem with it. If I type one char it works fine but if
 I type one and another then the first char always get selected and I can't
 type other chars.
 How can I get it work ?





 Regards., Sandor

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AjaxFormSubmitBehavior-and-FilterForm-problem-tp4664422.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: Modular Wicket Application

2014-02-13 Thread IowA
Thanks!


Martin Grigorov-4 wrote
 https://github.com/ReginaldasR/wicket-modular/pull/1
 
 Martin Grigorov
 Wicket Training and Consulting
 
 
 On Wed, Feb 12, 2014 at 5:51 PM, IowA lt;

 reginaldasr@

 gt; wrote:
 
 Hello, I was not using annotations, so after removing it from pom.xml I
 am
 still getting same error


 Martin Grigorov-4 wrote
  Hi,
 
  You have to use Wicket libraries with the same major version.
  wicket is 7.0.0-SNAPSHOT
  but wicketstuff-annotation is 1.4
 
  I'd recommend you to use 6.13 for both
 
  Martin Grigorov
  Wicket Training and Consulting
 
 
  On Sat, Feb 8, 2014 at 10:12 AM, IowA lt;

  reginaldasr@

  gt; wrote:
 
  Hello all, I am new to Wicket. When I use Guice in Wicket's quickstart
  everything works like a charm and it is possible to deploy it on
 Tomcat.
  But
  when i use same code + write my module deploying to Tomcat ends with
  errors.
  Catalina - http://pastebin.com/CaFGzDta
  Tomcat - http://pastebin.com/prEU4RX5
 
  wicket module pom.xml - http://pastebin.com/zF0z2MiN
  domain module pom.xml - http://pastebin.com/bLkbwhsN
  parent pom.xml - http://pastebin.com/hC9sLpuJ
 
  Any ideas what I am doing wrong?
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Modular-Wicket-Application-tp4664317.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail:

  users-unsubscribe@.apache

  For additional commands, e-mail:

  users-help@.apache

 
 



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Modular-Wicket-Application-tp4664317p4664413.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: 

 users-unsubscribe@.apache

 For additional commands, e-mail: 

 users-help@.apache






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Modular-Wicket-Application-tp4664317p4664425.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: AjaxFormSubmitBehavior and FilterForm problem

2014-02-13 Thread Sandor Feher
Hi Martin,

Thanks for the prompt answer. First I try to not re-render filterform's
field.
How could I do that ? My panel looks like this:


I changed target.add from container to table to refresh table only but that
did not help.



Regards., Sandor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormSubmitBehavior-and-FilterForm-problem-tp4664422p4664427.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: AjaxFormSubmitBehavior and FilterForm problem

2014-02-13 Thread Martin Grigorov
Do you
use 
org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilteredPropertyColumn
?
Where is the filtering text input field ? Is it in the table ? If YES, then
rerendering the table will rerender the input field too.
See the JS solution or move the filtering text field out of the table...

Martin Grigorov
Wicket Training and Consulting


On Thu, Feb 13, 2014 at 10:21 AM, Sandor Feher sfe...@bluesystem.hu wrote:

 Hi Martin,

 Thanks for the prompt answer. First I try to not re-render filterform's
 field.
 How could I do that ? My panel looks like this:


 I changed target.add from container to table to refresh table only but that
 did not help.



 Regards., Sandor

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AjaxFormSubmitBehavior-and-FilterForm-problem-tp4664422p4664427.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: AjaxFormSubmitBehavior and FilterForm problem

2014-02-13 Thread Sandor Feher
Yes, I use TextFilteredPropertyColumn and FilterToolbar.
So it might better to use js to solve this.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormSubmitBehavior-and-FilterForm-problem-tp4664422p4664429.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: AjaxFormSubmitBehavior and FilterForm problem

2014-02-13 Thread Richter, Marvin
I implemented a Search for a simple ListView but could be used also for any 
DataView.
This solution also highlights the found String if you add the class 
'highlighted' to you CSS.

The table part:

final WebMarkupContainer table = new WebMarkupContainer(table);
table.setOutputMarkupId(true);
table.add(new TableBehavior().condensed().striped());
add(table);
final TextFieldString searchQuery = new 
TextFieldString(searchQuery, Model.of());
searchQuery.add(new AjaxFormComponentUpdatingBehavior(onkeyup) {
 
private static final long serialVersionUID = 
314186226258079912L;
 
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(table);
target.appendJavaScript(
$('.searchResult').find('td:contains(' + 
$('.searchQuery').val() + ')').each(function () {\n
+ 
$(this).html($(this).html().replace($('.searchQuery').val(), 'span 
class=\highlighted\' + $('.searchQuery').val() + '/span'));\n
+ }););
}
});
add(searchQuery);
 
IModelListActionJournal filteredHistoryEntries = new 
AbstractReadOnlyModelListActionJournal() {
 
private static final long serialVersionUID = 
6375514913998162927L;
 
@Override
public ListActionJournal getObject() {
if ((searchQuery.getInput() == null) || 
StringUtils.EMPTY.equals(searchQuery.getInput())) {
return model.getObject();
} else {
ListActionJournal filtered = model.getObject();
CollectionUtils.filter(filtered, new 
HistoryFilter(searchQuery.getInput()));
return filtered;
}
}
};
 
ListViewActionJournal historyEntries = new 
ListViewActionJournal(historyEntries, filteredHistoryEntries) {
 
private static final long serialVersionUID = 
389308185477622395L;
 
@Override
protected void populateItem(ListItemActionJournal item) {
item.setDefaultModel(new 
CompoundPropertyModelActionJournal(item.getModel()));
item.add(new DateLabel(created, new CcaDateConverter()));
item.add(new Label(createdByLogin));
item.add(new Label(contactChannel.name));
item.add(new Label(action.name));
item.add(new Label(reason.name));
item.add(new Label(actionText));
}
};
table.add(historyEntries);
 
 The Predicate for comparsion (you need to replace the evaluation to check for 
your object fields)
private final class HistoryFilter implements Predicate {
 
private final String searchQuery;
 
private HistoryFilter(String searchQuery) {
this.searchQuery = searchQuery;
}
 
@Override
public boolean evaluate(Object object) {
if (object instanceof ActionJournal) {
ActionJournal entry = (ActionJournal) object;
String q = searchQuery.toLowerCase();
if ((entry.getCreatedByLogin() != null)
 
StringUtils.contains(entry.getCreatedByLogin().toLowerCase(), q)) {
return true;
} else if ((entry.getActionText() != null)
 
StringUtils.contains(entry.getActionText().toLowerCase(), q)) {
return true;
} else if ((entry.getContactChannel() != null)
 
StringUtils.contains(entry.getContactChannel().getName().toLowerCase(), q)) {
return true;
} else if ((entry.getAction() != null)
 
StringUtils.contains(entry.getAction().getName().toLowerCase(), q)) {
return true;
} else if ((entry.getReason() != null)
 
StringUtils.contains(entry.getReason().getName().toLowerCase(), q)) {
return true;
}
}
return false;
}
}

Marvin Richter

-Original Message-
From: Sandor Feher [mailto:sfe...@bluesystem.hu] 
Sent: Thursday, February 13, 2014 10:45 AM
To: users@wicket.apache.org
Subject: Re: AjaxFormSubmitBehavior and FilterForm problem

Yes, I use TextFilteredPropertyColumn and FilterToolbar.
So it might better to use js to solve this.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormSubmitBehavior-and-FilterForm-problem-tp4664422p4664429.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org

how bind CompoundPropertyModel to items of DataView

2014-02-13 Thread Farrukh SATTOROV
Hi everyone,  is there any example or explanation of using
CompundPropertyModel for wciket output component (like table).


Re: how bind CompoundPropertyModel to items of DataView

2014-02-13 Thread Martin Grigorov
Hi,

CompoundPropertyModel (CPM) works by using the component path between the
component with the model and its children.
I.e. if you set CPM to the DataView then you must make sure its object has
the same structure as the items in the dataview. This could be challenging
to setup and to maintain!
Check whether CompoundPropertyModel#bind() can be in help. Or use different
model.

Martin Grigorov
Wicket Training and Consulting


On Thu, Feb 13, 2014 at 1:15 PM, Farrukh SATTOROV fireda...@gmail.comwrote:

 Hi everyone,  is there any example or explanation of using
 CompundPropertyModel for wciket output component (like table).



Re: Error in Modal opening two diffrent instances of Wicket applicaiton.

2014-02-13 Thread eaglei22
Okay, so I was able to try some more scenerios, and it looks like if I have
one instance of the application open in one tab, and open a modal window and
now do anything.. Then open another instance of the application but not even
click on anything, and go back to the first intance and just hit cancel on
the Modal which calls a window.close(target)  then I get a page expired
error.. 

So, How do I keep the modal window from being affected by another instance
of an application being opened?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Error-in-Modal-opening-two-diffrent-instances-of-Wicket-applicaiton-tp4664418p4664442.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: AjaxFormSubmitBehavior and FilterForm problem

2014-02-13 Thread Sandor Feher
Hi,

Thanks for the tip. I have almost done it.
Just one annoying problem. I can't set filter fields' markup up. Not the td
where the input field resides but the input tag itself.
I have five filter fields on my filtertoolbar. To use javascript trick I
have to set id for every filter fields.(Now wicket set these ids for
filter6, filter7 and so one.)

Thnx.  S

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormSubmitBehavior-and-FilterForm-problem-tp4664422p4664443.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



Hybrid palette with DropDownChoice and ListView

2014-02-13 Thread ChambreNoire
Hello,

I'd like to create a hybrid 'palette'. First there's a DropDownChoice with
an 'Add' link and next to this a vertical list of selected items, each with
a 'remove' link. Of course, adding an item removes it from the
DropDownChoice and adds it to the list and vice-versa for item 'removal'. 

I have already started but I fear that this is probably going to be fairly
complicated as it involves using ListViews in a form and DropDownChoice
customisation so any pointers to get me going would be most appreciated.
I'll post some code once I have something vaguely functional!

Thanks,

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Hybrid-palette-with-DropDownChoice-and-ListView-tp4664445.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: Hybrid palette with DropDownChoice and ListView

2014-02-13 Thread Paul Bors
I don't think you need to go nuts and worry much about a ListView. Use a
Select2 instead of the drop-down and have a custom panel instead of the
plain old option. You can place an Add button or something or better yet,
check boxes and then you won't need the second list.

Suppose you do stick to old HTML components like a DropDown and a ListView.
First off, get off the list view and use a multiple Select.
Take a look at how the wicket pallet is done at:
http://www.wicket-library.com/wicket-examples/compref/wicket/bookmarkable/org.apache.wicket.examples.compref.PalettePage

All you would have to do is change the left available multi select with
your drop down.


Now, I would recommend using jQuery UI's widgets since they are easier to
use and more fun to work with (both for the developer and the application
user):
http://jqueryui.com/demos/

Have fun!

On Thu, Feb 13, 2014 at 11:05 AM, ChambreNoire a...@tentelemed.com wrote:

 Hello,

 I'd like to create a hybrid 'palette'. First there's a DropDownChoice with
 an 'Add' link and next to this a vertical list of selected items, each with
 a 'remove' link. Of course, adding an item removes it from the
 DropDownChoice and adds it to the list and vice-versa for item 'removal'.

 I have already started but I fear that this is probably going to be fairly
 complicated as it involves using ListViews in a form and DropDownChoice
 customisation so any pointers to get me going would be most appreciated.
 I'll post some code once I have something vaguely functional!

 Thanks,

 Chambre

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Hybrid-palette-with-DropDownChoice-and-ListView-tp4664445.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: Hybrid palette with DropDownChoice and ListView

2014-02-13 Thread Paul Bors
Btw, Select2 demos are at:
http://ivaynberg.github.io/select2/

Its Wicket integration at:
https://github.com/ivaynberg/select2

That's Igor's baby (you might have seen Igor's name in Wicket's API
JavaDocs :)


On Thu, Feb 13, 2014 at 11:34 AM, Paul Bors p...@bors.ws wrote:

 I don't think you need to go nuts and worry much about a ListView. Use a
 Select2 instead of the drop-down and have a custom panel instead of the
 plain old option. You can place an Add button or something or better yet,
 check boxes and then you won't need the second list.

 Suppose you do stick to old HTML components like a DropDown and a
 ListView. First off, get off the list view and use a multiple Select.
 Take a look at how the wicket pallet is done at:

 http://www.wicket-library.com/wicket-examples/compref/wicket/bookmarkable/org.apache.wicket.examples.compref.PalettePage

 All you would have to do is change the left available multi select with
 your drop down.


 Now, I would recommend using jQuery UI's widgets since they are easier to
 use and more fun to work with (both for the developer and the application
 user):
 http://jqueryui.com/demos/

 Have fun!

 On Thu, Feb 13, 2014 at 11:05 AM, ChambreNoire a...@tentelemed.com wrote:

 Hello,

 I'd like to create a hybrid 'palette'. First there's a DropDownChoice with
 an 'Add' link and next to this a vertical list of selected items, each
 with
 a 'remove' link. Of course, adding an item removes it from the
 DropDownChoice and adds it to the list and vice-versa for item 'removal'.

 I have already started but I fear that this is probably going to be fairly
 complicated as it involves using ListViews in a form and DropDownChoice
 customisation so any pointers to get me going would be most appreciated.
 I'll post some code once I have something vaguely functional!

 Thanks,

 Chambre

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Hybrid-palette-with-DropDownChoice-and-ListView-tp4664445.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: Hybrid palette with DropDownChoice and ListView

2014-02-13 Thread ChambreNoire
Thanks for the suggestions. Regrettably the spec requires a vertical list of
labels and specifically not a multi choice list as used in the extensions
Palette component otherwise yes it would be trivial to make the right hand
side a one row drop down as you mention...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Hybrid-palette-with-DropDownChoice-and-ListView-tp4664445p4664448.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 make a Wiket DropDownChoice with complex a model return a simple String

2014-02-13 Thread Andrea Del Bene
Your welcome! I will try to publish this snippet somewhere in the guide.

 Thanks Andrea,

 I was trying what you sent in your previous  message and I was having
 trouble figuring out how to get the value set on the target property model.

 Your code here, especially this line:

 targetModel.setObject(getChoiceRenderer().getIdValue(newSelection,
 choiceIndex));

 was really helpful and I was able to get everything working.

 Thanks again. 
 Have you ever consider making this available to the Wicket community? I see
 a lot of questions related to DropDownChoice, but not many answers.

 - Bruce


 -Original Message-
 From: Andrea Del Bene [mailto:an.delb...@gmail.com] 
 Sent: Wednesday, February 12, 2014 4:31 AM
 To: users@wicket.apache.org
 Subject: Re: How to make a Wiket DropDownChoice with complex a model return
 a simple String

 Here is some code of a possible solution:


 public class DropDownChoiceForStringT extends DropDownChoiceT {

 private IModelString targetModel;

 public DropDownChoiceForString(String id, IModelT model,
 IModelString targetModel, List? extends T choices,
 IChoiceRenderer? super T renderer) {
 super(id, model, choices, renderer);
 this.targetModel = targetModel;
 }

 protected DropDownChoiceForString(String id, IModelT model,
 IModelString targetModel) {
 this(id, model, targetModel, Collections.T emptyList(), null);
 }

 @Override
 protected void onInitialize() {
 super.onInitialize();
 // load the initial choice.
 setModelObject(convertChoiceIdToChoice(targetModel.getObject()));
 }

 @Override
 protected void onDetach() {
 super.onDetach();

 targetModel.detach();
 }

 @Override
 protected void onModelChanged() {
 super.onModelChanged();

 T newSelection = getModelObject();

 int choiceIndex = getChoices().indexOf(newSelection);
 // update the string source with the selected value.
 targetModel.setObject(getChoiceRenderer().getIdValue(newSelection,
 choiceIndex));
 }
 }



 Hi,

 I needed something similar in a couple of projects. One solution is to 
 create a custom DropDownChoice which takes also the string model to 
 update. Then you can override onModelChanged to update the string 
 model with the new value that can be extracted with the ChoiceRenderer.
 To make this easier to understand, let's say that I have a list of 
 state abbreviations for example AL, AK, AZ, AR etcetera (the actual 
 example has two letter abbreviations also, but much longer names). I 
 need a DropDownChoice that shows the abbreviations for selection 
 (e.g., AK) but will show the full name as a tooltip whenever the 
 mouse hovers over one of the choice (e.g., AK shows Alaska).

  
 I have developed a solution that is based on the example presented here:
 http://stackoverflow.com/questions/12234738/wicket-dropdownchoice-tit
 les-too

 ltips-for-options

 that develops a subclass of DropDownChoice and overrides 
 appendOptionHtml to append a title to the buffer. My class takes a 
 StateDisplay object as its model, and the model has two fields, an 
 id that is displayed in the list, and a fullName which is added 
 as the title by the appendOptionHtml method.

  
 This works fine for displaying thedropdown with the  tooltip, but the 
 problem is that the model is a complex object( StateDisplay) with two 
 fields, but the underlying domain object needs a simple String with 
 the state ID.

  
 Prior to implementing the tooltip, the DrowdownChoice was formed using:

  
 Item.add(new DropDownChoiceString(state, new
 PropertyModelString((CompanyDTO) item.getDefaultModelObject(), 
 state), stateList)));

  
 Note: item is there because this is used in the populateItem method 
 of a ListView.

  
 Now the code is:

  
 Model StateDisplay  selectedState = new Model();

  
 ChoiceRendererStateDisplay choiceRenderer = new 
 ChoiceRendererModifierDisplayDto(id, id);


 Item.add(new StateDropDownChoice StateDisplay (state, 
 selectedState, stateList, choiceRenderer));

  
 After the selection is made the model (selectedState) is set to the 
 chosen StateDisplay, but there is no easy way to the simple String 
 value set on the CompanyDTO.

  
 How can I make the dropdown selection update the domain model's 
 simple String.

  
 Thanks

 Bruce



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