Re: best way to add tooltips in wicket

2009-05-07 Thread RoyBatty

Thanks Nino. 

A little bit more input on the Mootip performance bit, if you're interested.
Basically, when we're using it it behaves quite differently from the mootip
examples you can see on their page.

here's what happens: 

When a Mootip is added to, for example, a label, and you drag the mouse
pointer reeally slowly over it, the tip shows up, then when the mouse
comes to the next pixel, it disappears, then appears/disappears for every
other pixel that the mouse moves across!

If you check with Firebug, you can see that the div visibility settings are
changed as you move the mouse across. 

Really funky, and i have no idea why it behaves like that :)



Hi Roy

Regarding 1. You should be able to tweak settings as you want theres a
showdelay setting you can setup. And a lot more settings regarding
timeout etc if wanted..

Regarding 2:
No it seems it has to have a title at least my wrappers, you could try
to set maxTitleChars to 0, int the mootip settings..

I just did'nt see the need for not having a title when I created it :)

-- 
View this message in context: 
http://www.nabble.com/best-way-to-add-tooltips-in-wicket-tp22697930p23422027.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



calendar component with date & TIME field

2009-05-07 Thread Christoph Grün
Hi!

 

Is there a calendar component with date & TIME field?

The calendar components, that I know so far (e.g., YUI DatePicker) just
provide a date field. I also would need a field for hours/minutes.

Instead of adding textfields for hours/minutes seperately, it would be nice
to have them included in the calendar component.

 

Thanks, 

Christoph

 

 



jquery slider component not working

2009-05-07 Thread Christoph Grün
Hello,

 

I tried out different slider components jquery slider
(jquery-examples-1.4-20090427.160726-150.war), yui slider
(yui-examples-1.4-20090427.160726-141.war).

Actually, none of them works out of the box with Wicket 1.4.

 

The class below is the JQuery slider. The onChange method is never called,
so I cannot get the int value of the slider.

 Can anyone give me a hint?

 

public class Page4Slider extends WebPage {

 

public Page4Slider() {



final SliderHandleOptions sliderOneHandleSettings = new
SliderHandleOptions(

"uno", 0);

 

final SliderOptions sliderOptions = new SliderOptions();

sliderOptions.setStepping(10);

sliderOptions.setMin(0);

sliderOptions.setMax(100);

sliderOptions.setRange(false);

 

// sliderOptions.setOnChange("console.log('ui: ' + ui.toSource());",
"e", "ui");

 

@SuppressWarnings("serial")

final Slider slider = new Slider("slider", sliderOptions,
sliderOneHandleSettings) {

@Override

public void onChange(AjaxRequestTarget target, String handleId,
int value) {

info(String.format("Handle with id '%s' changed its value to
'%d'",

handleId, value));

target.addChildren(getPage(), FeedbackPanel.class);

}

 

};

add(new FeedbackPanel("feedback").setOutputMarkupId(true));

add(slider).setOutputMarkupId(true);

}

}

 

Thanks a lot,

Christoph



Re: non-existent Springbean lazy beans only work when name specified

2009-05-07 Thread Antony Stubbs
Sorry, not sure if I was clear enough? I know it's to wire by type, we  
want that. But the SpringBeanInjector is requesting a name be  
generated for our 'type' injected bean, which is causing a problem.
We are _not_ relying on succesful injection of beans of the wrong type  
- unless you consider the lazy target to be null being the wrong type.
And like I said, our code _isn't_ using those other beans. The only  
bean we are actually using, we _do_ insert into the MockAppContext, we  
just aren't inserting all the rest - and one those happens to be  
nameless and is the only one causing a problem.


Your valid test setups are what i already described when I discussed  
work around - one work around we already are avoiding Spring and using  
our own ComponentInjector, and the other is that we _do_ add a mock  
implementation of the missing bean that gets injected by type.


What I would like addressed is the inconsistent treatment of named vs  
nameless injection - one effectively make sure a registered bean of  
the required type exists (nameless), and one does not (named).


They would both effectively break the same way if code actually tried  
to use the beans that don't exist, even if it were declared as named.


Does that clarify some what?

Regards,
Antony Stubbs,
NZ
http://friendfeed.com/astubbs

On 7/05/2009, at 11:41 AM, Marat Radchenko wrote:


Your setup seems to be broken. That's the whole point of nameless
@SpringBean/@Resource/@Autowire - to find beans by _type_, not name.
Relying on successful injection of beans of wrong type is a bad idea
IMO. It'll break as soon as smth in your code tries to invoke that
bean. I'd even say that allowing injection of bean of wrong type (when
name-based injection is used) is a bug.

I see to valid setups for tests:
1. Completely avoid SpringBeanInjector and inject mock objects  
manually.

2. Setup Spring context with mock object and allow SpringBeanInjector
to inject them wherever is needed (that's what we use for our
project).

2009/5/7 Antony Stubbs :

I think I've found a potential bug/ area for improvement.

We are setting up pure unit tests for a component, and in this test  
case,
although the component declares several @SpringBean's, only 1 is  
used. Our
tests all work fine when we run them against our "test" spring  
context, but

I wanted to do something more isolated...

So, in our custom injector, we only inject the, let's call it,  
TemplatesDao

object. The other 'dao's or whatever, remain un-attended to.

This runs fine, in one case, where we specify the names of the  
beans - i.e.
@SpringBean(name="templateDao"), @SpringBean(name="peopleDao"),  
etc, where
we ignore the peopleDao bean for example. The fields are all set to  
lazy
proxy's, and the actual resolution of the bean only happens on  
first access
- so, our peopleDao is never looked up (which wouldn't work,  
because it's

not there), and our templateDao get's looked up successfully.

However, if we do not specify the name of the bean - i.e. with have  
another
bean @SpringBean of type RoomsDao. When the wicket code goes to  
setup this

field's lazy initialiser, it fails. It turns down the wrong road at:
SpringBeanLocator:
singletonCache =
Boolean.valueOf(getSpringContext().isSingleton(getBeanName()));
which leads to the:
String[] names =  
BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ctx,

clazz);
This of course calls the getBeanName(). And because we didn't  
specify a
name, the injector tries to ask Spring for it - which of course  
doesn't

work, because no bean of that type actually exists in the conext.

IMO the treatment of named vs unnamed @SringBeans is thus sort of
inconsistent, and would be useful for us to be able to not worry  
about
unnamed bean types not existing. Is there a way to avoid this call  
into the

Spring context?

One of the work arounds we can use for this, is to add a mock  
implementation
of that class into the test application context, so spring is able  
to find a

bean of that type. But I'd prefer not to have to :)

The other work around, is to not use the SpringComponentInjector, and
instead setup our own ComponentInjector which only cares about the  
one panel

we're testing:
   @Override
   public void onInstantiation(Component component) {
   if (component instanceof ProfileDetailPanel) {
   ProfileDetailPanel p = (ProfileDetailPanel) component;
   p.setProfileManager( mockProfileManager );
   }
   }


I wanted to get some thoughts, before I posted a Jira.

Regards,
Antony Stubbs,
NZ
http://friendfeed.com/astubbs




-
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: DateTextField design issue

2009-05-07 Thread Eyal Golan
I'm going to review on Sunday the code my team mate has made .
I'll be able to give you more information and see if maybe we misunderstood
something.


Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Wed, May 6, 2009 at 6:43 PM, Igor Vaynberg wrote:

> what is the full name of this class? there are two DateTextField
> classes in wicket codebase.
>
> -igor
>
> On Tue, May 5, 2009 at 9:51 AM, Eyal Golan  wrote:
> > Hello,
> > We use Wicket 1.3.5 and I found something annoying with the
> DateTextField.
> > In the constructor of that class, the converter is created internally.
> > If I want to use my own converter, I need to inherit DateTextField, add a
> > converter as a member, and return it in the getConverter method.
> >
> > Why not have a protected method (that can be overridden) that returns the
> > converter:
> > Instead of:
> >public DateTextField(String id, IModel model, String datePattern)
> >{
> >super(id, model, Date.class);
> >this.datePattern = datePattern;
> >*this.converter = new DateConverter()
> >{
> >private static final long serialVersionUID = 1L;
> >
> >/**
> > * @see
> >
> org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
> > */
> >public DateFormat getDateFormat(Locale locale)
> >{
> >return new
> SimpleDateFormat(DateTextField.this.datePattern);
> >}
> >};*
> >}
> >
> > Do something like:
> >public DateTextField(String id, IModel model, String datePattern)
> >{
> >super(id, model, Date.class);
> >this.datePattern = datePattern;
> >*this.converter = newDateConverter();*
> >}
> > and
> >
> > protected newDateConverter() {
> > return new DateConverter()
> >{
> >private static final long serialVersionUID = 1L;
> >
> >/**
> > * @see
> >
> org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
> > */
> >public DateFormat getDateFormat(Locale locale)
> >{
> >return new
> SimpleDateFormat(DateTextField.this.datePattern);
> >}
> >};
> > }
> >
> > BTW, I know that we can also use the newConverterLocator() in our
> > application.
> >
> > Do you think I should open a JIRA issue with 'wish' for that?
> >
> >
> > Eyal Golan
> > egola...@gmail.com
> >
> > Visit: http://jvdrums.sourceforge.net/
> > LinkedIn: http://www.linkedin.com/in/egolan74
> >
> > P  Save a tree. Please don't print this e-mail unless it's really
> necessary
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Pimp your Wicket app!

2009-05-07 Thread Martijn Dashorst
I (and possibly the rest of the Wicket community) would like to know
more about your deployed Wicket applications. Even though we have a
page that enables everyone to list their Wicket application, it lacks
the details we all crave for. So I'd like to invite everyone to share
their setup with us.

Answer these questions for each Wicket application you've deployed:

Name of your application:
Intranet or internet: [ ] intranet [ ] internet
Public or private site: [ ] public [ ] private [ ] both

Average number of concurrent users:
Max number of concurrent users you have encountered:
Average number of Wicket served requests per (business)day:

Number of servers running your Wicket frontend code:
Number of cores/CPUs per server:
Number of JVMs running on your server for Wicket frontend code:
Do these JVMs run in a cluster? [ ] yes [ ] no
-Xmx setting (max memory) for your JVMs:

Now pimp your application!

Martijn

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



Re: Pimp your Wicket app!

2009-05-07 Thread Martijn Dashorst
To start myself:

Name of your application: Vocus
Industry: education
Intranet or internet: [ ] intranet [X] internet
Public or private site: [ ] public [X] private [ ] both

Average number of concurrent users: 400
Max number of concurrent users you have encountered: 500
Average number of Wicket served requests per (business)day: 200k

Number of servers running your Wicket frontend code: 2
Number of cores/CPUs per server: quad core, dual cpu
Number of JVMs running on your server for Wicket frontend code: 1
Do these JVMs run in a cluster? [ ] yes [X] no
-Xmx setting (max memory) for your JVMs: -Xmx4096m

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



Re: Breadcrumbs and "raw" URLs

2009-05-07 Thread Wilhelmsen Tor Iver
> Is there a way to use urlFor() or the like to create links 
> that updates the breadcrumb model with our BreadCrumbPanel 
> subclass for the linked id, i.e. 
> IBreadCrumbModel.setActive(new ArticlePanel(...))?

*crickets*

Anyway, I finally found the likely answer in the form of an extended
PageRequestTarget.

However, it seems the call to urlFor() returns a link that does not
invoke the code as expected; it just re-renders the same page and panel
instead of invoking my object. Am I doing something wrong regarding the
urlFor call? Does the request target object need to be registered
somewhere?

// ...

CharSequence urlFor = RequestCycle.get().urlFor(new
ChangeArticleRequestTarget(getPage(), token.getLinkData()));


public static class ChangeArticleRequestTarget extends
PageRequestTarget {

private String articleId;

public ChangeArticleRequestTarget(Page page, String
articleId) {
super(page);
this.articleId = articleId;
}

@Override
public void respond(RequestCycle requestCycle) {
Page page = getPage();
BreadCrumbBar bar = (BreadCrumbBar)
page.get("breadCrumbBar");
try {
ArticlePanel newPanel = new
ArticlePanel("articlePanel", bar, new
Model(Integer.valueOf(articleId)));
page.replace(newPanel);
bar.setActive(newPanel);
page.dirty();
}
catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

super.respond(requestCycle);
}



}

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



Re: Pimp your Wicket app!

2009-05-07 Thread CrocodileShoes


Name of your application: Knowledge management research project for ESA -
Name not yet decided!
Intranet or internet: [X] intranet [ ] internet 
Public or private site: [ ] public [X] private [ ] both 

Average number of concurrent users: Not sure yet - We are deploying for the
Rosetta mission soon (50 users) to get feedback.
Max number of concurrent users you have encountered: N/A - early days!
Average number of Wicket served requests per (business)day: N/A - early
days!

Number of servers running your Wicket frontend code: 1
Number of cores/CPUs per server: Virtual server
Number of JVMs running on your server for Wicket frontend code: 1
Do these JVMs run in a cluster? [ ] yes [X] no 

The project is a technical research project so it won't go live.  There are
possibilities for this down the line though depending upon the results.

The prototype was demonstrated at ESAW http://www.congrex.nl/09c25/
yesterday and the Wicket front-end generated a fair bit of interest!  It's a
testament to Wicket because I am completely new to web development (C++ java
app background) and have no real experience with Javascript/HTML/CSS.

Thanks for a great Framework!
-- 
View this message in context: 
http://www.nabble.com/Pimp-your-Wicket-app%21-tp23422714p23423309.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



Editable select

2009-05-07 Thread Vladimir Kovalyuk
Does anybody know any editable select wicket-component that supports
attaching 'onchange' AjaxFormComponentUpdatingBehavior?


Re: Pimp your Wicket app!

2009-05-07 Thread Daniel Frisk

Name of your application: http://jalbum.net
Intranet or internet: [ ] intranet [X ] internet
Public or private site: [ X] public [ ] private [ ] both

Average number of concurrent users: ~500
Max number of concurrent users you have encountered: Don't know
Average number of Wicket served requests per (business)day: ~20 M

Number of servers running your Wicket frontend code: 4
Number of cores/CPUs per server: 4
Number of JVMs running on your server for Wicket frontend code: 1
Do these JVMs run in a cluster? [ X] yes [ ] no
-Xmx setting (max memory) for your JVMs: 4 GB

// Daniel
jalbum.net



On 2009-05-07, at 10:54, Martijn Dashorst wrote:


I (and possibly the rest of the Wicket community) would like to know
more about your deployed Wicket applications. Even though we have a
page that enables everyone to list their Wicket application, it lacks
the details we all crave for. So I'd like to invite everyone to share
their setup with us.

Now pimp your application!

Martijn



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



Re: Editable select

2009-05-07 Thread James Carman
Perhaps autocomplete?

On Thu, May 7, 2009 at 5:55 AM, Vladimir Kovalyuk  wrote:
> Does anybody know any editable select wicket-component that supports
> attaching 'onchange' AjaxFormComponentUpdatingBehavior?
>

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



AjaxResponse with control characters is not validated

2009-05-07 Thread Jens Alenius

Hi.
Found something that might be a wicket ajax bug.
This code wont work in Firefox and we believe that its the Ajax xml 
response that is invalid.
The control characters is not properly escaped. Ex: "\u0014" is written 
as 0014 in the xml Ajax Response but should be .

See: http://www.w3.org/TR/REC-xml/#dt-charref.

This code wont work in firefox

Markup:
...

   
   Submit

...


   Java:
  
   final Label testLabel = new Label("testValue",themodel);
   testLabel.setOutputMarkupId(true);
   add(testLabel);
   Form testForm = new Form("testform");
   testForm.add(new AjaxButton("testSubmit"){

   @Override
   protected void onSubmit(AjaxRequestTarget pTarget, Form 
pForm) {

   themodel.setObject("\u0014");
  
   pTarget.addComponent(testLabel);
   }   
  
   });

   add(testForm);
   ...

Jens Alenius


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



Bug? Element hidden by wicket:enclosure is required?

2009-05-07 Thread Martin Makundi
Hi!

Is it a bug that wicket requires a field which is in an enclosure
which is then not visible?



  


On Java side:
add(new WebMarkupContainer("switch").setVisible(false));

wicketTester.newFormTester("form").submit();
tester.assertNoErrorMessages();

**
Martin

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



Re: Editable select

2009-05-07 Thread Vladimir K

Thanks. I'll try AutoCompleteSettings.


James Carman-3 wrote:
> 
> Perhaps autocomplete?
> 
> On Thu, May 7, 2009 at 5:55 AM, Vladimir Kovalyuk 
> wrote:
>> Does anybody know any editable select wicket-component that supports
>> attaching 'onchange' AjaxFormComponentUpdatingBehavior?
>>
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Editable-select-tp23423534p23426031.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



AW: Lazy Open Session In View with AOP

2009-05-07 Thread Christian Helmbold

Thanks for your answer, James.

I try to understand magic things. The missing peace in the puzzle was the 
difference between Hibernates openSession() and getCurrentSession(). More than 
one transaction within one session seems only to be possible with openSession() 
and manual flushing and closing. 
http://www.techfaq360.com/hibernate_interview_questions.jsp?qid=241

This is a pure Hibernate concern, but I want to post an important of the answer 
to my initial question.

The question "What is the current thread, the Hibernate Session is bound to, in 
a Wicket application?" is still open.



- Ursprüngliche Mail 
> Von: James Carman 
> An: users@wicket.apache.org
> Gesendet: Mittwoch, den 6. Mai 2009, 22:13:09 Uhr
> Betreff: Re: Lazy Open Session In View with AOP
> 
> If you use the @Transactional annotation (or define your transactions
> in the XML), Spring will take care of the transactions for you
> automagically.

Thanks,
Christian





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



Re: Lazy Open Session In View with AOP

2009-05-07 Thread James Carman
On Thu, May 7, 2009 at 8:53 AM, Christian Helmbold
 wrote:
>
> Thanks for your answer, James.
>
> I try to understand magic things. The missing peace in the puzzle was the 
> difference between Hibernates openSession() and getCurrentSession(). More 
> than one transaction within one session seems only to be possible with 
> openSession() and manual flushing and closing.
> http://www.techfaq360.com/hibernate_interview_questions.jsp?qid=241
>
> This is a pure Hibernate concern, but I want to post an important of the 
> answer to my initial question.
>
> The question "What is the current thread, the Hibernate Session is bound to, 
> in a Wicket application?" is still open.

The current thread is the request thread.

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



Re: Pimp your Wicket app!

2009-05-07 Thread David Brown
Hello, my Wicket app is still in alpha dev. Closer to reality I'm still trying 
to migrate the backend from MSSQL 2005 to MySQL embeddable. The entire project 
is just a pilot to see if I get the job. The current running enterprise web app 
to be replaced is a concoction of hundreds of code-generated cut-and-paste 
Servlet sourcecode, a few pojos, hundreds of Stored Procedures executing 
against 800+ tables and no keys!. If I succeed in navigating this quagmire web 
app I will surely post the deliverable. Regards, David.

There are 10 kinds of people in this world: those who understand binary and 
those who don’t (Valid only for 2's complement).

- Original Message -
From: "Daniel Frisk" 
To: users@wicket.apache.org
Sent: Thursday, May 7, 2009 5:13:12 AM GMT -06:00 US/Canada Central
Subject: Re: Pimp your Wicket app!

Name of your application: http://jalbum.net
Intranet or internet: [ ] intranet [X ] internet
Public or private site: [ X] public [ ] private [ ] both

Average number of concurrent users: ~500
Max number of concurrent users you have encountered: Don't know
Average number of Wicket served requests per (business)day: ~20 M

Number of servers running your Wicket frontend code: 4
Number of cores/CPUs per server: 4
Number of JVMs running on your server for Wicket frontend code: 1
Do these JVMs run in a cluster? [ X] yes [ ] no
-Xmx setting (max memory) for your JVMs: 4 GB

// Daniel
jalbum.net



On 2009-05-07, at 10:54, Martijn Dashorst wrote:

> I (and possibly the rest of the Wicket community) would like to know
> more about your deployed Wicket applications. Even though we have a
> page that enables everyone to list their Wicket application, it lacks
> the details we all crave for. So I'd like to invite everyone to share
> their setup with us.
>
> Now pimp your application!
>
> Martijn
>

-
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: Add a ui lock page over the page while waiting for response

2009-05-07 Thread Matthias Keller

Hi

Thanks for the input. I now used wicketstuff-jquery and wrote a custom 
behaviour which adds the code to my form.

For later reference:
public class UIBlockerBehaviour extends JQueryBehavior {
   private static final ResourceReference BLOCKUI_JS =
   new CompressedResourceReference(UIBlockerBehaviour.class, 
"jquery.blockUI.js");


   public void renderHead (IHeaderResponse response) {
   super.renderHead(response);
   response.renderJavascriptReference(BLOCKUI_JS);
   }

   protected void onBind () {
 super.onBind();
 getComponent().add(
 new AttributeAppender(this.attributeName, new 
ResourceModel("JQuery.blockUI.code"), ";"));

   }
}

Where the string resource contains:

JQuery.blockUI.code = \
   $.blockUI({\
   message: 'Please wait...',\
   css:{\
   border: 'none',\
   padding: '15px',\
   backgroundColor: '#000',\
   '-webkit-border-radius': '10px',\
   '-moz-border-radius': '10px',\
   opacity: '.5',\
   color: '#fff'\
   }\
   });

Thanks for your help

The Veil component didn't work for me at all - I saw no difference 
wether I had added it to the button or not at all


Matt

Serkan Camurcuoglu wrote:

you could use the jquery blockui plugin..

http://malsup.com/jquery/block/#demos



James Carman wrote:
There is a "veil" component in wicketstuff-minis, I believe.  That 
might help.


On Wed, May 6, 2009 at 10:30 AM, Linda van der Pal
 wrote:
 
Back when I was programming in jsp I solved this by disabling the 
button
after clicking it (because it would redirect after processing the 
data). Not

sure how I'd do such a thing with Wicket.

Linda.


Matthias Keller wrote:
   

Hi

We have a web form which does some very extensive backend 
communication

requiring a lot of time. So usually after pressing 'submit', the UI is
locked for 10-30 seconds. To avoid re-submission, we'd like to put 
some kind
of ui-lock-page over the current page, stating 'Please wait' or 
something.
So I'd need something to add to the onclick of the submit button 
(which is
NOT an ajax button but a normal  button) which 
blocks the

UI until the response is ready.
I've tried the wicket-stuff veil thingy, but it doesn't work. 
Here's what

I tried:
WebMarkupContainer submit = new WebMarkupContainer("submit");
submit.add(new Veil());
add(submit);

But even though I see some JS files added to the page, nothing happens
when I click my button?

Is there something else that I can just add to a button?
Thanks a lot

Matt

  

-
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




--
matthias.kel...@ergon.ch  +41 44 268 83 98
Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich
http://www.ergon.ch
__
e r g o nsmart people - smart software




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Add a ui lock page over the page while waiting for response

2009-05-07 Thread Vladimir K

The following works for me pretty well:

http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html
http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html
 


Matthias Keller wrote:
> 
> Hi
> 
> Thanks for the input. I now used wicketstuff-jquery and wrote a custom 
> behaviour which adds the code to my form.
> For later reference:
> public class UIBlockerBehaviour extends JQueryBehavior {
> private static final ResourceReference BLOCKUI_JS =
> new CompressedResourceReference(UIBlockerBehaviour.class, 
> "jquery.blockUI.js");
> 
> ...
> 

-- 
View this message in context: 
http://www.nabble.com/Add-a-ui-lock-page-over-the-page-while-waiting-for-response-tp23407195p23427935.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: calendar component with date & TIME field

2009-05-07 Thread reiern70

Maybe 

org.apache.wicket.extensions.yui.calendar.DateTimeField

Best,

Ernesto
 

Christoph Grün wrote:
> 
> Hi!
> 
>  
> 
> Is there a calendar component with date & TIME field?
> 
> The calendar components, that I know so far (e.g., YUI DatePicker) just
> provide a date field. I also would need a field for hours/minutes.
> 
> Instead of adding textfields for hours/minutes seperately, it would be
> nice
> to have them included in the calendar component.
> 
>  
> 
> Thanks, 
> 
> Christoph
> 
>  
> 
>  
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/calendar-component-with-date---TIME-field-tp23422189p23428506.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: DateTextField design issue

2009-05-07 Thread Igor Vaynberg
if you want to use your own converter then override getconverter() and
return whatever you like.

-igor

On Thu, May 7, 2009 at 1:38 AM, Eyal Golan  wrote:
> I'm going to review on Sunday the code my team mate has made .
> I'll be able to give you more information and see if maybe we misunderstood
> something.
>
>
> Eyal Golan
> egola...@gmail.com
>
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
>
> P  Save a tree. Please don't print this e-mail unless it's really necessary
>
>
> On Wed, May 6, 2009 at 6:43 PM, Igor Vaynberg wrote:
>
>> what is the full name of this class? there are two DateTextField
>> classes in wicket codebase.
>>
>> -igor
>>
>> On Tue, May 5, 2009 at 9:51 AM, Eyal Golan  wrote:
>> > Hello,
>> > We use Wicket 1.3.5 and I found something annoying with the
>> DateTextField.
>> > In the constructor of that class, the converter is created internally.
>> > If I want to use my own converter, I need to inherit DateTextField, add a
>> > converter as a member, and return it in the getConverter method.
>> >
>> > Why not have a protected method (that can be overridden) that returns the
>> > converter:
>> > Instead of:
>> >    public DateTextField(String id, IModel model, String datePattern)
>> >    {
>> >        super(id, model, Date.class);
>> >        this.datePattern = datePattern;
>> >        *this.converter = new DateConverter()
>> >        {
>> >            private static final long serialVersionUID = 1L;
>> >
>> >            /**
>> >             * @see
>> >
>> org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
>> >             */
>> >            public DateFormat getDateFormat(Locale locale)
>> >            {
>> >                return new
>> SimpleDateFormat(DateTextField.this.datePattern);
>> >            }
>> >        };*
>> >    }
>> >
>> > Do something like:
>> >    public DateTextField(String id, IModel model, String datePattern)
>> >    {
>> >        super(id, model, Date.class);
>> >        this.datePattern = datePattern;
>> >        *this.converter = newDateConverter();*
>> >    }
>> > and
>> >
>> > protected newDateConverter() {
>> >     return new DateConverter()
>> >        {
>> >            private static final long serialVersionUID = 1L;
>> >
>> >            /**
>> >             * @see
>> >
>> org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
>> >             */
>> >            public DateFormat getDateFormat(Locale locale)
>> >            {
>> >                return new
>> SimpleDateFormat(DateTextField.this.datePattern);
>> >            }
>> >        };
>> > }
>> >
>> > BTW, I know that we can also use the newConverterLocator() in our
>> > application.
>> >
>> > Do you think I should open a JIRA issue with 'wish' for that?
>> >
>> >
>> > Eyal Golan
>> > egola...@gmail.com
>> >
>> > Visit: http://jvdrums.sourceforge.net/
>> > LinkedIn: http://www.linkedin.com/in/egolan74
>> >
>> > P  Save a tree. Please don't print this e-mail unless it's really
>> necessary
>> >
>>
>> -
>> 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: AjaxResponse with control characters is not validated

2009-05-07 Thread Igor Vaynberg
open a jira issue and add a quickstart please.

-igor

On Thu, May 7, 2009 at 4:12 AM, Jens Alenius  wrote:
> Hi.
> Found something that might be a wicket ajax bug.
> This code wont work in Firefox and we believe that its the Ajax xml response
> that is invalid.
> The control characters is not properly escaped. Ex: "\u0014" is written as
> 0014 in the xml Ajax Response but should be .
> See: http://www.w3.org/TR/REC-xml/#dt-charref.
>
> This code wont work in firefox
>
> Markup:
> ...
> 
>   
>   Submit
> 
> ...
>
>
>       Java:
>      
>       final Label testLabel = new Label("testValue",themodel);
>       testLabel.setOutputMarkupId(true);
>       add(testLabel);
>       Form testForm = new Form("testform");
>       testForm.add(new AjaxButton("testSubmit"){
>
>           @Override
>           protected void onSubmit(AjaxRequestTarget pTarget, Form pForm)
> {
>               themodel.setObject("\u0014");
>                             pTarget.addComponent(testLabel);
>           }                       });
>       add(testForm);
>       ...
>
> Jens Alenius
>
>
> -
> 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: Bug? Element hidden by wicket:enclosure is required?

2009-05-07 Thread Igor Vaynberg
no it is not a bug. your hierarchy has to match the markup even if
things are not visible.

-igor

On Thu, May 7, 2009 at 4:19 AM, Martin Makundi
 wrote:
> Hi!
>
> Is it a bug that wicket requires a field which is in an enclosure
> which is then not visible?
>
> 
>    
>  
> 
>
> On Java side:
> add(new WebMarkupContainer("switch").setVisible(false));
>
> wicketTester.newFormTester("form").submit();
> tester.assertNoErrorMessages();
>
> **
> Martin
>
> -
> 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: Bug? Element hidden by wicket:enclosure is required?

2009-05-07 Thread Martin Makundi
> no it is not a bug. your hierarchy has to match the markup even if
> things are not visible.

That was pseudocode.. don't mind the hierarchy. It's all about the
enclosure only. So I gather it is a bug. It does not throw exception,
the problem is just that an element hidden (only via enclosure) is
evaluated when the form is submitted.

**
Martin

>
>
> On Thu, May 7, 2009 at 4:19 AM, Martin Makundi
>  wrote:
>> Hi!
>>
>> Is it a bug that wicket requires a field which is in an enclosure
>> which is then not visible?
>>
>> 
>>
>>  
>> 
>>
>> On Java side:
>> add(new WebMarkupContainer("switch").setVisible(false));
>>
>> wicketTester.newFormTester("form").submit();
>> tester.assertNoErrorMessages();
>>
>> **
>> Martin
>>
>> -
>> 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



bug in swfObject.java --> http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html

2009-05-07 Thread Fernando Wermus
Hi all,
There is a small bug in swfObject in page:
http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html.

When SwfObject receives more than one parameter, instead of adding a comma
between them, SwfObject omits it.

This mini bug could be fixed as follows:


  private String buildDataObject(Map data) {
final String quote = "'";
final String comma=",";
if (data != null && !data.isEmpty()) {
  StringBuilder result = new StringBuilder();
  result.append("{");
  for (Map.Entry e : getParameters().entrySet()) {
result.append(quote).append(e.getKey()).append(quote + ":" +
quote).append(e.getValue()).append(quote).append(comma);
  }
  result.deleteCharAt(result.length() - 1);
  result.append("}");
  return result.toString();
}
return "{}";
  }

Besides, It doesn't work using modal windows :(.


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://mientretiempo.blogspot.com/


Re: validation message-keys differences on m3 to rc2

2009-05-07 Thread Brill Pappin

I'm having a bit of trouble with this as well.

Are the properties document any place? I can't seem to find them  
anywhere.


- brill

On 6-Apr-09, at 5:59 AM, Gianni Doe wrote:


ComponentStringResourceLoader's javadoc is very helpful here:


assume a component hierarchy like page1.form1.input1 and your are  
requesting a key named 'Required'. Wicket will search the property  
in the following order:


page1.properties => form1.input1.Required
page1.properties => Required
form1.properties => input1.Required
form1.properties => Required
input1.properties => Required
myApplication.properties => page1.form1.input1.Required
myApplication.properties => Required


What it doesn't mention is that if the form component is nested in  
another container such as a border then the border id needs to be  
included in the key.


e.g. if I have page1.form1.border1.input1 then in the form's  
properties file I have to include the border component in the key -  
border1.input1.Required, it would be cleaner just to be able to use  
input1.Required.


-Gianni



On 18/mar/09, at 21:09, Gianni Doe wrote:


https://issues.apache.org/jira/browse/WICKET-2159

On 10/mar/09, at 15:55, Igor Vaynberg wrote:


jira, quickstart, you know the drill

-igor

On Tue, Mar 10, 2009 at 3:15 AM, gilberthuph   
wrote:


I'm having exactly the same problem after moving from 1.4-rc1 ->  
1.4-rc2


Here's the extract from my properties file TaxiBookingPage.xml.


http://java.sun.com/dtd/ 
properties.dtd">


 key="generalDetails.numberOfVehiclesRequired.Required">You must

enter the number of vehicles
 .. snip ..


RC1

The key "generalDetails.numberOfVehiclesRequired.Required" is found
immediately and the appropriate message retrieved.

11:00:38.595 [http-8180-3] DEBUG org.apache.wicket.Session -  
Getting

page [path = 4:taxiBookingForm, versionNumber = 0]
11:00:38.609 [http-8180-3] DEBUG
org.apache.wicket.resource.loader.ComponentStringResourceLoader -  
Found

resource from: com/rp/webapp/taxi/TaxiBookingPage.; key:
generalDetails.numberOfVehiclesRequired.Required


RC2

Does not attempt to look up
"generalDetails.numberOfVehiclesRequired.Required" but the key
"taxiBookingForm 
.numberOfVehiclesContainer 
.numberOfVehiclesRequiredBorder 
.generalDetails.numberOfVehiclesRequired.Required"

which is not found.

10:47:47.902 [http-8180-1] DEBUG org.apache.wicket.Localizer  
- Locate
property: key: 'Required'; Component: '[MarkupContainer  
[Component id =

generalDetails.numberOfVehiclesRequired]]'
10:47:47.903 [http-8180-1] DEBUG
org.apache.wicket.resource.loader.ComponentStringResourceLoader -  
component:

'[MarkupContainer [Component id =
generalDetails.numberOfVehiclesRequired]]'; key: 'Required'
10:47:47.903 [http-8180-1] DEBUG
org.apache.wicket.resource.loader.ComponentStringResourceLoader -  
key:
'taxiBookingForm 
.numberOfVehiclesContainer 
.numberOfVehiclesRequiredBorder 
.generalDetails.numberOfVehiclesRequired.Required';
class: 'com.rp.webapp.taxi.TaxiBookingPage'; locale: 'en_GB';  
Style: 'null'

10:47:47.903 [http-8180-1] DEBUG
org.apache.wicket.resource.loader.ComponentStringResourceLoader -  
Found
properties file: 'com/rp/webapp/taxi/TaxiBookingPage.' but it  
doesn't

contain the property

So it seems the lookup algorithm hasn't changed but the message  
key.


Is this a bug or should we now be using the full form-relative  
key as shown

above?



Alexander Lohse wrote:


I could not find any reported changes concerning validation  
message

keys from version 1.4-m3 to 1.4-rc2, but I have the following
"required" key in my application resources that does not work  
anymore.

.. trim ..



--
View this message in context: 
http://www.nabble.com/validation-message-keys-differences-on-m3-to-rc2-tp22155986p22431244.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





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





smime.p7s
Description: S/MIME cryptographic signature


AW: calendar component with date & TIME field

2009-05-07 Thread Christoph Grün
Dear Ernesto,

thanks a lot - it works.

Christoph

-Ursprüngliche Nachricht-
Von: reiern70 [mailto:reier...@gmail.com] 
Gesendet: Donnerstag, 07. Mai 2009 16:53
An: users@wicket.apache.org
Betreff: Re: calendar component with date & TIME field


Maybe 

org.apache.wicket.extensions.yui.calendar.DateTimeField

Best,

Ernesto
 

Christoph Grün wrote:
> 
> Hi!
> 
>  
> 
> Is there a calendar component with date & TIME field?
> 
> The calendar components, that I know so far (e.g., YUI DatePicker) just
> provide a date field. I also would need a field for hours/minutes.
> 
> Instead of adding textfields for hours/minutes seperately, it would be
> nice
> to have them included in the calendar component.
> 
>  
> 
> Thanks, 
> 
> Christoph
> 
>  
> 
>  
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/calendar-component-with-date---TIME-field-tp23422189p23428506.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: DateTextField design issue

2009-05-07 Thread Eyal Golan
"if you want to use your own converter then override getconverter() and
return whatever you like."

True. This is what I suggested my mate when we discussed it. And I guess
this what we'll do.
But isn't using a converter for the whole application eliminates the need to
create a custom component?

Thanks


Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Thu, May 7, 2009 at 6:16 PM, Igor Vaynberg wrote:

> if you want to use your own converter then override getconverter() and
> return whatever you like.
>
> -igor
>
> On Thu, May 7, 2009 at 1:38 AM, Eyal Golan  wrote:
> > I'm going to review on Sunday the code my team mate has made .
> > I'll be able to give you more information and see if maybe we
> misunderstood
> > something.
> >
> >
> > Eyal Golan
> > egola...@gmail.com
> >
> > Visit: http://jvdrums.sourceforge.net/
> > LinkedIn: http://www.linkedin.com/in/egolan74
> >
> > P  Save a tree. Please don't print this e-mail unless it's really
> necessary
> >
> >
> > On Wed, May 6, 2009 at 6:43 PM, Igor Vaynberg  >wrote:
> >
> >> what is the full name of this class? there are two DateTextField
> >> classes in wicket codebase.
> >>
> >> -igor
> >>
> >> On Tue, May 5, 2009 at 9:51 AM, Eyal Golan  wrote:
> >> > Hello,
> >> > We use Wicket 1.3.5 and I found something annoying with the
> >> DateTextField.
> >> > In the constructor of that class, the converter is created internally.
> >> > If I want to use my own converter, I need to inherit DateTextField,
> add a
> >> > converter as a member, and return it in the getConverter method.
> >> >
> >> > Why not have a protected method (that can be overridden) that returns
> the
> >> > converter:
> >> > Instead of:
> >> >public DateTextField(String id, IModel model, String datePattern)
> >> >{
> >> >super(id, model, Date.class);
> >> >this.datePattern = datePattern;
> >> >*this.converter = new DateConverter()
> >> >{
> >> >private static final long serialVersionUID = 1L;
> >> >
> >> >/**
> >> > * @see
> >> >
> >>
> org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
> >> > */
> >> >public DateFormat getDateFormat(Locale locale)
> >> >{
> >> >return new
> >> SimpleDateFormat(DateTextField.this.datePattern);
> >> >}
> >> >};*
> >> >}
> >> >
> >> > Do something like:
> >> >public DateTextField(String id, IModel model, String datePattern)
> >> >{
> >> >super(id, model, Date.class);
> >> >this.datePattern = datePattern;
> >> >*this.converter = newDateConverter();*
> >> >}
> >> > and
> >> >
> >> > protected newDateConverter() {
> >> > return new DateConverter()
> >> >{
> >> >private static final long serialVersionUID = 1L;
> >> >
> >> >/**
> >> > * @see
> >> >
> >>
> org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
> >> > */
> >> >public DateFormat getDateFormat(Locale locale)
> >> >{
> >> >return new
> >> SimpleDateFormat(DateTextField.this.datePattern);
> >> >}
> >> >};
> >> > }
> >> >
> >> > BTW, I know that we can also use the newConverterLocator() in our
> >> > application.
> >> >
> >> > Do you think I should open a JIRA issue with 'wish' for that?
> >> >
> >> >
> >> > Eyal Golan
> >> > egola...@gmail.com
> >> >
> >> > Visit: http://jvdrums.sourceforge.net/
> >> > LinkedIn: http://www.linkedin.com/in/egolan74
> >> >
> >> > P  Save a tree. Please don't print this e-mail unless it's really
> >> necessary
> >> >
> >>
> >> -
> >> 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: Bug? Element hidden by wicket:enclosure is required?

2009-05-07 Thread Igor Vaynberg
ah, that is different and that should be fixed in latest versions i believe.

-igor

On Thu, May 7, 2009 at 9:26 AM, Martin Makundi
 wrote:
>> no it is not a bug. your hierarchy has to match the markup even if
>> things are not visible.
>
> That was pseudocode.. don't mind the hierarchy. It's all about the
> enclosure only. So I gather it is a bug. It does not throw exception,
> the problem is just that an element hidden (only via enclosure) is
> evaluated when the form is submitted.
>
> **
> Martin
>
>>
>>
>> On Thu, May 7, 2009 at 4:19 AM, Martin Makundi
>>  wrote:
>>> Hi!
>>>
>>> Is it a bug that wicket requires a field which is in an enclosure
>>> which is then not visible?
>>>
>>> 
>>>    
>>>  
>>> 
>>>
>>> On Java side:
>>> add(new WebMarkupContainer("switch").setVisible(false));
>>>
>>> wicketTester.newFormTester("form").submit();
>>> tester.assertNoErrorMessages();
>>>
>>> **
>>> Martin
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: DateTextField design issue

2009-05-07 Thread Igor Vaynberg
problem is datetextfield suppports different formats which require
different converters, so it is a bit of a special case with regard to
using a global date converter.

-igor

On Thu, May 7, 2009 at 11:16 AM, Eyal Golan  wrote:
> "if you want to use your own converter then override getconverter() and
> return whatever you like."
>
> True. This is what I suggested my mate when we discussed it. And I guess
> this what we'll do.
> But isn't using a converter for the whole application eliminates the need to
> create a custom component?
>
> Thanks
>
>
> Eyal Golan
> egola...@gmail.com
>
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
>
> P  Save a tree. Please don't print this e-mail unless it's really necessary
>
>
> On Thu, May 7, 2009 at 6:16 PM, Igor Vaynberg wrote:
>
>> if you want to use your own converter then override getconverter() and
>> return whatever you like.
>>
>> -igor
>>
>> On Thu, May 7, 2009 at 1:38 AM, Eyal Golan  wrote:
>> > I'm going to review on Sunday the code my team mate has made .
>> > I'll be able to give you more information and see if maybe we
>> misunderstood
>> > something.
>> >
>> >
>> > Eyal Golan
>> > egola...@gmail.com
>> >
>> > Visit: http://jvdrums.sourceforge.net/
>> > LinkedIn: http://www.linkedin.com/in/egolan74
>> >
>> > P  Save a tree. Please don't print this e-mail unless it's really
>> necessary
>> >
>> >
>> > On Wed, May 6, 2009 at 6:43 PM, Igor Vaynberg > >wrote:
>> >
>> >> what is the full name of this class? there are two DateTextField
>> >> classes in wicket codebase.
>> >>
>> >> -igor
>> >>
>> >> On Tue, May 5, 2009 at 9:51 AM, Eyal Golan  wrote:
>> >> > Hello,
>> >> > We use Wicket 1.3.5 and I found something annoying with the
>> >> DateTextField.
>> >> > In the constructor of that class, the converter is created internally.
>> >> > If I want to use my own converter, I need to inherit DateTextField,
>> add a
>> >> > converter as a member, and return it in the getConverter method.
>> >> >
>> >> > Why not have a protected method (that can be overridden) that returns
>> the
>> >> > converter:
>> >> > Instead of:
>> >> >    public DateTextField(String id, IModel model, String datePattern)
>> >> >    {
>> >> >        super(id, model, Date.class);
>> >> >        this.datePattern = datePattern;
>> >> >        *this.converter = new DateConverter()
>> >> >        {
>> >> >            private static final long serialVersionUID = 1L;
>> >> >
>> >> >            /**
>> >> >             * @see
>> >> >
>> >>
>> org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
>> >> >             */
>> >> >            public DateFormat getDateFormat(Locale locale)
>> >> >            {
>> >> >                return new
>> >> SimpleDateFormat(DateTextField.this.datePattern);
>> >> >            }
>> >> >        };*
>> >> >    }
>> >> >
>> >> > Do something like:
>> >> >    public DateTextField(String id, IModel model, String datePattern)
>> >> >    {
>> >> >        super(id, model, Date.class);
>> >> >        this.datePattern = datePattern;
>> >> >        *this.converter = newDateConverter();*
>> >> >    }
>> >> > and
>> >> >
>> >> > protected newDateConverter() {
>> >> >     return new DateConverter()
>> >> >        {
>> >> >            private static final long serialVersionUID = 1L;
>> >> >
>> >> >            /**
>> >> >             * @see
>> >> >
>> >>
>> org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
>> >> >             */
>> >> >            public DateFormat getDateFormat(Locale locale)
>> >> >            {
>> >> >                return new
>> >> SimpleDateFormat(DateTextField.this.datePattern);
>> >> >            }
>> >> >        };
>> >> > }
>> >> >
>> >> > BTW, I know that we can also use the newConverterLocator() in our
>> >> > application.
>> >> >
>> >> > Do you think I should open a JIRA issue with 'wish' for that?
>> >> >
>> >> >
>> >> > Eyal Golan
>> >> > egola...@gmail.com
>> >> >
>> >> > Visit: http://jvdrums.sourceforge.net/
>> >> > LinkedIn: http://www.linkedin.com/in/egolan74
>> >> >
>> >> > P  Save a tree. Please don't print this e-mail unless it's really
>> >> necessary
>> >> >
>> >>
>> >> -
>> >> 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: bug in swfObject.java --> http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html

2009-05-07 Thread Jeremy Thomerson
Please file a JIRA issue so that it doesn't get lost.

--
Jeremy Thomerson
http://www.wickettraining.com




On Thu, May 7, 2009 at 12:46 PM, Fernando Wermus
 wrote:
> Hi all,
>    There is a small bug in swfObject in page:
> http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html.
>
> When SwfObject receives more than one parameter, instead of adding a comma
> between them, SwfObject omits it.
>
> This mini bug could be fixed as follows:
>
>
>  private String buildDataObject(Map data) {
>    final String quote = "'";
>    final String comma=",";
>    if (data != null && !data.isEmpty()) {
>      StringBuilder result = new StringBuilder();
>      result.append("{");
>      for (Map.Entry e : getParameters().entrySet()) {
>        result.append(quote).append(e.getKey()).append(quote + ":" +
> quote).append(e.getValue()).append(quote).append(comma);
>      }
>      result.deleteCharAt(result.length() - 1);
>      result.append("}");
>      return result.toString();
>    }
>    return "{}";
>  }
>
> Besides, It doesn't work using modal windows :(.
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
> http://mientretiempo.blogspot.com/
>

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



Re: bug in swfObject.java --> http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html

2009-05-07 Thread Maarten Bosteels
It's a wiki page, you can fix it yourself.
Yes you can !

regards,
Maarten

On Thu, May 7, 2009 at 9:46 PM, Jeremy Thomerson
wrote:

> Please file a JIRA issue so that it doesn't get lost.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Thu, May 7, 2009 at 12:46 PM, Fernando Wermus
>  wrote:
> > Hi all,
> >There is a small bug in swfObject in page:
> > http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html.
> >
> > When SwfObject receives more than one parameter, instead of adding a
> comma
> > between them, SwfObject omits it.
> >
> > This mini bug could be fixed as follows:
> >
> >
> >  private String buildDataObject(Map data) {
> >final String quote = "'";
> >final String comma=",";
> >if (data != null && !data.isEmpty()) {
> >  StringBuilder result = new StringBuilder();
> >  result.append("{");
> >  for (Map.Entry e : getParameters().entrySet()) {
> >result.append(quote).append(e.getKey()).append(quote + ":" +
> > quote).append(e.getValue()).append(quote).append(comma);
> >  }
> >  result.deleteCharAt(result.length() - 1);
> >  result.append("}");
> >  return result.toString();
> >}
> >return "{}";
> >  }
> >
> > Besides, It doesn't work using modal windows :(.
> >
> >
> > --
> > Fernando Wermus.
> >
> > www.linkedin.com/in/fernandowermus
> > http://mientretiempo.blogspot.com/
> >
>


HybridUrlCodingStrategy and parameters with "."

2009-05-07 Thread Ryan McKinley
I'm using the HybridUrlCodingStrategy and ran into a glitch when I  
have parameter values that include the character "."


For example, if I make a link with:
params.add( "p", "Hello 2.01.00" )

This creates a link to:
http://host/context/path/p/Hello%202.01.00

and then that gets redirected to:
http://host/context/path/p/Hello%202.${page version here}

and the parameter value is lost.

Things work fine if I escape "." with "%2E":
http://host/context/path/p/Hello%202%2E01%2E00

I'm trying to follow the parameter setting code to where it actually  
does the escaping with little success.  What would be the recommended  
way to get around this limitation?  Is it something that should be  
fixed for HybridUrlCodingStrategy in general?


thanks
ryan

inmethod grid & converter/formatter?

2009-05-07 Thread Brill Pappin
I'm spiking on the inmethod grid components from wicketstuff (1.4- 
SNAPSHOT)


I need to be able to format the data in columns and or modify it for  
view only columns.


the specific case is a description field that sometime needs and  
ellipsis.


I can't see any way to add converters or formatters to the column  
models.. have anyone else tried this or come up with a solution?


So far the only solution i have is to wrap my Pojo's in another pojo  
and provide read-only access to one of the fields.


- Brill Pappin

smime.p7s
Description: S/MIME cryptographic signature


Re: inmethod grid & converter/formatter?

2009-05-07 Thread Ryan McKinley

what about just implementing AbstractLightWeightColumn#newCell?

this lets you write text directly to the output...


On May 7, 2009, at 4:15 PM, Brill Pappin wrote:

I'm spiking on the inmethod grid components from wicketstuff (1.4- 
SNAPSHOT)


I need to be able to format the data in columns and or modify it for  
view only columns.


the specific case is a description field that sometime needs and  
ellipsis.


I can't see any way to add converters or formatters to the column  
models.. have anyone else tried this or come up with a solution?


So far the only solution i have is to wrap my Pojo's in another pojo  
and provide read-only access to one of the fields.


- Brill Pappin




Re: DateTextField design issue

2009-05-07 Thread Eyal Golan
What we actually want to do is, to use the regular converter for Date.class
with a small addition.
The converter uses a DateFormat. We want to set this DateFormat:
setLenient(true).
I thought to put it in the application scope as we want this everywhere in
the application.
Following this thread, I start thinking that your previous suggestion is the
best solution for us: just override the getConverter.


Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Thu, May 7, 2009 at 9:36 PM, Igor Vaynberg wrote:

> problem is datetextfield suppports different formats which require
> different converters, so it is a bit of a special case with regard to
> using a global date converter.
>
> -igor
>
> On Thu, May 7, 2009 at 11:16 AM, Eyal Golan  wrote:
> > "if you want to use your own converter then override getconverter() and
> > return whatever you like."
> >
> > True. This is what I suggested my mate when we discussed it. And I guess
> > this what we'll do.
> > But isn't using a converter for the whole application eliminates the need
> to
> > create a custom component?
> >
> > Thanks
> >
> >
> > Eyal Golan
> > egola...@gmail.com
> >
> > Visit: http://jvdrums.sourceforge.net/
> > LinkedIn: http://www.linkedin.com/in/egolan74
> >
> > P  Save a tree. Please don't print this e-mail unless it's really
> necessary
> >
> >
> > On Thu, May 7, 2009 at 6:16 PM, Igor Vaynberg  >wrote:
> >
> >> if you want to use your own converter then override getconverter() and
> >> return whatever you like.
> >>
> >> -igor
> >>
> >> On Thu, May 7, 2009 at 1:38 AM, Eyal Golan  wrote:
> >> > I'm going to review on Sunday the code my team mate has made .
> >> > I'll be able to give you more information and see if maybe we
> >> misunderstood
> >> > something.
> >> >
> >> >
> >> > Eyal Golan
> >> > egola...@gmail.com
> >> >
> >> > Visit: http://jvdrums.sourceforge.net/
> >> > LinkedIn: http://www.linkedin.com/in/egolan74
> >> >
> >> > P  Save a tree. Please don't print this e-mail unless it's really
> >> necessary
> >> >
> >> >
> >> > On Wed, May 6, 2009 at 6:43 PM, Igor Vaynberg <
> igor.vaynb...@gmail.com
> >> >wrote:
> >> >
> >> >> what is the full name of this class? there are two DateTextField
> >> >> classes in wicket codebase.
> >> >>
> >> >> -igor
> >> >>
> >> >> On Tue, May 5, 2009 at 9:51 AM, Eyal Golan 
> wrote:
> >> >> > Hello,
> >> >> > We use Wicket 1.3.5 and I found something annoying with the
> >> >> DateTextField.
> >> >> > In the constructor of that class, the converter is created
> internally.
> >> >> > If I want to use my own converter, I need to inherit DateTextField,
> >> add a
> >> >> > converter as a member, and return it in the getConverter method.
> >> >> >
> >> >> > Why not have a protected method (that can be overridden) that
> returns
> >> the
> >> >> > converter:
> >> >> > Instead of:
> >> >> >public DateTextField(String id, IModel model, String
> datePattern)
> >> >> >{
> >> >> >super(id, model, Date.class);
> >> >> >this.datePattern = datePattern;
> >> >> >*this.converter = new DateConverter()
> >> >> >{
> >> >> >private static final long serialVersionUID = 1L;
> >> >> >
> >> >> >/**
> >> >> > * @see
> >> >> >
> >> >>
> >>
> org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
> >> >> > */
> >> >> >public DateFormat getDateFormat(Locale locale)
> >> >> >{
> >> >> >return new
> >> >> SimpleDateFormat(DateTextField.this.datePattern);
> >> >> >}
> >> >> >};*
> >> >> >}
> >> >> >
> >> >> > Do something like:
> >> >> >public DateTextField(String id, IModel model, String
> datePattern)
> >> >> >{
> >> >> >super(id, model, Date.class);
> >> >> >this.datePattern = datePattern;
> >> >> >*this.converter = newDateConverter();*
> >> >> >}
> >> >> > and
> >> >> >
> >> >> > protected newDateConverter() {
> >> >> > return new DateConverter()
> >> >> >{
> >> >> >private static final long serialVersionUID = 1L;
> >> >> >
> >> >> >/**
> >> >> > * @see
> >> >> >
> >> >>
> >>
> org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
> >> >> > */
> >> >> >public DateFormat getDateFormat(Locale locale)
> >> >> >{
> >> >> >return new
> >> >> SimpleDateFormat(DateTextField.this.datePattern);
> >> >> >}
> >> >> >};
> >> >> > }
> >> >> >
> >> >> > BTW, I know that we can also use the newConverterLocator() in our
> >> >> > application.
> >> >> >
> >> >> > Do you think I should open a JIRA issue with 'wish' for that?
> >> >> >
> >> >> >
> >> >> > Eyal Golan
> >> >> > egola...@gmail.com
> >> >> >
> >> >> > Visit: http://jvdrums.sou

Ajax Request Security

2009-05-07 Thread Douglas Ferguson
It just dawned on me that most users will protect their url parameters to make 
sure that end users can't fiddle with parameters and see inappropriate data, 
however, is it conceivable to issue ajax requests to get an app to do something 
it shouldn't?

If so, any tips on how to build a request that would cause an ajax response? Is 
important to protect all ajax calls? 

Dougals

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



Re: Ajax Request Security

2009-05-07 Thread Jeremy Thomerson
Ajax requests, like non-bookmarkable links within Wicket, are
inherently secure through the fact that they are session-relative.
That is, unless you specifically try to make it less secure, it is
secure by default in that I can not just twiddle with an ID field in
the request URL to edit an entity with a different ID.

However, many ajax requests may submit form data.  And, of course, all
such data DOES need to be checked - which should be accomplished
automatically if you have added validation to your form fields.
Again, the URL is session-relative, and can't be emailed to someone
else for them to use or fiddled with to create an unexpected request.
But the data itself that is submitted must always be verified.

--
Jeremy Thomerson
http://www.wickettraining.com




On Thu, May 7, 2009 at 5:22 PM, Douglas Ferguson
 wrote:
> It just dawned on me that most users will protect their url parameters to 
> make sure that end users can't fiddle with parameters and see inappropriate 
> data, however, is it conceivable to issue ajax requests to get an app to do 
> something it shouldn't?
>
> If so, any tips on how to build a request that would cause an ajax response? 
> Is important to protect all ajax calls?
>
> Dougals
>
> -
> 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: bug in swfObject.java --> http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html

2009-05-07 Thread Fernando Wermus
done


On Thu, May 7, 2009 at 12:48 PM, Maarten Bosteels
wrote:

> It's a wiki page, you can fix it yourself.
> Yes you can !
>
> regards,
> Maarten
>
> On Thu, May 7, 2009 at 9:46 PM, Jeremy Thomerson
> wrote:
>
> > Please file a JIRA issue so that it doesn't get lost.
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
> >
> >
> >
> > On Thu, May 7, 2009 at 12:46 PM, Fernando Wermus
> >  wrote:
> > > Hi all,
> > >There is a small bug in swfObject in page:
> > > http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html.
> > >
> > > When SwfObject receives more than one parameter, instead of adding a
> > comma
> > > between them, SwfObject omits it.
> > >
> > > This mini bug could be fixed as follows:
> > >
> > >
> > >  private String buildDataObject(Map data) {
> > >final String quote = "'";
> > >final String comma=",";
> > >if (data != null && !data.isEmpty()) {
> > >  StringBuilder result = new StringBuilder();
> > >  result.append("{");
> > >  for (Map.Entry e : getParameters().entrySet()) {
> > >result.append(quote).append(e.getKey()).append(quote + ":" +
> > > quote).append(e.getValue()).append(quote).append(comma);
> > >  }
> > >  result.deleteCharAt(result.length() - 1);
> > >  result.append("}");
> > >  return result.toString();
> > >}
> > >return "{}";
> > >  }
> > >
> > > Besides, It doesn't work using modal windows :(.
> > >
> > >
> > > --
> > > Fernando Wermus.
> > >
> > > www.linkedin.com/in/fernandowermus
> > > http://mientretiempo.blogspot.com/
> > >
> >
>



-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://mientretiempo.blogspot.com/


Re: Wicket & SWFObject

2009-05-07 Thread Fernando Wermus
I couldnt make it work with Modal Window :(

On Tue, May 5, 2009 at 2:33 AM, Martin Grigorov  wrote:

> check this
> http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html
>
> El lun, 04-05-2009 a las 22:54 -0700, Douglas Ferguson escribió:
> > I just figured out that the deal is that SWFObject doesn't like to be set
> visible false on page load then visible true via Ajax.
> >
> > Any thoughts on how to get around this?
> >
> > D/
> >
> > -Original Message-
> > From: Douglas Ferguson [mailto:doug...@douglasferguson.us]
> > Sent: Tuesday, May 05, 2009 12:20 AM
> > To: users@wicket.apache.org
> > Subject: Wicket & SWFObject
> >
> > Has anybody successfully got SWFObject to work on a wicket page?
> >
> > Douglas
> >
> > -
> > 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
>
>


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://mientretiempo.blogspot.com/


RE: Ajax Request Security

2009-05-07 Thread Douglas Ferguson
How is this session relative security implemented?

Is this really just security through obfuscation?

I.E. If you know the session id could you make valid Ajax Requests?

Douglas

-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Thursday, May 07, 2009 5:26 PM
To: users@wicket.apache.org
Subject: Re: Ajax Request Security

Ajax requests, like non-bookmarkable links within Wicket, are
inherently secure through the fact that they are session-relative.
That is, unless you specifically try to make it less secure, it is
secure by default in that I can not just twiddle with an ID field in
the request URL to edit an entity with a different ID.

However, many ajax requests may submit form data.  And, of course, all
such data DOES need to be checked - which should be accomplished
automatically if you have added validation to your form fields.
Again, the URL is session-relative, and can't be emailed to someone
else for them to use or fiddled with to create an unexpected request.
But the data itself that is submitted must always be verified.

--
Jeremy Thomerson
http://www.wickettraining.com




On Thu, May 7, 2009 at 5:22 PM, Douglas Ferguson
 wrote:
> It just dawned on me that most users will protect their url parameters to 
> make sure that end users can't fiddle with parameters and see inappropriate 
> data, however, is it conceivable to issue ajax requests to get an app to do 
> something it shouldn't?
>
> If so, any tips on how to build a request that would cause an ajax response? 
> Is important to protect all ajax calls?
>
> Dougals
>
> -
> 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: inmethod grid & converter/formatter?

2009-05-07 Thread Brill Pappin

that would certainly work, but I'd lose the editor column I'm using ;)
All i really need is to be able to add a display formatter so i can  
truncate the content with an ellipsis. Even a method i could override  
when its outputting the label content would work. If there is such a  
method, I'm unsure where it is.


I constantly need to reformat some content into something the user can  
see. but with a inmethod grid, you actually need a display formatter  
and an editor formatter.


- Brill Pappin

On 7-May-09, at 4:21 PM, Ryan McKinley wrote:


what about just implementing AbstractLightWeightColumn#newCell?

this lets you write text directly to the output...


On May 7, 2009, at 4:15 PM, Brill Pappin wrote:

I'm spiking on the inmethod grid components from wicketstuff (1.4- 
SNAPSHOT)


I need to be able to format the data in columns and or modify it  
for view only columns.


the specific case is a description field that sometime needs and  
ellipsis.


I can't see any way to add converters or formatters to the column  
models.. have anyone else tried this or come up with a solution?


So far the only solution i have is to wrap my Pojo's in another  
pojo and provide read-only access to one of the fields.


- Brill Pappin






smime.p7s
Description: S/MIME cryptographic signature


Form that gets data form multiple models.

2009-05-07 Thread Chris
I have a form that combines data from multiple pojo's.  Currently I am 
creating two  seperate IModels inside my form, something like this.


IModel model1 = new LoadableDetachableModel() {
 @Override
  protected Object load() { ... }
};

IModel model2 = new LoadableDetachableModel() {
 @Override
  protected Object load() { ... }
};

add(new TextField("foo", new PropertyModel(model1, "foo")));
add(new TextField("bar", new PropertyModel(model2, "bar")));


When the form is submitted, what's the best way to get the form 
components back into their respected object models?


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



Re: Ajax Request Security

2009-05-07 Thread Jeremy Thomerson
If you have someone's session ID (within the lifetime of the session)
you can break into any application - java, php, etc.  That's just how
it is.  But if you have that level of information on them while the
session is still live, then you are either already pulling off a man
in the middle attack, sniffing their packets, or have compromised
their machine or the server.

It's not obfuscation - the links are relative to the path that you
took through the application.  When your session expires, they can't
be used any more.  But if you sent the link to someone else, in their
session, the link wouldn't even work unless they took a path so
similar to yours that their page map was the same (i.e. the fifth page
in the page map was the edit users page, and they could click the
sixth "editFoo" link on that page).

Just look at the URLs that are generated when you add(new Link("foo")
{ public void onClick() {}};  - Now copy those to another computer and
try them - no bueno.  Now, dump your cookies and get a new session -
try the link - no bueno.

And then, you should have action-level security anyway - so it should
protect from unauthorized users completing actions that they should
not be.  And typically your normal Ajax behavior should not be
deleting / editing unless it is a form post (which you need to verify
ajax or not) or a link (which again, needs to be subject to your
role-based security).

--
Jeremy Thomerson
http://www.wickettraining.com




On Thu, May 7, 2009 at 6:29 PM, Douglas Ferguson
 wrote:
> How is this session relative security implemented?
>
> Is this really just security through obfuscation?
>
> I.E. If you know the session id could you make valid Ajax Requests?
>
> Douglas
>
> -Original Message-
> From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
> Sent: Thursday, May 07, 2009 5:26 PM
> To: users@wicket.apache.org
> Subject: Re: Ajax Request Security
>
> Ajax requests, like non-bookmarkable links within Wicket, are
> inherently secure through the fact that they are session-relative.
> That is, unless you specifically try to make it less secure, it is
> secure by default in that I can not just twiddle with an ID field in
> the request URL to edit an entity with a different ID.
>
> However, many ajax requests may submit form data.  And, of course, all
> such data DOES need to be checked - which should be accomplished
> automatically if you have added validation to your form fields.
> Again, the URL is session-relative, and can't be emailed to someone
> else for them to use or fiddled with to create an unexpected request.
> But the data itself that is submitted must always be verified.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Thu, May 7, 2009 at 5:22 PM, Douglas Ferguson
>  wrote:
>> It just dawned on me that most users will protect their url parameters to 
>> make sure that end users can't fiddle with parameters and see inappropriate 
>> data, however, is it conceivable to issue ajax requests to get an app to do 
>> something it shouldn't?
>>
>> If so, any tips on how to build a request that would cause an ajax response? 
>> Is important to protect all ajax calls?
>>
>> Dougals
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Form that gets data form multiple models.

2009-05-07 Thread Jeremy Thomerson
Make those models private fields within your form.  Make sure that you
are overriding onDetach in the form and detaching them (even though
the PropertyModel should chain the detach down to it's nested model -
this is a good habit to get into so that you don't forget somewhere
else).

--
Jeremy Thomerson
http://www.wickettraining.com




On Thu, May 7, 2009 at 9:54 PM, Chris  wrote:
> I have a form that combines data from multiple pojo's.  Currently I am
> creating two  seperate IModels inside my form, something like this.
>
> IModel model1 = new LoadableDetachableModel() {
> �...@override
>  protected Object load() { ... }
> };
>
> IModel model2 = new LoadableDetachableModel() {
> �...@override
>  protected Object load() { ... }
> };
>
> add(new TextField("foo", new PropertyModel(model1, "foo")));
> add(new TextField("bar", new PropertyModel(model2, "bar")));
>
>
> When the form is submitted, what's the best way to get the form components
> back into their respected object models?
>
> -
> 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



How to avoid code duplication on forms?

2009-05-07 Thread Christian Helmbold

Hello,

Wicket uses input validation on the presentation layer. This leads often to 
code duplication and I'm looking for a way to avoid it.

Example: I have a registration form where you fill in your first and last name, 
password and so on. Every field has its restrictions like max length or 
required. Registered users have a form for their personal information with 
additional fields. The password can be changed on a seperate page.

How can I avoid to double the programmtic configuration of the form fields? To 
extract and reuse panels is not an option, because of the different composition 
of the forms. 

a) I could create a subclass for every form field, but this would be a lot of 
writing.

b)I could create something like a FormFieldFactory:

public class UserFormFieldFactory
{
public static TextField createEmailField()
{
return new TextField("email")
.setRequired(true)
.add(EmailAddressValidator.getInstance())
.add(UniqueValidator.unique(SystemUser.class, "email"));
}

public static PasswordTextField createPasswordField()
{
...
}
...
}

c) ?

How do you avoid code duplication on forms?

Regards,
Christian




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