Re: Internationalization: dynamic message for feedback Panel

2010-12-03 Thread Eugene Malan
I just happened to be in that part of my code , so here goes :

MapString, String map = new HashMapString, String();
map.put(username, user.getDisplayName);
MapModelString, String values = new MapModelString, String(map);
String message = getLocalizer().getString(deleteConfirm, values);
etc...
--
Eugene

On 03 Dec 2010, at 8:01 AM, Ernesto Reinaldo Barreiro wrote:

 What do you want to use instead? A map? I think it will also work with
 a map: map.put(name, Bla Bla). If not I think old Java style
 properties  are also supported (thought I'm not 100% sure)
 
 property = The user {0} will be deleted. Proceed?
 
 and then passing an array of Object.
 
 Ernesto
 
 
 On Fri, Dec 3, 2010 at 1:47 PM, sap2000 sap2...@indiatimes.com wrote:
 
 ok. thank you.
 but is there any way when you don't have a bean?
 
 - Shantanu
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Internationalization-dynamic-message-for-feedback-Panel-tp3070945p3071012.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: Internationalization: dynamic message for feedback Panel

2010-12-03 Thread Eugene Malan
I just happened to be in that part of my code , so here goes :

MapString, String map = new HashMapString, String();
map.put(username, user.getDisplayName);
MapModelString, String values = new MapModelString, String(map);
String message = getLocalizer().getString(deleteConfirm, values);
etc...
--
Eugene

On 03 Dec 2010, at 8:01 AM, Ernesto Reinaldo Barreiro wrote:

 What do you want to use instead? A map? I think it will also work with
 a map: map.put(name, Bla Bla). If not I think old Java style
 properties  are also supported (thought I'm not 100% sure)
 
 property = The user {0} will be deleted. Proceed?
 
 and then passing an array of Object.
 
 Ernesto
 
 
 On Fri, Dec 3, 2010 at 1:47 PM, sap2000 sap2...@indiatimes.com wrote:
 
 ok. thank you.
 but is there any way when you don't have a bean?
 
 - Shantanu
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Internationalization-dynamic-message-for-feedback-Panel-tp3070945p3071012.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: IMarkupResourceStreamProvider for ListView

2010-12-03 Thread Eugene Malan
You might want to check that you are adding your components in the correct 
place, hierarchically speaking...

I always forget to add elements to the item like so...

protected abstract void populateItem(final ListItemT item){
item.add(new Component(...));  -- correct
add(new Component(...)); --- WRONG


I imagine getMarkupResourceStream is not called because one of the validations 
that check the tree of components failed.

--
Eugene

On 03 Dec 2010, at 9:36 AM, alex shubert wrote:

 Hello
 
 I got the following error trying to provide custom render for ListView
 WicketMessage: The component(s) below failed to render. A common problem is 
 that you have added a component in code but forgot to reference it in the 
 markup (thus the component will never be rendered).
 
 New class  signature is
 private abstract class EnumListViewT extends ListViewT implements
 IMarkupResourceStreamProvider
 
 I was sure getMarkupResourceStream will be called then EnumListView is
 to be added to a page.
 But it never happens, debug pointer never suspends execution at this point.
 
 What may be wrong? (except my English ofc)
 
 -- 
 Best regards
 Alex
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



Re: IMarkupResourceStreamProvider for ListView

2010-12-03 Thread Eugene Malan
Alex, please ignore me listen to Martin. My english reading skills need 
improving :-)
On 03 Dec 2010, at 9:47 AM, Eugene Malan wrote:

 You might want to check that you are adding your components in the correct 
 place, hierarchically speaking...
 
 I always forget to add elements to the item like so...
 
 protected abstract void populateItem(final ListItemT item){
item.add(new Component(...));  -- correct
add(new Component(...)); --- WRONG
 
 
 I imagine getMarkupResourceStream is not called because one of the 
 validations that check the tree of components failed.
 
 --
 Eugene
 
 On 03 Dec 2010, at 9:36 AM, alex shubert wrote:
 
 Hello
 
 I got the following error trying to provide custom render for ListView
 WicketMessage: The component(s) below failed to render. A common problem 
 is that you have added a component in code but forgot to reference it in 
 the markup (thus the component will never be rendered).
 
 New class  signature is
 private abstract class EnumListViewT extends ListViewT implements
 IMarkupResourceStreamProvider
 
 I was sure getMarkupResourceStream will be called then EnumListView is
 to be added to a page.
 But it never happens, debug pointer never suspends execution at this point.
 
 What may be wrong? (except my English ofc)
 
 -- 
 Best regards
 Alex
 
 -
 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 question

2010-12-01 Thread Eugene Malan
I took a look at the site and I have started implementing something similar.

I use a normal non-wicket form on the home page that posts to my mounted wicket 
page with the login form on it. I mounted my login registration page to 
memberRegistration

form method=post action=memberRegistration
label for=userUser/label
input id=user type=text name=user
label for=pwdPassword/label
input id=pwd type=password name=pwd
input class=button value=Log in type=submit
/form

http://croptrak.emalan.com/Home

--
Eugene


On 01 Dec 2010, at 11:23 AM, 96silvia wrote:

 
 I have this wicket form I want to use wicket to pass the phone number and
 contact email.
 
 wicket:extend
 form wicket:id=test method=post action=http://www.mypage.com;
 input type=hidden wicket:id =phoneNumber name=phoneNumber
 input type=hidden wicket:id =contactEmail name=email
 /form
 /wicket:extend
 
 my question is my java code passes the correct parameters for the phone
 number and the contact email.
 but overwrites the form action and places
 wicket:interface=:10:opcForward::IFormSubmitListener:: I don't want this
 to happen I need to post these values to www.mypage.com 
 
 is there a way to do this?
 I am using wicket 1.4.5, jdk6
 
 
 -- 
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/wicket-question-tp3067609p3067609.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 question

2010-12-01 Thread Eugene Malan
I see your problem... In my case I am posting from a simple form (no validation 
or pre-populated values) that just needs to pass the parameters to my wicket 
form on a secure page.

So.. it is back to your main question, how to stop the wicket form from posting 
to itself, but to get it to post to different url.

You could try something suggested by Igor

http://apache-wicket.1842946.n4.nabble.com/RelativePathPrefixHandler-and-form-quot-action-quot-attributes-td1867803.html

override oncomponenttag() of the form and call super followed by 
tag.put(action, whateverurl); 

-igor 
-

On 01 Dec 2010, at 12:26 PM, 96silvia wrote:

 
 the problem is the hidden input values are coming from a wicket session. so
 if I use a non wicket form how do I get the values from a wicket session to
 the non wicket form?
 -- 
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/wicket-question-tp3067609p3067719.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: component .... not found on page

2010-02-03 Thread Eugene Malan

cresc,

Make sure you do not have any broken links in your header section,  
like the one I had.



link rel=shortcut icon href= type=images/x-icon /


It is broken because there is a space in the rel=  part of it.

Also make sure you do not have empty image src   img src=/  (per :  
Thomas Kappler )



You could also add a debug points to check if you are getting page  
reloads (This was my problem). So if you see the debug twice when  
there should only be one --- then you know the page is reloading.


@Override
protected void onBeforeRender() {
log.debug(Page is being rendered: + getPage());
super.onBeforeRender();
}

Good luck...

--
Eugene

On 02 Feb 2010, at 8:45 PM, cresc wrote:



I am sorry, I did not understand the solution. I searched for  
quickstart in

jira issue but found one link which says to use patch
https://issues.apache.org/jira/secure/attachment/12417508/WICKET-2404-1.4.patch

So I modified my html tag in homepage to
html
xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd 


But still not resovled..

Can you give me more details...

- cresc
--
View this message in context: 
http://old.nabble.com/component--not-found-on-page-tp27421536p27430297.html
Sent from the Wicket - User 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: component .... not found on page

2010-02-02 Thread Eugene Malan
I am wrestling with the same Exception. I think I am doing something  
similar, in that I have a DataView with a link to a detail Page and  
then I return to the list page usingsetResponsePage(returnPage);


Different browsers react differently. On my Mac...
Chrome:  gives the Exception on first load of the page.
Safari: gives Exception after a few renderings of the Page.
Firefox: Cannot re-create the Exception.

What browser are you using?

In my instance it is a Link that cannot be found

item.add(new LinkEntry(entryName, new ModelEntry(entry)){

@Override
public void onClick() {
setResponsePage(new OBOEntryViewPage(entry, getPage()));
}

@Override
	protected void onComponentTagBody(MarkupStream markupStream,  
ComponentTag openTag) {
		replaceComponentTagBody(markupStream, openTag,  
getModelObject().getName());	

}

});


On 02 Feb 2010, at 9:57 AM, cresc wrote:



Forgot to copy the error message.

Root cause:

org.apache.wicket.WicketRuntimeException: component
content-panel:table-container:table-content:tcontainer:list: 
1:viewDetail not
found on page com.mypackage.ordertracking.client.TrackingHomePage[id  
= 3],

listener interface = [RequestListenerInterface name=IBehaviorListener,
method=public abstract void
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
at
org 
.apache 
.wicket 
.request 
.AbstractRequestCycleProcessor 
.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java: 
426)

at
org 
.apache 
.wicket 
.request 
.AbstractRequestCycleProcessor 
.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)

at
org 
.apache 
.wicket 
.protocol 
.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java: 
144)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)

So
--
View this message in context: 
http://old.nabble.com/component--not-found-on-page-tp27421536p27421759.html
Sent from the Wicket - User 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: component .... not found on page

2010-02-02 Thread Eugene Malan

I get the same behavior in  1.4.4  1.4.5  1.4.6

On 02 Feb 2010, at 12:20 PM, Riyad Kalla wrote:


What version of Wicket?

On Tue, Feb 2, 2010 at 10:11 AM, Eugene Malan eug...@emalan.com  
wrote:



I am wrestling with the same Exception. I think I am doing something
similar, in that I have a DataView with a link to a detail Page and  
then I

return to the list page usingsetResponsePage(returnPage);

Different browsers react differently. On my Mac...
Chrome:  gives the Exception on first load of the page.
Safari: gives Exception after a few renderings of the Page.
Firefox: Cannot re-create the Exception.

What browser are you using?

In my instance it is a Link that cannot be found

item.add(new LinkEntry(entryName, new ModelEntry(entry)){

  @Override
  public void onClick() {
  setResponsePage(new OBOEntryViewPage(entry,  
getPage()));

  }

  @Override
  protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) {
  replaceComponentTagBody(markupStream, openTag,
getModelObject().getName());
  }

});



On 02 Feb 2010, at 9:57 AM, cresc wrote:



Forgot to copy the error message.

Root cause:

org.apache.wicket.WicketRuntimeException: component
content-panel:table-container:table-content:tcontainer:list: 
1:viewDetail

not
found on page  
com.mypackage.ordertracking.client.TrackingHomePage[id = 3],
listener interface = [RequestListenerInterface  
name=IBehaviorListener,

method=public abstract void
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
at

org 
.apache 
.wicket 
.request 
.AbstractRequestCycleProcessor 
.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java: 
426)

at

org 
.apache 
.wicket 
.request 
.AbstractRequestCycleProcessor 
.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)

at

org 
.apache 
.wicket 
.protocol 
.http 
.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)

So
--
View this message in context:
http://old.nabble.com/component--not-found-on-page-tp27421536p27421759.html
Sent from the Wicket - User 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: component .... not found on page

2010-02-02 Thread Eugene Malan
Of course the quickstart worked just fine, so I had to add the layers  
of junk back on to find out where it was going wrong.


Eventually the last thing I added back on was the cause   a broken  
link in the head section.

link rel=shortcut icon href= type=images/x-icon /

Lesson : Make sure you have valid html.  It can manifest itself in non- 
obvious ways...


--
Eugene

PS To the Core Wicket devs ---  Thanks for your hard-work, you make  
people like me look good as we churn out features quickly.



On 02 Feb 2010, at 1:02 PM, Igor Vaynberg wrote:


jira issue, quickstart...

-igor

On Tue, Feb 2, 2010 at 9:31 AM, Eugene Malan eug...@emalan.com  
wrote:

I get the same behavior in  1.4.4  1.4.5  1.4.6

On 02 Feb 2010, at 12:20 PM, Riyad Kalla wrote:


What version of Wicket?

On Tue, Feb 2, 2010 at 10:11 AM, Eugene Malan eug...@emalan.com  
wrote:


I am wrestling with the same Exception. I think I am doing  
something
similar, in that I have a DataView with a link to a detail Page  
and then

I
return to the list page usingsetResponsePage(returnPage);

Different browsers react differently. On my Mac...
Chrome:  gives the Exception on first load of the page.
Safari: gives Exception after a few renderings of the Page.
Firefox: Cannot re-create the Exception.

What browser are you using?

In my instance it is a Link that cannot be found

item.add(new LinkEntry(entryName, new ModelEntry(entry)){

 @Override
 public void onClick() {
 setResponsePage(new OBOEntryViewPage(entry,  
getPage()));

 }

 @Override
 protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) {
 replaceComponentTagBody(markupStream, openTag,
getModelObject().getName());
 }

});



On 02 Feb 2010, at 9:57 AM, cresc wrote:



Forgot to copy the error message.

Root cause:

org.apache.wicket.WicketRuntimeException: component
content-panel:table-container:table-content:tcontainer:list: 
1:viewDetail

not
found on page  
com.mypackage.ordertracking.client.TrackingHomePage[id =

3],
listener interface = [RequestListenerInterface  
name=IBehaviorListener,

method=public abstract void
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
at


org 
.apache 
.wicket 
.request 
.AbstractRequestCycleProcessor 
.resolveListenerInterfaceTarget 
(AbstractRequestCycleProcessor.java:426)

at


org 
.apache 
.wicket 
.request 
.AbstractRequestCycleProcessor 
.resolveRenderedPage(AbstractRequestCycleProcessor.java:471)

at


org 
.apache 
.wicket 
.protocol 
.http 
.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java: 
144)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)

So
--
View this message in context:

http://old.nabble.com/component--not-found-on-page-tp27421536p27421759.html
Sent from the Wicket - User 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




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




Re: Updating Form Elements by Ajax with new POJO-Model

2009-12-16 Thread Eugene Malan

Try replacing the Model's object instead of the actual Model.

	private EditFormModel editFormModel = new  
CompoundPropertyModelFunctionsbereich(el);


replace
//f.setModel(new CompoundPropertyModelFunctionsbereich(el));
editFormModel.setObject(el);


On 16 Dec 2009, at 6:27 AM, Martin U wrote:


Iam totally confused.

Iam using the Todo-List-Example from here :
http://www.wicket-library.com/wicket-examples/ajax/todo-list.0
to play around with wicket.

This example works, but i want to display a list of Entities from the
Backend and edit one of them with my new-entity-Form.
So i want to click on edit in a row and want to use the *same*  
*form *as i

use to add a entity. How could i handle this?

I tried sooo much but nothing works right.


The addForm (showForm(target)) function works right. But in public  
void

showForm(AjaxRequestTarget _t, Functionsbereich el)
i deliver el which is my POJO and i cant figure out how to treat  
the Form

to use now my new Model...
I tried with modelChange() und mondelChanging() but nothing works  
=( allways

the empty Form is shown ;(

Thanks a lot for any help!!

   private final class FormContainer extends WebMarkupContainer{

   private EditForm f;

   public FormContainer(String id) {
   super(id);
   setOutputMarkupId(true);


   add(f = (EditForm) new EditForm(form).setVisible(false));
   add(new AjaxFallbackLinkObject(link){

   @Override
   public void onClick(AjaxRequestTarget target) {
   showForm(target);
   }

   });
   }

   public void showForm(AjaxRequestTarget _t){
   f.setVisible(true);
   _t.addComponent(this);

   }

   /** Shows form with entity **/
   public void showForm(AjaxRequestTarget _t, Functionsbereich  
el){

//add(f = new EditForm(link, el));
   f.modelChanging();
   f.setModel(new  
CompoundPropertyModelFunctionsbereich(el));



   f.modelChanged();
   f.setVisible(true);

   _t.addComponent(this);

   }


   }

   private final class EditForm extends FormFunctionsbereich{

   public EditForm(String id){
   this(id, new CompoundPropertyModelFunctionsbereich(new
Functionsbereich()));
   }

   public EditForm(String id, Functionsbereich _el){
   super(id,new  
CompoundPropertyModelFunctionsbereich(_el) );

   }

   public EditForm(String id,  
CompoundPropertyModelFunctionsbereich

_model) {
   super(id, _model);


   setOutputMarkupId(true);
   add( new TextFieldObject(form_text,  
_model.bind(label)));


   //add(new Label(vendor, _model.bind(vendor.name)));


   }

   }



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



Re: Updating Form Elements by Ajax with new POJO-Model

2009-12-16 Thread Eugene Malan
I think you might have to use setVisibilityAllowed(true), otherwise  
the html does not make it onto the page.

Maybe this is better...

	f = new EditFormFunctionsbereich(form,new  
CompoundPropertyModelFunctionsbereich(el));

f.setVisible(false);
f.setVisibilityAllowed(true);

and then for Ajax...

f.setModelObject(e);

On 16 Dec 2009, at 7:09 AM, Eugene Malan wrote:


Try replacing the Model's object instead of the actual Model.

	private EditFormModel editFormModel = new  
CompoundPropertyModelFunctionsbereich(el);


replace
//f.setModel(new CompoundPropertyModelFunctionsbereich(el));
editFormModel.setObject(el);


On 16 Dec 2009, at 6:27 AM, Martin U wrote:


Iam totally confused.

Iam using the Todo-List-Example from here :
http://www.wicket-library.com/wicket-examples/ajax/todo-list.0
to play around with wicket.

This example works, but i want to display a list of Entities from the
Backend and edit one of them with my new-entity-Form.
So i want to click on edit in a row and want to use the *same*  
*form *as i

use to add a entity. How could i handle this?

I tried sooo much but nothing works right.


The addForm (showForm(target)) function works right. But in  
public void

showForm(AjaxRequestTarget _t, Functionsbereich el)
i deliver el which is my POJO and i cant figure out how to treat  
the Form

to use now my new Model...
I tried with modelChange() und mondelChanging() but nothing works  
=( allways

the empty Form is shown ;(

Thanks a lot for any help!!

  private final class FormContainer extends WebMarkupContainer{

  private EditForm f;

  public FormContainer(String id) {
  super(id);
  setOutputMarkupId(true);


  add(f = (EditForm) new EditForm(form).setVisible(false));
  add(new AjaxFallbackLinkObject(link){

  @Override
  public void onClick(AjaxRequestTarget target) {
  showForm(target);
  }

  });
  }

  public void showForm(AjaxRequestTarget _t){
  f.setVisible(true);
  _t.addComponent(this);

  }

  /** Shows form with entity **/
  public void showForm(AjaxRequestTarget _t, Functionsbereich  
el){

//add(f = new EditForm(link, el));
  f.modelChanging();
  f.setModel(new  
CompoundPropertyModelFunctionsbereich(el));



  f.modelChanged();
  f.setVisible(true);

  _t.addComponent(this);

  }


  }

  private final class EditForm extends FormFunctionsbereich{

  public EditForm(String id){
  this(id, new CompoundPropertyModelFunctionsbereich(new
Functionsbereich()));
  }

  public EditForm(String id, Functionsbereich _el){
  super(id,new  
CompoundPropertyModelFunctionsbereich(_el) );

  }

  public EditForm(String id,  
CompoundPropertyModelFunctionsbereich

_model) {
  super(id, _model);


  setOutputMarkupId(true);
  add( new TextFieldObject(form_text,  
_model.bind(label)));


  //add(new Label(vendor, _model.bind(vendor.name)));


  }

  }



-
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