Re: Ill really apreciate the help to get the selected item of a DropDownChoice using Scala

2013-05-17 Thread Bruno Moura
Martin, the DDC has already created with the sema object type in the
constructor
for PropertyModel, listCustomer, and ChoiceRenderer

new DropDownChoice(customerSelection,
new PropertyModel[Customer](customer, name), listCustomer, new
ChoiceRenderer[Customer](name))*

But I need only a piece of code that works in retrieve the selected value.

Thanks again.

Bruno Moura


2013/5/17 Martin Grigorov mgrigo...@apache.org

 Hi Bruno,


 On Fri, May 17, 2013 at 6:12 AM, Bruno Moura brunormo...@gmail.com
 wrote:

  Hi Martin
 
  But the DDC doesn't have a constructor with PropertyModel[String](this,
  custName)
  only a property model with the Object/Pojo as I was using.
 

 String is an Object, no ? ;-)


 
  Sorry, I'm new in the world of wicket and scala, and is difficult to find
 

 You need to read some more on Java generics.
 There is nothing more you need to understand this problem.


  good examples around
  so I'm using this list a lot because I'm getting suport and feedback and
 I
  don't want to give up
  of my project.
 
  thanks
 
  Bera
 
 
  2013/5/15 Martin Grigorov mgrigo...@apache.org
 
   Hi,
  
  
   On Wed, May 15, 2013 at 6:32 AM, Bruno Moura brunormo...@gmail.com
   wrote:
  
Hi
   
For some weeks I'm trying to implement a simple combobox, DDC, and
 I'm
struggling with this. I asked  for some help several times but
unfortunately I didn't archive my goal because I'm failing sometimes
 to
understand  scala with wicket, I have a little background with them
 at
   the
moment.
   
Anyway,  my code is showed bellow:
   
*// ComboBox in a listView
item.add(new DropDownChoice(customerSelection, new
PropertyModel[Customer](customer, name), listCustomer, new
ChoiceRenderer[Customer](name))*
   
   
   DropDownChoice[Customer]
  
  
   
If I create a variable, for example,* val custName*,  to receive the
  name
of the selected customer which functions I need to implement on the
creation of DDC object and how can I retrieve this value for the
   variable?
   
  
   The way you already did it will set the selected value in customer's
  name.
   Check PropertyModel's javadoc to understand how it works.
  
   If you want to read/write the value in 'custName' then you have to use:
  new
   PropertyModel[String](this, custName)
  
  
Thanks very much for help me.
   
  
  
  
   --
   Martin Grigorov
   Wicket Training  Consulting
   http://jWeekend.com http://jweekend.com/
  
 



 --
 Martin Grigorov
 Wicket Training  Consulting
 http://jWeekend.com http://jweekend.com/



Re: Example for advanced grid for wicket with timer/date picker controls

2013-05-17 Thread Bruno Moura
Thanks Martin

I will investigate this and how add a datepicker behaviour in a textField.

Bruno Moura


2013/5/17 Martin Grigorov mgrigo...@apache.org

 Hi Bruno,

 WicketStuff provides two grid components - InMethod Grid and EnhancedGrid.
 DatePicker usually is just a behavior added to a TextField. It should be
 simple to achieve what you need.


 On Fri, May 17, 2013 at 5:59 AM, Bruno Moura brunormo...@gmail.com
 wrote:

  Someone could give an example of code of an app built with an advanced
 grid
  with date picker component in it cells?
 
  Thanks
 
  Bera
 



 --
 Martin Grigorov
 Wicket Training  Consulting
 http://jWeekend.com http://jweekend.com/



Re: Retrieve a value of textField and set the property of the Model

2013-05-17 Thread Bruno Moura
Hi Martin

I have used this pastie http://pastie.org/7922079 as you requested.

The problem that I really stuck in retrieve the value of the textField
description, inside a listView
and the selected value of DDC neither. And without these values I can't set
the properties name
and description for the model Meeting to save it in the database.

An off topic question.

The most of the time you are working an put effort to help people and
answer questions from noobies
like me? :-D

If I know some prize for people that help other specifically for IT
subjects I'll nominate you to win :-P

Thanks very much!




Bruno Moura


2013/5/17 Martin Grigorov mgrigo...@apache.org

 Hi Bruno,

 Use any pastebin service to paste your code with Scala/Java highlighting so
 we can see what is wrong.


 On Fri, May 17, 2013 at 6:04 AM, Bruno Moura brunormo...@gmail.com
 wrote:

  Thanks Martin again
 
  I coded as you told me but unfortunately the code doesn't work
  because the description property of the model/object descriptionModel
  didn't receive the value inserted in the text field.
 
  after inspected the descriptionModel in debug time I saw that description
  hasn't any value assigned.
 
 
 
  Bruno Moura
 
 
  2013/5/15 Martin Grigorov mgrigo...@apache.org
 
   Hi,
  
  
   On Wed, May 15, 2013 at 6:18 AM, Bruno Moura brunormo...@gmail.com
   wrote:
  
Hi Paul, thanks very much for your help!
   
I followed your suggestion but this peace of code doesn't compile
unfortunately:
   
IModel descriptionModel = new PropertyModel[Meeting](meeting,
description));
   
I have tried
   
val descriptionModel[IModel] = new PropertyModel[Meeting](meeting,
description)); //wrong systax for scala
   
   
   the easiest is: val descriptionModel = new
  PropertyModel[Meeting](meeting,
   description)
  
   the more explicit ones are:
  
   val descriptionModel : IModel[Meeting] = new
   PropertyModel[Meeting](meeting, description)
   val descriptionModel : PropertyModel[Meeting] = new
   PropertyModel[Meeting](meeting, description)
  
  
and
   
val descriptionModel = new IModel[Meeting](meeting, description));
 //
IModel can't be instanced
   
But I'm doing this thing wrong.
   
I made a great progress with my app but now I'm struggling with this
   issue
and I spent a lot
of time to archive this simple task. If I'm  doing this stuff with
 java
   my
life could
be much easier :-D.
   
I'll appreciate your hep again
   
   
Thanks very much
   
   
   
   
Bera
   
   
2013/5/10 Paul Bors p...@bors.ws
   
 Why the Ajax round-trips for each keyup to extract the model's
   object?
 Have you tried to implement just the Save link/button and then
  look-up
the
 model object from inside the onClick() method?

 In your case it would come from the PropertyModel you use already:

 TextField description = new TextField(description,new
 PropertyModel[Meeting](meeting, description))

 change to:

 IModel descriptionModel = new
 PropertyModel[Meeting](meeting, description));
 TextField descriptionTextField = new TextField(description,
 descriptionModel );

 and your link becomes:

 private class LinkSave(id: String, meeting: Meeting) extends
 AjaxLink[String](id) {

 @SpringBean
 var meetingMediator: TMeetingMediator = _
   def onClick(target: AjaxRequestTarget) {
 meetingDAO.saveMeeting(descriptionModel.getObject())
   }
 }

 Unless you want to also update some other element on the screen
 with
   each
 user key press I really don't think you need the keyup listener.

 ~ Thank you,
Paul Bors


 On Thu, May 9, 2013 at 11:03 PM, Bruno Moura 
 brunormo...@gmail.com
 wrote:

  I'm trying to implement a ListView and in on column of it I
 added a
  listView, for each line,
  I want to save the data inserted on it and update the model:
 
  I'm implemented the code bellow:
 
  val description = new TextField(description,new
  PropertyModel[Meeting](meeting, description))
  description.add(new AjaxFormComponentUpdatingBehavior(keyup) {
protected def onUpdate(target: AjaxRequestTarget) {
  description.getDefaultModelObjectAsString
}
  })
 
  item.add(description)
 
  And I added a link for each line of my ListView for save the
information
 in
  database,
  each line is a instance of a model meeting as is showed bellow:
 
  item.add(new LinkSave(save, meeting))
 
  private class LinkSave(id: String, meeting: Meeting) extends
  AjaxLink[String](id) {
 
  @SpringBean
  var meetingMediator: TMeetingMediator = _
 
  setVisible(clickavel.asInstanceOf[Boolean])
  add(new Label(label, new Model[String]() {
override def getObject: String = Save

Re: Example for advanced grid for wicket with timer/date picker controls

2013-05-17 Thread Bruno Moura
Thanks Sebastien.

I'll verify your links and I hope some one will help me a lot!

Regards

Bruno Moura


2013/5/17 Sebastien seb...@gmail.com

 Hi Bruno,

 If you plan to use jQuery UI, you way find a DatePicker (for wicket 1.5 or
 6) here for instance:
 http://www.7thweb.net/wicket-jquery-ui/datepicker/DefaultDatePickerPage

 The DatePickerBehavior is also available in case you want to make your
 own...

 https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/form/datepicker/DatePickerBehavior.java

 There is also the Kendo UI's one:

 http://www.7thweb.net/wicket-jquery-ui/kendo/datetimepicker/KendoDatePickerPage

 Best regards,
 Sebastien.

 On Fri, May 17, 2013 at 3:36 PM, Bruno Moura brunormo...@gmail.com
 wrote:

  Thanks Martin
 
  I will investigate this and how add a datepicker behaviour in a
 textField.
 
  Bruno Moura
 



Example for advanced grid for wicket with timer/date picker controls

2013-05-16 Thread Bruno Moura
Someone could give an example of code of an app built with an advanced grid
with date picker component in it cells?

Thanks

Bera


Re: Retrieve a value of textField and set the property of the Model

2013-05-16 Thread Bruno Moura
Thanks Martin again

I coded as you told me but unfortunately the code doesn't work
because the description property of the model/object descriptionModel
didn't receive the value inserted in the text field.

after inspected the descriptionModel in debug time I saw that description
hasn't any value assigned.



Bruno Moura


2013/5/15 Martin Grigorov mgrigo...@apache.org

 Hi,


 On Wed, May 15, 2013 at 6:18 AM, Bruno Moura brunormo...@gmail.com
 wrote:

  Hi Paul, thanks very much for your help!
 
  I followed your suggestion but this peace of code doesn't compile
  unfortunately:
 
  IModel descriptionModel = new PropertyModel[Meeting](meeting,
  description));
 
  I have tried
 
  val descriptionModel[IModel] = new PropertyModel[Meeting](meeting,
  description)); //wrong systax for scala
 
 
 the easiest is: val descriptionModel = new PropertyModel[Meeting](meeting,
 description)

 the more explicit ones are:

 val descriptionModel : IModel[Meeting] = new
 PropertyModel[Meeting](meeting, description)
 val descriptionModel : PropertyModel[Meeting] = new
 PropertyModel[Meeting](meeting, description)


  and
 
  val descriptionModel = new IModel[Meeting](meeting, description)); //
  IModel can't be instanced
 
  But I'm doing this thing wrong.
 
  I made a great progress with my app but now I'm struggling with this
 issue
  and I spent a lot
  of time to archive this simple task. If I'm  doing this stuff with java
 my
  life could
  be much easier :-D.
 
  I'll appreciate your hep again
 
 
  Thanks very much
 
 
 
 
  Bera
 
 
  2013/5/10 Paul Bors p...@bors.ws
 
   Why the Ajax round-trips for each keyup to extract the model's
 object?
   Have you tried to implement just the Save link/button and then look-up
  the
   model object from inside the onClick() method?
  
   In your case it would come from the PropertyModel you use already:
  
   TextField description = new TextField(description,new
   PropertyModel[Meeting](meeting, description))
  
   change to:
  
   IModel descriptionModel = new
   PropertyModel[Meeting](meeting, description));
   TextField descriptionTextField = new TextField(description,
   descriptionModel );
  
   and your link becomes:
  
   private class LinkSave(id: String, meeting: Meeting) extends
   AjaxLink[String](id) {
  
   @SpringBean
   var meetingMediator: TMeetingMediator = _
 def onClick(target: AjaxRequestTarget) {
   meetingDAO.saveMeeting(descriptionModel.getObject())
 }
   }
  
   Unless you want to also update some other element on the screen with
 each
   user key press I really don't think you need the keyup listener.
  
   ~ Thank you,
  Paul Bors
  
  
   On Thu, May 9, 2013 at 11:03 PM, Bruno Moura brunormo...@gmail.com
   wrote:
  
I'm trying to implement a ListView and in on column of it I added a
listView, for each line,
I want to save the data inserted on it and update the model:
   
I'm implemented the code bellow:
   
val description = new TextField(description,new
PropertyModel[Meeting](meeting, description))
description.add(new AjaxFormComponentUpdatingBehavior(keyup) {
  protected def onUpdate(target: AjaxRequestTarget) {
description.getDefaultModelObjectAsString
  }
})
   
item.add(description)
   
And I added a link for each line of my ListView for save the
  information
   in
database,
each line is a instance of a model meeting as is showed bellow:
   
item.add(new LinkSave(save, meeting))
   
private class LinkSave(id: String, meeting: Meeting) extends
AjaxLink[String](id) {
   
@SpringBean
var meetingMediator: TMeetingMediator = _
   
setVisible(clickavel.asInstanceOf[Boolean])
add(new Label(label, new Model[String]() {
  override def getObject: String = Save
}))
   
def onClick(target: AjaxRequestTarget) {
  meetingDAO.saveMeeting(meeting)
   
}
  }
   
   
But unfortunately the code above doesn't work. It's fail to retrieve
  the
value of the text
field and also to set the attribute description of the Object meeting
   with
the value of the text field, so in the database the column
 description
  is
never filled
   
Someone know where I am doing wrong stuff?
   
Thanks a lot!
   
   
Bera
   
  
 



 --
 Martin Grigorov
 Wicket Training  Consulting
 http://jWeekend.com http://jweekend.com/



Re: Ill really apreciate the help to get the selected item of a DropDownChoice using Scala

2013-05-16 Thread Bruno Moura
Hi Martin

But the DDC doesn't have a constructor with PropertyModel[String](this,
custName)
only a property model with the Object/Pojo as I was using.

Sorry, I'm new in the world of wicket and scala, and is difficult to find
good examples around
so I'm using this list a lot because I'm getting suport and feedback and I
don't want to give up
of my project.

thanks

Bera


2013/5/15 Martin Grigorov mgrigo...@apache.org

 Hi,


 On Wed, May 15, 2013 at 6:32 AM, Bruno Moura brunormo...@gmail.com
 wrote:

  Hi
 
  For some weeks I'm trying to implement a simple combobox, DDC, and I'm
  struggling with this. I asked  for some help several times but
  unfortunately I didn't archive my goal because I'm failing sometimes to
  understand  scala with wicket, I have a little background with them at
 the
  moment.
 
  Anyway,  my code is showed bellow:
 
  *// ComboBox in a listView
  item.add(new DropDownChoice(customerSelection, new
  PropertyModel[Customer](customer, name), listCustomer, new
  ChoiceRenderer[Customer](name))*
 
 
 DropDownChoice[Customer]


 
  If I create a variable, for example,* val custName*,  to receive the name
  of the selected customer which functions I need to implement on the
  creation of DDC object and how can I retrieve this value for the
 variable?
 

 The way you already did it will set the selected value in customer's name.
 Check PropertyModel's javadoc to understand how it works.

 If you want to read/write the value in 'custName' then you have to use: new
 PropertyModel[String](this, custName)


  Thanks very much for help me.
 



 --
 Martin Grigorov
 Wicket Training  Consulting
 http://jWeekend.com http://jweekend.com/



Re: Retrieve a value of textField and set the property of the Model

2013-05-14 Thread Bruno Moura
Hi Paul, thanks very much for your help!

I followed your suggestion but this peace of code doesn't compile
unfortunately:

IModel descriptionModel = new PropertyModel[Meeting](meeting,
description));

I have tried

val descriptionModel[IModel] = new PropertyModel[Meeting](meeting,
description)); //wrong systax for scala

and

val descriptionModel = new IModel[Meeting](meeting, description)); //
IModel can't be instanced

But I'm doing this thing wrong.

I made a great progress with my app but now I'm struggling with this issue
and I spent a lot
of time to archive this simple task. If I'm  doing this stuff with java my
life could
be much easier :-D.

I'll appreciate your hep again


Thanks very much




Bera


2013/5/10 Paul Bors p...@bors.ws

 Why the Ajax round-trips for each keyup to extract the model's object?
 Have you tried to implement just the Save link/button and then look-up the
 model object from inside the onClick() method?

 In your case it would come from the PropertyModel you use already:

 TextField description = new TextField(description,new
 PropertyModel[Meeting](meeting, description))

 change to:

 IModel descriptionModel = new
 PropertyModel[Meeting](meeting, description));
 TextField descriptionTextField = new TextField(description,
 descriptionModel );

 and your link becomes:

 private class LinkSave(id: String, meeting: Meeting) extends
 AjaxLink[String](id) {

 @SpringBean
 var meetingMediator: TMeetingMediator = _
   def onClick(target: AjaxRequestTarget) {
 meetingDAO.saveMeeting(descriptionModel.getObject())
   }
 }

 Unless you want to also update some other element on the screen with each
 user key press I really don't think you need the keyup listener.

 ~ Thank you,
Paul Bors


 On Thu, May 9, 2013 at 11:03 PM, Bruno Moura brunormo...@gmail.com
 wrote:

  I'm trying to implement a ListView and in on column of it I added a
  listView, for each line,
  I want to save the data inserted on it and update the model:
 
  I'm implemented the code bellow:
 
  val description = new TextField(description,new
  PropertyModel[Meeting](meeting, description))
  description.add(new AjaxFormComponentUpdatingBehavior(keyup) {
protected def onUpdate(target: AjaxRequestTarget) {
  description.getDefaultModelObjectAsString
}
  })
 
  item.add(description)
 
  And I added a link for each line of my ListView for save the information
 in
  database,
  each line is a instance of a model meeting as is showed bellow:
 
  item.add(new LinkSave(save, meeting))
 
  private class LinkSave(id: String, meeting: Meeting) extends
  AjaxLink[String](id) {
 
  @SpringBean
  var meetingMediator: TMeetingMediator = _
 
  setVisible(clickavel.asInstanceOf[Boolean])
  add(new Label(label, new Model[String]() {
override def getObject: String = Save
  }))
 
  def onClick(target: AjaxRequestTarget) {
meetingDAO.saveMeeting(meeting)
 
  }
}
 
 
  But unfortunately the code above doesn't work. It's fail to retrieve the
  value of the text
  field and also to set the attribute description of the Object meeting
 with
  the value of the text field, so in the database the column description is
  never filled
 
  Someone know where I am doing wrong stuff?
 
  Thanks a lot!
 
 
  Bera
 



Ill really apreciate the help to get the selected item of a DropDownChoice using Scala

2013-05-14 Thread Bruno Moura
Hi

For some weeks I'm trying to implement a simple combobox, DDC, and I'm
struggling with this. I asked  for some help several times but
unfortunately I didn't archive my goal because I'm failing sometimes to
understand  scala with wicket, I have a little background with them at the
moment.

Anyway,  my code is showed bellow:

*// ComboBox in a listView
item.add(new DropDownChoice(customerSelection, new
PropertyModel[Customer](customer, name), listCustomer, new
ChoiceRenderer[Customer](name))*


If I create a variable, for example,* val custName*,  to receive the name
of the selected customer which functions I need to implement on the
creation of DDC object and how can I retrieve this value for the variable?

Thanks very much for help me.


Re: Textbox in a listView, retrieve the value and set the property model

2013-05-10 Thread Bruno Moura
Maxin, thanks a lot again!

I'll verify and if this approach works for me and then I'll share the code
here!

Regards!

Bruno Moura


2013/5/10 Maxim Solodovnik solomax...@gmail.com

 ChoiceRenderer accepts 2 parameters (one of its constructor) one parameter
 for the name being displayed, other for id (hidden)
 I never had problems with dropDown but I always specified both.

 If this doesn't help you can try to debug and see what is the reason, i.e.
 what value is being casted ...



 On Fri, May 10, 2013 at 10:41 AM, Bruno Moura brunormo...@gmail.com
 wrote:

  Thanks Maxin, yes the code is in scala I didn't understand your
  suggestion
  I want to display the property name in the DDC no the property or field
 id,
  sorry
  if I did mistake in the code of my previous message.
 
  Bruno Moura
 
 
  2013/5/10 Maxim Solodovnik solomax...@gmail.com
 
   I would try to change your code as follows:
  
   new DropDownChoice*[Customer]*(customerSelection, new
   PropertyModel[Customer](customer, name), listCustomer, new
   ChoiceRenderer[Customer](name, *id*))
  
   your code seems to not in JAVA
  
  
  
   On Fri, May 10, 2013 at 9:13 AM, Bruno Moura brunormo...@gmail.com
   wrote:
  
Errata:
   
the original message and code is:
   
WicketMessage: Method onSelectionChanged of interface
org.apache.wicket.markup.html.form.IOnChangeListener targeted at
   component
[MarkupContainer [Component id = customerSelection]] threw an
 exception
   
Root cause:
   
java.lang.ClassCastException: java.lang.String cannot be cast to
com.prog.entities.Customer
   
The code that I have implemented is showed bellow
   
item.add(new DropDownChoice(customerSelection, new
PropertyModel[Customer](customer, name), listCustomer, new
ChoiceRenderer[Customer](name)) {
protected override def wantOnSelectionChangedNotifications:
   Boolean
= true
   
protected override def onSelectionChanged(newSelection:
   Customer) {
  super.onSelectionChanged(newSelection)
  }
})
   
Thanks
   
Bruno Moura
   
   
2013/5/9 Bruno Moura brunormo...@gmail.com
   

 I implemented a dropbox in a ListView, now when I choose a value
 the
   erro
 bellow always happen:

 WicketMessage: Method onSelectionChanged of interface
 org.apache.wicket.markup.html.form.IOnChangeListener targeted at
component
 [MarkupContainer [Component id = customerSelection]] threw an
  exception

 Root cause:

 java.lang.ClassCastException: java.lang.String cannot be cast to
 com.prog.entities.Cliente
 The code that I have implemented is showed bellow:

 item.add(new DropDownChoice(clienteSelection, new
 PropertyModel[Customer](customer, name), listCustomer, new
 ChoiceRenderer[Customer](name)) {
 protected override def wantOnSelectionChangedNotifications:
 Boolean = true

 protected override def onSelectionChanged(newSelection:
Customer) {
   super.onSelectionChanged(newSelection)
   }
 })

 I'll appreciate your help.

 Bera

   
  
  
  
   --
   WBR
   Maxim aka solomax
  
 



 --
 WBR
 Maxim aka solomax



Textbox in a listView, retrieve the value and set the property model

2013-05-09 Thread Bruno Moura
I implemented a dropbox in a ListView, now when I choose a value the erro
bellow always happen:

WicketMessage: Method onSelectionChanged of interface
org.apache.wicket.markup.html.form.IOnChangeListener targeted at component
[MarkupContainer [Component id = customerSelection]] threw an exception

Root cause:

java.lang.ClassCastException: java.lang.String cannot be cast to
com.prog.entities.Cliente
The code that I have implemented is showed bellow:

item.add(new DropDownChoice(clienteSelection, new
PropertyModel[Customer](customer, name), listCustomer, new
ChoiceRenderer[Customer](name)) {
protected override def wantOnSelectionChangedNotifications: Boolean
= true

protected override def onSelectionChanged(newSelection: Customer) {
  super.onSelectionChanged(newSelection)
  }
})

I'll appreciate your help.

Bera


Re: Keep the state or value of a DropDownChoice and TextField both inside a ListView

2013-05-09 Thread Bruno Moura
Thanks Ernesto for your help

Bruno Moura


2013/5/5 Ernesto Reinaldo Barreiro reier...@gmail.com

 From javadoc of ListView

  * p
  * strongWARNING:/strong though you can nest ListViews within Forms,
 you HAVE to set the
  * setReuseItems property to true in order to have validation work
 properly. By default,
  * setReuseItems is false, which has the effect that ListView replaces all
 child components by new
  * instances. The idea behind this is that you always render the fresh
 data, and as people usually
  * use ListViews for displaying read-only lists (at least, that's what we
 think), this is good
  * default behavior. br /
  * However, as the components are replaced before the rendering starts, the
 search for specific
  * messages for these components fails as they are replaced with other
 instances. Another problem is
  * that 'wrong' user input is kept as (temporary) instance data of the
 components. As these
  * components are replaced by new ones, your user will never see the wrong
 data when setReuseItems
  * is false.
  * /p



 On Mon, May 6, 2013 at 5:32 AM, Bruno Moura brunormo...@gmail.com wrote:

  I have implemented a listView and every time that a new item is added in
  this ListView the values inserted in the textField and selected in a
  DropDownChoice are lost.
 
  The following pictures show what's happen before and after add a new
  ListView item:
 
  [image: Imagem inline 1]
 
  And after Add a new item:
 
  [image: Imagem inline 1]
 
  I'm implemented the code bellow:
 
 
 
 
var listData = workSheetDAO.listWorkSheetUser(selectedUser,
  beginDate, endDate)
 
var lbPeriodTotal = new Label(periodTotal)
lbPeriodTotal.setOutputMarkupId(true)
add(lbPeriodTotal)
 
add(new ListView[WorkSheet](listWorkSheet, listData) {
 
  override protected def onBeforeRender() {
super.onBeforeRender()
  }
 
  def populateItem(item: ListItem[WorkSheet]) = {
var workSheet = item.getModelObject()
 
item.add(new LinkDate(initDate, workSheet, 1))
item.add(new LinkDate(endDate, workSheet, 1))
 
item.add(new TextField(description))
 
val listCustomer: java.util.List[Customer] =
  customerDAO.listCustomers
 
item.add(new DropDownChoice(customerSelection, listCustomer,
  new ChoiceRenderer[Customer](id)))
 
if (workSheet.endDate == None) {
  item.add(new Label(total, ))
} else {
  var period = new Period(workSheet.initDate,
  workSheet.endDate.get)
  periodTotal = periodTotal.plus(period)
  lbPeriodTotal.setDefaultModel(new
 
 Model(periodTotal.toPeriod().normalizedStandard().toString(getFormatter(
  period = period.normalizedStandard()
  item.add(new Label(total, period.toString(getFormatter(
}
 
 }
  }
 
  private class LinkDate(id: String, workSheet: WorkSheet, type: Int)
  extends Link[String](id) {
 
setEnabled(false)
add(new Label(label, new Model[String]() {
  override def getObject(): String = {
var result = 
if (type == 1) {
result = workSheet.initDate.toString(dd/MM/ HH:mm:ss)
} else
result = workSheet.endDate.toString(dd/MM/ HH:mm:ss)
return result
  }
}))
 
def onClick() {}
  }
 
 
  The only values preserved are the values of the labels.
 
  Please, someone could help me, thanks
 
 
 
  Bera
 



 --
 Regards - Ernesto Reinaldo Barreiro



Re: Wicket - get the value of a textbox using scala

2013-05-09 Thread Bruno Moura
Thanks very much Martin again for your help

Bruno Moura


2013/5/6 Martin Grigorov mgrigo...@apache.org

 Hi,


 On Mon, May 6, 2013 at 2:48 AM, Bruno Moura brunormo...@gmail.com wrote:

  I'm trying to retrieve a value of a TextField as is showed bellow:
 
  item.add(new TextField(description, new Model[String]() {
  override def getObject(): String = {
  customer.description = ??? // I don't know how I can get the
  value here
  return ...
  }
  }))
 
  I have this TextField inserted in a ListView and I need to use the
  TextField value to set it in a property model.
 


 item.add(new TextFeild[String](description, new
 PropertyModel(objectWithDescription, description))

 This way you can read the description with:
 objectWithDescription.getDescription()


 
  Thanks
 
  Bera
 



 --
 Martin Grigorov
 Wicket Training  Consulting
 http://jWeekend.com http://jweekend.com/



Re: Wicket MarkupContainer error, the component failed to render

2013-05-09 Thread Bruno Moura
thanks very much for your help Sven

Bruno Moura


2013/5/5 Sven Meier s...@meiers.net

 I'm not fluent in Scala but it seems you're adding additional components
 without reason:


  private class TextDesc(id: String, workSheet: WorkSheet)
  extends TextField[String](id) {
add(new TextField(textField, new Model[String]() {


 TextDesc *is* a textfield, why are you adding another textfield to it?

  private class DropDownChoiceCustomer(id: String, listCustomer:
 List[Customer], workSheet: WorkSheet)

  extends DropDownChoice[String](id) {
add(new DropDownChoice(**customerSelection, listCustomer,
  new ChoiceRenderer[Customer](**name)) {


 DropDownChoiceCustomer *is* a dropdownchoice already, why are you adding
 another one to it?

 Regards
 Sven



 On 05/05/2013 02:26 AM, Bruno Moura wrote:

 I need to add components in a listView and associate all of them with a
 model,for allow keep the state of each object saved in this listView. I'm
 using wicket 1.4 with scala.
 The code is showed bellow, isn't a short piece of code but I tried to keep
 it simple as possible


 add(new ListView[WorkSheet](**listWorkSheet, listData) {

  override protected def onBeforeRender() {
super.onBeforeRender()
  }

  def populateItem(item: ListItem[WorkSheet]) = {
var workSheet = item.getModelObject()

// Render normally
item.add(new LinkDate(initDate, workSheet, 1))

// render normally
item.add(new TextField(description))
// error on Render Page
item.add(new TextDesc(description, workSheet))

val listCustomer: java.util.List[Customer] =
 customerDAO.listCustomers

// render normally
item.add(new DropDownChoice(**customerSelection, listCustomer,
 new
 ChoiceRenderer[Customer](**name)))
// error on Render Page
item.add(new DropDownChoiceCustomer(**customerSelection,
 listCustomer, workSheet))

 }

 // Render normally, works
 private class LinkDate(id: String, workSheet: WorkSheet, type: Int)
 extends
 Link[String](id) {

setEnabled(false)
add(new Label(label, new Model[String]() {
  override def getObject(): String = {
var result = 
if (type == 1) {
result = workSheet.initDate.toString(**dd/MM/ HH:mm:ss)
}
return result
  }
}))

def onClick() {}
 }

 // doesn't work
 private class TextDesc(id: String, workSheet: WorkSheet) extends
 TextField[String](id) {

add(new TextField(textField, new Model[String]() {
  override def getObject(): String = {
var result = 
if (result.length != 0) {
result = workSheet.description
}
return result
  }
}))
 }

 // doesn't work
 private class DropDownChoiceCustomer(id: String, listCustomer:
 java.util.List[Customer], workSheet: WorkSheet) extends
 DropDownChoice[String](id) {

  add(new DropDownChoice(**customerSelection, listCustomer, new
 ChoiceRenderer[Customer](**name)) {
protected override def wantOnSelectionChangedNotifica**tions:
 Boolean =
 {
  true
}
protected override def onSelectionChanged(**customerSelection:
 Customer) {
  System.out.println(selected:  + customerSelection.id)
}
  })
 }

 // I got the error messages bellow

 WicketMessage: The component(s) below failed to render. A common problem
 is
 that you have added a component in code but forgot to reference it in the
 markup (thus the component will never be rendered).

 1. [MarkupContainer [Component id = textField]]
 2. [MarkupContainer [Component id = textField]]

 Root cause:

 org.apache.wicket.**WicketRuntimeException: The component(s) below
 failed to
 render. A common problem is that you have added a component in code but
 forgot to reference it in the markup (thus the component will never be
 rendered).

 1. [MarkupContainer [Component id = textField]]
 2. [MarkupContainer [Component id = textField]]

 at org.apache.wicket.Page.**checkRendering(Page.java:1201)
 at org.apache.wicket.Page.**renderPage(Page.java:941)
 at
 org.apache.wicket.protocol.**http.WebRequestCycle.**
 redirectTo(WebRequestCycle.**java:201)


 WicketMessage: The component(s) below failed to render. A common problem
 is
 that you have added a component in code but forgot to reference it in the
 markup (thus the component will never be rendered).

 1. [MarkupContainer [Component id = customerSelection]]
 2. [MarkupContainer [Component id = customerSelection]]

 Root cause:

 org.apache.wicket.**WicketRuntimeException: The component(s) below
 failed to
 render. A common problem is that you have added a component in code but
 forgot to reference it in the markup (thus the component will never be
 rendered).

 1. [MarkupContainer [Component id = customerSelection]]
 2. [MarkupContainer [Component id = customerSelection]]


 // the markup

 TD
 SELECT wicket:id=customerSelection name=id/SELECT
 /TD
 TDINPUT wicket:id=description type=text

Re: Textbox in a listView, retrieve the value and set the property model

2013-05-09 Thread Bruno Moura
Errata:

the original message and code is:

WicketMessage: Method onSelectionChanged of interface
org.apache.wicket.markup.html.form.IOnChangeListener targeted at component
[MarkupContainer [Component id = customerSelection]] threw an exception

Root cause:

java.lang.ClassCastException: java.lang.String cannot be cast to
com.prog.entities.Customer

The code that I have implemented is showed bellow

item.add(new DropDownChoice(customerSelection, new
PropertyModel[Customer](customer, name), listCustomer, new
ChoiceRenderer[Customer](name)) {
protected override def wantOnSelectionChangedNotifications: Boolean
= true

protected override def onSelectionChanged(newSelection: Customer) {
  super.onSelectionChanged(newSelection)
  }
})

Thanks

Bruno Moura


2013/5/9 Bruno Moura brunormo...@gmail.com


 I implemented a dropbox in a ListView, now when I choose a value the erro
 bellow always happen:

 WicketMessage: Method onSelectionChanged of interface
 org.apache.wicket.markup.html.form.IOnChangeListener targeted at component
 [MarkupContainer [Component id = customerSelection]] threw an exception

 Root cause:

 java.lang.ClassCastException: java.lang.String cannot be cast to
 com.prog.entities.Cliente
 The code that I have implemented is showed bellow:

 item.add(new DropDownChoice(clienteSelection, new
 PropertyModel[Customer](customer, name), listCustomer, new
 ChoiceRenderer[Customer](name)) {
 protected override def wantOnSelectionChangedNotifications:
 Boolean = true

 protected override def onSelectionChanged(newSelection: Customer) {
   super.onSelectionChanged(newSelection)
   }
 })

 I'll appreciate your help.

 Bera



Retrieve a value of textField and set the property of the Model

2013-05-09 Thread Bruno Moura
I'm trying to implement a ListView and in on column of it I added a
listView, for each line,
I want to save the data inserted on it and update the model:

I'm implemented the code bellow:

val description = new TextField(description,new
PropertyModel[Meeting](meeting, description))
description.add(new AjaxFormComponentUpdatingBehavior(keyup) {
  protected def onUpdate(target: AjaxRequestTarget) {
description.getDefaultModelObjectAsString
  }
})

item.add(description)

And I added a link for each line of my ListView for save the information in
database,
each line is a instance of a model meeting as is showed bellow:

item.add(new LinkSave(save, meeting))

private class LinkSave(id: String, meeting: Meeting) extends
AjaxLink[String](id) {

@SpringBean
var meetingMediator: TMeetingMediator = _

setVisible(clickavel.asInstanceOf[Boolean])
add(new Label(label, new Model[String]() {
  override def getObject: String = Save
}))

def onClick(target: AjaxRequestTarget) {
  meetingDAO.saveMeeting(meeting)

}
  }


But unfortunately the code above doesn't work. It's fail to retrieve the
value of the text
field and also to set the attribute description of the Object meeting with
the value of the text field, so in the database the column description is
never filled

Someone know where I am doing wrong stuff?

Thanks a lot!


Bera


Re: Textbox in a listView, retrieve the value and set the property model

2013-05-09 Thread Bruno Moura
Thanks Maxin, yes the code is in scala I didn't understand your
suggestion
I want to display the property name in the DDC no the property or field id,
sorry
if I did mistake in the code of my previous message.

Bruno Moura


2013/5/10 Maxim Solodovnik solomax...@gmail.com

 I would try to change your code as follows:

 new DropDownChoice*[Customer]*(customerSelection, new
 PropertyModel[Customer](customer, name), listCustomer, new
 ChoiceRenderer[Customer](name, *id*))

 your code seems to not in JAVA



 On Fri, May 10, 2013 at 9:13 AM, Bruno Moura brunormo...@gmail.com
 wrote:

  Errata:
 
  the original message and code is:
 
  WicketMessage: Method onSelectionChanged of interface
  org.apache.wicket.markup.html.form.IOnChangeListener targeted at
 component
  [MarkupContainer [Component id = customerSelection]] threw an exception
 
  Root cause:
 
  java.lang.ClassCastException: java.lang.String cannot be cast to
  com.prog.entities.Customer
 
  The code that I have implemented is showed bellow
 
  item.add(new DropDownChoice(customerSelection, new
  PropertyModel[Customer](customer, name), listCustomer, new
  ChoiceRenderer[Customer](name)) {
  protected override def wantOnSelectionChangedNotifications:
 Boolean
  = true
 
  protected override def onSelectionChanged(newSelection:
 Customer) {
super.onSelectionChanged(newSelection)
}
  })
 
  Thanks
 
  Bruno Moura
 
 
  2013/5/9 Bruno Moura brunormo...@gmail.com
 
  
   I implemented a dropbox in a ListView, now when I choose a value the
 erro
   bellow always happen:
  
   WicketMessage: Method onSelectionChanged of interface
   org.apache.wicket.markup.html.form.IOnChangeListener targeted at
  component
   [MarkupContainer [Component id = customerSelection]] threw an exception
  
   Root cause:
  
   java.lang.ClassCastException: java.lang.String cannot be cast to
   com.prog.entities.Cliente
   The code that I have implemented is showed bellow:
  
   item.add(new DropDownChoice(clienteSelection, new
   PropertyModel[Customer](customer, name), listCustomer, new
   ChoiceRenderer[Customer](name)) {
   protected override def wantOnSelectionChangedNotifications:
   Boolean = true
  
   protected override def onSelectionChanged(newSelection:
  Customer) {
 super.onSelectionChanged(newSelection)
 }
   })
  
   I'll appreciate your help.
  
   Bera
  
 



 --
 WBR
 Maxim aka solomax



Get the selected item in the DropDownChoice using Scala

2013-05-05 Thread Bruno Moura
How can I get the selected item form a DropDownChoice inside an ListView?

I implemented the chunky code bellow:

val listCustomer: java.util.List[Customer] = customerDAO.listCustomers

item.add(new DropDownChoice(customerSelection, listCustomer, new
ChoiceRenderer[Customer](name)))

In this case I want to get the name property displayed of the model
Customer.

Thanks



Bera


Wicket - get the value of a textbox using scala

2013-05-05 Thread Bruno Moura
I'm trying to retrieve a value of a TextField as is showed bellow:

item.add(new TextField(description, new Model[String]() {
override def getObject(): String = {
customer.description = ??? // I don't know how I can get the
value here
return ...
}
}))

I have this TextField inserted in a ListView and I need to use the
TextField value to set it in a property model.

Thanks

Bera


Keep the state or value of a DropDownChoice and TextField both inside a ListView

2013-05-05 Thread Bruno Moura
I have implemented a listView and every time that a new item is added in
this ListView the values inserted in the textField and selected in a
DropDownChoice are lost.

The following pictures show what's happen before and after add a new
ListView item:

[image: Imagem inline 1]

And after Add a new item:

[image: Imagem inline 1]

I'm implemented the code bellow:




  var listData = workSheetDAO.listWorkSheetUser(selectedUser,
beginDate, endDate)

  var lbPeriodTotal = new Label(periodTotal)
  lbPeriodTotal.setOutputMarkupId(true)
  add(lbPeriodTotal)

  add(new ListView[WorkSheet](listWorkSheet, listData) {

override protected def onBeforeRender() {
  super.onBeforeRender()
}

def populateItem(item: ListItem[WorkSheet]) = {
  var workSheet = item.getModelObject()

  item.add(new LinkDate(initDate, workSheet, 1))
  item.add(new LinkDate(endDate, workSheet, 1))

  item.add(new TextField(description))

  val listCustomer: java.util.List[Customer] =
customerDAO.listCustomers

  item.add(new DropDownChoice(customerSelection, listCustomer,
new ChoiceRenderer[Customer](id)))

  if (workSheet.endDate == None) {
item.add(new Label(total, ))
  } else {
var period = new Period(workSheet.initDate,
workSheet.endDate.get)
periodTotal = periodTotal.plus(period)
lbPeriodTotal.setDefaultModel(new
Model(periodTotal.toPeriod().normalizedStandard().toString(getFormatter(
period = period.normalizedStandard()
item.add(new Label(total, period.toString(getFormatter(
  }

   }
}

private class LinkDate(id: String, workSheet: WorkSheet, type: Int)
extends Link[String](id) {

  setEnabled(false)
  add(new Label(label, new Model[String]() {
override def getObject(): String = {
  var result = 
  if (type == 1) {
  result = workSheet.initDate.toString(dd/MM/ HH:mm:ss)
  } else
  result = workSheet.endDate.toString(dd/MM/ HH:mm:ss)
  return result
}
  }))

  def onClick() {}
}


The only values preserved are the values of the labels.

Please, someone could help me, thanks



Bera


Wicket MarkupContainer error, the component failed to render

2013-05-04 Thread Bruno Moura
I need to add components in a listView and associate all of them with a
model,for allow keep the state of each object saved in this listView. I'm
using wicket 1.4 with scala.
The code is showed bellow, isn't a short piece of code but I tried to keep
it simple as possible


add(new ListView[WorkSheet](listWorkSheet, listData) {

override protected def onBeforeRender() {
  super.onBeforeRender()
}

def populateItem(item: ListItem[WorkSheet]) = {
  var workSheet = item.getModelObject()

  // Render normally
  item.add(new LinkDate(initDate, workSheet, 1))

  // render normally
  item.add(new TextField(description))
  // error on Render Page
  item.add(new TextDesc(description, workSheet))

  val listCustomer: java.util.List[Customer] = customerDAO.listCustomers

  // render normally
  item.add(new DropDownChoice(customerSelection, listCustomer, new
ChoiceRenderer[Customer](name)))
  // error on Render Page
  item.add(new DropDownChoiceCustomer(customerSelection,
listCustomer, workSheet))

}

// Render normally, works
private class LinkDate(id: String, workSheet: WorkSheet, type: Int) extends
Link[String](id) {

  setEnabled(false)
  add(new Label(label, new Model[String]() {
override def getObject(): String = {
  var result = 
  if (type == 1) {
  result = workSheet.initDate.toString(dd/MM/ HH:mm:ss)
  }
  return result
}
  }))

  def onClick() {}
}

// doesn't work
private class TextDesc(id: String, workSheet: WorkSheet) extends
TextField[String](id) {

  add(new TextField(textField, new Model[String]() {
override def getObject(): String = {
  var result = 
  if (result.length != 0) {
  result = workSheet.description
  }
  return result
}
  }))
}

// doesn't work
private class DropDownChoiceCustomer(id: String, listCustomer:
java.util.List[Customer], workSheet: WorkSheet) extends
DropDownChoice[String](id) {

add(new DropDownChoice(customerSelection, listCustomer, new
ChoiceRenderer[Customer](name)) {
  protected override def wantOnSelectionChangedNotifications: Boolean =
{
true
  }
  protected override def onSelectionChanged(customerSelection:
Customer) {
System.out.println(selected:  + customerSelection.id)
  }
})
}

// I got the error messages bellow

WicketMessage: The component(s) below failed to render. A common problem is
that you have added a component in code but forgot to reference it in the
markup (thus the component will never be rendered).

1. [MarkupContainer [Component id = textField]]
2. [MarkupContainer [Component id = textField]]

Root cause:

org.apache.wicket.WicketRuntimeException: The component(s) below failed to
render. A common problem is that you have added a component in code but
forgot to reference it in the markup (thus the component will never be
rendered).

1. [MarkupContainer [Component id = textField]]
2. [MarkupContainer [Component id = textField]]

at org.apache.wicket.Page.checkRendering(Page.java:1201)
at org.apache.wicket.Page.renderPage(Page.java:941)
at
org.apache.wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:201)


WicketMessage: The component(s) below failed to render. A common problem is
that you have added a component in code but forgot to reference it in the
markup (thus the component will never be rendered).

1. [MarkupContainer [Component id = customerSelection]]
2. [MarkupContainer [Component id = customerSelection]]

Root cause:

org.apache.wicket.WicketRuntimeException: The component(s) below failed to
render. A common problem is that you have added a component in code but
forgot to reference it in the markup (thus the component will never be
rendered).

1. [MarkupContainer [Component id = customerSelection]]
2. [MarkupContainer [Component id = customerSelection]]


// the markup

TD
   SELECT wicket:id=customerSelection name=id/SELECT
/TD
TDINPUT wicket:id=description type=text name=obs value=_//TD

If someone could help me I'll appreciate, thanks.

Bera


Re: Example for saving value edited in Text Box on exit event

2013-04-26 Thread Bruno Moura
Hi Martin

I trying to add a TextField in a list view as is showed bellow:

val detail = new TextField(detail, new PropertyModel(objItem,
description))
  detail.add(new AjaxFormComponentUpdatingBehavior((keyup)) {
protected def onUpdate(target: AjaxRequestTarget) {
objItemDAO.saveObjItem(objItem)
}
})
item.add(detail)

I need to save the object objItem immediately after the user finishes
editing this. Maybe this component
coulb be changed by a inline label, but I need to some example that could
works with wicket 1.4.

Thanks again Martin for your help.




Bruno Moura


2013/4/26 Martin Grigorov mgrigo...@apache.org

 Hi,

 There is no 'exit' event.
 Please give us more details. And show us what you have so far.


 On Fri, Apr 26, 2013 at 8:54 PM, Bruno Moura brunormo...@gmail.com
 wrote:

  Hi someone please could give me an example for saving value edited in
 Text
  Box, inside a listview, via ajax on exit event.
 
  I need a example of this implementation for wicket 1.4 and if its
 possible
  in scala.
 
  Thanks
 
 
 
  Bruno Moura
 



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



Re: Error for add TextBox in a ListView

2013-04-24 Thread Bruno Moura
Really so sorry Martin for don't pay attention in your previous response

In fact I'm restricted to use wicket 1.4.x and jqwicket v 0.6 to avoid
brake compatibility
with code for many classes and other libraries dependencies that is not the case
to get deep in details on it now.

So the code bellow don't works and I get the error messages bellow, my
problem know is
to find an equivalent code that could work in wicket 1.4.

Just for remeber, I'm trying to add TextField in a listView  with the feature to
update and model onExit or after update the text. i hope that it could
be possible
to implement using wicket 1.4 too?


Thanks again

import org.apache.wicket.ajax.attributes.{ThrottlingSettings,
AjaxRequestAttributes}


 val detail = new TextField(detail, new
PropertyModel[Meeting](meeting, description))
  detail.add(new AjaxFormComponentUpdatingBehavior((keyup)) {
protected def onUpdate(target: AjaxRequestTarget) {
  meeting.salvarMeetingInfo(meeting)
}

protected override def updateAjaxAttributes(attributes:
AjaxRequestAttributes) {
  attributes.setThrottlingSettings(new
ThrottlingSettings(thr, Duration.milliseconds(800.0)))
  super.updateAjaxAttributes(attributes)
}
})
item.add(detail)

//Error messages
  scala: object attributes is not a member of package org.apache.wicket.ajax
import org.apache.wicket.ajax.attributes.{ThrottlingSettings,
AjaxRequestAttributes}

  ^

scala: not found: type AjaxRequestAttributes
protected override def updateAjaxAttributes(attributes:
AjaxRequestAttributes) {
^

Thanks again.

Bera


2013/4/24 Martin Grigorov mgrigo...@apache.org:
 Hi,

 I have answered you on similar question with DropDownChoice+PropertyModel.
 It is the same problem.


 On Wed, Apr 24, 2013 at 5:16 AM, Bruno Moura brunormo...@gmail.com wrote:

 I'm trying to add a textField in a listView using the code bellow:

 val detail = new TextField(detail, new PropertyModel(meeting,
 description))
 detail.add(new AjaxFormComponentUpdatingBehavior((keyup)) {
 protected def onUpdate(target: AjaxRequestTarget) {
   //
 }
 })

 But I'm getting this error message after compile the project:

 scala: type mismatch;
 found   : org.apache.wicket.model.PropertyModel[Nothing]
 required: org.apache.wicket.model.IModel[T]
 Note: Nothing : T, but Java-defined trait IModel is invariant in type T.
 You may wish to investigate a wildcard type such as `_ : T`. (SLS 3.2.10)
   val detail = new TextField(detail, new PropertyModel(meeting,
 description))
^

 My software stack are Wicket v6.7.0, scala 2.10, Intellij IDEA 12 with
 WicketForge Plugin Version 2.2.0

 Please someone could help me. I'll be very grateful.

 God bless you.

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




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

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



Re: Problem with iAjaxRequestAttributes

2013-04-24 Thread Bruno Moura
Hi Martin, I got back wicket to version 1,4 in my pom after realise
that I couldn't use the wicket 6.x because
I will need to change a LOT of source code in the application that I'm working.

Thanks for your support
Bruno Moura


2013/4/24 Martin Grigorov mgrigo...@apache.org:
 On Wed, Apr 24, 2013 at 5:03 AM, Bruno Moura brunormo...@gmail.com wrote:

 Hi Martin

 I verified the dependencies of my pom.xml and not found any reference
 for a previous version of wicket.

 Bellow is listed my pom.xml with dependencies:

 !-- WICKET DEPENDENCIES --
 dependency
 groupIdcom.google.code.jqwicket/groupId
 artifactIdjqwicket/artifactId
 version0.6/version


 May I guess that jqWicket is compiled against Wicket 1.5 ?


 /dependency
 dependency
 groupIdorg.apache.wicket/groupId
 artifactIdwicket/artifactId
 version${wicket.version}/version
 /dependency
 dependency
 groupIdorg.apache.wicket/groupId
 artifactIdwicket-ioc/artifactId
 version${wicket.version}/version
 /dependency
 dependency
 groupIdorg.apache.wicket/groupId
 artifactIdwicket-spring/artifactId
 version${wicket.version}/version
 /dependency
 dependency
 groupIdorg.apache.wicket/groupId
 artifactIdwicket-extensions/artifactId
 version${wicket.version}/version
 /dependency
 dependency
 groupIdorg.apache.wicket/groupId
 artifactIdwicket-datetime/artifactId
 version${wicket.version}/version
 /dependency

 properties
 wicket.version6.7.0/wicket.version
  /properties


 Run 'mvn clean compile' and paste the error.




 Bruno Moura


 2013/4/23 Martin Grigorov mgrigo...@apache.org:
  Hi,
 
  Most probably your pom.xml has more than one dependency for
  wicket(-core).jar with different versions.
 
 
  On Tue, Apr 23, 2013 at 2:56 PM, Bruno Moura brunormo...@gmail.com
 wrote:
 
  I'm using wicket 6.7.0 with maven and I'm trying to use the code below
  but I getting error with it the object AjaxRequestAttributes that
  isn't recognized:
 
  add(new ListView[ObjItem](listObjItem, listData) {
 
  override protected def onBeforeRender() {
periodTotal = new Period()
super.onBeforeRender()
  }
 
  def populateItem(item: ListItem[ObjItem]) = {
var objItem = item.getModelObject()
 
 
  val detail = new TextField(detail, new PropertyModel(objItem,
  description))
detail.add(new AjaxFormComponentUpdatingBehavior((keyup)) {
  protected def onUpdate(target: AjaxRequestTarget) {
 
   objItemDAO.saveObjItem(objItem)
  }
 
  //error here
  protected override def updateAjaxAttributes(attributes:
  AjaxRequestAttributes) {
attributes.setThrottlingSettings(new
  ThrottlingSettings(thr, Duration.milliseconds(800)))
super.updateAjaxAttributes(attributes)
  }
})
item.add(detail)
  }
  })
 
  And my import list for ajax behaviour is showed bellow:
 
  import org.apache.wicket.ajax.AjaxRequestTarget
  import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior
  import org.apache.wicket.ajax.attributes.AjaxRequestAttributes
 
  The last is not recognized neither after maven build
 
  What's the heck with this code and how is the issue that i need to
 correct
  since
  I'm using wicket 6.7?
 
  Thanks for your help! This list is saving my time!
 
 
 
 
 
 
 
 
  Bruno Moura
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com http://jweekend.com/

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




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

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



Problem with iAjaxRequestAttributes

2013-04-23 Thread Bruno Moura
I'm using wicket 6.7.0 with maven and I'm trying to use the code below
but I getting error with it the object AjaxRequestAttributes that
isn't recognized:

add(new ListView[ObjItem](listObjItem, listData) {

override protected def onBeforeRender() {
  periodTotal = new Period()
  super.onBeforeRender()
}

def populateItem(item: ListItem[ObjItem]) = {
  var objItem = item.getModelObject()


val detail = new TextField(detail, new PropertyModel(objItem, description))
  detail.add(new AjaxFormComponentUpdatingBehavior((keyup)) {
protected def onUpdate(target: AjaxRequestTarget) {

 objItemDAO.saveObjItem(objItem)
}

//error here
protected override def updateAjaxAttributes(attributes:
AjaxRequestAttributes) {
  attributes.setThrottlingSettings(new
ThrottlingSettings(thr, Duration.milliseconds(800)))
  super.updateAjaxAttributes(attributes)
}
  })
  item.add(detail)
}
})

And my import list for ajax behaviour is showed bellow:

import org.apache.wicket.ajax.AjaxRequestTarget
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes

The last is not recognized neither after maven build

What's the heck with this code and how is the issue that i need to correct since
I'm using wicket 6.7?

Thanks for your help! This list is saving my time!








Bruno Moura

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



DropDownChoice and Wicket 6.7

2013-04-23 Thread Bruno Moura
I updated the wicket dependence from 1.4.22 to 6.7  and now I'm trouble for
create a DropDownChoice component (I'm using scala).

Before: Wicket 1.4 (works fine)

val listCustomer: java.util.List[Customer] = customerDAO.listCustomer
item.add(new DropDownChoice(customerSelection, listCustomer,new
ChoiceRenderer[Customer](name)))


After: Wicket 6.7 ( get in trouble)

val customerSelectionCurrent = new PropertyModel(manager, customer)

val customerSelection = new
DropDownChoice[Customer](customerSelection,
customerSelectionCurrent, listCustomer,new
ChoiceRenderer[Customer](name)) {

The error stack trace is showed bellow:

scala: overloaded method constructor DropDownChoice with alternatives:
  
(String,org.apache.wicket.model.IModel[com.wicket-app.entities.Customer],org.apache.wicket.model.IModel[_
: java.util.List[_ :
com.wicket-app.entities.Customer]],org.apache.wicket.markup.html.form.IChoiceRenderer[_
: 
com.wicket-app.entities.Customer])org.apache.wicket.markup.html.form.DropDownChoice[com.wicket-app.entities.Customer]
and
  
(String,org.apache.wicket.model.IModel[com.wicket-app.entities.Customer],java.util.List[_
: 
com.wicket-app.entities.Customer],org.apache.wicket.markup.html.form.IChoiceRenderer[_
: 
com.wicket-app.entities.Customer])org.apache.wicket.markup.html.form.DropDownChoice[com.wicket-app.entities.Customer]
 cannot be applied to (String,
org.apache.wicket.model.PropertyModel[Nothing],
java.util.List[com.wicket-app.entities.Customer],
org.apache.wicket.markup.html.form.ChoiceRenderer[com.wicket-app.entities.Customer])
  val customerSelection = new
DropDownChoice[Customer](customerSelection,
customerSelectionCurrent, listCustomer,new
ChoiceRenderer[Customer](name)) {
 ^

Thanks for your help

Bera

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



Re: Problem with iAjaxRequestAttributes

2013-04-23 Thread Bruno Moura
Hi Martin

I verified the dependencies of my pom.xml and not found any reference
for a previous version of wicket.

Bellow is listed my pom.xml with dependencies:

!-- WICKET DEPENDENCIES --
dependency
groupIdcom.google.code.jqwicket/groupId
artifactIdjqwicket/artifactId
version0.6/version
/dependency
dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket/artifactId
version${wicket.version}/version
/dependency
dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket-ioc/artifactId
version${wicket.version}/version
/dependency
dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket-spring/artifactId
version${wicket.version}/version
/dependency
dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket-extensions/artifactId
version${wicket.version}/version
/dependency
dependency
groupIdorg.apache.wicket/groupId
artifactIdwicket-datetime/artifactId
version${wicket.version}/version
/dependency

properties
wicket.version6.7.0/wicket.version
 /properties


Bruno Moura


2013/4/23 Martin Grigorov mgrigo...@apache.org:
 Hi,

 Most probably your pom.xml has more than one dependency for
 wicket(-core).jar with different versions.


 On Tue, Apr 23, 2013 at 2:56 PM, Bruno Moura brunormo...@gmail.com wrote:

 I'm using wicket 6.7.0 with maven and I'm trying to use the code below
 but I getting error with it the object AjaxRequestAttributes that
 isn't recognized:

 add(new ListView[ObjItem](listObjItem, listData) {

 override protected def onBeforeRender() {
   periodTotal = new Period()
   super.onBeforeRender()
 }

 def populateItem(item: ListItem[ObjItem]) = {
   var objItem = item.getModelObject()


 val detail = new TextField(detail, new PropertyModel(objItem,
 description))
   detail.add(new AjaxFormComponentUpdatingBehavior((keyup)) {
 protected def onUpdate(target: AjaxRequestTarget) {

  objItemDAO.saveObjItem(objItem)
 }

 //error here
 protected override def updateAjaxAttributes(attributes:
 AjaxRequestAttributes) {
   attributes.setThrottlingSettings(new
 ThrottlingSettings(thr, Duration.milliseconds(800)))
   super.updateAjaxAttributes(attributes)
 }
   })
   item.add(detail)
 }
 })

 And my import list for ajax behaviour is showed bellow:

 import org.apache.wicket.ajax.AjaxRequestTarget
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior
 import org.apache.wicket.ajax.attributes.AjaxRequestAttributes

 The last is not recognized neither after maven build

 What's the heck with this code and how is the issue that i need to correct
 since
 I'm using wicket 6.7?

 Thanks for your help! This list is saving my time!








 Bruno Moura

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




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

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



Error for add TextBox in a ListView

2013-04-23 Thread Bruno Moura
I'm trying to add a textField in a listView using the code bellow:

val detail = new TextField(detail, new PropertyModel(meeting, description))
detail.add(new AjaxFormComponentUpdatingBehavior((keyup)) {
protected def onUpdate(target: AjaxRequestTarget) {
  //
}
})

But I'm getting this error message after compile the project:

scala: type mismatch;
found   : org.apache.wicket.model.PropertyModel[Nothing]
required: org.apache.wicket.model.IModel[T]
Note: Nothing : T, but Java-defined trait IModel is invariant in type T.
You may wish to investigate a wildcard type such as `_ : T`. (SLS 3.2.10)
  val detail = new TextField(detail, new PropertyModel(meeting,
description))
   ^

My software stack are Wicket v6.7.0, scala 2.10, Intellij IDEA 12 with
WicketForge Plugin Version 2.2.0

Please someone could help me. I'll be very grateful.

God bless you.

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



wicket Jquery/JqueryUI Ajax modal windows examples

2013-04-22 Thread Bruno Moura
Hi

Someone could provide resources and links for Jquery/JqueryUI Ajax
modal examples
with wicket?

Thanks a lot!

Bera

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



Advanced editable grid component for wicket

2013-04-22 Thread Bruno Moura
Hi

I'm looking for a grid component with pagination, editables cells,
inline ajax editable labels, combobox inside cells and update
line/model,  all of these capabilities/featues out of the box.

Someone could give me links for components and examples?

Thanks a lot

Bera

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



Re: Advanced editable grid component for wicket

2013-04-22 Thread Bruno Moura
Thanks a lot Martin!

Best Regards!
Bruno Moura


2013/4/22 Martin Grigorov mgrigo...@apache.org:
 demo: http://www.wicket-library.com/inmethod-grid/data-grid/simple?1
 source code:
 https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/inmethod-grid-parent

 also see:
 https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/editable-grid-parent


 On Mon, Apr 22, 2013 at 4:12 PM, Bruno Moura brunormo...@gmail.com wrote:

 Hi

 I'm looking for a grid component with pagination, editables cells,
 inline ajax editable labels, combobox inside cells and update
 line/model,  all of these capabilities/featues out of the box.

 Someone could give me links for components and examples?

 Thanks a lot

 Bera

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




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

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



Re: wicket Jquery/JqueryUI Ajax modal windows examples

2013-04-22 Thread Bruno Moura
Thanks a lot Martin and Maxim
Bruno Moura


2013/4/22 Martin Grigorov mgrigo...@apache.org:
 Hi,

 See https://github.com/sebfz1/wicket-jquery-ui and the demo app at:
 http://www.7thweb.net/wicket-jquery-ui/dialog/MessageDialogPage?1


 On Mon, Apr 22, 2013 at 4:07 PM, Bruno Moura brunormo...@gmail.com wrote:

 Hi

 Someone could provide resources and links for Jquery/JqueryUI Ajax
 modal examples
 with wicket?

 Thanks a lot!

 Bera

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




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

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



Wicket with Scala Book or Deep/Complete tutorial

2013-04-21 Thread Bruno Moura
Someone know a good resources to learning wicket + scala together?


Populate Listitem with comboboxes and editables labes and preserve the state of each object in lines

2013-04-21 Thread Bruno Moura
I have created a listView with method populateList, that fills a list
of customers meetings with the respective manager responsible for each
line according the figure bellow:

Begin   End  Manager  Detail  Total
   Actions
21/04/2013 09:52:41 21/04/2013 10:05:21  --V  __  00:12:40
   Edit
21/04/2013 10:05:38 21/04/2013 10:05:41  --V  __  00:00:03
   Edit
21/04/2013 10:36:06 21/04/2013 10:36:09  --V  __  00:00:03
   Edit
  TOTAL   -   00:12:46

Obs: I'm using scala :-D


Two problems here:

 1. When a new new item is created, only the fields (labels) dateBegin and
dateEnd are preserved with previous assigned values, I lost the
values of **Manager** *DropDownChoice* and the **Detail**
*TextField* in last line of the ListItem.
 2. **After change** the *DropDownChoice* of after exit from the
*Detail TextField* is needed *update the model* with the respective
value have chosen from each filed.

So the values are kept only for labels, in truth links. Let me show the code:


add(new ListView[Meetings](listMeetings, listData) {
  override protected def onBeforeRender() {
  periodTotal = new Period()
  super.onBeforeRender()
}

// for populating the listView
def populateItem(item: ListItem[customer]) = {
var customer = item.getModelObject()

item.add(new LinkDate(beginDate, customer))
item.add(new LinkDate(endDate, customer))

val listManagers: java.util.List[Manager] = managerDAO.listManagers
item.add(new DropDownChoice(managerSelection,
listManagers,new ChoiceRenderer[Manager](name)))

item.add(new TextField(detail))

/*
 * I tried to use the code bellow but it's cause a markups errors too.
 * Only the code above display the components without errors.
 */
//val managerSelection = new LinkManager(managerSelection,customer)
//item.add(managerSelection)
//item.add(new LinkDetail(detail,  customer))

var period = new Period(customer.beginDate, customer.endDate.get)
item.add(new Label(total, period.toString(getFormatter(

item.add(new LinkEdit(edit, customer))
}})

The functions bellow work fine for date value and for edit a
respective fields of the line:

private class LinkDate(id: String, customer: Customer) extends
Link[String](id) {

setEnabled(false)
add(new Label(label, new Model[String]() {
  override def getObject(): String = {
var result = 
if (id == beginDate) {
  result = customer.beginDate.toString(dd/MM/ HH:mm:ss)
}
if (id == endDate) {
  result = customer.endDate.get.toString(dd/MM/ HH:mm:ss)
}
return result
  }
}))
 // ... doing other stuff
  }

  private class LinkEdit(id: String, customer: Customer) extends
Link[String](id) {

add(new Label(label, new Model[String]() {
  override def getObject: String = edit
}));
// ... doing other stuff
  }

 But for DropDown and TextField I tried to do the same and I failed strongly:

  // Doesn't work
  private class LinkManager(id: String, customer: Customer)
extends Link[String](id) {

val listManagers: java.util.List[Manager] = managerDAO.listManagers
add(new DropDownChoice(managerSelection, listManagers,new
ChoiceRenderer[Manager](name) {

  def wantOnSelectionChangedNotifications() = {
true;
  }
  def onSelectionChanged(managerSelection: Manager): String = {
// saving model
})
  }
}))

// ... doing other stuff
  }

  // Doesn't work
  // Also here I tried to change textFiled for a inline-ajax Editable label
  // And I need the behaviour to change model imadiately after change value
  private class LinkDetail(id: String, customer: Customer) extends
Link[String](id) {

add(new AjaxEditableLabel(detail, new Model[String]() {
  override def getObject(): String = {
// ... doing other stuff
  }
}))
  }

The piece of corresponding markup is shoewd bellow:

TR wicket:id=listCustomersMettings
  TDa wicket:id=beginDatespan wicket:id=label/span/a/TD
  TDa wicket:id=endDatespan wicket:id=label/span/a/TD
  TD
  SELECT wicket:id=managerSelection name=id/SELECT
  BR
  /TD

  TDINPUT wicket:id=detail type=text name=obs value=_//TD

  TD wicket:id=total/TD

  TDa wicket:id=editspan wicket:id=label
style=text-align: center/span/a/TD

/TR


I think that is needed a Object, similar to LinkDate, to deal and
store the values for Manager DropDownChoice and for the textField or
AjaxEditableLabel Detail, but I got in trouble to implement them.

Thanks for 

Re: Wicket free guide updated.

2013-04-09 Thread Bruno Moura
Great job Andrea, really nice!

Thanks

Bruno Moura


2013/4/9 Bertrand Guay-Paquet ber...@step.polymtl.ca

 Hi Paul,

 I asked the same question for v1. Here's the answer:

 no, at the moment there is no source for documentation. The main document
 is a LibreOffice odt file. I didn't decide yet how to make it available... 

 As for contributions, they are welcome! Either send an email or use the
 google code issues.

 Regards,
 Bertrand


 On 09/04/2013 12:33 PM, Paul Szulc wrote:

 Hi,

 is ths under open source? Are you looking for contributors?


 On Mon, Apr 8, 2013 at 11:42 AM, Andrea Del Bene an.delb...@gmail.com
 wrote:

  Hi,

 I bother you just to tell that I released an updated version of the guide
 with some typo corrections and two small additions.
 http://code.google.com/p/wicket-guide/http://code.google.com/p/**wicket-guide/
 http://code.**google.com/p/wicket-guide/http://code.google.com/p/wicket-guide/
 

 Bye! :)

 --**
 --**-
 To unsubscribe, e-mail: 
 users-unsubscribe@wicket.**apa**che.orghttp://apache.org
 users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org
 
 For additional commands, e-mail: users-h...@wicket.apache.org




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

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




Update Model on DropDown Item Selection

2013-04-08 Thread Bruno Moura
I need to update a model or object immediately after select
a DropDownChoice item.


Bellow is the code that I'm working:

//
-

 add(new ListView[Company](listCompanies, listData) {

override protected def onBeforeRender() {
  //
  // ...
  super.onBeforeRender()
}

def populateItem(item: ListItem[Company]) = {
  var company = item.getModelObject()

  //...

  val listClients: java.util.List[Client] = clientControler.listClients


  item.add(new DropDownChoice(clientSelection, listClients,new
ChoiceRenderer[Client](name)))

//
-

In the Listview with properties of Company Object,
after choose a name property of the DropDownChoice, the model
Company would be updated with the Client Name selected.

How can I achieve this?

Thanks


Using a Inline-label Editable inside a ListView and update a model after change label value

2013-04-08 Thread Bruno Moura
I need to use a editable label or inline-label in a ListView and after
change the
value of this component I want to know how I can Update the property of
the Object displayed in this listView

add(new ListView[SomeObject](listSomeObject, listData) {

override protected def onBeforeRender() {
 ...
  super.onBeforeRender()
}

def populateItem(item: ListItem[SomeObject]) = {
  var objValue = item.getModelObject()

  item.add(new Label(total, objValue.toString(getFormatter(
 }
}
  })

In the code above, the object SomeObject has a property called total, the
listView
shows a set of SomeObject, when the label total is changed in some line of
the
listview the corresponding object SomeObject should be updated with the new
value of the label total.

Someone can provide some useful example for help me with this task?

Thanks

Bruno Moura


Dealing with time counters with different values from each other and show them simultaneously in realtime

2013-04-03 Thread Bruno Moura
I'm implementing an application to register the duration of different tasks
that could be happen in parallel. Each of them can be launched by an user
using a web application/interface and for each one there is a javascript
counter that allow user to see the time progress for the task launched by
him/her. For me it's important to store only the start and the end of each
task in the database in timestamp format.

User view

[image: UserView]

I need to discover the best approach to keep all tasks timers counters in
the back end and display all of them for a specific user with admin
privileges in a view like a grid or dashboard with the progress for all
tasks of all users that have started one in real time.

Admin view

[image: enter image description here]

I'm using scala and wicket mainly for development. Considering this
information, someone knows a way or libraries that could help to implement
this feature?

Thanks!

Bruno Moura