catch jquery event at AjaxEventBehavior

2011-08-01 Thread Lurtz Nazgul
Hi; 

I used jquery dialog. I can open and close jquery dialog box. I represent 
jquery 
dialog as a panel at wicket side.

My question is how can i catch jquery close event ? 

I tested like below but it doesn't work

dialogConfirmation.add(new AjaxEventBehavior(close) {
  @Override
  protected void onEvent(AjaxRequestTarget target) {
  System.out.println( closed );
  }
}) ;

Thanks.

Re: catch jquery event at AjaxEventBehavior

2011-08-01 Thread julien roche
Hi,

You can use the setCloseEvent method of the Dialog component:
http://code.google.com/p/wiquery/source/browse/trunk/src/main/java/org/odlabs/wiquery/ui/dialog/Dialog.java#702

And if you want to associate the event to an Ajax Behavior, I suggest you to
look on this example (
http://code.google.com/p/wiquery-demos/source/browse/trunk/wiquery-examples/src/main/java/org/odlabs/wiquery/examples/dialog/DialogPage.java)
where we link an Ajax Behavior to a button of the Dialog (and so, you can
reproduce it for the close event)

Regards

Julien Roche

On Mon, Aug 1, 2011 at 8:57 AM, Lurtz Nazgul lu...@ymail.com wrote:

 Hi;

 I used jquery dialog. I can open and close jquery dialog box. I represent
 jquery
 dialog as a panel at wicket side.

 My question is how can i catch jquery close event ?

 I tested like below but it doesn't work

dialogConfirmation.add(new AjaxEventBehavior(close) {
  @Override
  protected void onEvent(AjaxRequestTarget target) {
  System.out.println( closed );
  }
}) ;

 Thanks.


Re: show modal window without clicking on ajaxLink

2011-08-01 Thread Mathilde Pellerin
I use Wicket 1.4.17.
I tried with replaceWith like this :
//affichage du module interactif
String idContent = qPage.getModalWindow().getContentId();
ModuleContentPanel moduleContentPanel = new
ModuleContentPanel(idContent);
moduleContentPanel.initialiserModule(questionnaireCourant);

qPage.getModalWindow().get(idContent).replaceWith(moduleContentPanel);
qPage.getModalWindow().setTitle(Module
+questionnaireCourant.getTitre());
//qPage.getModalWindow().setContent(moduleContentPanel);

target.addComponent(qPage.getModalWindow());

and it's weird : my unit test is OK
@Test
public void testStory09_TA01(){
tester.startPage(QuestionnairesPage.class);
//On répond au questionnaire
Component module = reponseQuestionnaireNutrition();
//et on vérifie que le module s'affiche bien
tester.assertNoErrorMessage();
tester.assertRenderedPage(QuestionnairesPage.class);
tester.assertVisible(module.getPageRelativePath());
}

but when I test manually I can see that content panel of modal window is
still the same...



Maybe reponseQuestionnaireNutrition() can be useful to understand my test:
private Component reponseQuestionnaireNutrition() {
//Récupération des composants présents dans la fenetre du
questionnaire
ModalWindowE4N modalWindowQuestionnaire = (ModalWindowE4N)
tester.getComponentFromLastRenderedPage(fenetreModale);
QuestionnaireContentPanel questionnairePanel =
(QuestionnaireContentPanel)
modalWindowQuestionnaire.get(modalWindowQuestionnaire.getContentId());
Form? qForm = (Form?) questionnairePanel.get(qForm);

tester.assertInvisible(qForm.getPageRelativePath());

tester.clickLink(listeQuestionnaire:1:boutonQuestionnaire:remplir);
tester.assertVisible(qForm.getPageRelativePath());

//creation d'un formTester
FormTester formTester =
tester.newFormTester(qForm.getPageRelativePath());

//on répond aux questions
RepeatingView view = (RepeatingView) qForm.get(qRepeating);
Iterator? extends Component iter = view.iterator();
int index = 2;
while(iter.hasNext()){
//on selectionne une reponse
formTester.select(qRepeating:+index+:reponse:reponseListe,
2);
iter.next();
index++;
}
//puis on soumet le formulaire
tester.executeAjaxEvent(qForm.get(ajaxSubmitQuestionnaire),
onclick);
ModuleContentPanel modulePanel = (ModuleContentPanel)
modalWindowQuestionnaire.get(modalWindowQuestionnaire.getContentId());
Component module = modulePanel.get(module);
module = modulePanel.get(module);
return module;
}

2011/7/29 Mathilde Pellerin mathilde.pelle...@statlife.fr

 I tried your solution Andrea :
 - just one modal window :
 modalWindow = new ModalWindowE4N(modalQuestionnaire, );
 questionnaireContentPanel = new
 QuestionnaireContentPanel(modalWindow.getContentId(), this);
 modalWindow.setContent(questionnaireContentPanel);
 modalWindow.setInitialWidth(800);
 add(modalWindow);

 - after submit, substitute window content with ModuleContentPanel :

 membreCourant =
 serviceMembre.enregistrerReponses(membreCourant, questionnaireCourant);
 SessionE4N.get().setMembre(membreCourant);
 //qPage.getModalWindow().close(target);
 ModuleContentPanel moduleContentPanel = new
 ModuleContentPanel(qPage.getModalWindow().getContentId());
 moduleContentPanel.initialiserModule(questionnaireCourant);
 qPage.getModalWindow().setTitle(Module
 +questionnaireCourant.getTitre());
 qPage.getModalWindow().setContent(moduleContentPanel);

 target.addComponent(qPage.getModalWindow());
 //qPage.getModalWindow().show(target);

 but modal window is not re-render, so it content is not changed...
 maybe target.addComponent() is not sufficient?

 so I tried also with qPage.getModalWindow().close before changes and
 qPage.getModalWindow().show() after changes (with or without
 target.addComponent) : in these cases, we can see modal window change a
 second and then render with first content...

 what am I doing wrong?




-- 
*Mathilde Pellerin*
Ingénieur en développement de logiciel

STATLIFE
tel : 01.42.11.64.88
mail : mathilde.pelle...@statlife.fr


Re: Xforms Controls within Wicket Application

2011-08-01 Thread sramay
Hi,

My request for integrating XFORMS within a Wicket Application is as follows:

I have a XForms (with XHTML as hosting language) with few controls, actions,
etc. for validation on client-side. This form uses XSLTForms as XForms
engine.
This form should be integrated with normal Wicket application with the
following requirements:
  i) This form should rendered to client from Wicket application, so that on
client-side only XForms tags (controls, actions, etc) will be rendered and
not Wicket's tags
  ii) Wicket application should take the inputs from the XForms and handle
on server side with necessary actions (like validation, storing/retrieving
data from database, etc.)
Any solution available for this XForms-Wicket integration?

Is the question clear?

Regards

Ramachandran 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Xforms-Controls-within-Wicket-Application-tp3619253p3709083.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: show modal window without clicking on ajaxLink

2011-08-01 Thread Andrea Del Bene

Hi,

I've adapted (and tested) my solution to wicket 1.4.17. It's slightly 
different from 1.5 because you should pass
target.addComponent just moduleContentPanel and not the whole window. 
The code of my solution is this:


//modal window constructor

add(new AjaxLink(btn) {
@Override
public void onClick(AjaxRequestTarget target) {
Component cmp;
getParent().replaceWith(cmp = new 
Label(modalWindow.getContentId(), test));

cmp.setOutputMarkupId(true);

target.addComponent(cmp);
}
});


It just replaces modal window content with a label.



I use Wicket 1.4.17.
I tried with replaceWith like this :
 //affichage du module interactif
 String idContent = qPage.getModalWindow().getContentId();
 ModuleContentPanel moduleContentPanel = new
ModuleContentPanel(idContent);
 moduleContentPanel.initialiserModule(questionnaireCourant);

qPage.getModalWindow().get(idContent).replaceWith(moduleContentPanel);
 qPage.getModalWindow().setTitle(Module
+questionnaireCourant.getTitre());
 //qPage.getModalWindow().setContent(moduleContentPanel);

 target.addComponent(qPage.getModalWindow());

and it's weird : my unit test is OK
 @Test
 public void testStory09_TA01(){
 tester.startPage(QuestionnairesPage.class);
 //On répond au questionnaire
 Component module = reponseQuestionnaireNutrition();
 //et on vérifie que le module s'affiche bien
 tester.assertNoErrorMessage();
 tester.assertRenderedPage(QuestionnairesPage.class);
 tester.assertVisible(module.getPageRelativePath());
 }

but when I test manually I can see that content panel of modal window is
still the same...



Maybe reponseQuestionnaireNutrition() can be useful to understand my test:
 private Component reponseQuestionnaireNutrition() {
 //Récupération des composants présents dans la fenetre du
questionnaire
 ModalWindowE4N modalWindowQuestionnaire = (ModalWindowE4N)
tester.getComponentFromLastRenderedPage(fenetreModale);
 QuestionnaireContentPanel questionnairePanel =
(QuestionnaireContentPanel)
modalWindowQuestionnaire.get(modalWindowQuestionnaire.getContentId());
 Form?  qForm = (Form?) questionnairePanel.get(qForm);

 tester.assertInvisible(qForm.getPageRelativePath());

tester.clickLink(listeQuestionnaire:1:boutonQuestionnaire:remplir);
 tester.assertVisible(qForm.getPageRelativePath());

 //creation d'un formTester
 FormTester formTester =
tester.newFormTester(qForm.getPageRelativePath());

 //on répond aux questions
 RepeatingView view = (RepeatingView) qForm.get(qRepeating);
 Iterator? extends Component  iter = view.iterator();
 int index = 2;
 while(iter.hasNext()){
 //on selectionne une reponse
 formTester.select(qRepeating:+index+:reponse:reponseListe,
2);
 iter.next();
 index++;
 }
 //puis on soumet le formulaire
 tester.executeAjaxEvent(qForm.get(ajaxSubmitQuestionnaire),
onclick);
 ModuleContentPanel modulePanel = (ModuleContentPanel)
modalWindowQuestionnaire.get(modalWindowQuestionnaire.getContentId());
 Component module = modulePanel.get(module);
 module = modulePanel.get(module);
 return module;
 }

2011/7/29 Mathilde Pellerinmathilde.pelle...@statlife.fr




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



Re: show modal window without clicking on ajaxLink

2011-08-01 Thread Mathilde Pellerin
Thank you very much Andrea.
Now unit tests are OK and it works well when I test it manually.



2011/8/1 Mathilde Pellerin mathilde.pelle...@statlife.fr

 I use Wicket 1.4.17.
 I tried with replaceWith like this :
 //affichage du module interactif
 String idContent = qPage.getModalWindow().getContentId();
 ModuleContentPanel moduleContentPanel = new
 ModuleContentPanel(idContent);
 moduleContentPanel.initialiserModule(questionnaireCourant);

 qPage.getModalWindow().get(idContent).replaceWith(moduleContentPanel);

 qPage.getModalWindow().setTitle(Module
 +questionnaireCourant.getTitre());
 //qPage.getModalWindow().setContent(moduleContentPanel);

 target.addComponent(qPage.getModalWindow());

 and it's weird : my unit test is OK
 @Test
 public void testStory09_TA01(){
 tester.startPage(QuestionnairesPage.class);
 //On répond au questionnaire
 Component module = reponseQuestionnaireNutrition();
 //et on vérifie que le module s'affiche bien
 tester.assertNoErrorMessage();
 tester.assertRenderedPage(QuestionnairesPage.class);
 tester.assertVisible(module.getPageRelativePath());
 }

 but when I test manually I can see that content panel of modal window is
 still the same...



 Maybe reponseQuestionnaireNutrition() can be useful to understand my test:
 private Component reponseQuestionnaireNutrition() {
 //Récupération des composants présents dans la fenetre du
 questionnaire
 ModalWindowE4N modalWindowQuestionnaire = (ModalWindowE4N)
 tester.getComponentFromLastRenderedPage(fenetreModale);
 QuestionnaireContentPanel questionnairePanel =
 (QuestionnaireContentPanel)
 modalWindowQuestionnaire.get(modalWindowQuestionnaire.getContentId());
 Form? qForm = (Form?) questionnairePanel.get(qForm);

 tester.assertInvisible(qForm.getPageRelativePath());

 tester.clickLink(listeQuestionnaire:1:boutonQuestionnaire:remplir);
 tester.assertVisible(qForm.getPageRelativePath());

 //creation d'un formTester
 FormTester formTester =
 tester.newFormTester(qForm.getPageRelativePath());

 //on répond aux questions
 RepeatingView view = (RepeatingView) qForm.get(qRepeating);
 Iterator? extends Component iter = view.iterator();
 int index = 2;
 while(iter.hasNext()){
 //on selectionne une reponse
 formTester.select(qRepeating:+index+:reponse:reponseListe,
 2);
 iter.next();
 index++;
 }
 //puis on soumet le formulaire
 tester.executeAjaxEvent(qForm.get(ajaxSubmitQuestionnaire),
 onclick);
 ModuleContentPanel modulePanel = (ModuleContentPanel)
 modalWindowQuestionnaire.get(modalWindowQuestionnaire.getContentId());
 Component module = modulePanel.get(module);
 module = modulePanel.get(module);
 return module;
 }

 2011/7/29 Mathilde Pellerin mathilde.pelle...@statlife.fr

 I tried your solution Andrea :
 - just one modal window :
 modalWindow = new ModalWindowE4N(modalQuestionnaire, );
 questionnaireContentPanel = new
 QuestionnaireContentPanel(modalWindow.getContentId(), this);
 modalWindow.setContent(questionnaireContentPanel);
 modalWindow.setInitialWidth(800);
 add(modalWindow);

 - after submit, substitute window content with ModuleContentPanel :

 membreCourant =
 serviceMembre.enregistrerReponses(membreCourant, questionnaireCourant);
 SessionE4N.get().setMembre(membreCourant);
 //qPage.getModalWindow().close(target);
 ModuleContentPanel moduleContentPanel = new
 ModuleContentPanel(qPage.getModalWindow().getContentId());

 moduleContentPanel.initialiserModule(questionnaireCourant);
 qPage.getModalWindow().setTitle(Module
 +questionnaireCourant.getTitre());
 qPage.getModalWindow().setContent(moduleContentPanel);

 target.addComponent(qPage.getModalWindow());
 //qPage.getModalWindow().show(target);

 but modal window is not re-render, so it content is not changed...
 maybe target.addComponent() is not sufficient?

 so I tried also with qPage.getModalWindow().close before changes and
 qPage.getModalWindow().show() after changes (with or without
 target.addComponent) : in these cases, we can see modal window change a
 second and then render with first content...

 what am I doing wrong?




 --
 *Mathilde Pellerin*
 Ingénieur en développement de logiciel

 STATLIFE
 tel : 01.42.11.64.88
 mail : mathilde.pelle...@statlife.fr






-- 
*Mathilde Pellerin*
Ingénieur en développement de logiciel

STATLIFE
tel : 01.42.11.64.88
mail : mathilde.pelle...@statlife.fr


Re: serialization problem with spring

2011-08-01 Thread Martin Grigorov
My application uses wicket-spring and I tested kryo-serializer with it
while developing it. No problems at all with serializing JDK based
proxies or CGLIB based ones.
We don't use Spring Data-JPA nor any other kind of JDBC based backend...

On Mon, Aug 1, 2011 at 8:41 AM, Joe Fawzy joewic...@gmail.com wrote:
 Hi

 actually for testing , i tried using the new kryo-serializer from wicket
 stuff
 IT DOES NOT WORK, actually it has many more errors than the default one,
 actuallly it cannot serialize a JdkDynamicProxy which is the basis for
 injection
 If someone have a solution or workaround , please help
 Thanks
 Joe

 On Mon, Aug 1, 2011 at 8:10 AM, Joe Fawzy joewic...@gmail.com wrote:

 Hi

 i am living on the edge ,using wicket 1.5RC5.1 (the latest)
 and also using the newly released Spring data-jpa project for data access

 i do not use or reference PersistenceExceptionTranslationInterceptor
 directly, actually i never know it is there  till i saw that error

 based on its name it is an interceptor which translate the jpa or jdbc
 exception to spring's counterpart

 in AccountManager there is an instance of AccountDAO which use this
 persistence technology

 i thought it might be a solution to use kryo serialization as it does not
 require the object to be serializable, but the site does not recommend using
 it in production as it is in its early stages and not yet stable

 Any help please?

 Thanks

 Joe

 On Mon, Aug 1, 2011 at 4:35 AM, Dan Retzlaff dretzl...@gmail.com wrote:

 Hi Joe,

 Based on the depth of that serialization stack, I doubt it's your
 AccountManager proxy that's giving you problems. I usually just breakpoint
 NotSerializableException and walk up the stack to find the culprit. Any
 change your CreatePage uses a method on AccountManager that returns an
 object with PersistenceExceptionTranslationInterceptor, then holds a
 reference to it? If so, that'll be a problem since Wicket doesn't know to
 proxy that one.

 Dan

 On Sun, Jul 31, 2011 at 5:08 PM, Joe Fawzy joewic...@gmail.com wrote:

  Hi
  i have a serialization problem with spring
  My CreatePage class looks like:-
 
  public class CreatePage extends WebPage{
     @SpringBean
     AccountManager accountManager;
  }
 
  as i am using @SpringBean , it should handle creating a serializable
 proxy
  for me BUT
 
  i got the following exception
 
 
 
  ERROR - JavaSerializer             - Error serializing object class
  com.app.view.account.CreatePage [object=[Page class =
  com.app.view.account.CreatePage, id = 1, render count = 1]]
  java.io.NotSerializableException:
 
 org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
  at
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
  at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
  at
 
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
  at
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
  at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
  at
 
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
  at
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
  at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
  at
 
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
  at
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
  at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
  at
 
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
  at
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
  at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
  at
 
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
  at
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
  at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
  at
 
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
  at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
  at
 
 

Re: Xforms Controls within Wicket Application

2011-08-01 Thread Zilvinas Vilutis
Hi,

I don't see any current integration between wicket  XForms available,
but you can always start one, e.g. in code.google.com :)

You may always extend the form component ( or any other ) and
override the getMarkup ( or whatever method Wicket provide - Igor
please correct me here ) to generate your required X(HT)ML markup for
the form, or any input.

When you submit the form make sure the fields have wicket IDs ( and
name ) attributes set correctly for server side validation. Not sure
about client side - you might need to write your own validators here -
but it should not be super complex.

Regards

Žilvinas Vilutis

Mobile:   (+1) 623 330 6048
E-mail:   cika...@gmail.com



On Mon, Aug 1, 2011 at 10:58 AM, sramay nic.sr...@gmail.com wrote:
 Hi,

 My request for integrating XFORMS within a Wicket Application is as follows:

 I have a XForms (with XHTML as hosting language) with few controls, actions,
 etc. for validation on client-side. This form uses XSLTForms as XForms
 engine.
 This form should be integrated with normal Wicket application with the
 following requirements:
  i) This form should rendered to client from Wicket application, so that on
 client-side only XForms tags (controls, actions, etc) will be rendered and
 not Wicket's tags
  ii) Wicket application should take the inputs from the XForms and handle
 on server side with necessary actions (like validation, storing/retrieving
 data from database, etc.)
 Any solution available for this XForms-Wicket integration?

 Is the question clear?

 Regards

 Ramachandran

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

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



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



Re: Scala DSL for Wicket

2011-08-01 Thread Bruno Borges
The WicketStuff Scala project is the best way to put all this.

The project is more Scala-based components driven, like Fodel/SLabel and
SForm, but I think Scala can offer even more advantages like the one you
propose here.

DSL is the way to go IMO for this Scala-Wicket integration


*Bruno Borges*
www.brunoborges.com.br
+55 21 76727099



On Mon, Aug 1, 2011 at 2:45 AM, Gary Thomas 7za...@gmail.com wrote:


 I've written some Scala utilities as well, but instead of a DSL I'm using
 implicit conversions via traits, which I've found to be a really nice fit
 with Wicket.

 An example:

 import org.apache.wicket.model.IModel
 import org.apache.wicket.model.**LoadableDetachableModel
 import org.apache.wicket.model.**PropertyModel

 trait WicketConversions {
   // transparent PropertyModel conversion
implicit def tuple2model[T](tuple: (AnyRef, String)): PropertyModel[T] =
 {
new PropertyModel[T](tuple._1, tuple._2)
}

// transparent function/closure to LoadableDetachableModel conversion
implicit def function2model[T](f: = T): IModel[T] = {
new LoadableDetachableModel[T] {
def load: T = f
}
}
 }

 Usage:

 class MyPanel extends Panel(id) with WicketConversions {

// transparent PropertyModel conversion using article.rating):
add(new RatingPanel(rating, article - rating) // so pretty

// transparent LoadableDetachableModel conversion (expects
 IModel[Boolean]):
add(new AjaxCheckBox(selected, { dao.get(id).isAdmin }) {
def onUpdate(target: AjaxRequestTarget) { ... }
})
 }


 I have more code as well for Spring integration, etc.
 If anyone is interested, I could add mine to this or to a new GitHub
 project.


 Thanks,
 Gary



 On 7/29/11 5:22 PM, Ben Tilford wrote:

 For LDM

 class Ldm[T](provider:()=  T) extends LoadableDetachable... {
   def load():T {
 provider()
   }
 }

 object Ldm {
   def apply(provider:()=T) = new Ldm[T](provider)
 }

 could be used as

 ...
 val id = 1
 val model = Ldm(()={dao.get(id)})

 or

 val id = 1
 def provider = dao.get(id)
 val model = Ldm(provider)


 On Fri, Jul 29, 2011 at 6:44 AM, Martin Grigorovmgrigo...@apache.org**
 wrote:

  Bruno,

 Yet another idea for the dsl:

 def ldm[R, ID](id: ID = null, f: (ID) =  R) = {new
 LoadableDetachableModel(id) { override def load() : R = { f(id); } } }

 P.S. Not tested.

 On Thu, Jul 28, 2011 at 9:07 AM, Bruno Borgesbruno.bor...@gmail.com
 wrote:

 Just wanted to share my experience playing a little more with Scala and
 Wicket  A few minutes ago I got this excelent code:

 I know it is too simple, and it can be accomplished as well in Java with
 static imports. But still, for my project it's being great (and cool) to

 do

 such things.

 object btnEditar extends Button(btnEditar) {
   override def onSubmit() = {
 -/* show fields */
 -camposForm.**setVisibilityAllowed(true)
 -btnSalvar.**setVisibilityAllowed(true)
 -cancelar.setVisibilityAllowed(**true)
 -
 -/* hide them */
 -camposTela.**setVisibilityAllowed(false)
 -btnEditar.**setVisibilityAllowed(false)
 +show(camposForm, btnSalvar, cancelar)
 +hide(camposTela, btnEditar)
   }
 }
 add(btnEditar)

 Methods show/hide are imported as import code.DSLWicket._



 *Bruno Borges*
 www.brunoborges.com.br
 +55 21 76727099



 On Wed, Jul 27, 2011 at 4:53 PM, Bruno Borgesbruno.bor...@gmail.com
 wrote:

  Thanks Martin,

 There was only a small little problem in your code. The correct syntax

 is:


 def label[T](id: String, model: IModel[T] = null): Label = { val label
 = new Label(id, model); add(label); label }

 The suggestions were updated on Gist.

 *Bruno Borges*
 www.brunoborges.com.br
 +55 21 76727099



 On Wed, Jul 27, 2011 at 3:55 PM, Martin Grigorovmgrigo...@apache.org

 wrote:


  Idea for simplification: use named parameters.
 For example
 def label[T](id: String, model: IModel[T]): Label = { val label = new
 Label(id, model); add(label); label }
 would become
 def label[T](id: String, model = _ : IModel[T]): Label = { val label =
 new Label(id, model); add(label); label }

 this way you'll have just one declaration of label function which will
 handle the current three

 additionally you may add a pimp:
 implicit def ser2model[S :  Serializable](ser: S): IModel[S] =
 Model.of(ser)

 now even when you pass String as second param to label() it will be
 converted to IModel

 On Wed, Jul 27, 2011 at 9:11 PM, Martin Grigorovmgrigo...@apache.org


  wrote:

 Take a look at scala.swing.* sources.

 On Wed, Jul 27, 2011 at 8:34 PM, Bruno Borges

 bruno.bor...@gmail.com

 wrote:

 Can some Scala expert help me to make this DSL available as PML

 (pimp

 my

 library)?

 I've tried to code it that way but things didn't quite worked out

 the

 way

 they should.

 The reason is that for every Wicket object I create, I must extend

 the

 trait

 DSLWicket



 *Bruno Borges*
 www.brunoborges.com.br
 +55 21 

Re: Manually Rendering a DataGridView

2011-08-01 Thread Matt Schmidt
Gotcha. Is there a way to do this without adding the DGV to the page? In my
case, I just want to add an empty table/ tag and pass the would-be
rendered HTML of the DGV to a jQuery function that populates the table.

Specifically, I am trying to dynamically instantiate a jQuery DataTables
using the JavaScript array method (
http://datatables.net/examples/data_sources/js_array.html).

On Sun, Jul 31, 2011 at 10:40 PM, Pedro Santos pedros...@gmail.com wrote:

 The char sequence is returned by mockResponse.getText()
 Sure, there are no public methods and would be a good idea to
 refectory the code and move the mock response logic to other place.
 You can use an IVisitor to visit cells in you component tree,  create
 a mock response to render them and use its text, i.e.
 mockResponse.getText(), to fit your needs

 On Sun, Jul 31, 2011 at 10:33 AM, Matt Schmidt mschmid...@gmail.com
 wrote:
  So after calling tableParser.parse(myDataGridView), how do I get the the
  char sequence? Or iterate over each row to get the char sequence for each
  cell? I don't see any public methods for that.
 
  On Sunday, July 31, 2011, Pedro Santos pedros...@gmail.com wrote:
  Hi, I had a similar need and used the code at TableParser[1] to render
  the component tree to a mock response and later get its char sequence.
 
  1 -
 
 https://github.com/wicketstuff/core/blob/master/jdk-1.5-parent/wicket-poi-parent/wicket-poi/src/main/java/org/wicketstuff/poi/excel/TableParser.java
 
  On Fri, Jul 29, 2011 at 6:01 PM, Matt Schmidt mschmid...@gmail.com
  wrote:
  Is there any way to access the HTML of each cell that would be rendered
  in a
  DataGridView without adding it to the page and actually rendering it?
 
  Ultimately, I am trying to add all of the inner HTML of the cells of
 the
  DataGridView to a JavaScript array.
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 



 --
 Pedro Henrique Oliveira dos Santos

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




Re: serialization problem with spring

2011-08-01 Thread Dan Retzlaff
Did you put a breakpoint on the serialization exception? I'd guess that
something in your component hierarchy is holding a reference to AccountDAO.
Wicket only proxies @SpringBean annotated variables.

On Sun, Jul 31, 2011 at 10:10 PM, Joe Fawzy joewic...@gmail.com wrote:

 Hi

 i am living on the edge ,using wicket 1.5RC5.1 (the latest)
 and also using the newly released Spring data-jpa project for data access

 i do not use or reference PersistenceExceptionTranslationInterceptor
 directly, actually i never know it is there  till i saw that error

 based on its name it is an interceptor which translate the jpa or jdbc
 exception to spring's counterpart

 in AccountManager there is an instance of AccountDAO which use this
 persistence technology

 i thought it might be a solution to use kryo serialization as it does not
 require the object to be serializable, but the site does not recommend
 using
 it in production as it is in its early stages and not yet stable

 Any help please?

 Thanks

 Joe

 On Mon, Aug 1, 2011 at 4:35 AM, Dan Retzlaff dretzl...@gmail.com wrote:

  Hi Joe,
 
  Based on the depth of that serialization stack, I doubt it's your
  AccountManager proxy that's giving you problems. I usually just
 breakpoint
  NotSerializableException and walk up the stack to find the culprit. Any
  change your CreatePage uses a method on AccountManager that returns an
  object with PersistenceExceptionTranslationInterceptor, then holds a
  reference to it? If so, that'll be a problem since Wicket doesn't know to
  proxy that one.
 
  Dan
 
  On Sun, Jul 31, 2011 at 5:08 PM, Joe Fawzy joewic...@gmail.com wrote:
 
   Hi
   i have a serialization problem with spring
   My CreatePage class looks like:-
  
   public class CreatePage extends WebPage{
  @SpringBean
  AccountManager accountManager;
   }
  
   as i am using @SpringBean , it should handle creating a serializable
  proxy
   for me BUT
  
   i got the following exception
  
  
  
   ERROR - JavaSerializer - Error serializing object class
   com.app.view.account.CreatePage [object=[Page class =
   com.app.view.account.CreatePage, id = 1, render count = 1]]
   java.io.NotSerializableException:
  
 
 org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
   at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
   at
  
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
   at
  java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
   at
  
  
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
   at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
   at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
   at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
   at
  
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
   at
  java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
   at
  
  
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
   at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
   at
  
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
   at
  java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
   at
  
  
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
   at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
   at
  
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
   at
  java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
   at
  
  
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
   at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
   at
  
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
   at
  java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
   at
  
  
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
   at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
   at
  
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
   at
  java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
   at
  
  
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
   at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
   at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
   at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
   at
  
 
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
   at
  java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
   at
  
  
 
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
   at
 

Re: Manually Rendering a DataGridView

2011-08-01 Thread Martin Grigorov
See 
https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/datatables-parent

On Mon, Aug 1, 2011 at 3:54 PM, Matt Schmidt mschmid...@gmail.com wrote:
 Gotcha. Is there a way to do this without adding the DGV to the page? In my
 case, I just want to add an empty table/ tag and pass the would-be
 rendered HTML of the DGV to a jQuery function that populates the table.

 Specifically, I am trying to dynamically instantiate a jQuery DataTables
 using the JavaScript array method (
 http://datatables.net/examples/data_sources/js_array.html).

 On Sun, Jul 31, 2011 at 10:40 PM, Pedro Santos pedros...@gmail.com wrote:

 The char sequence is returned by mockResponse.getText()
 Sure, there are no public methods and would be a good idea to
 refectory the code and move the mock response logic to other place.
 You can use an IVisitor to visit cells in you component tree,  create
 a mock response to render them and use its text, i.e.
 mockResponse.getText(), to fit your needs

 On Sun, Jul 31, 2011 at 10:33 AM, Matt Schmidt mschmid...@gmail.com
 wrote:
  So after calling tableParser.parse(myDataGridView), how do I get the the
  char sequence? Or iterate over each row to get the char sequence for each
  cell? I don't see any public methods for that.
 
  On Sunday, July 31, 2011, Pedro Santos pedros...@gmail.com wrote:
  Hi, I had a similar need and used the code at TableParser[1] to render
  the component tree to a mock response and later get its char sequence.
 
  1 -
 
 https://github.com/wicketstuff/core/blob/master/jdk-1.5-parent/wicket-poi-parent/wicket-poi/src/main/java/org/wicketstuff/poi/excel/TableParser.java
 
  On Fri, Jul 29, 2011 at 6:01 PM, Matt Schmidt mschmid...@gmail.com
  wrote:
  Is there any way to access the HTML of each cell that would be rendered
  in a
  DataGridView without adding it to the page and actually rendering it?
 
  Ultimately, I am trying to add all of the inner HTML of the cells of
 the
  DataGridView to a JavaScript array.
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 



 --
 Pedro Henrique Oliveira dos Santos

 -
 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

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



Re: Xforms Controls within Wicket Application

2011-08-01 Thread Martin Grigorov
On Mon, Aug 1, 2011 at 2:17 PM, Zilvinas Vilutis cika...@gmail.com wrote:
 Hi,

 I don't see any current integration between wicket  XForms available,
 but you can always start one, e.g. in code.google.com :)

 You may always extend the form component ( or any other ) and
 override the getMarkup ( or whatever method Wicket provide - Igor
 please correct me here ) to generate your required X(HT)ML markup for
 the form, or any input.
It's #getMarkupType().

 When you submit the form make sure the fields have wicket IDs ( and
 name ) attributes set correctly for server side validation. Not sure
 about client side - you might need to write your own validators here -
 but it should not be super complex.

 Regards

 Žilvinas Vilutis

 Mobile:   (+1) 623 330 6048
 E-mail:   cika...@gmail.com



 On Mon, Aug 1, 2011 at 10:58 AM, sramay nic.sr...@gmail.com wrote:
 Hi,

 My request for integrating XFORMS within a Wicket Application is as follows:

 I have a XForms (with XHTML as hosting language) with few controls, actions,
 etc. for validation on client-side. This form uses XSLTForms as XForms
 engine.
 This form should be integrated with normal Wicket application with the
 following requirements:
  i) This form should rendered to client from Wicket application, so that on
 client-side only XForms tags (controls, actions, etc) will be rendered and
 not Wicket's tags
  ii) Wicket application should take the inputs from the XForms and handle
 on server side with necessary actions (like validation, storing/retrieving
 data from database, etc.)
 Any solution available for this XForms-Wicket integration?

 Is the question clear?

 Regards

 Ramachandran

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

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



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





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

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



Re: catch jquery event at AjaxEventBehavior

2011-08-01 Thread Lurtz Nazgul
Hi ; 

I used AbstractDefaultAjaxBehavior to catch jquery close event. 

On jquery side i triggered event when jquery event window closed. 

wicketAjaxGet('+behavior.getCallbackUrl()+ ');

It is little tricky.

Thanks.




From: Lurtz Nazgul lu...@ymail.com
To: users@wicket.apache.org
Sent: Mon, August 1, 2011 9:57:30 AM
Subject: catch jquery event at  AjaxEventBehavior

Hi; 

I used jquery dialog. I can open and close jquery dialog box. I represent 
jquery 

dialog as a panel at wicket side.

My question is how can i catch jquery close event ? 

I tested like below but it doesn't work

dialogConfirmation.add(new AjaxEventBehavior(close) {
  @Override
  protected void onEvent(AjaxRequestTarget target) {
  System.out.println( closed );
  }
}) ;

Thanks.

Re: Manually Rendering a DataGridView

2011-08-01 Thread Matt Schmidt
I already have a WiQuery plugin/behavior that does basically the same thing.
It renders the table's HTML to the page, then jQuery has to parse through it
and put it in the DOM to initialize. It gets awfully slow with a lot of
data. That's why I'm trying to not render the table to the HTML at all, and
initialize with a JavaScript array that puts the data directly in the DOM.

On Mon, Aug 1, 2011 at 10:38 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 See
 https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/datatables-parent

 On Mon, Aug 1, 2011 at 3:54 PM, Matt Schmidt mschmid...@gmail.com wrote:
  Gotcha. Is there a way to do this without adding the DGV to the page? In
 my
  case, I just want to add an empty table/ tag and pass the would-be
  rendered HTML of the DGV to a jQuery function that populates the table.
 
  Specifically, I am trying to dynamically instantiate a jQuery DataTables
  using the JavaScript array method (
  http://datatables.net/examples/data_sources/js_array.html).
 
  On Sun, Jul 31, 2011 at 10:40 PM, Pedro Santos pedros...@gmail.com
 wrote:
 
  The char sequence is returned by mockResponse.getText()
  Sure, there are no public methods and would be a good idea to
  refectory the code and move the mock response logic to other place.
  You can use an IVisitor to visit cells in you component tree,  create
  a mock response to render them and use its text, i.e.
  mockResponse.getText(), to fit your needs
 
  On Sun, Jul 31, 2011 at 10:33 AM, Matt Schmidt mschmid...@gmail.com
  wrote:
   So after calling tableParser.parse(myDataGridView), how do I get the
 the
   char sequence? Or iterate over each row to get the char sequence for
 each
   cell? I don't see any public methods for that.
  
   On Sunday, July 31, 2011, Pedro Santos pedros...@gmail.com wrote:
   Hi, I had a similar need and used the code at TableParser[1] to
 render
   the component tree to a mock response and later get its char
 sequence.
  
   1 -
  
 
 https://github.com/wicketstuff/core/blob/master/jdk-1.5-parent/wicket-poi-parent/wicket-poi/src/main/java/org/wicketstuff/poi/excel/TableParser.java
  
   On Fri, Jul 29, 2011 at 6:01 PM, Matt Schmidt mschmid...@gmail.com
   wrote:
   Is there any way to access the HTML of each cell that would be
 rendered
   in a
   DataGridView without adding it to the page and actually rendering
 it?
  
   Ultimately, I am trying to add all of the inner HTML of the cells of
  the
   DataGridView to a JavaScript array.
  
  
  
  
   --
   Pedro Henrique Oliveira dos Santos
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 
  -
  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

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




Why isn't my stateless form recreated from page parameters automatically?

2011-08-01 Thread Mike Mander

Hi,

i would like to build up a stateless page for collecting an itemId and 
an amount from my user.
The website should act as a direct shopping formular. The user only 
should insert the data

and on form submission the itemId is checked for existence.
A helper button should clear the field values from the appropriate row. 
All has to work

without any javascript.

My intention was that i create the stateless page, present it to the 
user, collect the data,
submit the form, clear the row data and present the stateless page again 
to the user

with data in row cleared. But i don't get it to work.

My question: If i post the form an page is coming back everything is 
recreated and the values
from the page parameters are not deployed to appropriate components 
automatically.

Do i have to do this by hand? Or is there a way?

I use wicket 1.4.17.

Thanks for helping me
Mike

code
HomePage.java
import java.util.Arrays;
import java.util.List;

import org.apache.wicket.PageParameters;
import org.apache.wicket.devutils.stateless.StatelessComponent;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.StatelessForm;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.PropertyModel;

@StatelessComponent
public class HomePage extends WebPage {

public HomePage(final PageParameters parameters) {
super(parameters);
final StatelessForm? form;
add(form = (StatelessForm?) new StatelessFormVoid(form));
form.add(new ListViewItemModel(item, items()) {

@Override
protected void populateItem(final ListItemItemModel item) {
item.add(new TextFieldString(itemId, new 
PropertyModelString(item.getModel(), itemId)));
item.add(new TextFieldInteger(amount, new 
PropertyModelInteger(item.getModel(), amount)));

item.add(new Button(clearContent) {
@Override
public void onSubmit() {
item.getModelObject().clear();
}
});
}
}.setReuseItems(true));
}

private ListItemModel items() {
return Arrays.asList(new ItemModel(0), new ItemModel(1));
}
}
/code

ItemModel.java
code
import org.apache.wicket.util.string.Strings;

public class ItemModel {

private String _itemId = null;
private int _amount = 1;
private int _pos = 0;

public ItemModel(int pos) {
_pos = pos;
System.out.println(this);
}

public ItemModel(String key) {
if (!Strings.isEmpty(key)) {
String[] parts = key.split(-);
setPos(Integer.valueOf(parts[0]).intValue());
setItemId(String.valueOf(parts[1]));
setAmount(Integer.valueOf(parts[2]).intValue());
}
}

public int getAmount() {
return _amount;
}

public void setAmount(int amount) {
_amount = amount;
}

public String getItemId() {
return _itemId;
}

public void setItemId(String itemId) {
_itemId = itemId;
}

public int getPos() {
return _pos;
}

public void setPos(int pos) {
_pos = pos;
}

public String createKey() {
StringBuilder key = new 
StringBuilder().append(getPos()).append(-).append(getItemId()).append(-).append(getAmount());

return key.toString();
}

public void clear() {
setItemId(null);
setAmount(1);
}
}
/code

HomePage.html
code
html 
xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd; 


head
titleWicket Quickstart Archetype Homepage/title
/head
body
strongWicket Quickstart Archetype Homepage/strong
br/br/
a href=/Home/a
form wicket:id=form
table
tr
tdItem/td
tdAmount/td
tdClear content/td
/tr
tr wicket:id=item
tdinput wicket:id=itemId //td
tdinput wicket:id=amount //td
tdinput type=submit wicket:id=clearContent //td
/tr
/table
/form
/body
/html
/code

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



Re: Manually Rendering a DataGridView

2011-08-01 Thread Pedro Santos
I don't think you can because page carries some renderer state. What
do you think about use a transient page? one with just one component
slot available to you plug any component you want, visit children,
extract the info you need to assemble the JavaScript, and discard its
instance to be garbage collected latter.

On Mon, Aug 1, 2011 at 9:54 AM, Matt Schmidt mschmid...@gmail.com wrote:
 Gotcha. Is there a way to do this without adding the DGV to the page? In my
 case, I just want to add an empty table/ tag and pass the would-be
 rendered HTML of the DGV to a jQuery function that populates the table.

 Specifically, I am trying to dynamically instantiate a jQuery DataTables
 using the JavaScript array method (
 http://datatables.net/examples/data_sources/js_array.html).

 On Sun, Jul 31, 2011 at 10:40 PM, Pedro Santos pedros...@gmail.com wrote:

 The char sequence is returned by mockResponse.getText()
 Sure, there are no public methods and would be a good idea to
 refectory the code and move the mock response logic to other place.
 You can use an IVisitor to visit cells in you component tree,  create
 a mock response to render them and use its text, i.e.
 mockResponse.getText(), to fit your needs

 On Sun, Jul 31, 2011 at 10:33 AM, Matt Schmidt mschmid...@gmail.com
 wrote:
  So after calling tableParser.parse(myDataGridView), how do I get the the
  char sequence? Or iterate over each row to get the char sequence for each
  cell? I don't see any public methods for that.
 
  On Sunday, July 31, 2011, Pedro Santos pedros...@gmail.com wrote:
  Hi, I had a similar need and used the code at TableParser[1] to render
  the component tree to a mock response and later get its char sequence.
 
  1 -
 
 https://github.com/wicketstuff/core/blob/master/jdk-1.5-parent/wicket-poi-parent/wicket-poi/src/main/java/org/wicketstuff/poi/excel/TableParser.java
 
  On Fri, Jul 29, 2011 at 6:01 PM, Matt Schmidt mschmid...@gmail.com
  wrote:
  Is there any way to access the HTML of each cell that would be rendered
  in a
  DataGridView without adding it to the page and actually rendering it?
 
  Ultimately, I am trying to add all of the inner HTML of the cells of
 the
  DataGridView to a JavaScript array.
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 



 --
 Pedro Henrique Oliveira dos Santos

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






-- 
Pedro Henrique Oliveira dos Santos

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



Wiquery - jqGrid and top toolbar buttons

2011-08-01 Thread Joselito Lobo
Hi folks,

I'm using an integration of jqgrid with wicket
and I would like to know if there's a way to include
wicket buttons in the top toolbar, below the caption, in the same way
we do with the jquery code:

$(#t_GRID_ID).append(input type='button'...)

regards,
Joselito.


radio button example help

2011-08-01 Thread wmike1...@gmail.com
This code is from the wicket examples:
I'm having a lot of trouble understanding it. How is the current selection
recognized? Why does the compound property model (the Input object) not have
any getters/setters?

package org.apache.wicket.examples.compref;

import java.util.Arrays;
import java.util.List;

import org.apache.wicket.IClusterable;
import org.apache.wicket.examples.WicketExamplePage;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.RadioChoice;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.model.CompoundPropertyModel;


/**
 * Page with examples on {@link
org.apache.wicket.markup.html.form.ListChoice}.
 * 
 * @author Eelco Hillenius
 */
public class RadioChoicePage extends WicketExamplePage
{
/** available sites for selection. */
private static final List SITES = Arrays.asList(new String[] { The
Server Side, Java Lobby,
Java.Net });

/**
 * Constructor
 */
public RadioChoicePage()
{
final Input input = new Input();
setModel(new CompoundPropertyModel(input));

// Add a FeedbackPanel for displaying our messages
FeedbackPanel feedbackPanel = new FeedbackPanel(feedback);
add(feedbackPanel);

// Add a form with an onSumbit implementation that sets a message
Form form = new Form(form)
{
protected void onSubmit()
{
info(input:  + input);
}
};
add(form);

// Add a radio choice component that uses Input's 'site' property to
// designate the
// current selection, and that uses the SITES list for the available
// options.
form.add(new RadioChoice(site, SITES));
}

/** Simple data class that acts as a model for the input fields. */
private static class Input implements IClusterable
{
/** the selected site. */
public String site = (String)SITES.get(0);

/**
 * @see java.lang.Object#toString()
 */
public String toString()
{
return site = ' + site + ';
}
}
}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/radio-button-example-help-tp3710953p3710953.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



Wicket - TinyMCE

2011-08-01 Thread ramazan pekin
Hi to everyone,

I am looking for rich text editor and I found TinyMCE. But I couldnt
find any document/example page how can I integrate wicket and TinyMCE
explained detailed. Do you know is there any documentation or example
about this subject?

Thanks, br.
Ramazan

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



How to handle exceptions caused by img src=GARBAGE?

2011-08-01 Thread Alec Swan
Hello,

Our app has a basic HTML editor where users can enter some HTML code.
Sometimes users enter something like img src=GARBAGE. When the
browser displays renders the page with this HTML it treats GARBAGE as
a relative URL. So, the browser tacks GARBAGE on to the current page
URL causing the application to throw an error. In fact, if the current
page URL is http://xxx/yyy/oid/1 the browser will send and HTTP
request to http://xxx/yyy/oid/GARBAGE making it look like oid
parameter is invalid.

Is there a way to distinguish between this scenario and a scenario
where the user did enter an invalid oid value?

Thanks,

Alec

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



Re: Wicket - TinyMCE

2011-08-01 Thread Michal Letynski

Hi.
W dniu 2011-08-02 04:29, ramazan pekin pisze:

Hi to everyone,

I am looking for rich text editor and I found TinyMCE. But I couldnt
find any document/example page how can I integrate wicket and TinyMCE
explained detailed. Do you know is there any documentation or example
about this subject?

There are some examples for it:

https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/tinymce-parent/tinymce-examples


Thanks, br.
Ramazan

-
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: Wicket - TinyMCE/FckEditor

2011-08-01 Thread Chris Colman
Are there any examples of Wicket integrated with FckEditor (the one
before CkEditor)?

-Original Message-
From: Michal Letynski [mailto:m...@consol.ae]
Sent: Tuesday, 2 August 2011 3:25 PM
To: users@wicket.apache.org
Subject: Re: Wicket - TinyMCE

Hi.
W dniu 2011-08-02 04:29, ramazan pekin pisze:
 Hi to everyone,

 I am looking for rich text editor and I found TinyMCE. But I couldnt
 find any document/example page how can I integrate wicket and TinyMCE
 explained detailed. Do you know is there any documentation or example
 about this subject?
There are some examples for it:

https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/tinymce-
parent/tinymce-examples

 Thanks, br.
 Ramazan

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



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


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



Re: Wicket - TinyMCE/FckEditor

2011-08-01 Thread Josh Kamau
Hi Michal,

If you want a really nice and simple Rich Text Editor, take a look at
visural-wicket project.

Here is the link to the demos - http://wicket.visural.net/examples/app/

regards.
Josh.

On Tue, Aug 2, 2011 at 8:27 AM, Chris Colman
chr...@stepaheadsoftware.comwrote:

 Are there any examples of Wicket integrated with FckEditor (the one
 before CkEditor)?

 -Original Message-
 From: Michal Letynski [mailto:m...@consol.ae]
 Sent: Tuesday, 2 August 2011 3:25 PM
 To: users@wicket.apache.org
 Subject: Re: Wicket - TinyMCE
 
 Hi.
 W dniu 2011-08-02 04:29, ramazan pekin pisze:
  Hi to everyone,
 
  I am looking for rich text editor and I found TinyMCE. But I couldnt
  find any document/example page how can I integrate wicket and TinyMCE
  explained detailed. Do you know is there any documentation or example
  about this subject?
 There are some examples for it:
 
 https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/tinymce-
 parent/tinymce-examples
 
  Thanks, br.
  Ramazan
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


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




Re: wicketstuff tinymce development

2011-08-01 Thread Michal Letynski

W dniu 2011-07-29 18:30, jbrookover pisze:

Michal Letynski wrote:

Ok i solved the problem. I used wrong version (1.4.17.3 - its buggy). I
get exceptions:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  at java.lang.String.substring(String.java:1937)
  at
wicket.contrib.tinymce.settings.TinyMCESettings.lazyLoadTinyMCEResource(TinyMCESettings.java:971)
  at
wicket.contrib.tinymce.TinyMceBehavior.renderHead(TinyMceBehavior.java:60)

And looking and java docs ( TODO: This has not been extensively
tested.) it still under development.


For TinyMCE to work properly with AJAX, it must be loaded on the page prior
to the Ajax call that generates the editor.  This is a flaw with TinyMCE
itself, not the wicket component.

Up until version 1.4.17.2, you needed to render the TinyMCE javascript
resource with the Page (or some other non-Ajax generated component) and then
individual components can use TinyMCEBehavior on an Ajax rendered text area.
This is described in the JavaDoc for lazyLoadTinyMCEResource().

lazyLoadTinyMCEResource() was my attempt to get around this requirement and
load the javascript via Ajax.  I suspect the problem is not with the
technique but with the URL manipulation.  Feel free to contribute a bug fix
and/or ignore the lazyLoadTinyMCEResource() function.  However, it should be
considered beta and is completely optional.  You can still use the old
method.

Hope that helps!  I still recommend using 1.4.17.3 as it has an up-to-date
version of TinyMCE and several other improvements.
I used tinymce editor in previous company for two years and it worked 
with/without ajax just from scrath, without any magic.
Recommended version 1.4.17.3 just not worked for me, so i used previous 
one.

Thanks for support.


Jake

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicketstuff-tinymce-development-tp3698059p3704257.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



Re: Wicket - TinyMCE/FckEditor

2011-08-01 Thread Michal Letynski

W dniu 2011-08-02 09:34, Josh Kamau pisze:

Hi Michal,

If you want a really nice and simple Rich Text Editor, take a look at
visural-wicket project.

Here is the link to the demos - http://wicket.visural.net/examples/app/

NicEdit is dead. Its not supported for long time.


regards.
Josh.

On Tue, Aug 2, 2011 at 8:27 AM, Chris Colman
chr...@stepaheadsoftware.comwrote:


Are there any examples of Wicket integrated with FckEditor (the one
before CkEditor)?


-Original Message-
From: Michal Letynski [mailto:m...@consol.ae]
Sent: Tuesday, 2 August 2011 3:25 PM
To: users@wicket.apache.org
Subject: Re: Wicket - TinyMCE

Hi.
W dniu 2011-08-02 04:29, ramazan pekin pisze:

Hi to everyone,

I am looking for rich text editor and I found TinyMCE. But I couldnt
find any document/example page how can I integrate wicket and TinyMCE
explained detailed. Do you know is there any documentation or example
about this subject?

There are some examples for it:

https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/tinymce-
parent/tinymce-examples


Thanks, br.
Ramazan

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



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


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: 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: Wicket - TinyMCE/FckEditor

2011-08-01 Thread Chris Colman
Unfortunately we're using some features of FckEditor that don't seem to
be supported by Visural. The main one is the support of images and being
able to specify an image provider that can provide the user with a
list of images available to choose from. The developer can define
virtually any implementation they want of the image provider.

If that sort of thing were available today we'd really like to move to
Visural.
 
-Original Message-
From: Josh Kamau [mailto:joshnet2...@gmail.com]
Sent: Tuesday, 2 August 2011 3:34 PM
To: users@wicket.apache.org
Subject: Re: Wicket - TinyMCE/FckEditor

Hi Michal,

If you want a really nice and simple Rich Text Editor, take a look at
visural-wicket project.

Here is the link to the demos - http://wicket.visural.net/examples/app/

regards.
Josh.

On Tue, Aug 2, 2011 at 8:27 AM, Chris Colman
chr...@stepaheadsoftware.comwrote:

 Are there any examples of Wicket integrated with FckEditor (the one
 before CkEditor)?

 -Original Message-
 From: Michal Letynski [mailto:m...@consol.ae]
 Sent: Tuesday, 2 August 2011 3:25 PM
 To: users@wicket.apache.org
 Subject: Re: Wicket - TinyMCE
 
 Hi.
 W dniu 2011-08-02 04:29, ramazan pekin pisze:
  Hi to everyone,
 
  I am looking for rich text editor and I found TinyMCE. But I
couldnt
  find any document/example page how can I integrate wicket and
TinyMCE
  explained detailed. Do you know is there any documentation or
example
  about this subject?
 There are some examples for it:
 

https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/tinymce-
 parent/tinymce-examples
 
  Thanks, br.
  Ramazan
 
 
-
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

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


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



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