Re: Errors in data view , req for help to fix the error in code

2014-05-27 Thread Francois Meillet
The DemoBean needs to implement the Serializable interface.

François Meillet
Formation Wicket - Développement Wicket





Le 27 mai 2014 à 07:54, kumar ramanathan kumarramana...@gmail.com a écrit :

 Hi Friends ,
 
 Am trying to execute a wicket program to accomplish the below task,
 
 a. a submit button is in place in a form
 b. when I click that i have to show the ouput in data view of the same page
 
 My codes are below and need your help to fix the erros and get the ouput
 
 
 *Demoapplication.java*
 
 package com.demo.application;
 
 import org.apache.wicket.Page;
 import org.apache.wicket.protocol.http.WebApplication;
 import com.demo.pages.*;
 
 public class DemoApplication extends WebApplication {
 
   @Override
   public Class? extends Page getHomePage() {
   // TODO Auto-generated method stub
   return DemoHomePage.class;
   }
 
 }
 
 DemoHomePage.html:
 html
 body
 form wicket:id=homePageForm
 input type=submit value=ok
 /form
 
 
 Id 
 Name 
 
 
 
 
 
 /body
 /html
 
 DemoHomePage.java
 package com.demo.pages;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.form.*;
 import org.apache.wicket.markup.html.list.*;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.markup.repeater.RepeatingView;
 import org.apache.wicket.markup.repeater.data.DataView;
 import org.apache.wicket.markup.repeater.data.ListDataProvider;
 
 import com.sun.xml.internal.ws.org.objectweb.asm.Label;
 
 
 
 public class DemoHomePage extends WebPage {
 public DemoHomePage ()
 {
  Form form=new Form(homePageForm){
 public void submit(){
   ListDemoBean list = new ArrayList();
   list.add(new DemoBean(1,ram));
   list.add(new DemoBean(2,sam));
   
   ListDataProviderDemoBean listDataProvider = new
 ListDataProviderDemoBean(list);
   
   DataViewDemoBean dataView = new
 DataViewDemoBean(row,listDataProvider){
   protected void populateItem(ItemDemoBean item){
   DemoBean bean=item.getModelObject();
   RepeatingView repeatingView = new 
 RepeatingView(dataRow);
   repeatingView.add(new 
 Label(repeatingView.newChildId().bean.getId()));
   repeatingView.add(new 
 Label(repeatingView.newChildId().bean.getName()));
   item.add(repeatingView);
   }
   };
   
   add(dataView);
 }
  };
 
 }
 
 }
 
 Am getting the below error in the highlighted red area ListDataProvider
 DemoBean and repeatingView.add.(.)
 
 Error: 
 Bound mismatch: The type DemoBean is not a valid substitute for the bounded
 parameter T extends Serializable of the type ListDataProviderT
 The method add(Component...) in the type MarkupContainer is not applicable
 for the arguments (Label)
 
 DemoBean.java
 
 package com.demo.pages;
 
 public class DemoBean {
 public String id;
 public String name;
 
 public DemoBean(String id,String name)
 {
   this.id=id;this.name=name;
 }
 
 public String getId(){
   return this.id;
 }
 
 public void setId(String id){
   this.id=id;
 }
 
 public String getName(){
   return this.name;
 }
 
 public void setName(String name){
   this.name=name;
 }
 
 
 }
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread kumar ramanathan
Thanks,
The serializable error resolved once it has been implemented. I have the
error in the below add component still(which is in bold font).Please help me
on this.

repeatingView*.add(n*ew Label(repeatingView.newChildId(), bean.getId()));
repeatingView.add(new 
Label(repeatingView.newChildId(),*
bean.getName()));*

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666027.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread Francois Meillet
You should read these very good documentation

http://wicket.apache.org/guide/guide/single.pdf
http://www.wicket-library.com/wicket-examples-6.0.x/repeater/


François Meillet
Formation Wicket - Développement Wicket





Le 27 mai 2014 à 09:16, kumar ramanathan kumarramana...@gmail.com a écrit :

 Thanks,
 The serializable error resolved once it has been implemented. I have the
 error in the below add component still(which is in bold font).Please help me
 on this.
 
 repeatingView*.add(n*ew Label(repeatingView.newChildId(), bean.getId()));
   repeatingView.add(new 
 Label(repeatingView.newChildId(),*
 bean.getName()));*
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666027.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread Martin Grigorov
Hi,

What is the error ?

Martin Grigorov
Wicket Training and Consulting


On Tue, May 27, 2014 at 9:16 AM, kumar ramanathan
kumarramana...@gmail.comwrote:

 Thanks,
 The serializable error resolved once it has been implemented. I have the
 error in the below add component still(which is in bold font).Please help
 me
 on this.

 repeatingView*.add(n*ew Label(repeatingView.newChildId(), bean.getId()));
 repeatingView.add(new
 Label(repeatingView.newChildId(),*
 bean.getName()));*

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666027.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread kumar ramanathan
a. The method add(Component...) in the type MarkupContainer is not applicable
for the arguments (Label)
b. The constructor Label(String, String) is undefined

these are the two errors.please help.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666030.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread Martin Grigorov
Are you sure you have imported Wicket's Label component in this class ?

Martin Grigorov
Wicket Training and Consulting


On Tue, May 27, 2014 at 9:38 AM, kumar ramanathan
kumarramana...@gmail.comwrote:

 a. The method add(Component...) in the type MarkupContainer is not
 applicable
 for the arguments (Label)
 b. The constructor Label(String, String) is undefined

 these are the two errors.please help.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666030.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: Wicket Groovy DSL

2014-05-27 Thread Eugene Kamenev
Added examples of GORM from grails integrated into wicket application

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Groovy-DSL-tp4666017p4666032.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread kumar ramanathan
Thanks Martin.I did not import the label . Now that issue resolved.

Now am facing issue in the run time.

DemoHomePage.java

package com.demo.pages;

import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.*;
import org.apache.wicket.markup.html.list.*;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.RepeatingView;
import org.apache.wicket.markup.repeater.data.DataView;
import org.apache.wicket.markup.repeater.data.ListDataProvider;
import org.apache.wicket.markup.html.basic.Label;





public class DemoHomePage extends WebPage {
public DemoHomePage ()
{
  Form form=new Form(homePageForm){
  public void submit(){
ListDemoBean list = new ArrayList();
list.add(new DemoBean(1,ram));
list.add(new DemoBean(2,sam));

ListDataProviderDemoBean listDataProvider = new
ListDataProviderDemoBean(list);

final DataViewDemoBean dataView = new
DataViewDemoBean(row,listDataProvider){
/**
 * 
 */
private static final long serialVersionUID = 1L;

protected void populateItem(ItemDemoBean item){
DemoBean bean=item.getModelObject();
RepeatingView repeatingView = new 
RepeatingView(dataRow);
repeatingView.add(new 
Label(repeatingView.newChildId(), bean.getId()));
repeatingView.add(new 
Label(repeatingView.newChildId(),
bean.getName()));
item.add(repeatingView);
}
};
add(dataView);

  }
  };
  add(form);
}

}


*Html:*

html
body
form wicket:id=homePageForm
input type=submit value=ok
/form


 Id 
 Name 


 


/body
/html

Run time error is below:
WicketMessage: Unable to find component with id 'row' in [Page class =
com.demo.pages.DemoHomePage, id = 4, version = 0]. This means that you
declared wicket:id=row in your markup, but that you either did not add the
component to your page at all, or that the hierarchy does not match.
[markup =
file:/home/kumar/Documents/javaapplications/Eclipse_Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/demo/WEB-INF/classes/com/demo/pages/DemoHomePage.html
html
head/headbody
form wicket:id=homePageForm
input type=submit value=ok
/form


 Id 
 Name 


 


/body
/html, index = 8, current = '
' (line 11, column 1)]

Root cause:

org.apache.wicket.markup.MarkupException: Unable to find component with id
'row' in [Page class = com.demo.pages.DemoHomePage, id = 4, version = 0].
This means that you declared wicket:id=row in your markup, but that you
either did not add the component to your page at all, or that the hierarchy
does not match.
[markup =
file:/home/kumar/Documents/javaapplications/Eclipse_Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/demo/WEB-INF/classes/com/demo/pages/DemoHomePage.html
html

I have used row in the submit method , but the wicket is not able to find
since Dataview scope is not exist outside submit method. How could we
resolve this problem, please help me.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666033.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: NPE in AbstractSingleSelectChoice

2014-05-27 Thread Martin Grigorov
Improved to not fail with NPE with
https://issues.apache.org/jira/browse/WICKET-5601

I think Wicket should warn you somehow when the returned idValue is null
though. Because now it sets null as a model object and the client choice is
being lost.
@Sven, @Igor: what do you think ?

Martin Grigorov
Wicket Training and Consulting


On Sun, May 25, 2014 at 10:29 PM, Francois Meillet 
francois.meil...@gmail.com wrote:

 When the DropDownChoice try to convert the submitted choice id back to the
 choice object
 there is an iteration over the choices.
 You get the NPE in this iteration because nullItem has no id.

 Have a look to AbstractSingleSelectChoice's setNullValid(true) method to
 include a null value.

 http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/markup/html/form/AbstractSingleSelectChoice.html#setNullValid(boolean)



 François Meillet
 Formation Wicket - Développement Wicket





 Le 25 mai 2014 à 21:18, Marco Springer ma...@glitchbox.nl a écrit :

  Haven't run the code but my guess is that the idValue returns a null
 instead
  of  0.
  Take a look at
 AbstractSingleSelectChoice.convertChoiceIdToChoice(String) line
  281. (Wicket 6.15.0)
  if(renderer.getIdValue(choice, index).equals(id)
  This would trigger a NPE if a null is returned, which would be the case
 with
  your nullItem.
 
  Cheers,
  Marco
 
  On Sunday 25 May 2014 21:06:41 Lucio Crusca wrote:
  I'm pretty sure it's my fault, but I can't spot it. I'm trying to use a
  DropDownChoice with custom renderer and a PropertyModel, without a Form.
 
  I get a NullPointerException in AbstractSingleSelectChoice, here is the
  quickstart:
 
  http://www.sulweb.org/download/sparsi/quickstart.zip
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 




Re: Errors in data view , req for help to fix the error in code

2014-05-27 Thread Martin Grigorov
Hi Kumar,


On Tue, May 27, 2014 at 3:08 PM, kumar ramanathan
kumarramana...@gmail.comwrote:

 Thanks Martin.I did not import the label . Now that issue resolved.

 Now am facing issue in the run time.

 DemoHomePage.java

 package com.demo.pages;

 import java.util.ArrayList;
 import java.util.List;

 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.form.*;
 import org.apache.wicket.markup.html.list.*;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.markup.repeater.RepeatingView;
 import org.apache.wicket.markup.repeater.data.DataView;
 import org.apache.wicket.markup.repeater.data.ListDataProvider;
 import org.apache.wicket.markup.html.basic.Label;





 public class DemoHomePage extends WebPage {
 public DemoHomePage ()
 {
   Form form=new Form(homePageForm){
   public void submit(){
 ListDemoBean list = new ArrayList();
 list.add(new DemoBean(1,ram));
 list.add(new DemoBean(2,sam));

 ListDataProviderDemoBean listDataProvider = new
 ListDataProviderDemoBean(list);

 final DataViewDemoBean dataView = new
 DataViewDemoBean(row,listDataProvider){
 /**
  *
  */
 private static final long serialVersionUID = 1L;

 protected void populateItem(ItemDemoBean item){
 DemoBean bean=item.getModelObject();
 RepeatingView repeatingView = new
 RepeatingView(dataRow);
 repeatingView.add(new
 Label(repeatingView.newChildId(), bean.getId()));
 repeatingView.add(new
 Label(repeatingView.newChildId(),
 bean.getName()));
 item.add(repeatingView);
 }
 };
 add(dataView);

   }
   };
   add(form);
 }

 }


 *Html:*

 html
 body
 form wicket:id=homePageForm
 input type=submit value=ok
 /form


  Id
  Name





 /body
 /html

 Run time error is below:
 WicketMessage: Unable to find component with id 'row' in [Page class =
 com.demo.pages.DemoHomePage, id = 4, version = 0]. This means that you
 declared wicket:id=row in your markup, but that you either did not add the
 component to your page at all, or that the hierarchy does not match.


Which part of the explanation above is not clear?
It tells you exactly what the problem is.


 [markup =

 file:/home/kumar/Documents/javaapplications/Eclipse_Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/demo/WEB-INF/classes/com/demo/pages/DemoHomePage.html
 html
 head/headbody
 form wicket:id=homePageForm
 input type=submit value=ok
 /form


  Id
  Name





 /body
 /html, index = 8, current = '
 ' (line 11, column 1)]

 Root cause:

 org.apache.wicket.markup.MarkupException: Unable to find component with id
 'row' in [Page class = com.demo.pages.DemoHomePage, id = 4, version = 0].
 This means that you declared wicket:id=row in your markup, but that you
 either did not add the component to your page at all, or that the hierarchy
 does not match.
 [markup =

 file:/home/kumar/Documents/javaapplications/Eclipse_Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/demo/WEB-INF/classes/com/demo/pages/DemoHomePage.html
 html

 I have used row in the submit method , but the wicket is not able to find
 since Dataview scope is not exist outside submit method. How could we
 resolve this problem, please help me.


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666033.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread kumar ramanathan
Yes Martin,I Understand the problem is the row (wicket:id) is not properly
referred in the java.

but I have referred inside the submit method in dataview component . The
data view scope is not accessible. It throwed the error.

While using inside submit method , how we could make the scope accessible
and resolve this problem.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666037.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread Martin Grigorov
Hi Kumar,

The real problem is that you give us wrong information.
The error message says that you HAVE a component with wicket:id=row in
your markup but it seems you've saved this from us!
The real problem is that you add the DataView (with id row) to the page,
while it has to be added to the Form.

Martin Grigorov
Wicket Training and Consulting


On Tue, May 27, 2014 at 3:25 PM, kumar ramanathan
kumarramana...@gmail.comwrote:

 Yes Martin,I Understand the problem is the row (wicket:id) is not properly
 referred in the java.

 but I have referred inside the submit method in dataview component . The
 data view scope is not accessible. It throwed the error.

 While using inside submit method , how we could make the scope accessible
 and resolve this problem.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666037.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread kumar ramanathan
Apologize Martin.Please tell how to fix my problem. Code snap is below for
your reference,kindly help  on what needs to modified in that.

public DemoHomePage ()
{
  Form form=new Form(homePageForm){
  public void submit(){
ListDemoBean list = new ArrayList();
list.add(new DemoBean(1,ram));
list.add(new DemoBean(2,sam));

ListDataProviderDemoBean listDataProvider = new
ListDataProviderDemoBean(list);

 DataViewDemoBean dataView = new
DataViewDemoBean(row,listDataProvider){
/**
 * 
 */
private static final long serialVersionUID = 1L;

protected void populateItem(ItemDemoBean item){
DemoBean bean=item.getModelObject();
RepeatingView repeatingView = new 
RepeatingView(dataRow);
repeatingView.add(new 
Label(repeatingView.newChildId(), bean.getId()));
repeatingView.add(new 
Label(repeatingView.newChildId(),
bean.getName()));
item.add(repeatingView);
}
};

add(dataView);
  }
  };
 
  add(form);
}

Html page:

html
body
form wicket:id=homePageForm
input type=submit value=ok
/form


 Id 
 Name 


 


/body
/html

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666039.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread Martin Grigorov
Hi,

Please use some pastebin service with code highlighting next time. It is
hard to follow it in a mail client.
The problem is that you try to add a component (the DataView) on the fly
when the form is submitted.
You should add the dataview to the page or form when they are constructed
and just populate its IDataProvider with data in onSubmit();
I.e. initially the DataView will render empty (invisible for the user) and
will show itself after submit because it will have entries to show.

Martin Grigorov
Wicket Training and Consulting


On Tue, May 27, 2014 at 3:51 PM, kumar ramanathan
kumarramana...@gmail.comwrote:

 Apologize Martin.Please tell how to fix my problem. Code snap is below for
 your reference,kindly help  on what needs to modified in that.

 public DemoHomePage ()
 {
   Form form=new Form(homePageForm){
   public void submit(){
 ListDemoBean list = new ArrayList();
 list.add(new DemoBean(1,ram));
 list.add(new DemoBean(2,sam));

 ListDataProviderDemoBean listDataProvider = new
 ListDataProviderDemoBean(list);

  DataViewDemoBean dataView = new
 DataViewDemoBean(row,listDataProvider){
 /**
  *
  */
 private static final long serialVersionUID = 1L;

 protected void populateItem(ItemDemoBean item){
 DemoBean bean=item.getModelObject();
 RepeatingView repeatingView = new
 RepeatingView(dataRow);
 repeatingView.add(new
 Label(repeatingView.newChildId(), bean.getId()));
 repeatingView.add(new
 Label(repeatingView.newChildId(),
 bean.getName()));
 item.add(repeatingView);
 }
 };

 add(dataView);
   }
   };

   add(form);
 }

 Html page:

 html
 body
 form wicket:id=homePageForm
 input type=submit value=ok
 /form


  Id
  Name





 /body
 /html

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666039.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread kumar ramanathan
Martin,I have tried to put the data view code out side the submit method ,it
throwed the below error.java.lang.IllegalArgumentException: argument
[dataProvider] cannot be null at
org.apache.wicket.markup.repeater.data.DataViewBase.(DataViewBase.java:59)
at org.apache.wicket.markup.repeater.data.DataView.(DataView.java:81)Can you
please tell how to put the data view code in the form while constructing
itself . If possible please give some example.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666041.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: Errors in data view , req for help to fix the error in code

2014-05-27 Thread Martin Grigorov
The data provider should be as before. Just start with empty List and put
the values into the List in onSubmit().
Read about static vs. dynamic models at
https://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models
You need dynamic data provider.

Martin Grigorov
Wicket Training and Consulting


On Tue, May 27, 2014 at 4:29 PM, kumar ramanathan
kumarramana...@gmail.comwrote:

 Martin,I have tried to put the data view code out side the submit method
 ,it
 throwed the below error.java.lang.IllegalArgumentException: argument
 [dataProvider] cannot be null at
 org.apache.wicket.markup.repeater.data.DataViewBase.(DataViewBase.java:59)
 at org.apache.wicket.markup.repeater.data.DataView.(DataView.java:81)Can
 you
 please tell how to put the data view code in the form while constructing
 itself . If possible please give some example.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Errors-in-data-view-req-for-help-to-fix-the-error-in-code-tp4666025p4666041.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




IModel-based multiple-selection DataTable

2014-05-27 Thread ChambreNoire
Hello,

I'm trying to roll my own paginated multiple-selection datatable and I'm not
sure how to store the selected entities. Many of the solutions I have found
online simply add/remove selected entities to/from a SetMyEntity located
in the parent component however my DataProviders use
LoadableDetachableModels. I could always store them in a Set of IModels but
then I'd have to load everything for comparisons. I'm currently digging
around in the sources for DataTable and I'm thinking that maybe I would have
to provide a custom Item id generation based on the persistent entities' ids
and use that to determine whether an item is selected or not but I'm not too
sure about this approach (and would also make this solution un-generic)...

Has anyone else tried something along these lines?  

Many Thanks,

Anthony

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IModel-based-multiple-selection-DataTable-tp4666043.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: Ajax timer not counting when tab doesn't have focus?

2014-05-27 Thread Bruce Lombardi
For anyone interested, and particularly for Ernesto, I have successfully 
created  a version of the InactivityTimeOutPanel that works even if the user 
changes to another browser tab. The key, which I became aware of from the 
jsfiddle links (see previous posts below is to use an absolute time for when a 
period of inactivity would result in a timeout (timeoutTime,set to now plus an 
interval,, say 5 minutes), and then when the timer fires, to compare the 
current time against the timeoutTime. This seems to avoid the problem of the 
timer slowing down when the user changes to another page. Reset just resets the 
timeoutTime to a now plus the interval. I have set the timer to go off in one 
quarter of the interval, thinking if there are some delays this will keep it 
closer to the mark.

I have tested this and it seems to work fine. 

I only had to change the JavaScript in Ernesto's example to get everything  to 
work, and I have posted the code here:  http://pastebin.com/TWwS5hhE
for people to see.

Ernesto, It would be great if you could put this code into the JavaScript in 
your example and try it out. Then we would have a complete example to point 
people to if it works OK.

Regards,

Bruce


-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Friday, May 16, 2014 2:42 PM
To: users@wicket.apache.org
Subject: Re: Ajax timer not counting when tab doesn't have focus?

Bruce.

Let me see if I can find some time during weekend to play a bit with the links 
your provided and come up with a more robust solution.


On Fri, May 16, 2014 at 3:57 PM, Bruce Lombardi brlom...@gmail.com wrote:

 First, thank you  for your continuing interest. This is the best 
 support group experience  I've ever had. I hope the message come in 
 the right sequence. Lke Ernesto and other A saw the sequencing problem 
 cause by the apache server problem.

 I ran the test that Martin suggestion with  6.16.0-SNAPSHOTand got the 
 same behavior, which is what Ernesto and I suspected would happen.

 I'm sorry, but I don't know a lot about JavaScript so I'm having with 
 certain things.  I read this article in stackoverflow:


 https://stackoverflow.com/questions/6032429/chrome-timeouts-interval-s
 uspended-in-background-tabs

 Which lead to this:


 http://stackoverflow.com/questions/5927284/how-can-i-make-setinterval-
 also-work-when-a-tab-is-inactive-in-chrome


 Which contained an example of a script that doesn’t work correctly (if 
 you go to it, you will see that  it walks the word test  across the screen.
 If you go to another  tab and come back test hasn’t moved)

 http://jsfiddle.net/7f6DX/3/


 and this example that works (does the same thing but you can see that 
 test  moves even when you go to another  tab - but don't go away too 
 long it will reach the end and disappear).

 http://jsfiddle.net/7f6DX/31/

 Do you think the last (working) script  could be adapted  for our timeout?

 Regards,
 Bruce



 -Original Message-
 From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
 Sent: Tuesday, May 13, 2014 1:59 AM
 To: users@wicket.apache.org
 Subject: Re: Ajax timer not counting when tab doesn't have focus?

 Martin,

 Thanks for pointing out this. The exact JavaScript enabling this 
 feature can be found here


 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-p
 arent/client-sign-out/src/main/java/com/antilia/signout/InactivitySign
 OutPanel.js

 Maybe there is a memory leak in here as well... but I do not see the 
 relation with WICKET-5570 as I do not use any of the AJAX timer 
 behavior, see


 https://github.com/reiern70/antilia-bits/blob/master/client-sign-out-p
 arent/client-sign-out/src/main/java/com/antilia/signout/InactivitySign
 OutPanel.java

 As Bruce describes the problem it sounds like if by switching to other 
 tab browser give less priority to the execution of JavaScript in 
 inactive tabs.



 On Mon, May 12, 2014 at 9:28 PM, Martin Grigorov mgrigo...@apache.org
 wrote:

  It could be that https://issues.apache.org/jira/browse/WICKET-5570 
  is the issue.
  Please try with 6.16.0-SNAPSHOT if you can.
 
  Martin Grigorov
  Wicket Training and Consulting
 
 
  On Mon, May 12, 2014 at 8:02 PM, Bruce Lombardi brlom...@gmail.com
  wrote:
 
   Thanks Ernesto.
  
   Yes, I do mean another browser tab. I have some new information. 
   The
  timer
   seems to slow way down, but not stop counting down when the user 
   switches focus to another tab, either opening a new tab, or just 
   clicking on
  another
   tab. This is happening in both Chrome and Firefox.
  
   I thought that my code was never timing out, but further 
   experimentation with a shorter timeout period shows that it is 
   doing the same thing as
  the
   demo. That is, timing out in about 10 second when you stay on the 
   tab,
  but
   taking 3 minutes or longer to timeout when if you change focus to 
   a different tab.
  
   I would appreciate it if you could look at