RE: post request with wicket

2011-05-17 Thread Hielke Hoeve
You need to make an xml envelope, fill that with the right url to call
add arguments for the function, calling something like an ajax url that
returns json data is way quicker.

Hielke

-Original Message-
From: wmike1...@gmail.com [mailto:wmike1...@gmail.com] 
Sent: maandag 16 mei 2011 15:58
To: users@wicket.apache.org
Subject: RE: post request with wicket

I'm just calling a webservice, getting some data that I want to populate
some fields on the page. The soap call as of now is on the server-side,
inside an ajaxLink's onClick() method. Seems to be working fine.

Why would building the request on the cilent be expensive? Expensive in
terms of what?

thanks

--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/post-request-with-wicket-tp35
20861p3526264.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: Ajax and IComponentResolver

2011-05-17 Thread Martin Grigorov
Currently we are at 1.5 RC4. If there are no major problems the next one may
be 1.5 Final.
Final or RC5 it will be out in ~ 3 weeks from now.

Use
https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5when
migrating.
The problem with Request class can be solved with Optimize imports
feature in the IDE.

On Mon, May 16, 2011 at 9:15 PM, Alexandru Artimon 
aarti...@developmentgateway.org wrote:

 I've compiled the latest code from the wicket trunk and when plugging in
 the latest jars into our project I've seen that some changes have to be done
 in order to use wicket 1.5 (like some package names changed, can't find
 org.apache.wicket.Request).

 So I was wandering how far is the 1.5 release ? Because we're usually
 including final versions in our project.

 Thanks,
 Alex


 On 05/16/2011 06:28 PM, Martin Grigorov wrote:

 How to build Wicket is described at
 http://wicket.apache.org/contribute/build.html
 But the patch is only for 1.5. You can't use it in 1.4.

 I recommend you to upgrade.

 On Mon, May 16, 2011 at 5:16 PM, Alexandru Artimon
 aarti...@developmentgateway.org  wrote:

  I can try the patch and test, but I only have the wicket 1.4.17 jars.
 So can I do a code checkout from somewhere? :D
 Or get a jar that has the patch in it ?



 On 05/16/2011 05:50 PM, Martin Grigorov wrote:

  Sounds like https://issues.apache.org/jira/browse/WICKET-3719

 Can you try the patch there and give feedback ?
 If it still fails then a quickstart app or a test case would help us to
 improve it.

 On Mon, May 16, 2011 at 4:43 PM, Alexandru Artimon
 aarti...@developmentgateway.org   wrote:

  Hello,

 I have a custom wicket html tag that is handled by a component resolver
 to
 automatically generate a component for it. And these components only
 exist
 at the render phase and aren't stored in the page tree.

 Now when Ajax is used to update a fragment of the web page, looks like
 the
 components for these wicket html tags were not rendered. So instead of
 getting the desired markup I get only the contents of the original
 markup.

 Might this be a bug? It looks like the component resolver doesn't work
 when
 the response is built for the ajax update.

 Any ideas/workarounds ?

 Thanks again,
 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




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




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


Issue with internationalising the MultiFileUploadField component

2011-05-17 Thread Steve Swinsburg
Hi,

We are having an issue setting some properties to override the default text for 
the MultiFileUploadField component. As per the docs, we have set the following 
in our local properties file:

 org.apache.wicket.mfu.caption.unlimited=Ficheros:
 org.apache.wicket.mfu.caption.limited=Ficheros (m\u00E1ximo ${max}): 
 org.apache.wicket.mfu.delete=Borrar


however they are not being overridden. We know our properties file is working 
because we can override other properties, like:

 workphone.PhoneNumberValidator = N\u00FAmero de tel\u00E9fono no v\u00E1lido

and those come up correctly.

Is this a bug? If not, what might we be missing? 

Wicket 1.4.13

thanks,
steve

Re: Issue with internationalising the MultiFileUploadField component

2011-05-17 Thread Martin Grigorov
Looking at MultiFileUploadField.java these are exactly the keys you have to
use.
Try to put them in MyApp_es.properties

On Tue, May 17, 2011 at 9:31 AM, Steve Swinsburg
steve.swinsb...@gmail.comwrote:

 Hi,

 We are having an issue setting some properties to override the default text
 for the MultiFileUploadField component. As per the docs, we have set the
 following in our local properties file:

  org.apache.wicket.mfu.caption.unlimited=Ficheros:
  org.apache.wicket.mfu.caption.limited=Ficheros (m\u00E1ximo ${max}):
  org.apache.wicket.mfu.delete=Borrar


 however they are not being overridden. We know our properties file is
 working because we can override other properties, like:

  workphone.PhoneNumberValidator = N\u00FAmero de tel\u00E9fono no
 v\u00E1lido

 and those come up correctly.

 Is this a bug? If not, what might we be missing?

 Wicket 1.4.13

 thanks,
 steve




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


Re: FormComponent convertInput for children FormComponets

2011-05-17 Thread Sven Meier

Hi Clint,

move your code into #updateModel() and set the collected list right into 
your model.


Best regards
Sven

On 05/16/2011 11:35 PM, Clint Checketts wrote:

   I have a FormComponentPanel that contains multiple child formcomponent.
The purpose of this panel is to be able to add in several cihldren
dynamically. The end model is supposed to be the list from all the children
component. I get the value in my convertInput() method by iterating over all
the children components, calling each one's getConvertedInput()

Here's the problem, the child component's values haven't convertedTheir
input at that point, so i call 'validate()' on each one to trigger that
coversion.  Is that the right way to approach this? Am i causing
unneeded/duplicate processing?
.

protected void convertInput() {
   final ArrayListT  convertedInputList = new ArrayListT();
   inForm.visitFormComponents(new IVisitor() {
public Object formComponent(IFormVisitorParticipant formComponent) {
 if (formComponent instanceof FormComponent?) {
  FormComponentT  fc = (FormComponentT) formComponent;
  *fc.validate();
* T convertedInput =  *fc.getConvertedInput();
* if(null != convertedInput){
   convertedInputList.add(convertedInput);
  }
 }
 return Component.IVisitor.CONTINUE_TRAVERSAL;
}
   });
   setConvertedInput(convertedInputList);
  }

  Thanks,

-Clint




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



How to access SwitchProtocolRequestTarget

2011-05-17 Thread Philipp
I am currently working on an integration of SSL into our wicket 
application. If pages are accessed, which are annotated with 
@RequireHttps wicket correctly switches to SSL. This is achieved by adding:


/**
 * Returns a HTTPS request cycle processor, if necessary
 */
@Override
protected IRequestCycleProcessor newRequestCycleProcessor()
{

return new HttpsRequestCycleProcessor(getHttpsConfig())
{

@Override
protected IRequestTarget checkSecureIncoming(IRequestTarget 
target)

{
return super.checkSecureIncoming(target);
}

@Override
protected IRequestTarget checkSecureOutgoing(IRequestTarget 
target)

{

return super.checkSecureOutgoing(target);

}

};
}

to the application class (as also indicated by the wicket wiki). Ok - 
everything fine so far.


Now the next requirement is to always stay in SSL mode, if the user is 
logged in. I thought about extending the  methods above and add logic 
such as



@Override
protected IRequestTarget checkSecureIncoming(IRequestTarget 
target)

{

if (userisLoggedIn) {
return 
SwitchProtocolRequestTarget.requireProtocol(Protocol.HTTPS);

}

return super.checkSecureIncoming(target);
}

However, I cannot access the SwitchProtocolRequestTarget class, because 
it is not defined as public.


What would you suggest in this case? Make a local copy of the class 
(which would work). However, that does not seem to be nice Java coding 
to me.


I was wondering what the other members of the mailing list think about it.

Kind regards
Philipp


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



Re: Issue with internationalising the MultiFileUploadField component

2011-05-17 Thread Steve Swinsburg
Yeah, that's where I have them and its not working. Its the same spot we have 
the ones that do work too.

We do use a custom resource loader but I don't understand why it would allow us 
to override some properties from Wicket components, and not others. 

Does the property need to be prefixed with the wicket id or something?

Any ideas? 

Thanks
Steve


Sent from my iPhone

On 17/05/2011, at 17:37, Martin Grigorov mgrigo...@apache.org wrote:

 Looking at MultiFileUploadField.java these are exactly the keys you have to
 use.
 Try to put them in MyApp_es.properties
 
 On Tue, May 17, 2011 at 9:31 AM, Steve Swinsburg
 steve.swinsb...@gmail.comwrote:
 
 Hi,
 
 We are having an issue setting some properties to override the default text
 for the MultiFileUploadField component. As per the docs, we have set the
 following in our local properties file:
 
 org.apache.wicket.mfu.caption.unlimited=Ficheros:
 org.apache.wicket.mfu.caption.limited=Ficheros (m\u00E1ximo ${max}):
 org.apache.wicket.mfu.delete=Borrar
 
 
 however they are not being overridden. We know our properties file is
 working because we can override other properties, like:
 
 workphone.PhoneNumberValidator = N\u00FAmero de tel\u00E9fono no
 v\u00E1lido
 
 and those come up correctly.
 
 Is this a bug? If not, what might we be missing?
 
 Wicket 1.4.13
 
 thanks,
 steve
 
 
 
 
 -- 
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/

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



Howto modify css-class prefix of all components on a panel?

2011-05-17 Thread Mike Mander

Hi,

i use a component twice. Layout of first component has to be horizontal 
of second vertical (MainMenu, Sidebar).
Because the component itself provides the layout (horizontal version) i 
run into trouble with vertical layout.
My solution would be to add a prefix to vertical layout component and 
it's children. So i could modify the layout
by css class overriding. But strangely my solution is not working (= no 
prefix in any component child).


Modifier for css class
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.model.Model;

public class FirstCssClassDecorator extends AttributeModifier {

public FirstCssClassDecorator(String prefix) {
super(class, Model.String of(prefix));
}

@Override
protected String newValue(String currentValue, String 
replacementValue) {

  // Here add sidebar- to current css class
  return replacementValue.concat(currentValue);
}
}

Visitor for appending FirstCssClassDecorator to all children
import org.apache.wicket.Component;
import org.apache.wicket.Component.IVisitor;
import org.apache.wicket.MarkupContainer;

public class FirstCssClassDecorationVisitor implements IVisitorComponent {

private final String _prefix;

public FirstCssClassDecorationVisitor(String prefix) {
_prefix = prefix;
}

@Override
public Object component(Component component) {
if (component instanceof MarkupContainer) {
((MarkupContainer) component).visitChildren(new 
FirstCssClassDecorationVisitor(_prefix));

}
component.add(new FirstCssClassDecorator(String.valueOf(_prefix)));
return CONTINUE_TRAVERSAL;
}
}

I've added the visitor
visitChildren(new FirstCssClassDecorationVisitor(sidebar-));
+ in sidebar Constructor
+ in sidebar onConfigure
+ in Page Constructor

But all did the same - no sidebar-xyz class in Markup.

What am i missing here?
Thanks
Mike

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



Re: Issue with internationalising the MultiFileUploadField component

2011-05-17 Thread Martin Grigorov
Enable debug level logging for org.apache.wicket.Localizer and see what is
attempted.

On Tue, May 17, 2011 at 1:37 PM, Steve Swinsburg
steve.swinsb...@gmail.comwrote:

 Yeah, that's where I have them and its not working. Its the same spot we
 have the ones that do work too.

 We do use a custom resource loader but I don't understand why it would
 allow us to override some properties from Wicket components, and not others.

 Does the property need to be prefixed with the wicket id or something?

 Any ideas?

 Thanks
 Steve


 Sent from my iPhone

 On 17/05/2011, at 17:37, Martin Grigorov mgrigo...@apache.org wrote:

  Looking at MultiFileUploadField.java these are exactly the keys you have
 to
  use.
  Try to put them in MyApp_es.properties
 
  On Tue, May 17, 2011 at 9:31 AM, Steve Swinsburg
  steve.swinsb...@gmail.comwrote:
 
  Hi,
 
  We are having an issue setting some properties to override the default
 text
  for the MultiFileUploadField component. As per the docs, we have set the
  following in our local properties file:
 
  org.apache.wicket.mfu.caption.unlimited=Ficheros:
  org.apache.wicket.mfu.caption.limited=Ficheros (m\u00E1ximo ${max}):
  org.apache.wicket.mfu.delete=Borrar
 
 
  however they are not being overridden. We know our properties file is
  working because we can override other properties, like:
 
  workphone.PhoneNumberValidator = N\u00FAmero de tel\u00E9fono no
  v\u00E1lido
 
  and those come up correctly.
 
  Is this a bug? If not, what might we be missing?
 
  Wicket 1.4.13
 
  thanks,
  steve
 
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com http://jweekend.com/

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




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


Re: Howto modify css-class prefix of all components on a panel?

2011-05-17 Thread Andrea Del Bene

Hi Mike,

maybe is not related to your problem, but I think you shouldn't recall 
vistiChildren inside visitor because visitChildren already traverse the 
whole hierarchy of children.




Hi,

i use a component twice. Layout of first component has to be 
horizontal of second vertical (MainMenu, Sidebar).
Because the component itself provides the layout (horizontal version) 
i run into trouble with vertical layout.
My solution would be to add a prefix to vertical layout component and 
it's children. So i could modify the layout
by css class overriding. But strangely my solution is not working (= 
no prefix in any component child).


Modifier for css class
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.model.Model;

public class FirstCssClassDecorator extends AttributeModifier {

public FirstCssClassDecorator(String prefix) {
super(class, Model.String of(prefix));
}

@Override
protected String newValue(String currentValue, String 
replacementValue) {

  // Here add sidebar- to current css class
  return replacementValue.concat(currentValue);
}
}

Visitor for appending FirstCssClassDecorator to all children
import org.apache.wicket.Component;
import org.apache.wicket.Component.IVisitor;
import org.apache.wicket.MarkupContainer;

public class FirstCssClassDecorationVisitor implements 
IVisitorComponent {


private final String _prefix;

public FirstCssClassDecorationVisitor(String prefix) {
_prefix = prefix;
}

@Override
public Object component(Component component) {
if (component instanceof MarkupContainer) {
((MarkupContainer) component).visitChildren(new 
FirstCssClassDecorationVisitor(_prefix));

}
component.add(new 
FirstCssClassDecorator(String.valueOf(_prefix)));

return CONTINUE_TRAVERSAL;
}
}

I've added the visitor
visitChildren(new FirstCssClassDecorationVisitor(sidebar-));
+ in sidebar Constructor
+ in sidebar onConfigure
+ in Page Constructor

But all did the same - no sidebar-xyz class in Markup.

What am i missing here?
Thanks
Mike

-
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: MarkupNotFoundException strange behavior

2011-05-17 Thread Tito
Yes Clint. In fact extends from BasePage wich extends from WebPage. But the
point is, it's working except for one user y one computer.

Andrea, It's so weird. I asked user to remove Cookies, to try with anothers
navigators, and to refresh page. Not to clean cache, but while I'm having
this problem in my server (I checked it on log) I think it shouldn't be user
machine. Isn't it?

Thanks!
Tito

2011/5/16 andrea del bene andrea.on@libero.it

 Do you mean that on another computer with the same user you don't get the
 error?
 That sounds weird. Have you tried cleaning cache and temporary files on pc
 that gives error?

  Hi, I'm having this error:

org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html'
 for component 'com.keepcon.web.timetracking.EmployeeDedicationLoad' not
 found. Enable debug messages for org.apache.wicket.util.resource to get a
 list of all filenames tried.: [Page class =
 com.keepcon.web.timetracking.EmployeeDedicationLoad, id = 0, version = 0]
 Usually It's because html doesn't exist. But my application is deployed
 and
 working. Only with one user, and only in his computer (at least for the
 moment) I get this error.

 Does anyone know what could be causing this selective error?

 Thanks in advance

 Tito



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




Re: MarkupNotFoundException strange behavior

2011-05-17 Thread Andrea Del Bene
Is there any software on the infamous machine that could interfere 
with the tcp/ip connection (firewall, antivirus, security suite, etc...) ?

Yes Clint. In fact extends from BasePage wich extends from WebPage. But the
point is, it's working except for one user y one computer.

Andrea, It's so weird. I asked user to remove Cookies, to try with anothers
navigators, and to refresh page. Not to clean cache, but while I'm having
this problem in my server (I checked it on log) I think it shouldn't be user
machine. Isn't it?

Thanks!
Tito

2011/5/16 andrea del beneandrea.on@libero.it


Do you mean that on another computer with the same user you don't get the
error?
That sounds weird. Have you tried cleaning cache and temporary files on pc
that gives error?

  Hi, I'm having this error:

org.apache.wicket.markup.MarkupNotFoundException: Markup of type 'html'
for component 'com.keepcon.web.timetracking.EmployeeDedicationLoad' not
found. Enable debug messages for org.apache.wicket.util.resource to get a
list of all filenames tried.: [Page class =
com.keepcon.web.timetracking.EmployeeDedicationLoad, id = 0, version = 0]
Usually It's because html doesn't exist. But my application is deployed
and
working. Only with one user, and only in his computer (at least for the
moment) I get this error.

Does anyone know what could be causing this selective error?

Thanks in advance

Tito



-
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: MarkupNotFoundException strange behavior

2011-05-17 Thread Tito
I don't know, I'm gonna ask him. But I have not access to user machine.
For now, I will still trying to get a more specific information about error.

2011/5/17 Andrea Del Bene adelb...@ciseonweb.it

 Is there any software on the infamous machine that could interfere with
 the tcp/ip connection (firewall, antivirus, security suite, etc...) ?

  Yes Clint. In fact extends from BasePage wich extends from WebPage. But
 the
 point is, it's working except for one user y one computer.

 Andrea, It's so weird. I asked user to remove Cookies, to try with
 anothers
 navigators, and to refresh page. Not to clean cache, but while I'm having
 this problem in my server (I checked it on log) I think it shouldn't be
 user
 machine. Isn't it?

 Thanks!
 Tito

 2011/5/16 andrea del beneandrea.on@libero.it

  Do you mean that on another computer with the same user you don't get the
 error?
 That sounds weird. Have you tried cleaning cache and temporary files on
 pc
 that gives error?

  Hi, I'm having this error:

org.apache.wicket.markup.MarkupNotFoundException: Markup of type
 'html'
 for component 'com.keepcon.web.timetracking.EmployeeDedicationLoad' not
 found. Enable debug messages for org.apache.wicket.util.resource to get
 a
 list of all filenames tried.: [Page class =
 com.keepcon.web.timetracking.EmployeeDedicationLoad, id = 0, version =
 0]
 Usually It's because html doesn't exist. But my application is deployed
 and
 working. Only with one user, and only in his computer (at least for the
 moment) I get this error.

 Does anyone know what could be causing this selective error?

 Thanks in advance

 Tito


  -
 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




Last Page visited

2011-05-17 Thread Vitor Granzinoli Vellozo
 

Wicketers,

 

What is the Best way to store the last Page visited? My business need
that to create a Page control to make

a special back action, not the back browser action. In this case, my
application is inside another.

 

Thanks,

Vitor



HeaderContributors, Ajax and IE8

2011-05-17 Thread Nicklas Johnson
(posting this as its own thread rather than burying it in a reply like I did
last time)

Has anyone experienced HeaderContributors being ineffective in IE8 when
added via an ajax event?

The scenario is that a component with an attached Ibehavior which in turn
provides several Javascript HeaderContributors is added to an ajax target
(eg, target.addComponent(fooComponent)).

In Firefox the HeaderContributor seems to be added and evaluated correctly,
and the behavior works as expected.  In IE8, however, the contributed
Javascript appears not to be evaluated.

We are able to work around it by pre-adding the HeaderContributors to the
page (thus prior to the ajax event being fired), but that's kind of a messy
solution... Would rather see IE8 doing the right thing.

(Still need to get up to the latest 1.4, so it's possible that this problem
has already been addressed, though I'm curious if it is or was a known
problem with that dreadful browser.)

   Nick
-- 
Nicklas Johnson -=- N6OL
TXBU Software Engineer
Ask is not a noun.  You mean request, requirement, or question.



Re: Last Page visited

2011-05-17 Thread Igor Vaynberg
you can pass PageReference objects around. see Page#getPageReference()

-igor

On Tue, May 17, 2011 at 7:38 AM, Vitor Granzinoli Vellozo
vitor.vell...@cpmbraxis.com wrote:


 Wicketers,



 What is the Best way to store the last Page visited? My business need
 that to create a Page control to make

 a special back action, not the back browser action. In this case, my
 application is inside another.



 Thanks,

 Vitor



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



RES: Last Page visited

2011-05-17 Thread Vitor Granzinoli Vellozo

Igor,

I had a problem with getPageReference().
I need go back to the preview page. So, from the Page2, go to Page1. The 
getPageReference() method
do not gave me preview Page. It gave me the same Page.

Is there a way to get the Page.class reference of the preview Page?

The code I've tested getPageReference() is:

PageReference reference = getPage().getPageReference();
setResponsePage(reference.getPage());

Some ligth?


Thanks a lot,
Vitor



-Mensagem original-
De: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Enviada em: terça-feira, 17 de maio de 2011 13:40
Para: users@wicket.apache.org
Assunto: Re: Last Page visited

you can pass PageReference objects around. see Page#getPageReference()

-igor

On Tue, May 17, 2011 at 7:38 AM, Vitor Granzinoli Vellozo
vitor.vell...@cpmbraxis.com wrote:


 Wicketers,



 What is the Best way to store the last Page visited? My business need
 that to create a Page control to make

 a special back action, not the back browser action. In this case, my
 application is inside another.



 Thanks,

 Vitor



-
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: Last Page visited

2011-05-17 Thread Martin Grigorov
The idea is :

setResponsePage(new NewPage(getPageReference()))

later in NewPage you can do:
Link linkToPreviousPage = new BookmarkablePageLink(link,
previousPageRef.getPage().getClass())

On Tue, May 17, 2011 at 7:11 PM, Vitor Granzinoli Vellozo 
vitor.vell...@cpmbraxis.com wrote:


 Igor,

 I had a problem with getPageReference().
 I need go back to the preview page. So, from the Page2, go to Page1. The
 getPageReference() method
 do not gave me preview Page. It gave me the same Page.

 Is there a way to get the Page.class reference of the preview Page?

 The code I've tested getPageReference() is:

 PageReference reference = getPage().getPageReference();
 setResponsePage(reference.getPage());

 Some ligth?


 Thanks a lot,
 Vitor



 -Mensagem original-
 De: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Enviada em: terça-feira, 17 de maio de 2011 13:40
 Para: users@wicket.apache.org
 Assunto: Re: Last Page visited

 you can pass PageReference objects around. see Page#getPageReference()

 -igor

 On Tue, May 17, 2011 at 7:38 AM, Vitor Granzinoli Vellozo
 vitor.vell...@cpmbraxis.com wrote:
 
 
  Wicketers,
 
 
 
  What is the Best way to store the last Page visited? My business need
  that to create a Page control to make
 
  a special back action, not the back browser action. In this case, my
  application is inside another.
 
 
 
  Thanks,
 
  Vitor
 
 

 -
 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 http://jweekend.com/


Re: Last Page visited

2011-05-17 Thread Martin Grigorov
On Tue, May 17, 2011 at 7:18 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 The idea is :

 setResponsePage(new NewPage(getPageReference()))

 later in NewPage you can do:
 Link linkToPreviousPage = new BookmarkablePageLink(link,
 previousPageRef.getPage().getClass())


Or even : setResponsePage(previousPageRef.getPage())



 On Tue, May 17, 2011 at 7:11 PM, Vitor Granzinoli Vellozo 
 vitor.vell...@cpmbraxis.com wrote:


 Igor,

 I had a problem with getPageReference().
 I need go back to the preview page. So, from the Page2, go to Page1. The
 getPageReference() method
 do not gave me preview Page. It gave me the same Page.

 Is there a way to get the Page.class reference of the preview Page?

 The code I've tested getPageReference() is:

 PageReference reference = getPage().getPageReference();
 setResponsePage(reference.getPage());

 Some ligth?


 Thanks a lot,
 Vitor



 -Mensagem original-
 De: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Enviada em: terça-feira, 17 de maio de 2011 13:40
 Para: users@wicket.apache.org
 Assunto: Re: Last Page visited

 you can pass PageReference objects around. see Page#getPageReference()

 -igor

 On Tue, May 17, 2011 at 7:38 AM, Vitor Granzinoli Vellozo
 vitor.vell...@cpmbraxis.com wrote:
 
 
  Wicketers,
 
 
 
  What is the Best way to store the last Page visited? My business need
  that to create a Page control to make
 
  a special back action, not the back browser action. In this case, my
  application is inside another.
 
 
 
  Thanks,
 
  Vitor
 
 

 -
 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 http://jweekend.com/




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


RES: Last Page visited

2011-05-17 Thread Vitor Granzinoli Vellozo

Martin,

It not works.

I did: setResponsePage(getPage().getPageReference().getPage());

My structure is:

Page (a separated class)
   |- Form (a separated class)
 |- Button (a separated class BackButton)


Each component is a separated class in our application.


The Button code is:

public class BackButton extends Button {

public BackButton(String id) {
super(id);
setDefaultFormProcessing(false); // because it is inside a form 
and cannot make submit forward
}

@Override
public void onSubmit() {
setResponsePage(getPage().getPageReference().getPage());
}

}


On debug, the inspect of the first getPage() is the same Page as 
getPage().getPageReference().getPage().
In the class BackButton I do not have direct access at getPageReference().

I Just need know the preview Page, and don't care witch Page is, because the 
business rules can create different
paths to the user.

Thanks a lot again!
Vitor



-Mensagem original-
De: Martin Grigorov [mailto:mgrigo...@apache.org] 
Enviada em: terça-feira, 17 de maio de 2011 14:19
Para: users@wicket.apache.org
Assunto: Re: Last Page visited

On Tue, May 17, 2011 at 7:18 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 The idea is :

 setResponsePage(new NewPage(getPageReference()))

 later in NewPage you can do:
 Link linkToPreviousPage = new BookmarkablePageLink(link,
 previousPageRef.getPage().getClass())


Or even : setResponsePage(previousPageRef.getPage())



 On Tue, May 17, 2011 at 7:11 PM, Vitor Granzinoli Vellozo 
 vitor.vell...@cpmbraxis.com wrote:


 Igor,

 I had a problem with getPageReference().
 I need go back to the preview page. So, from the Page2, go to Page1. The
 getPageReference() method
 do not gave me preview Page. It gave me the same Page.

 Is there a way to get the Page.class reference of the preview Page?

 The code I've tested getPageReference() is:

 PageReference reference = getPage().getPageReference();
 setResponsePage(reference.getPage());

 Some ligth?


 Thanks a lot,
 Vitor



 -Mensagem original-
 De: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Enviada em: terça-feira, 17 de maio de 2011 13:40
 Para: users@wicket.apache.org
 Assunto: Re: Last Page visited

 you can pass PageReference objects around. see Page#getPageReference()

 -igor

 On Tue, May 17, 2011 at 7:38 AM, Vitor Granzinoli Vellozo
 vitor.vell...@cpmbraxis.com wrote:
 
 
  Wicketers,
 
 
 
  What is the Best way to store the last Page visited? My business need
  that to create a Page control to make
 
  a special back action, not the back browser action. In this case, my
  application is inside another.
 
 
 
  Thanks,
 
  Vitor
 
 

 -
 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 http://jweekend.com/




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


Re: Last Page visited

2011-05-17 Thread Martin Grigorov
Read carefully my examples.

On Tue, May 17, 2011 at 7:31 PM, Vitor Granzinoli Vellozo 
vitor.vell...@cpmbraxis.com wrote:


 Martin,

 It not works.

 I did: setResponsePage(getPage().getPageReference().getPage());

 My structure is:

 Page (a separated class)
   |- Form (a separated class)
 |- Button (a separated class BackButton)


 Each component is a separated class in our application.


 The Button code is:

 public class BackButton extends Button {

public BackButton(String id) {
super(id);
setDefaultFormProcessing(false); // because it is inside a
 form and cannot make submit forward
}

@Override
public void onSubmit() {
setResponsePage(getPage().getPageReference().getPage());
}

 }


 On debug, the inspect of the first getPage() is the same Page as
 getPage().getPageReference().getPage().
 In the class BackButton I do not have direct access at getPageReference().

 I Just need know the preview Page, and don't care witch Page is, because
 the business rules can create different
 paths to the user.

 Thanks a lot again!
 Vitor



 -Mensagem original-
 De: Martin Grigorov [mailto:mgrigo...@apache.org]
 Enviada em: terça-feira, 17 de maio de 2011 14:19
 Para: users@wicket.apache.org
 Assunto: Re: Last Page visited

 On Tue, May 17, 2011 at 7:18 PM, Martin Grigorov mgrigo...@apache.org
 wrote:

  The idea is :
 
  setResponsePage(new NewPage(getPageReference()))
 
  later in NewPage you can do:
  Link linkToPreviousPage = new BookmarkablePageLink(link,
  previousPageRef.getPage().getClass())
 

 Or even : setResponsePage(previousPageRef.getPage())

 
 
  On Tue, May 17, 2011 at 7:11 PM, Vitor Granzinoli Vellozo 
  vitor.vell...@cpmbraxis.com wrote:
 
 
  Igor,
 
  I had a problem with getPageReference().
  I need go back to the preview page. So, from the Page2, go to Page1. The
  getPageReference() method
  do not gave me preview Page. It gave me the same Page.
 
  Is there a way to get the Page.class reference of the preview Page?
 
  The code I've tested getPageReference() is:
 
  PageReference reference = getPage().getPageReference();
  setResponsePage(reference.getPage());
 
  Some ligth?
 
 
  Thanks a lot,
  Vitor
 
 
 
  -Mensagem original-
  De: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
  Enviada em: terça-feira, 17 de maio de 2011 13:40
  Para: users@wicket.apache.org
  Assunto: Re: Last Page visited
 
  you can pass PageReference objects around. see Page#getPageReference()
 
  -igor
 
  On Tue, May 17, 2011 at 7:38 AM, Vitor Granzinoli Vellozo
  vitor.vell...@cpmbraxis.com wrote:
  
  
   Wicketers,
  
  
  
   What is the Best way to store the last Page visited? My business need
   that to create a Page control to make
  
   a special back action, not the back browser action. In this case, my
   application is inside another.
  
  
  
   Thanks,
  
   Vitor
  
  
 
  -
  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 http://jweekend.com/
 
 


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




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


Re: Wicket 1.5 IComponentInstantiationListener VS AutolinkBookmarkablePageLink

2011-05-17 Thread nino martinez wael
I'll produce one as fast as possible..

2011/5/16 Igor Vaynberg igor.vaynb...@gmail.com:
 i think the quickstart goes without saying... :)

 -igor

 On Mon, May 16, 2011 at 8:24 AM, Martin Grigorov mgrigo...@apache.org wrote:
 with a proper quickstart because fast check shows that
 bookmarkablePageLink#getPageClass() returns null and this seems to be
 impossible since there is a check for null in the constructor

 On Mon, May 16, 2011 at 5:18 PM, Igor Vaynberg 
 igor.vaynb...@gmail.comwrote:

 these reports should go into jira

 -igor


 On Sun, May 15, 2011 at 11:40 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
  Hi
 
  Essentially I just want to hide all links leading to unauthorized pages.
 
  I get exceptions when I do this in my AuthenticatedWebApplication,
  there are no exceptions when I run the app without the part below:
 
  protected void init() {
                 super.init();
                 getComponentInstantiationListeners().add(
                                 new IComponentInstantiationListener() {
 
                                         @Override
                                         public void
 onInstantiation(Component arg0) {
                                                 if
 (AutolinkBookmarkablePageLink.class
 
  .isAssignableFrom(arg0.getClass())) {
 
  AutolinkBookmarkablePageLink link = AutolinkBookmarkablePageLink.class
 
  .cast(arg0);
                                                         Boolean
 shouldRender = CCAdminSession
 
  .get()
 
  .getAuthorizationStrategy()
 
  .isInstantiationAuthorized(
 
              link.getPageClass());
 
  arg0.setVisible(shouldRender);
 
                                                 }
                                         }
                                 });
 
 
 
  Exception:
 
  2011-05-16 08:37:03,968 ERROR
  [org.apache.wicket.DefaultExceptionMapper]  - Unexpected error
  occurred
  org.apache.wicket.WicketRuntimeException: Exception in rendering
  component: [TransparentWebMarkupContainer [Component id =
  _wicket_link-8]]
         at
 org.apache.wicket.Component.internalRenderComponent(Component.java:2590)
         at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1491)
         at org.apache.wicket.Component.internalRender(Component.java:2394)
         at org.apache.wicket.Component.render(Component.java:2322)
         at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1425)
         at
 org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1553)
         at org.apache.wicket.Page.onRender(Page.java:989)
         at org.apache.wicket.Component.internalRender(Component.java:2394)
         at org.apache.wicket.Component.render(Component.java:2322)
         at org.apache.wicket.Page.renderPage(Page.java:1120)
         at
 org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
         at
 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:218)
         at
 org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:139)
         at
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:718)
         at
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
         at
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
         at
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
         at
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:138)
         at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
         at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
         at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
         at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
         at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
         at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
         at
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
         at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
         at org.mortbay.jetty.Server.handle(Server.java:326)
         at
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
         at
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
         at
 org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
         at
 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
         at
 org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
         at
 org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

RES: Last Page visited

2011-05-17 Thread Vitor Granzinoli Vellozo

Martin,

I really read your example, but on the new NewPage(...); I cannot do that, 
because
on the BackButton I wont know witch Page is

The Idea is, put this BackButton throught all application, so it needs to 
discover
from witch page the actual page was called, just it.

I swear I read again and again your example, but I had dificulties to implement 
in my
situation, and I had not success till now.

Do you really understood my problem?

Regards,
Vitor


-Mensagem original-
De: Martin Grigorov [mailto:mgrigo...@apache.org] 
Enviada em: terça-feira, 17 de maio de 2011 14:36
Para: users@wicket.apache.org
Assunto: Re: Last Page visited

Read carefully my examples.

On Tue, May 17, 2011 at 7:31 PM, Vitor Granzinoli Vellozo 
vitor.vell...@cpmbraxis.com wrote:


 Martin,

 It not works.

 I did: setResponsePage(getPage().getPageReference().getPage());

 My structure is:

 Page (a separated class)
   |- Form (a separated class)
 |- Button (a separated class BackButton)


 Each component is a separated class in our application.


 The Button code is:

 public class BackButton extends Button {

public BackButton(String id) {
super(id);
setDefaultFormProcessing(false); // because it is inside a
 form and cannot make submit forward
}

@Override
public void onSubmit() {
setResponsePage(getPage().getPageReference().getPage());
}

 }


 On debug, the inspect of the first getPage() is the same Page as
 getPage().getPageReference().getPage().
 In the class BackButton I do not have direct access at getPageReference().

 I Just need know the preview Page, and don't care witch Page is, because
 the business rules can create different
 paths to the user.

 Thanks a lot again!
 Vitor



 -Mensagem original-
 De: Martin Grigorov [mailto:mgrigo...@apache.org]
 Enviada em: terça-feira, 17 de maio de 2011 14:19
 Para: users@wicket.apache.org
 Assunto: Re: Last Page visited

 On Tue, May 17, 2011 at 7:18 PM, Martin Grigorov mgrigo...@apache.org
 wrote:

  The idea is :
 
  setResponsePage(new NewPage(getPageReference()))
 
  later in NewPage you can do:
  Link linkToPreviousPage = new BookmarkablePageLink(link,
  previousPageRef.getPage().getClass())
 

 Or even : setResponsePage(previousPageRef.getPage())

 
 
  On Tue, May 17, 2011 at 7:11 PM, Vitor Granzinoli Vellozo 
  vitor.vell...@cpmbraxis.com wrote:
 
 
  Igor,
 
  I had a problem with getPageReference().
  I need go back to the preview page. So, from the Page2, go to Page1. The
  getPageReference() method
  do not gave me preview Page. It gave me the same Page.
 
  Is there a way to get the Page.class reference of the preview Page?
 
  The code I've tested getPageReference() is:
 
  PageReference reference = getPage().getPageReference();
  setResponsePage(reference.getPage());
 
  Some ligth?
 
 
  Thanks a lot,
  Vitor
 
 
 
  -Mensagem original-
  De: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
  Enviada em: terça-feira, 17 de maio de 2011 13:40
  Para: users@wicket.apache.org
  Assunto: Re: Last Page visited
 
  you can pass PageReference objects around. see Page#getPageReference()
 
  -igor
 
  On Tue, May 17, 2011 at 7:38 AM, Vitor Granzinoli Vellozo
  vitor.vell...@cpmbraxis.com wrote:
  
  
   Wicketers,
  
  
  
   What is the Best way to store the last Page visited? My business need
   that to create a Page control to make
  
   a special back action, not the back browser action. In this case, my
   application is inside another.
  
  
  
   Thanks,
  
   Vitor
  
  
 
  -
  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 http://jweekend.com/
 
 


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




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


Re: Re: DataTable and FilterToolbar

2011-05-17 Thread Tom Eicher



there is a GoAndClearFilter which can submit the search form afair


Yes, but that ons is meant for use within a form, as you write,
but not within a FilterToolbar embedded in a DataTable.

Or how would you use it / where would you put in a FilterToolbar ?
(The FilterToolbar is below the column headers, and potentially has
a filter component (text input, dropdown, ...) per column, so there
is no room for a clear and go filter)...

Thanks, Tom.

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



Re: Re: DataTable and FilterToolbar

2011-05-17 Thread Igor Vaynberg
it is meant to go into one of the columns. usually there is an
action column and this filter is meant to go with that column. if
you do not have such, simply replicate the functionality - you have
the source.

-igor

On Tue, May 17, 2011 at 11:34 AM, Tom Eicher r...@teicher.net wrote:

 there is a GoAndClearFilter which can submit the search form afair

 Yes, but that ons is meant for use within a form, as you write,
 but not within a FilterToolbar embedded in a DataTable.

 Or how would you use it / where would you put in a FilterToolbar ?
 (The FilterToolbar is below the column headers, and potentially has
 a filter component (text input, dropdown, ...) per column, so there
 is no room for a clear and go filter)...

 Thanks, Tom.

 -
 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: FormComponent convertInput for children FormComponets

2011-05-17 Thread Clint Checketts
Sven,

Having that code in updateModel is too late. The input needs to be converted
and set to make it available to validators. The form processing cycle is
roughly:

1- User submitts the form
2- Required fields are checked for existence
3- Input is converted
4- Validators run
5- Models get updated
6- onSubmit logic fires

I need the logic in the conversion step so it is available in the validation
step.

-Clint

On Tue, May 17, 2011 at 3:06 AM, Sven Meier s...@meiers.net wrote:

 Hi Clint,

 move your code into #updateModel() and set the collected list right into
 your model.

 Best regards
 Sven


 On 05/16/2011 11:35 PM, Clint Checketts wrote:

   I have a FormComponentPanel that contains multiple child formcomponent.
 The purpose of this panel is to be able to add in several cihldren
 dynamically. The end model is supposed to be the list from all the
 children
 component. I get the value in my convertInput() method by iterating over
 all
 the children components, calling each one's getConvertedInput()

 Here's the problem, the child component's values haven't convertedTheir
 input at that point, so i call 'validate()' on each one to trigger that
 coversion.  Is that the right way to approach this? Am i causing
 unneeded/duplicate processing?
 .

 protected void convertInput() {
   final ArrayListT  convertedInputList = new ArrayListT();
   inForm.visitFormComponents(new IVisitor() {
public Object formComponent(IFormVisitorParticipant formComponent) {
 if (formComponent instanceof FormComponent?) {
  FormComponentT  fc = (FormComponentT) formComponent;
  *fc.validate();
 * T convertedInput =  *fc.getConvertedInput();
 * if(null != convertedInput){
   convertedInputList.add(convertedInput);
  }
 }
 return Component.IVisitor.CONTINUE_TRAVERSAL;
}
   });
   setConvertedInput(convertedInputList);
  }

  Thanks,

 -Clint



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




[ANN] Apache Wicket Cookbook Giveaway Contest

2011-05-17 Thread Igor Vaynberg
Packt Publishing has generously allowed me to give away a free copy of
the ebook version of Apache Wicket Cookbook [1], and a free one year
subscription to PacktLib. For details see the announcement [2].

[1] http://link.packtpub.com/AzN8N9
[2] http://wicketinaction.com/2011/05/apache_wicket_cookbook_giveaway_contest/

cheers,
-igor

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



Re: FormComponent convertInput for children FormComponets

2011-05-17 Thread Igor Vaynberg
On Mon, May 16, 2011 at 2:35 PM, Clint Checketts checke...@gmail.com wrote:
  I have a FormComponentPanel that contains multiple child formcomponent.
 The purpose of this panel is to be able to add in several cihldren
 dynamically. The end model is supposed to be the list from all the children
 component. I get the value in my convertInput() method by iterating over all
 the children components, calling each one's getConvertedInput()

 Here's the problem, the child component's values haven't convertedTheir
 input at that point,

are you sure that is correct? all children's convertInput should have
been called before the parent's...

-igor



 so i call 'validate()' on each one to trigger that
 coversion.  Is that the right way to approach this? Am i causing
 unneeded/duplicate processing?
 .

 protected void convertInput() {
  final ArrayListT convertedInputList = new ArrayListT();
  inForm.visitFormComponents(new IVisitor() {
   public Object formComponent(IFormVisitorParticipant formComponent) {
    if (formComponent instanceof FormComponent?) {
     FormComponentT fc = (FormComponentT) formComponent;
     *fc.validate();
 *     T convertedInput =  *fc.getConvertedInput();
 *     if(null != convertedInput){
      convertedInputList.add(convertedInput);
     }
    }
    return Component.IVisitor.CONTINUE_TRAVERSAL;
   }
  });
  setConvertedInput(convertedInputList);
  }

  Thanks,

 -Clint


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



Re: FormComponent convertInput for children FormComponets

2011-05-17 Thread Sven Meier
OK, if you have validators on your FormComponentPanel, my suggestion 
won't work.


Sven

On 05/17/2011 09:28 PM, Clint Checketts wrote:

Sven,

Having that code in updateModel is too late. The input needs to be converted
and set to make it available to validators. The form processing cycle is
roughly:

1- User submitts the form
2- Required fields are checked for existence
3- Input is converted
4- Validators run
5- Models get updated
6- onSubmit logic fires

I need the logic in the conversion step so it is available in the validation
step.

-Clint

On Tue, May 17, 2011 at 3:06 AM, Sven Meiers...@meiers.net  wrote:


Hi Clint,

move your code into #updateModel() and set the collected list right into
your model.

Best regards
Sven


On 05/16/2011 11:35 PM, Clint Checketts wrote:


   I have a FormComponentPanel that contains multiple child formcomponent.
The purpose of this panel is to be able to add in several cihldren
dynamically. The end model is supposed to be the list from all the
children
component. I get the value in my convertInput() method by iterating over
all
the children components, calling each one's getConvertedInput()

Here's the problem, the child component's values haven't convertedTheir
input at that point, so i call 'validate()' on each one to trigger that
coversion.  Is that the right way to approach this? Am i causing
unneeded/duplicate processing?
.

protected void convertInput() {
   final ArrayListT   convertedInputList = new ArrayListT();
   inForm.visitFormComponents(new IVisitor() {
public Object formComponent(IFormVisitorParticipant formComponent) {
 if (formComponent instanceof FormComponent?) {
  FormComponentT   fc = (FormComponentT) formComponent;
  *fc.validate();
* T convertedInput =  *fc.getConvertedInput();
* if(null != convertedInput){
   convertedInputList.add(convertedInput);
  }
 }
 return Component.IVisitor.CONTINUE_TRAVERSAL;
}
   });
   setConvertedInput(convertedInputList);
  }

  Thanks,

-Clint



-
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: Last Page visited

2011-05-17 Thread Jim Pinkham
Well, most browsers already have back button, so I'm not sure why you would
want to re-implement that, but assuming you do, here's one way to do what I
think Martin is suggesting by pass a page reference:

abstract class AbstractBase extends WebPage {
 PageReference priorPage;

 public AbstractBase(PageReference priorPage) {
   this.priorPage = priorPage;
 }
 public PageReference getPriorPage() { return priorPage; }
}

class PageThatNeedsABackButton extends AbstractBase {
 public AnyOtherPage() {
super(getPage());// you need to tell it where 'back' is as
you make each page

add(new Link(id) {
  public void onClick() {
   setResponsePage(getPriorPage());// then later you can
go there
  }
});
 }

Hope that makes sense.  Not a great idea, but hope it helps to experiment
and learn.

-- Jim.

On Tue, May 17, 2011 at 1:43 PM, Vitor Granzinoli Vellozo 
vitor.vell...@cpmbraxis.com wrote:


 Martin,

 I really read your example, but on the new NewPage(...); I cannot do
 that, because
 on the BackButton I wont know witch Page is

 The Idea is, put this BackButton throught all application, so it needs to
 discover
 from witch page the actual page was called, just it.

 I swear I read again and again your example, but I had dificulties to
 implement in my
 situation, and I had not success till now.

 Do you really understood my problem?

 Regards,
 Vitor


 -Mensagem original-
 De: Martin Grigorov [mailto:mgrigo...@apache.org]
 Enviada em: terça-feira, 17 de maio de 2011 14:36
 Para: users@wicket.apache.org
 Assunto: Re: Last Page visited

 Read carefully my examples.

 On Tue, May 17, 2011 at 7:31 PM, Vitor Granzinoli Vellozo 
 vitor.vell...@cpmbraxis.com wrote:

 
  Martin,
 
  It not works.
 
  I did: setResponsePage(getPage().getPageReference().getPage());
 
  My structure is:
 
  Page (a separated class)
|- Form (a separated class)
  |- Button (a separated class BackButton)
 
 
  Each component is a separated class in our application.
 
 
  The Button code is:
 
  public class BackButton extends Button {
 
 public BackButton(String id) {
 super(id);
 setDefaultFormProcessing(false); // because it is inside a
  form and cannot make submit forward
 }
 
 @Override
 public void onSubmit() {
 setResponsePage(getPage().getPageReference().getPage());
 }
 
  }
 
 
  On debug, the inspect of the first getPage() is the same Page as
  getPage().getPageReference().getPage().
  In the class BackButton I do not have direct access at
 getPageReference().
 
  I Just need know the preview Page, and don't care witch Page is, because
  the business rules can create different
  paths to the user.
 
  Thanks a lot again!
  Vitor
 
 
 
  -Mensagem original-
  De: Martin Grigorov [mailto:mgrigo...@apache.org]
  Enviada em: terça-feira, 17 de maio de 2011 14:19
  Para: users@wicket.apache.org
  Assunto: Re: Last Page visited
 
  On Tue, May 17, 2011 at 7:18 PM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
   The idea is :
  
   setResponsePage(new NewPage(getPageReference()))
  
   later in NewPage you can do:
   Link linkToPreviousPage = new BookmarkablePageLink(link,
   previousPageRef.getPage().getClass())
  
 
  Or even : setResponsePage(previousPageRef.getPage())
 
  
  
   On Tue, May 17, 2011 at 7:11 PM, Vitor Granzinoli Vellozo 
   vitor.vell...@cpmbraxis.com wrote:
  
  
   Igor,
  
   I had a problem with getPageReference().
   I need go back to the preview page. So, from the Page2, go to Page1.
 The
   getPageReference() method
   do not gave me preview Page. It gave me the same Page.
  
   Is there a way to get the Page.class reference of the preview Page?
  
   The code I've tested getPageReference() is:
  
   PageReference reference = getPage().getPageReference();
   setResponsePage(reference.getPage());
  
   Some ligth?
  
  
   Thanks a lot,
   Vitor
  
  
  
   -Mensagem original-
   De: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
   Enviada em: terça-feira, 17 de maio de 2011 13:40
   Para: users@wicket.apache.org
   Assunto: Re: Last Page visited
  
   you can pass PageReference objects around. see Page#getPageReference()
  
   -igor
  
   On Tue, May 17, 2011 at 7:38 AM, Vitor Granzinoli Vellozo
   vitor.vell...@cpmbraxis.com wrote:
   
   
Wicketers,
   
   
   
What is the Best way to store the last Page visited? My business
 need
that to create a Page control to make
   
a special back action, not the back browser action. In this case, my
application is inside another.
   
   
   
Thanks,
   
Vitor
   
   
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
   

RES: Last Page visited

2011-05-17 Thread Vitor Granzinoli Vellozo

Jim,

Thanks a lot!
Certainly it will help me!

My application needs a totally different way of navigation, it cannot back 
pages like
browser do, and it have diffent way of navigations, it Will depends of the app 
business,
so I need control by myself.

Thanks!


-Mensagem original-
De: Jim Pinkham [mailto:pinkh...@gmail.com] 
Enviada em: terça-feira, 17 de maio de 2011 17:44
Para: users@wicket.apache.org
Assunto: Re: Last Page visited

Well, most browsers already have back button, so I'm not sure why you would
want to re-implement that, but assuming you do, here's one way to do what I
think Martin is suggesting by pass a page reference:

abstract class AbstractBase extends WebPage {
 PageReference priorPage;

 public AbstractBase(PageReference priorPage) {
   this.priorPage = priorPage;
 }
 public PageReference getPriorPage() { return priorPage; }
}

class PageThatNeedsABackButton extends AbstractBase {
 public AnyOtherPage() {
super(getPage());// you need to tell it where 'back' is as
you make each page

add(new Link(id) {
  public void onClick() {
   setResponsePage(getPriorPage());// then later you can
go there
  }
});
 }

Hope that makes sense.  Not a great idea, but hope it helps to experiment
and learn.

-- Jim.

On Tue, May 17, 2011 at 1:43 PM, Vitor Granzinoli Vellozo 
vitor.vell...@cpmbraxis.com wrote:


 Martin,

 I really read your example, but on the new NewPage(...); I cannot do
 that, because
 on the BackButton I wont know witch Page is

 The Idea is, put this BackButton throught all application, so it needs to
 discover
 from witch page the actual page was called, just it.

 I swear I read again and again your example, but I had dificulties to
 implement in my
 situation, and I had not success till now.

 Do you really understood my problem?

 Regards,
 Vitor


 -Mensagem original-
 De: Martin Grigorov [mailto:mgrigo...@apache.org]
 Enviada em: terça-feira, 17 de maio de 2011 14:36
 Para: users@wicket.apache.org
 Assunto: Re: Last Page visited

 Read carefully my examples.

 On Tue, May 17, 2011 at 7:31 PM, Vitor Granzinoli Vellozo 
 vitor.vell...@cpmbraxis.com wrote:

 
  Martin,
 
  It not works.
 
  I did: setResponsePage(getPage().getPageReference().getPage());
 
  My structure is:
 
  Page (a separated class)
|- Form (a separated class)
  |- Button (a separated class BackButton)
 
 
  Each component is a separated class in our application.
 
 
  The Button code is:
 
  public class BackButton extends Button {
 
 public BackButton(String id) {
 super(id);
 setDefaultFormProcessing(false); // because it is inside a
  form and cannot make submit forward
 }
 
 @Override
 public void onSubmit() {
 setResponsePage(getPage().getPageReference().getPage());
 }
 
  }
 
 
  On debug, the inspect of the first getPage() is the same Page as
  getPage().getPageReference().getPage().
  In the class BackButton I do not have direct access at
 getPageReference().
 
  I Just need know the preview Page, and don't care witch Page is, because
  the business rules can create different
  paths to the user.
 
  Thanks a lot again!
  Vitor
 
 
 
  -Mensagem original-
  De: Martin Grigorov [mailto:mgrigo...@apache.org]
  Enviada em: terça-feira, 17 de maio de 2011 14:19
  Para: users@wicket.apache.org
  Assunto: Re: Last Page visited
 
  On Tue, May 17, 2011 at 7:18 PM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
   The idea is :
  
   setResponsePage(new NewPage(getPageReference()))
  
   later in NewPage you can do:
   Link linkToPreviousPage = new BookmarkablePageLink(link,
   previousPageRef.getPage().getClass())
  
 
  Or even : setResponsePage(previousPageRef.getPage())
 
  
  
   On Tue, May 17, 2011 at 7:11 PM, Vitor Granzinoli Vellozo 
   vitor.vell...@cpmbraxis.com wrote:
  
  
   Igor,
  
   I had a problem with getPageReference().
   I need go back to the preview page. So, from the Page2, go to Page1.
 The
   getPageReference() method
   do not gave me preview Page. It gave me the same Page.
  
   Is there a way to get the Page.class reference of the preview Page?
  
   The code I've tested getPageReference() is:
  
   PageReference reference = getPage().getPageReference();
   setResponsePage(reference.getPage());
  
   Some ligth?
  
  
   Thanks a lot,
   Vitor
  
  
  
   -Mensagem original-
   De: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
   Enviada em: terça-feira, 17 de maio de 2011 13:40
   Para: users@wicket.apache.org
   Assunto: Re: Last Page visited
  
   you can pass PageReference objects around. see Page#getPageReference()
  
   -igor
  
   On Tue, May 17, 2011 at 7:38 AM, Vitor Granzinoli Vellozo
   vitor.vell...@cpmbraxis.com wrote:
   
   
Wicketers,
   
   
   
What is the Best way to store the last Page visited? My business
 

Re: Issue with internationalising the MultiFileUploadField component

2011-05-17 Thread Steve Swinsburg
Ok I've done that and when the webapp starts up I get this:
INFO: 2011-05-18 09:36:53,246 Loading properties files from 
jar:file:/pah/to/my/app/WEB-INF/lib/wicket-1.4.13.jar!/org/apache/wicket/Application.properties
 [http-8081-Processor24]

Accessing pages I see things like:
DEBUG: 2011-05-18 09:38:27,823 Property found in cache: 
'link.my.profile.tooltip'; Component: '[MarkupContainer [Component id = 
myProfileLink]]'; value: 'Ver y editar tu perfil' [http-8081-Processor19]

Which all looks good.

Then, when I access the panel that has the MultiFileUploadField component, I 
see no reference at all to any of the properties.

In contrast, when I access a panel that has the phone number validator, which 
actually works in terms of internationalisation, I get:
DEBUG: 2011-05-18 09:40:06,655 Property found in cache: 
'homephone.PhoneNumberValidator'; Component: '[MarkupContainer [Component id = 
homephone]]'; value: 'N?mero de tel?fono no v?lido' [http-8081-Processor19]

Does that give you an idea of where the issue might be?

thanks,
Steve


On 17/05/2011, at 10:26 PM, Martin Grigorov wrote:

 Enable debug level logging for org.apache.wicket.Localizer and see what is
 attempted.
 
 On Tue, May 17, 2011 at 1:37 PM, Steve Swinsburg
 steve.swinsb...@gmail.comwrote:
 
 Yeah, that's where I have them and its not working. Its the same spot we
 have the ones that do work too.
 
 We do use a custom resource loader but I don't understand why it would
 allow us to override some properties from Wicket components, and not others.
 
 Does the property need to be prefixed with the wicket id or something?
 
 Any ideas?
 
 Thanks
 Steve
 
 
 Sent from my iPhone
 
 On 17/05/2011, at 17:37, Martin Grigorov mgrigo...@apache.org wrote:
 
 Looking at MultiFileUploadField.java these are exactly the keys you have
 to
 use.
 Try to put them in MyApp_es.properties
 
 On Tue, May 17, 2011 at 9:31 AM, Steve Swinsburg
 steve.swinsb...@gmail.comwrote:
 
 Hi,
 
 We are having an issue setting some properties to override the default
 text
 for the MultiFileUploadField component. As per the docs, we have set the
 following in our local properties file:
 
 org.apache.wicket.mfu.caption.unlimited=Ficheros:
 org.apache.wicket.mfu.caption.limited=Ficheros (m\u00E1ximo ${max}):
 org.apache.wicket.mfu.delete=Borrar
 
 
 however they are not being overridden. We know our properties file is
 working because we can override other properties, like:
 
 workphone.PhoneNumberValidator = N\u00FAmero de tel\u00E9fono no
 v\u00E1lido
 
 and those come up correctly.
 
 Is this a bug? If not, what might we be missing?
 
 Wicket 1.4.13
 
 thanks,
 steve
 
 
 
 
 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -- 
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/


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



Re: Issue with internationalising the MultiFileUploadField component

2011-05-17 Thread Martin Grigorov
Please create a quickstart app and attach it to a ticket.
Test the quickstart with 1.4.17 too.

On Wed, May 18, 2011 at 1:41 AM, Steve Swinsburg
steve.swinsb...@gmail.comwrote:

 Ok I've done that and when the webapp starts up I get this:
 INFO: 2011-05-18 09:36:53,246 Loading properties files from
 jar:file:/pah/to/my/app/WEB-INF/lib/wicket-1.4.13.jar!/org/apache/wicket/Application.properties
 [http-8081-Processor24]

 Accessing pages I see things like:
 DEBUG: 2011-05-18 09:38:27,823 Property found in cache:
 'link.my.profile.tooltip'; Component: '[MarkupContainer [Component id =
 myProfileLink]]'; value: 'Ver y editar tu perfil' [http-8081-Processor19]

 Which all looks good.

 Then, when I access the panel that has the MultiFileUploadField component,
 I see no reference at all to any of the properties.

 In contrast, when I access a panel that has the phone number validator,
 which actually works in terms of internationalisation, I get:
 DEBUG: 2011-05-18 09:40:06,655 Property found in cache:
 'homephone.PhoneNumberValidator'; Component: '[MarkupContainer [Component id
 = homephone]]'; value: 'N?mero de tel?fono no v?lido'
 [http-8081-Processor19]

 Does that give you an idea of where the issue might be?

 thanks,
 Steve


 On 17/05/2011, at 10:26 PM, Martin Grigorov wrote:

  Enable debug level logging for org.apache.wicket.Localizer and see what
 is
  attempted.
 
  On Tue, May 17, 2011 at 1:37 PM, Steve Swinsburg
  steve.swinsb...@gmail.comwrote:
 
  Yeah, that's where I have them and its not working. Its the same spot we
  have the ones that do work too.
 
  We do use a custom resource loader but I don't understand why it would
  allow us to override some properties from Wicket components, and not
 others.
 
  Does the property need to be prefixed with the wicket id or something?
 
  Any ideas?
 
  Thanks
  Steve
 
 
  Sent from my iPhone
 
  On 17/05/2011, at 17:37, Martin Grigorov mgrigo...@apache.org wrote:
 
  Looking at MultiFileUploadField.java these are exactly the keys you
 have
  to
  use.
  Try to put them in MyApp_es.properties
 
  On Tue, May 17, 2011 at 9:31 AM, Steve Swinsburg
  steve.swinsb...@gmail.comwrote:
 
  Hi,
 
  We are having an issue setting some properties to override the default
  text
  for the MultiFileUploadField component. As per the docs, we have set
 the
  following in our local properties file:
 
  org.apache.wicket.mfu.caption.unlimited=Ficheros:
  org.apache.wicket.mfu.caption.limited=Ficheros (m\u00E1ximo ${max}):
  org.apache.wicket.mfu.delete=Borrar
 
 
  however they are not being overridden. We know our properties file is
  working because we can override other properties, like:
 
  workphone.PhoneNumberValidator = N\u00FAmero de tel\u00E9fono no
  v\u00E1lido
 
  and those come up correctly.
 
  Is this a bug? If not, what might we be missing?
 
  Wicket 1.4.13
 
  thanks,
  steve
 
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com http://jweekend.com/
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com http://jweekend.com/


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




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