Re: the choices is key instead of value when using DropDownChoice component

2018-01-24 Thread Sven Meier
Hi,

put the localized values into the choices:

selectionDescription.add(getString("forms.cf37.question8.oneTime"));

Even better, put the above inside a ReadOnlyModel's getObject().

Have fun
Sven


⁣Gesendet mit Blue ​

Am 25. Jan. 2018, 07:50, um 07:50, extraquoo  schrieb:
>Hi
>I am adding a FormComponent DropDownChoice to display a dropdown list
>on
>the page like below
>
>
>
>To support the i18n, I  add the key to a list of choices and override
>the
>localizeDisplayValues, the code is below
>
>private FormComponent getQuestion8Select(String fieldName,
>   IModel parent) {
>
>   List selectionDescription = new ArrayList();
>   selectionDescription.add("forms.cf37.question8.oneTime");
>   
> selectionDescription.add("forms.cf37.question8.otherSourcemonthly");
>   DropDownChoice selector = new
>DropDownChoice(fieldName,
>selectionDescription){
>   private static final long serialVersionUID = 1L;
>   @Override
>   protected boolean 
> localizeDisplayValues() {
>   return true;
> }
>   };
>
>return selector;
>   }
>
>the key forms.cf37.question8.oneTime and
>forms.cf37.question8.otherSourcemonthly has different values in
>corresponding XML files.
>  .xml
>One time or ongoing
>payment:
>One time payment
>_es.xml
>Pago de solo una vez
>o
>pago mensual:
>Pago de solo una vez
>
>When I switch the locale to Spanish, the verbiage changes well on the
>HTML.
>
>
>
>However, the choices object carries the key instead of the value in the
>backend.
>
>Is there anything I miss to code for the DropDownChoice?  The choices
>need
>to carry the exact values.
>
>
>
>--
>Sent from:
>http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
>-
>To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>For additional commands, e-mail: users-h...@wicket.apache.org


the choices is key instead of value when using DropDownChoice component

2018-01-24 Thread extraquoo
Hi
 I am adding a FormComponent DropDownChoice to display a dropdown list on
the page like below
 

To support the i18n, I  add the key to a list of choices and override the
localizeDisplayValues, the code is below

private FormComponent getQuestion8Select(String fieldName,
IModel parent) {

List selectionDescription = new ArrayList();
selectionDescription.add("forms.cf37.question8.oneTime");

selectionDescription.add("forms.cf37.question8.otherSourcemonthly");
DropDownChoice selector = new 
DropDownChoice(fieldName,
selectionDescription){
private static final long serialVersionUID = 1L;
@Override
protected boolean 
localizeDisplayValues() {
return true;
  }
};

 return selector;
}

the key forms.cf37.question8.oneTime and
forms.cf37.question8.otherSourcemonthly has different values in
corresponding XML files. 
  .xml
One time or ongoing
payment:
One time payment
_es.xml
Pago de solo una vez o
pago mensual:
Pago de solo una vez

When I switch the locale to Spanish, the verbiage changes well on the HTML.
 

However, the choices object carries the key instead of the value in the
backend.

Is there anything I miss to code for the DropDownChoice?  The choices need
to carry the exact values.



--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



What should I use to perform the crawler test?

2018-01-24 Thread Sokab
Hi everyone. I have to write a crowler test for wicket application (wildfly
server). Do You think Jsoup is enough?I tried to log in to my application to
use Jsoup, for example the code on this page
http://www.scrapingauthority.com/2016/08/16/web-scraping-in-java-with-jsoup/
but I had many problems, because I did not have a reaction. Should I use
something else like Selenium and do not use Jsoup? I apologize for my
question but I really do not know what to use. I need to check where in my
application are errors after entering a link or search for a text. Thanks
for any help.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



Wicket PageStore and Token based authentication

2018-01-24 Thread Rakesh A
Hi,

I am trying to build a Wicket application which uses
1. Token based authentication; where token can be valid for a longer time
2. Have page store remain till token expires

I couldn't find any example/information regarding this, by going through the
PageStoreManager implementation, I was thinking about below
1. Have custom implementation of RequestAdapter and avoid setting page store
as http session attribute, but some other alternative way (Ex. persist this
information also)
2. Have custom PageStoreManager which use the custom RequestAdapter
mentioned in step#1

Other than that I think I also need to take care of 
1. Avoid using session id usage for page store lookup
2. Alternative implementation for KeyInSessionSunJceCryptFactory

Is this approach correct ?
Any suggestions on how to do it ?
Any links that I can refer for more information about it ?

Regards,
Rakesh.A

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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