Using repeater depending on ajax enabled dropdown choice

2009-08-31 Thread copenhag copenhagen
Hi,

I tried to implement a repeater(DataView) that should change depending on a
dropdownchoice.

I wanted the repeater to change right away, so i ajax enabled the
dropdownchoice, but for some reason it does not work.

Can anyone tell me what i am doing wrong, or does anyone have an sample on
the mentioned behaviour?

Here is my code:

public class CategoryOverviewPage {
...
DropDownChoice dropDownChoice = new MyDropDownChoice(categories,
new MyModel(caseCategory), caseCategoryService.getAllWithExtraOption(),
new ChoiceRenderer(category, id));

SortableCaseDataProvider dp = new
MySortableCaseDataProvider(CaseCategory.DEFAULT_OPTION);
DataView dataView = new MyDataView(sorting, dp);
dataView.setOutputMarkupId(true);

final WebMarkupContainer table = new WebMarkupContainer(table);
table.add(dataView);
table.setOutputMarkupId(true);
form.add(tabel);
// add ajax behavior to categories choice option
dropDownChoice.add(new AjaxFormComponentUpdatingBehavior(onchange)
{

private static final long serialVersionUID =
4599145001919000272L;

protected void onUpdate(AjaxRequestTarget target) {
log.debug(Updating list by ajax);
log.debug(CaseCategory + caseCategory);

SortableCaseDataProvider myDp = new
MySortableCaseDataProvider(caseCategory);
DataView myDataView = new MyDataView(sorting, myDp);
myDataView.setOutputMarkupId(true);

WebMarkupContainer myTable = new
WebMarkupContainer(table);
myTable .add(myDataView);
myTable.setOutputMarkupId(true);
table.replaceWith(myTable);
target.addComponent(table);
}
});
form.add(dropDownChoice);
}

So when user chooses a different category from the dropdown choice box, i
try to replace
the repater with a different one, that has the same id. I thought this
should work...

Best Regards
Muro


Re: Regarding datepicker popup when inputfield pressed

2009-08-25 Thread copenhag copenhagen
Hi,

A very nice solution to the this problem could be as Michael Mosmann
suggested:

initStart3 = function() {
 Wicket.DateTime.init( {

you should extend the input tag with
--
onfocus=initStart3.showCalendar()


The problem is that in the wicket-date.js the showCalendar function is
private.

It can be found under the section where the datepicker is initialized:
Wicket.DateTime.init = function(cfg) { ... function showCalendar() {}

Because the javascript function is private and not made public, the calendar
popup can not be triggered from other
fields by adding code like: onfocus=initStart3.showCalendar()

I must recommend that the showCalendar function is made public for the
future so the users
easily can trigger the calendar.

Right now i made a ugly hack to make it work.

Best Regards
Cemil


On Mon, Aug 24, 2009 at 1:49 PM, copenhag copenhagen
copenha...@gmail.comwrote:

 Hi

 Thanks for the tip...

 I looked at wiquery and it looks good.

 And i may use some nice features from WiQuery later on.

 The problem is that my datepicker is integrated with the default Wicket
 datepicker, so
 it would be to heavy a job to use the WiQuery datepicker.

 But appearently there is no easy way of doing this.

 Best Regards
 Cemil




 On Fri, Aug 21, 2009 at 4:24 PM, sander v F sandervanfaas...@gmail.comwrote:

 There is a JQuery plugin capable of doing this, see:

 http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerClickInput.html

 You should have a look at WiQuery ( http://code.google.com/p/wiquery/ ),
 a
 Wicket JQuery component. I don't know if they already implemented this
 datepicker, but it should be easy to make a plugin.



 2009/8/21 Michael Mosmann mich...@mosmann.de

  Am Freitag, den 21.08.2009, 14:33 +0200 schrieb copenhag copenhagen:
   Has no one really needed the calendar popup when the input field is
   selected/pressed ?
 
  sorry.. (btw. IMHO it is annoying ..)
 
  i searched for some solution.. but i think you have to
  a) take a look into this yui magic
  b) ask on dev list for some infos about an extension of the current
  datepicker
  c) choose some different..
  d) ..?
 
  mm:)
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 





Re: Regarding datepicker popup when inputfield pressed

2009-08-24 Thread copenhag copenhagen
Hi

Thanks for the tip...

I looked at wiquery and it looks good.

And i may use some nice features from WiQuery later on.

The problem is that my datepicker is integrated with the default Wicket
datepicker, so
it would be to heavy a job to use the WiQuery datepicker.

But appearently there is no easy way of doing this.

Best Regards
Cemil



On Fri, Aug 21, 2009 at 4:24 PM, sander v F sandervanfaas...@gmail.comwrote:

 There is a JQuery plugin capable of doing this, see:

 http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerClickInput.html

 You should have a look at WiQuery ( http://code.google.com/p/wiquery/ ), a
 Wicket JQuery component. I don't know if they already implemented this
 datepicker, but it should be easy to make a plugin.



 2009/8/21 Michael Mosmann mich...@mosmann.de

  Am Freitag, den 21.08.2009, 14:33 +0200 schrieb copenhag copenhagen:
   Has no one really needed the calendar popup when the input field is
   selected/pressed ?
 
  sorry.. (btw. IMHO it is annoying ..)
 
  i searched for some solution.. but i think you have to
  a) take a look into this yui magic
  b) ask on dev list for some infos about an extension of the current
  datepicker
  c) choose some different..
  d) ..?
 
  mm:)
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



Re: Regarding datepicker popup when inputfield pressed

2009-08-21 Thread copenhag copenhagen
Hi,

Thanks for the suggest, but it did not work.

Any other ideas on how to do it ...?

Best Regards
Cemil

On Thu, Aug 20, 2009 at 4:20 PM, Michael Mosmann mich...@mosmann.de wrote:

 Am Donnerstag, den 20.08.2009, 16:00 +0200 schrieb copenhag copenhagen:
  Maybe it's because i am a new Wicket user, but i tried that, without any
  luck.
 
  I can't figure out how the calendar is called when clicked on the icon,
 it's
  pretty tricky for me how
  it's done.

 IMHO yui is doing some magic stuff...

 maybe this will work

 DatePicker render something like
 ---
 initStart3 = function() {
  Wicket.DateTime.init( {
 
 ---

 to header..
 where Start3 is the WicketID of the input

 you should extend the input tag with
 --
 onfocus=initStart3.showCalendar()
 --

 not testet..
 mm:)


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




Re: Absolute urls in forms

2009-08-21 Thread copenhag copenhagen
Hi,

Why can't you just add a AttributeModifier to the Form and then modify it as
you wish ?

Best Regards
Cemil

On Fri, Aug 21, 2009 at 9:43 AM, Steen Larsen steen...@gmail.com wrote:

 Hi,

 Just a quick question. Is it somehow possible to make Wicket generate
 absolute urls in the forms action attribute. The reason I ask is
 because my Wicket application is going to be embedded in a CMS through
 a proxy, and apparently the dude writing the proxy would prefer the
 urls to be absolute.

 /Steen

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




Re: Regarding datepicker popup when inputfield pressed

2009-08-21 Thread copenhag copenhagen
Has no one really needed the calendar popup when the input field is
selected/pressed ?

It is a common feature on many calendars...How can i make it work...

Help would be appreciated a lot.

Best Regards

On Fri, Aug 21, 2009 at 11:13 AM, copenhag copenhagen
copenha...@gmail.comwrote:

 Hi,

 Thanks for the suggest, but it did not work.

 Any other ideas on how to do it ...?

 Best Regards
 Cemil


 On Thu, Aug 20, 2009 at 4:20 PM, Michael Mosmann mich...@mosmann.dewrote:

 Am Donnerstag, den 20.08.2009, 16:00 +0200 schrieb copenhag copenhagen:
  Maybe it's because i am a new Wicket user, but i tried that, without any
  luck.
 
  I can't figure out how the calendar is called when clicked on the icon,
 it's
  pretty tricky for me how
  it's done.

 IMHO yui is doing some magic stuff...

 maybe this will work

 DatePicker render something like
 ---
 initStart3 = function() {
  Wicket.DateTime.init( {
 
 ---

 to header..
 where Start3 is the WicketID of the input

 you should extend the input tag with
 --
 onfocus=initStart3.showCalendar()
 --

 not testet..
 mm:)


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





Re: Regarding datepicker popup when inputfield pressed

2009-08-20 Thread copenhag copenhagen
Hi Troy,

Thanks for the swift answer.

I know that you can attach a TextField to a DatePicker, but how would i make
the
calendar popup by just pressing the text field.

As it is now i have to click the calendar icon, but i want to pop the
calendar, by clicking on the field also.

Just as in the example:
http://blog.davglass.com/files/yui/cal2/http://www.ajaxbestiary.com/2008/10/19/yui-calendar-popup-from-text-input/

Best Regards
Cemil

On Thu, Aug 20, 2009 at 2:52 PM, Troy Cauble troycau...@gmail.com wrote:

 I'm doing this in 1.3.6.
 -troy


 import org.apache.wicket.extensions.markup.html.form.DateTextField;
 import org.apache.wicket.extensions.yui.calendar.DatePicker;

 ...
DateTextField date = new DateTextField(date,
 MM/dd/);
date.add(new DatePicker());
form.add(date);


 On Thu, Aug 20, 2009 at 7:52 AM, copenhag
 copenhagencopenha...@gmail.com wrote:
  Hi,
 
  Has anyone made it possible to attached an input field to the datepicker,
  so that the calendar popup's when the input field is selected ?
 
  I have tried, but i could not make it work.
 
  Also searching did not provide any wicket examples.
 
  I want the calendar to work as the example in this link:
 
 http://www.ajaxbestiary.com/2008/10/19/yui-calendar-popup-from-text-input/
 
  Only difference is i want it to work in a Wicket environment.
 
  Please assist if anyone can help.
 
  Best Regards
  Cemil
 

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




Re: Regarding datepicker popup when inputfield pressed

2009-08-20 Thread copenhag copenhagen
Maybe it's because i am a new Wicket user, but i tried that, without any
luck.

I can't figure out how the calendar is called when clicked on the icon, it's
pretty tricky for me how
it's done.

Best Regards
Cemil

On Thu, Aug 20, 2009 at 3:33 PM, Eyal Golan egola...@gmail.com wrote:

 without looking into code, you probably need to add a behavior with onclick
 to the text field.
 look how it's done in the click on icon.

 Eyal Golan
 egola...@gmail.com

 Visit: http://jvdrums.sourceforge.net/
 LinkedIn: http://www.linkedin.com/in/egolan74

 P  Save a tree. Please don't print this e-mail unless it's really necessary


 On Thu, Aug 20, 2009 at 4:19 PM, copenhag copenhagen
 copenha...@gmail.comwrote:

  Hi Troy,
 
  Thanks for the swift answer.
 
  I know that you can attach a TextField to a DatePicker, but how would i
  make
  the
  calendar popup by just pressing the text field.
 
  As it is now i have to click the calendar icon, but i want to pop the
  calendar, by clicking on the field also.
 
  Just as in the example:
  http://blog.davglass.com/files/yui/cal2/
 
 http://www.ajaxbestiary.com/2008/10/19/yui-calendar-popup-from-text-input/
  
 
  Best Regards
  Cemil
 
  On Thu, Aug 20, 2009 at 2:52 PM, Troy Cauble troycau...@gmail.com
 wrote:
 
   I'm doing this in 1.3.6.
   -troy
  
  
   import org.apache.wicket.extensions.markup.html.form.DateTextField;
   import org.apache.wicket.extensions.yui.calendar.DatePicker;
  
   ...
  DateTextField date = new DateTextField(date,
   MM/dd/);
  date.add(new DatePicker());
  form.add(date);
  
  
   On Thu, Aug 20, 2009 at 7:52 AM, copenhag
   copenhagencopenha...@gmail.com wrote:
Hi,
   
Has anyone made it possible to attached an input field to the
  datepicker,
so that the calendar popup's when the input field is selected ?
   
I have tried, but i could not make it work.
   
Also searching did not provide any wicket examples.
   
I want the calendar to work as the example in this link:
   
  
 
 http://www.ajaxbestiary.com/2008/10/19/yui-calendar-popup-from-text-input/
   
Only difference is i want it to work in a Wicket environment.
   
Please assist if anyone can help.
   
Best Regards
Cemil
   
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 



Datepicker popup when textfield is selected

2009-08-14 Thread copenhag copenhagen
Hi,

Would it be possible to make the datepicker popup whenever a textfield is
selected?

Thereby the textfield will be no editable, but only the datepicker will
modify the textfield value.

Here is an example on the behaviour i am looking for with the wicket
datepicker object:

http://blog.davglass.com/files/yui/cal2/

Best Regards
Cem...