Re: Nested forms not working in wizard.

2009-07-15 Thread Ned Collyer
Thanks I got it sorted.

Previously I was overriding delegateSubmit to perform validation.  I
have moved some of my validation logic into onSubmit which has
remedied the situation.

On Tue, Jul 7, 2009 at 9:01 PM, nino martinez
wael wrote:
> Hi Ned
>
> I know I have something similar, but my part are working.. It's pretty
> hard digesting without code.. :(
>
> 2009/7/7 Ned Collyer :
>> The nesting is -
>>
>> The outer form is inside the wizard, then I have an inner form inside
>> one of the steps.
>>
>> Sorry, I cant show you the output of the html - I scrapped the impl I
>> had am implementing a less "wizardy" wizard.
>>
>> On Mon, Jul 6, 2009 at 8:36 PM, nino martinez
>> wael wrote:
>>> Is the form nested in the other form in html. I remember vaguely
>>> something about it needs to be nested, wicket then rewrites it or
>>> something like that.. How does the resulting html look like?
>>>
>>> 2009/7/6 Ned Collyer :
>>>> I am currently running wicket 1.4-rc2
>>>>
>>>> I have nested forms setup in the wizard.  One of my steps is as follows.
>>>>
>>>> 
>>>> public class MyStep1 extends WizardStep {
>>>>    public MyStep1(final CompoundPropertyModel campaignModel) {
>>>>        super("Step 1", "Wow bananas");
>>>>
>>>>        add(new Form("form") {
>>>>           �...@override
>>>>            protected void onSubmit() {
>>>>                super.onSubmit();  <--- never fired
>>>>            }
>>>>        });
>>>>    }
>>>> }
>>>> 
>>>>
>>>>
>>>> The wizard successfully navigates between steps, and validation occurs
>>>> against any fields in the nested forms.
>>>>
>>>>
>>>> The onSubmit of the inner form is never fired - this is ... pretty 
>>>> annoying :)
>>>>
>>>> Any ideas?
>>>>
>>>> -
>>>> 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
>
>

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



FileUploads - keep them around for multiple requests...

2009-07-15 Thread Ned Collyer
I'm building a wizard.  It has 3 steps.  Persistence occurs for all my
models after the completion of the 3rd step.

Each step has a number of forms.  Each form is brought in dynamically
from 3rd party jars.

This works great so far.  The exception to the rule is FileUploads -
as these are only available for the initial submission.

What would be the best way to maintain a handle on the file so that I
can read the bytes in step 3.

I am wary of the fileupload field being IClusterable, and of the bytes
themselves being transient.

Also, I do not have access to any functionality in the dynamic forms.
They are purely used for updating a model object .


Thoughts:
In the outer form when it is submitted, visit each form for "enabled"
fileuploads and write tmp files out.  I do not want them floating
around in memory.
Find the inner forms modelobject, and update it with a reference to
the file created.

Is there a better way?

Rgds

Ned

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



Re: Nested forms not working in wizard.

2009-07-06 Thread Ned Collyer
The nesting is -

The outer form is inside the wizard, then I have an inner form inside
one of the steps.

Sorry, I cant show you the output of the html - I scrapped the impl I
had am implementing a less "wizardy" wizard.

On Mon, Jul 6, 2009 at 8:36 PM, nino martinez
wael wrote:
> Is the form nested in the other form in html. I remember vaguely
> something about it needs to be nested, wicket then rewrites it or
> something like that.. How does the resulting html look like?
>
> 2009/7/6 Ned Collyer :
>> I am currently running wicket 1.4-rc2
>>
>> I have nested forms setup in the wizard.  One of my steps is as follows.
>>
>> 
>> public class MyStep1 extends WizardStep {
>>    public MyStep1(final CompoundPropertyModel campaignModel) {
>>        super("Step 1", "Wow bananas");
>>
>>        add(new Form("form") {
>>           �...@override
>>            protected void onSubmit() {
>>                super.onSubmit();  <--- never fired
>>            }
>>        });
>>    }
>> }
>> 
>>
>>
>> The wizard successfully navigates between steps, and validation occurs
>> against any fields in the nested forms.
>>
>>
>> The onSubmit of the inner form is never fired - this is ... pretty annoying 
>> :)
>>
>> Any ideas?
>>
>> -
>> 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



Nested forms not working in wizard.

2009-07-05 Thread Ned Collyer
I am currently running wicket 1.4-rc2

I have nested forms setup in the wizard.  One of my steps is as follows.


public class MyStep1 extends WizardStep {
public MyStep1(final CompoundPropertyModel campaignModel) {
super("Step 1", "Wow bananas");

add(new Form("form") {
@Override
protected void onSubmit() {
super.onSubmit();  <--- never fired
}
});
}
}



The wizard successfully navigates between steps, and validation occurs
against any fields in the nested forms.


The onSubmit of the inner form is never fired - this is ... pretty annoying :)

Any ideas?

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



FormComponentPanel - ajaxifying

2009-06-04 Thread Ned Collyer
Hi,

I have a FormComponentPanel which contains several select boxes.

Title
Model
Transmission

I'd like to be able to be able to do the following - but not sure how
to achieve it.


MyAwesomeComponent extends FormComponentPanel

new MyAwesomeComponent.add(new OnChangeAjaxBehavior() {
   onUpdate(AjaxRequestTarget target)  {
 geblah geblah

  }
)



How do i get the inner components - when they change, to trigger that
an ajax event has occurred on MyAwesomeComponent?

Rgds

Ned

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



Re: Question re: style and variation

2009-03-04 Thread Ned Collyer

What I'm trying to do at the moment (and the purpose of starting this thread)
is creating custom form fields, that have different types of HTML depending
on the variant.

So I could do

new LabelledTextField("banana") {
  public String getVariation() {
return "complex";
  } 
}

new LabelledTextField("banana") {
  public String getVariation() {
return "basic";
  } 
}

I need these to work in conjunction with style which is driven by the users
session.  This handles the "skin" or look n feel of the app, and various
branded images.


An alternative approach could be:

Style = handles just the css filename and images
Locale = handles the properties files and images
Variant = handles the HTML files

Not all resources are created equal.


Brill Pappin wrote:
> 
> For my own edification, I missed the thread on "style".
> what exactly is the "style" that is different from the variation?
> 
> I guess for Locale, it *does* use the double underscores when you have  
> a placeholder as in the case of a country only.
> I think its a familiar model and using it for another "feature" would  
> not be so bad (although I admin, it's ugly)... I'd be very cautious  
> about what other chars you use as delimiters though.
> 
> - Brill
> 

-- 
View this message in context: 
http://www.nabble.com/Question-re%3A-style-and-variation-tp22302526p22341732.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: Question re: style and variation

2009-03-03 Thread Ned Collyer

IMO, the brackets approach works because it clearly separates each of the
sections.

It is a bit ugly, but its still simple.

Can't please everyone all of the time, but we can try to give the clients
the right stuff, and the devs the power to build it :).


yeah, not to mention it might get quiet ugly

mypanel_style.html
mypanel_style__variant.html
mypanel_style__variant___locale.html

mypanel__variant.html

mypanel___locale.html

markup(locale)(style)(variant) might work and is simpler

mypanel(en_us).html

mypanel(en_us)()(variant).html

but sure looks ugly... :)

not sure which one is better

-igor

-- 
View this message in context: 
http://www.nabble.com/Question-re%3A-style-and-variation-tp22302526p22319926.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: Question re: style and variation

2009-03-02 Thread Ned Collyer

Yep :).

I at least 1 thought on this matter.

Currently, I have a "webapp" module - which will have my components in it,
and my components variants.

I have pushed all i18n into properties files - which is working thus far.

I allow the clients to customise their HTML from another folder - ie,
someplace on the filesystem outside of the war.

The lookup for html files for me .. should be

custom dir - myPanel_myVariant_myStyle.html
webapp.war - myPanel_myVariant_myStyle.html
custom dir - myPanel_myVariant.html 
webapp.war - myPanel_myVariant.html
custom dir - myPanel_myStyle.html 
webapp.war - myPanel_myStyle.html
custom dir - myPanel.html 
webapp.war - myPanel.html

I have a similar thing in place for properties files - and the result is
actually a merge of the properties between filesystem and classpath.

So many ways to skin a cat.  If only we could skin this cat with locale,
style AND variant - each optional.

More static count of delimiters? Folder structure? Different delimiters? 
Different data in filename? Contents of file?

The balancing act is keeping it simple - which its currently nailed, but not
quite as useful as it could be!!!


igor.vaynberg wrote:
> 
> the problem is, if you have MyPanel_foo.html, is foo the style, the
> variation, or the locale?
> 
> perhaps we can identify the parts differently...needs some thinking.
> 
> -igor
> 

-- 
View this message in context: 
http://www.nabble.com/Question-re%3A-style-and-variation-tp22302526p22303708.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



Question re: style and variation

2009-03-02 Thread Ned Collyer

Hi,

I have browsed/read the previous threads regarding this topic and read the
wiki on styling and localisation - but its inconclusive as to how this
should be tackled.

I have my app running on multiple domains.

Each domain - when you hit it, sets a style into the session - so they
appear to be different apps.

So I can have something like

MyPanel_client1_en_AU.html

most of the time this will resolve to

MyPanel.html

Now, if I want to have a component implemented inside MyPanel, with its own
variant, then I was hoping to do this:

MyComponent_myVariant.html

However - the lookup I get is
MyComponent_myVariant_client1_en_AU.html
...
MyComponent_myVariant_client1.html
MyComponent.html

It treats "myVariant_client1" as a single style value.

Now - the wiki says that this is expected (see
http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications.html)
- it also says that the possibilities are "exponential" ;)

How would I achieve variants working in conjunction with style?

Seems the touchpoints would be writing my own ResourceNameIterator, and
writing my own ResourceStreamLocator.

Surely there is a cleaner simpler way - It feels dirty having to add this
functionality, and the existence of ResourceNameIterator and
ResourceStreamLocator indicates that it has already been thought about a
fair amount.
-- 
View this message in context: 
http://www.nabble.com/Question-re%3A-style-and-variation-tp22302526p22302526.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



NPE thrown from CheckBoxMultipleChoice when submitting a form.

2009-02-25 Thread Ned Collyer

After update to rc2 - I am getting an NPE on a CheckBoxMultipleChoice when
submitting a form.

The NPE is thrown from the same area that the following Jira addresses.

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

This patch does not appear in 1.4-rc2.

The stack I'm getting is

Caused by: java.lang.NullPointerException
at java.util.AbstractCollection.addAll(AbstractCollection.java:303)
at
org.apache.wicket.markup.html.form.ListMultipleChoice.updateModel(ListMultipleChoice.java:327)
at
org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223)
at
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:488)
at
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:467)
at
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:467)
at
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:467)
at
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrderHelper(FormComponent.java:467)
at
org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:439)
at
org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:1975)
at
org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:1938)
at org.apache.wicket.markup.html.form.Form.process(Form.java:960)
at org.apache.wicket.markup.html.form.Form.process(Form.java:908)
at 
org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:876)


Ideas please?

I am grabbing the source and going to scour changes - but its ... quite
difficult to debug.

This update from rc1 to rc2 has been much more problematic for me than 1.3
to 1.4, and the various other minor revisions.
-- 
View this message in context: 
http://www.nabble.com/NPE-thrown-from-CheckBoxMultipleChoice-when-submitting-a-form.-tp22216434p22216434.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: Upgrading to 1.4-rc2 - bug with form tester?

2009-02-23 Thread Ned Collyer

Perhaps this is the problem?

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

I'll change my test to have an invalid field.


Ned Collyer wrote:
> 
> Hi,
> 
> I have the following - which was working on 1.4-rc1
> 
> FormTester formTester = wicketTester.newFormTester("panel:form");
> formTester.getForm().error("test error");
> formTester.submit();
> 
> With 1.4-rc1 this code would not execute the forms onSubmit() method,
> because an error had been raised against the form.
> 
> With 1.4-rc2, the onSubmit is being executed, which is giving me errors in
> my tests - unexpected calls to mock objects.
> 
> I've scanned through the changelog and nothing jumps out at me as
> obviously effecting this.
> 
> Any ideas?
> 

-- 
View this message in context: 
http://www.nabble.com/Upgrading-to-1.4-rc2---bug-with-form-tester--tp22172382p22174427.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



Upgrading to 1.4-rc2 - bug with form tester?

2009-02-23 Thread Ned Collyer

Hi,

I have the following - which was working on 1.4-rc1

FormTester formTester = wicketTester.newFormTester("panel:form");
formTester.getForm().error("test error");
formTester.submit();

With 1.4-rc1 this code would not execute the forms onSubmit() method,
because an error had been raised against the form.

With 1.4-rc2, the onSubmit is being executed, which is giving me errors in
my tests - unexpected calls to mock objects.

I've scanned through the changelog and nothing jumps out at me as obviously
effecting this.

Any ideas?
-- 
View this message in context: 
http://www.nabble.com/Upgrading-to-1.4-rc2---bug-with-form-tester--tp22172382p22172382.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: Need help editing a Map plz.

2009-01-19 Thread Ned Collyer

Bleh - its one of those days.

Changed the base of the form fields from FormComponentPanel back to Panel -
and bobs ur uncle.

Sorry for the list noise (recovering from holidays still).



Ned Collyer wrote:
> 
> No - i officially don't know what's wrong :)
> 
> This is my snippet
> 
> -
> List list = new
> ArrayList(model.getObject().getConstraints().keySet());
> // display any existing constraints
> form.add(new ListView("fields", list) {
> protected void populateItem(ListItem listItem) {
> final Label label = new Label("label", new
> Model(model.getObject().getDocumentType()));
>
> label.setDefaultModelObject(label.getString(listItem.getModelObject()));
> listItem.add(label);
> listItem.add(new ListView("constraints", new
> PropertyModel>(model, String.format("constraints[%s]",
> listItem.getModelObject( {
> protected void populateItem(ListItem
> listItem) {
>
> listItem.add(getConstraintFormField(listItem.getModel()));
> }
> }.setReuseItems(true));
> }
> }.setReuseItems(true));
> 
> 
> The only constraint form field is this
>public LengthBetweenConstraintField(String id, IModel model) {
> super(id, model);
> add(new TextField("minimum", new PropertyModel(model,
> "minimum")));
> add(new TextField("maximum", new PropertyModel(model,
> "maximum")));
> }
> 
> 
> When the page is rendered - the correct values appear.  However when it's
> submitted - the values for max and minimum are set to null.
> 
> HELP :)
> 

-- 
View this message in context: 
http://www.nabble.com/Need-help-editing-a-Map-plz.-tp21554555p21556545.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: Need help editing a Map plz.

2009-01-19 Thread Ned Collyer

No - i officially don't know what's wrong :)

This is my snippet

-
List list = new
ArrayList(model.getObject().getConstraints().keySet());
// display any existing constraints
form.add(new ListView("fields", list) {
protected void populateItem(ListItem listItem) {
final Label label = new Label("label", new
Model(model.getObject().getDocumentType()));
   
label.setDefaultModelObject(label.getString(listItem.getModelObject()));
listItem.add(label);
listItem.add(new ListView("constraints", new
PropertyModel>(model, String.format("constraints[%s]",
listItem.getModelObject( {
protected void populateItem(ListItem
listItem) {
   
listItem.add(getConstraintFormField(listItem.getModel()));
}
}.setReuseItems(true));
}
}.setReuseItems(true));


The only constraint form field is this
   public LengthBetweenConstraintField(String id, IModel model) {
super(id, model);
add(new TextField("minimum", new PropertyModel(model, "minimum")));
add(new TextField("maximum", new PropertyModel(model, "maximum")));
}


When the page is rendered - the correct values appear.  However when it's
submitted - the values for max and minimum are set to null.

HELP :)
-- 
View this message in context: 
http://www.nabble.com/Need-help-editing-a-Map-plz.-tp21554555p21556339.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: Need help editing a Map plz.

2009-01-19 Thread Ned Collyer

Got it licked - stuffed up the editors.  Specifically I neglected
convertInput because I happen to be an idiot.

Thanks JT - I have the keyset stuff down already ;)

I was just wondering why my constraints were instantiated, but when they
were submitted their inner detail was nulled out.  Makes sense now.


Jeremy Thomerson-5 wrote:
> 
> Maybe try a RepeatingView of some sort (ListView?) over new
> ArrayList(map.keySet())...
> 
> 
> Jeremy Thomerson
> http://www.wickettraining.com
> -- sent from a wireless device
> 

-- 
View this message in context: 
http://www.nabble.com/Need-help-editing-a-Map-plz.-tp21554555p21555867.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



Need help editing a Map plz.

2009-01-19 Thread Ned Collyer

Hi Guys,

I have a data construct which is as follows:

Template
  Map> fieldConstraints;

The map is fieldname against a list of constraints.

Eg, I might have "firstName" as the field, and the following constraints
  length between 2 and 16 characters
  mandatory
  alphas only

I have editors for each of the constraints - that bit was easy.
I can also render out the field names, and the editors.

My question is, how do I bind the editors to the instances that are within
the map?
-- 
View this message in context: 
http://www.nabble.com/Need-help-editing-a-Map-plz.-tp21554555p21554555.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



Moments of awesome.

2009-01-05 Thread Ned Collyer

So, every once in a while - I get some buzz.

Wicket is really .. well thought out.. great puzzle.  Understanding it is an
absolute blast.

It's a great meld with Java.  One of the missing ingredients.

Today is full of wicket awesome.

Thanks.
-- 
View this message in context: 
http://www.nabble.com/Moments-of-awesome.-tp21301568p21301568.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: Is wicket:extend strictly required if including entire html child?

2008-12-22 Thread Ned Collyer

It is slightly ironic.  Java, when we change default behaviour - we annotate
methods with @Override.

Its not a dissimilar solution.  I can appreciate both decisions.

Same same but different.

What's the "norm" coding wise - what's more convenient? - I think when the
answer is "depends" - you can go either way.


Antony Stubbs wrote:
> 
> That's a pity - in my situation I would like the absence of the
> wicket:extend tag to mean the child wants to be completely encapsulated by
> it's parent. 
> It's useful because you can have your java class extend a parent without
> having to modify the html, in my case the grand parent has the important
> html that I want included in all children, but that means i have to put
> the extend tag into all the children, instead of just one place - the
> parent.
> 
> 
> igor.vaynberg wrote:
>> 
>> no it is not. not including wicket:extend means the child wants to
>> completely override the markup of the parent.
>> 
>> -igor
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Is-wicket%3Aextend-strictly-required-if-including-entire-html-child--tp20975395p21138307.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: Round corners n' stuff? Possible Contribution?

2008-12-22 Thread Ned Collyer

Ok - so I investigated a bit more - turns out I had a greasemonkey script
messing with it.  DOH.

It looks beautiful :) - all works now.  (and turns out safari is ok - i was
under the impression example 7 was misbehaving).

Sorry for the confusion.
-- 
View this message in context: 
http://www.nabble.com/Round-corners-n%27-stuff--Possible-Contribution--tp21097913p21126358.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: Round corners n' stuff? Possible Contribution?

2008-12-21 Thread Ned Collyer

FYI, I cannot see the liquid stuff with the latest firefox on osx leopard -
its borked.

Also looks like crap in safari :)

Soo bring on the nifty - but I wouldn't waste your time on liquid canvas
because I do not believe the browser support (currently) warrants your
effort.

I think it would be valuable to add support AFTER nifty corners - but if the
browsers never play nice, you will have wasted a bit of time.  Sure you
might have learned something cool, so perhaps thats not so bad, but if the
Liquid Canvas becomes defunct - then you're carrying baggage that will never
reach its potential of awesome - and it could be a deterrent from using your
lib.

I hope I have conveyed my thoughts adequately - and not quelled passionate
development :)


Nino Martinez-2 wrote:
> 
> Ok cool.. I heard that nifty corners require less cpu and are smaller 
> than liquid... Thats why I want to support the two...
> 
> I'll go ahead and hack something together :)
> 

-- 
View this message in context: 
http://www.nabble.com/Round-corners-n%27-stuff--Possible-Contribution--tp21097913p21122955.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: Question re wicket:enclosure tag and resource resolution with wicket:message tags

2008-12-15 Thread Ned Collyer

I can appreciate what it currently does - I just think it could be a little
more convenient.

It would still provide the default behavior, but allow keys to be translated
with the child scope primarily - in the same way it allows visibility to be
driven with the child scope.

Thanks for your feedback Igor.


igor.vaynberg wrote:
> 
> i do not think this is the irght way to go. the nesting is:
> 
> 
>
>
> 
> so clearly the key is owned by the panel. these are the rules for
> wicket:message. keep in mind the tag is a convinience and so we try to
> keep it as simple as possible. you can always add a label that uses
> whatever you want as the localizer.
> 
> -igor
> 

-- 
View this message in context: 
http://www.nabble.com/Question-re-wicket%3Aenclosure-tag-and-resource-resolution-with-wicket%3Amessage-tags-tp21008465p21023555.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



Question re wicket:enclosure tag and resource resolution with wicket:message tags

2008-12-14 Thread Ned Collyer

I think it would be useful if the message resolution inside a
wicket:enclosure used the "child" (or implicit child) as the component that
is sent thru the localiser.

This is the scenario

OverviewPanel extends Panel









 # [name] 













 # [name] 






ProductsListView.properties
  name=Product

CustomersListView.properties
  name=Customers

I think what's happening at the moment is the OverviewPanel instance is
passed through to the localiser, and as such, its trying to resolve the
wicket:message tag "name" against the OverviewPanel.

If the child element of the enclosure was sent to the localiser, then it
would make the above example work  (This is a  sensible usecase IMO).

Any missing resources would then try to be resolved against the parent - aka
OverviewPanel.

Any thoughts around this?
-- 
View this message in context: 
http://www.nabble.com/Question-re-wicket%3Aenclosure-tag-and-resource-resolution-with-wicket%3Amessage-tags-tp21008465p21008465.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: Terracotta integration and issue sharing pagemaps

2008-12-10 Thread Ned Collyer

>From a quick glance (and im not at all familiar with PageableListView - but
am alright with their parent - ListView)

Has it anything to do with not calling setReuseItems(true) on the list view
itself? - Ie, its destroying the links, then recreating them each request?

Rgds

Ned



Michael Oswell wrote:
> 
> I am running into an issue that I _think_ is related to our terracotta  
> installation.
> 
> 1.  User visits page with a PageableListView.
> 2.  User navigates to another page in the PageableListView
> 3.  User clicks on a link generated within the listview
> 
> The following exception is generated
> 
>>> org.apache.wicket.WicketRuntimeException: component  
>>> mainContentPanel:photoListContainer:photoList:82:switchLink not  
>>> found on page com.example.wicket.pages.ExamplePage[id = 2],  
>>> listener interface = [RequestListenerInterface  
>>> name=IBehaviorListener, method=public abstract void  
>>> org.apache.wicket.behavior.IBehaviorListener.onRequest()]
> 
> 
> If I run only one server, then everything works as expected.  As soon  
> as I add extra servers I begin to see this error.
>  From what I can tell, it appears as though the page map is not being  
> distributed via terracotta, though I could be wrong. :)
> The reason I think this is it appears as though the PageableListView  
> page that I navigate to doesn't exist in the pagemap on the server  
> that handles the request when I click a link and as such, generates  
> the above exception.
> 
> Installation:
>   Terracotta 2.7.1
>   Wicket 1.3.5
>   tim-wicket-1.3-1.1.3
> 
> Any suggestions welcome.
> 
> thanks,
> 
> -- Mike
> 

-- 
View this message in context: 
http://www.nabble.com/Terracotta-integration-and-issue-sharing-pagemaps-tp20946423p20947187.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: LoadableDetachableModel in Listview

2008-12-09 Thread Ned Collyer

Well... as far as validators are concerned - there is some murky water. 
Depending on your design, the services/domain layer should include object
validation - this allows you to expose services.  The trick is getting these
validators to be shared by the view layer AND the service layer.

I'm not sure if a technology exists to bridge this gap.  Spring validators
are close, but do not go into the realm of per field validation - only
object validation.  I've written some code to bridge this in a "usable"
fashion - but it's not perfect.

I like wickets handling of field validation - but am not sure its
appropriate at a domain/service layer level.

Handling of the validation decision really boils down to:
1/ is my app based on wicket - all interfacing with the app is via wicket.
<-- this makes it easy.
2/ or is wicket just _A_ view - and there are other means to access/write
the data. <-- this makes it harder.

Rgds

Ned


Martijn Dashorst wrote:
> 
> Why? The model is nothing more than a locator, a bridge if you like
> between your data stuff and the view layer. There is no reason why it
> shouldn't be able to work with the view component. There is absolutely
> no reason why one should get all anal about separating classes that
> live in the user interface layer. It is not like wicket components are
> bleading into your domain layer...
> 
> Martijn
> 
> On Mon, Dec 8, 2008 at 10:38 PM, James Carman
> <[EMAIL PROTECTED]> wrote:
>> Does anyone use a custom validator to implement this type of stuff?  I'm
>> not
>> crazy about a model implementing this functionality, especially during a
>> "get" operation.  Also, your model has to be aware of your view (the call
>> to
>> the form's clearInput() method).  I don't know.  Something about it just
>> doesn't seem right to me
> 

-- 
View this message in context: 
http://www.nabble.com/LoadableDetachableModel-in-Listview-tp20894115p20926367.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: LoadableDetachableModel in Listview

2008-12-09 Thread Ned Collyer


jwcarman wrote:
> 
>  I like shadow much better.
> 

He was an awesome hedgehog hey ;)
-- 
View this message in context: 
http://www.nabble.com/LoadableDetachableModel-in-Listview-tp20894115p20926225.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to print only one validation message from a listview of radiobuttons

2008-12-04 Thread Ned Collyer

Should you be using a RadioChoice instead?


novotny wrote:
> 
> Hi,
> 
> I have a ListView containing several RadioButtons.setRequired(true) (a Q &
> A list) that are all required to be answered. However, if someone doesn't
> click on all of the radio buttons, I see three "Please answer the
> question" messages on the feedback panel. How can I just consolidate it so
> only one message appears if any of the questions i.e. radiobuttons is not
> selected?
> 
> Thanks, Jason
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-print-only-one-validation-message-from-a-listview-of-radiobuttons-tp20846684p20847927.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [VOTE] Consistent naming for Wicket Stuff projects

2008-12-01 Thread Ned Collyer

If you can vote +1000 then.. that kinda defeats the purpose yeah ;)


Martijn Dashorst wrote:
> 
> voting is the apache way. It focusses discussions, and quickly allows
> us to find decisions. These *must* happen on the list. +1000 for
> Jeremy's energy and vote threads.
> 
> Martijn
> 
> On Fri, Nov 28, 2008 at 6:52 AM, Ned Collyer <[EMAIL PROTECTED]>
> wrote:
>>
>> [X] YES - I would like consistent naming!
> 

-- 
View this message in context: 
http://www.nabble.com/-VOTE--Consistent-naming-for-Wicket-Stuff-projects-tp20726075p20785481.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [VOTE] Consistent naming for Wicket Stuff projects

2008-11-27 Thread Ned Collyer

[X] YES - I would like consistent naming!

Contrib is a bit lame... could be gift or present.. but again - they are all
lame.

wicket stuff seems good.  Makes sense too.

I was thinking of making a post about all these vote threads :)  I'm
personally not a fan, but i think a vote page on the wiki would be
overlooked by many.

Perhaps if there was some vote section.. or the current vote on the wicket
homepage itself?



jwcarman wrote:
> 
> [X] YES - I would like consistent naming!
> 
> 
> On Thu, Nov 27, 2008 at 4:54 PM, Jeremy Thomerson
> <[EMAIL PROTECTED]
>> wrote:
> 
>> I am beginning the WS reorg as noted in previous emails.  You can monitor
>> progress here:
>>
>> https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/
>>
>> As we move projects into the wicketstuff-core, I would like to see us
>> rename
>> them consistently, getting rid of the prepended "wicket-contrib-" or
>> "wicketstuff-".  This would mean that when we release WicketStuff 1.4
>> (when
>> Wicket 1.4 is released) that if you are using that project, you would
>> need
>> to update your POM to the new name.  Please vote:
>>
>> [ ] - YES - I would like consistent naming
>> [ ] - NO (convincing reason)
>>
>> PS - I feel like I'm starting a lot of vote threads - should I not be? 
>> Any
>> suggestions?  I would like to efficiently get this reorg done, but I am
>> leery of just moving other people's projects around and making changes
>> without permission.  Feelings / thoughts?
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-VOTE--Consistent-naming-for-Wicket-Stuff-projects-tp20726075p20729328.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why does org.apache.wicket.authorization revolve around string tokens?

2008-11-27 Thread Ned Collyer

Interestingly we used a similar approach with using classes as pseudo enums.

Not being able to extend enums is a bit suckfull.


igor.vaynberg wrote:
> 
> the problem is that the enum would have to live *inside* the
> wicketstuffauth code. so wicketstuffauth would be the library that
> would need to define the enum - and it doesnt know about your
> application specific roles. at least this was the issue when it was
> first being designed. i havent really looked at it since than.
> 
> -igor
> 

-- 
View this message in context: 
http://www.nabble.com/Why-does-org.apache.wicket.authorization-revolve-around-string-tokens--tp20723820p20728137.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using CompoundPropertyModel with FormComponentPanel

2008-11-26 Thread Ned Collyer

FYI, you are awesome.

Always obvious what the problem is after its fixed hey ;)


igor.vaynberg wrote:
> 
> then just"model.object" will do :)
> 
> -igor
> 

-- 
View this message in context: 
http://www.nabble.com/Using-CompoundPropertyModel-with-FormComponentPanel-tp20697019p20710669.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using CompoundPropertyModel with FormComponentPanel

2008-11-26 Thread Ned Collyer

Bupbow. - that Yields an exception because the FormComponentPanels model
object is of type String - not user.

editor = new TextField("editor", new PropertyModel(this,
String.format("model.object.%s", id)));

org.apache.wicket.WicketRuntimeException: No get method defined for class:
class java.lang.String expression: name

Rgds

Ned




igor.vaynberg wrote:
> 
> String.format("model.object.%s", id)));
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-CompoundPropertyModel-with-FormComponentPanel-tp20697019p20709911.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using CompoundPropertyModel with FormComponentPanel

2008-11-26 Thread Ned Collyer

I'm going to be sourcing the labelText from a properties file relatve to the
class of the modelObject (in this case it will be the User - eg,
user.properties).

If I use the binding, then I need to have scope to the CPM in java world...
within the LabelledTextField - which is a shame, because it just makes it
less convenient to use like other regular form components where you do not
have to pass in the model if the form has CPM (eg, standard TextField) 


Nino.Martinez wrote:
> 
> Hi Ned
> 
> you can call bind on the compound property model..
> 
> labelText = new Label("labelText", CPM.bind("propertyname"));
> 
> You can also do this for your property models btw...
> 

-- 
View this message in context: 
http://www.nabble.com/Using-CompoundPropertyModel-with-FormComponentPanel-tp20697019p20699724.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using CompoundPropertyModel with FormComponentPanel

2008-11-26 Thread Ned Collyer

I'm not sure how to get the textfield "editor" working on the property "name"
of the user object - I am aware the CPM is trying to look at the id "editor"
which is wrong :).
-- 
View this message in context: 
http://www.nabble.com/Using-CompoundPropertyModel-with-FormComponentPanel-tp20697019p20698456.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Using CompoundPropertyModel with FormComponentPanel

2008-11-26 Thread Ned Collyer

I'm trying to throw together some components for easily creating accessible
forms.

I'm a fair bit along - just need some assistance with how to structure the
class for use with CompoundPropertyModels.

I want to be able to do the following:

Form form = new Form("form", new CompoundPropertyModel(new User());
form.add(new LabelledTextField("name"))

But I'm having difficulty setting the property model against the textfield
inside my LabelledTextField.

I can retrieve the values just fine, and they are set on the object from the
forms CPM.

I am using a fragment so that markup can be edited in a single place for all
"labelled" form fields.  And different markup providers or variants can be
used if any edge cases occur for any projects.

The form fields can also used as easily as any other form fields in wicket -
this is a different approach from wicketopia - which I've had a good dig
through.

I've gotta be close!


/* the class itself */

private final FormComponentLabel label;
private final Label labelText;
private final TextField editor;
private Fragment componentFragment;

public class LabelledTextField extends FormComponentPanel {

public LabelledTextField(String id) {
super(id);

componentFragment = new Fragment(COMPONENT_ID, "textField", this);
editor = new TextField("editor", new PropertyModel(this,
String.format("model.%s", id)));
label = new FormComponentLabel("label", editor);
labelText = new Label("labelText", "TBA");
label.add(labelText);

componentFragment.add(editor);
componentFragment.add(label);

add(componentFragment);

setRenderBodyOnly(true);
}

protected void convertInput() {
setConvertedInput(editor.getConvertedInput());
}

public String getInput() {
return editor.getInput();
}
}
-- 
View this message in context: 
http://www.nabble.com/Using-CompoundPropertyModel-with-FormComponentPanel-tp20697019p20697019.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Labelling/standard layout for form components.

2008-11-24 Thread Ned Collyer

Great :) I might hit you up on that sometime soon.  I think everyone has
deadlines looming - its the nature of IT.

What is the license?  I see 3 mentions of Apache in the form classes, but
thats about it.

Rgds

Ned


jwcarman wrote:
> 
> By the way, you're more than welcome to help out with wicketopia if
> you want.  Nino and I are working on it thus far.  I've just not had
> much time to do anything with it.  Our project at work is releasing
> very soon, so it's crunch time! :)
> 
> On Sun, Nov 23, 2008 at 11:00 PM, Ned Collyer <[EMAIL PROTECTED]>
> wrote:
>>
>> Thanks!  This has given some good ideas :) Love the central place with
>> the
>> fragment doing the layout - did a similar thing with a bean editor a
>> while
>> back (again similar to whats available on londonwicket.org).
>>
>> Thanks for your input.
> 

-- 
View this message in context: 
http://www.nabble.com/Labelling-standard-layout-for-form-components.-tp20653187p20671342.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket JavaDoc - plz publish

2008-11-24 Thread Ned Collyer

I would have some idea ... I'm using that plugin.. maven plugins have
issues.. :) i think it stems from the lack of standard approach of writing
the plugins, and even then - if you check the maven generated sites, so many
pages can be unintentionally left blank!!  The documentation on them is
generally poor too.

Hmm i should start reading ur blog hey :)


Martijn Dashorst wrote:
> 
> Like I said in my blog post I won't be publishing anything until maven
> site plugin works without problems. You don't have any idea how much
> time I've already sunk into that fcker.
> 
> Martijn
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-JavaDoc---plz-publish-tp20652802p20657152.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Labelling/standard layout for form components.

2008-11-23 Thread Ned Collyer

Thanks!  This has given some good ideas :) Love the central place with the
fragment doing the layout - did a similar thing with a bean editor a while
back (again similar to whats available on londonwicket.org).

Thanks for your input.


jwcarman wrote:
> 
> The wicketopia project has a mechanism for automagically creating
> labels for bean properties.
> 
> http://wicketopia.sourceforge.net
> 
> Take a look at PropertyLabel and PropertyLabelModel (there should be test
> cases)
> 

-- 
View this message in context: 
http://www.nabble.com/Labelling-standard-layout-for-form-components.-tp20653187p20654547.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Labelling/standard layout for form components.

2008-11-23 Thread Ned Collyer

My initial thinking is I'm thinking I'll have to roll my own form elements.
-- 
View this message in context: 
http://www.nabble.com/Labelling-standard-layout-for-form-components.-tp20653187p20654098.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Labelling/standard layout for form components.

2008-11-23 Thread Ned Collyer

I'm looking for suggestions on various ways of handling form layout -
specifically auto generating labels for form components, and the associated
markup surrounding the form fields.

I've currently got a system in place that allows you to add the fields very 
simply, and then uses a technique similar to "forms with flair"
http://londonwicket.org/content/LondonWicket-FormsWithFlair.pdf to add the
labels, error messages and standard markup.

What this gives us is a means for developers to have accessible standards
compliant forms (all labelled and linked) without each dev having to
manually add the appropriate markup structure.

Eg,
Java:
Form form = new Form("form", new PersonModel());
form.add(new TextField("name"));
form.add(new CheckBoxMultipleChoice("breakfasts",
breakfastList).setRequired(true));
form.visitFormComponents(new MyLabelMakerOfAwesome());
add(form);

Wicket Html:





Actual output


Name




Breakfasts *

   Egg   
   Bacon 
   Toast 





Manual markup of each form is a common point of failure, especially with
hundreds of fields and tens of developers.

This works well in MOST circumstances... except when you want to work
outside of the default.

I am looking for a solution that will allow me to:
a/ embed 3rd party components without them being effected (eg, the
calendar/datepicker controls).
b/ be able to update the LABELS only with Ajax - without replacing the
field.
c/ easily exclude fields from the default.
d/ be able to add new fields to the form with Ajax (currently fields added
like this are not effected by the visitor).

I'd love some ideas re: the best way of achieving this.  I'm not asking for
code :) just ideas.

I think it could be very useful - especially if the markup is easily changed
to meet individual project requirements, and definitely gives a more DRY
approach to forms.

ps, i wrote this all in a simple text editor so if there are any flaws, I
hope the message is still communicated ;)
-- 
View this message in context: 
http://www.nabble.com/Labelling-standard-layout-for-form-components.-tp20653187p20653187.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Wicket JavaDoc - plz publish

2008-11-23 Thread Ned Collyer

Can something be set up to publish either the snapshot or rc1 javadocs to a
public URL.

Does the wicket version need to be final to be published to
http://wicket.apache.org/docs/

I currently use -DdownloadSources - but its just not so great for navigating
- especially if you want to cut/paste URL's to other devs.
-- 
View this message in context: 
http://www.nabble.com/Wicket-JavaDoc---plz-publish-tp20652802p20652802.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Filtering (textfilter) and other DataTable examples?!

2008-11-18 Thread Ned Collyer

Thanks very much.

Wicket just gets better and better hey ;)


Kai Mütz wrote:
> 
> Ned Collyer <mailto:[EMAIL PROTECTED]> wrote:
>> Can someone please post or link to an example of how the filters are
>> meant to work with the data table.  Specifically TextFilter or
>> TextFilteredPropertyColumn.
>>
> 
> Check the wicket phonebook example:
> 
> https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-p
> honebook/
> 
> https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-p
> honebook/src/java/wicket/contrib/phonebook/web/page/ListContactsPage.java
> 

-- 
View this message in context: 
http://www.nabble.com/Filtering-%28textfilter%29-and-other-DataTable-examples-%21-tp20555138p20570407.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Filtering (textfilter) and other DataTable examples?!

2008-11-18 Thread Ned Collyer

Can someone please post or link to an example of how the filters are meant to
work with the data table.  Specifically TextFilter or
TextFilteredPropertyColumn.

I've done some poking around, but its escaping me.

I've added the elements to my page - but I'm having little luck.

The javadoc is pretty light too.

Thanks,

Rgds

Ned
-- 
View this message in context: 
http://www.nabble.com/Filtering-%28textfilter%29-and-other-DataTable-examples-%21-tp20555138p20555138.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: wicket 1.4 - Localizer getCacheKey BUG

2008-11-11 Thread Ned Collyer

actually.. found out what it was (and the example i gave was incorrect -
oops).

the new Localizer#getCacheKey(String, Component) assumes that for a given
key in the markup, there will only ever be a single translation.

I have my own resource resolver, which allows for resolution of the keys
based on the class of the model object (which saves having to duplicate
translations, and allows me to store translations against the domain
entities).  Igor has mentioned this is a bad idea, but it has been VERY
useful, and means that the translations are appropriate outside of the
wicket world (I also use them for web services through another application).

Previously, the following would result in different cache keys based on the
index of the list item - which was good because my custom
StringResourceResolver relied upon it.


 # [entity] 


I have fixed this by overriding the getCacheKey method with the old code.

It could be cleaned up a bit - the cache keys are HUGE...

Rgds

Ned



I'm in the process of updating to 1.4m3.

The following is resulting in the same cache key for each item. (which did
not happen in 1.4m1)

ListView createLinks = new ListView("createLinks", links) {
protected void populateItem(ListItem item) {
Link link = item.getModelObject();
link.add(new Label("banana"))
item.add(link);
}
};

Is this the correct behaviour?  It's causing my links to all have the same
label (ie, whichever was hit first)


Rgds

Ned

igor.vaynberg wrote:
> 
> should be fixed in m3 which is coming out any hour
> 
> -igor
> 

-- 
View this message in context: 
http://www.nabble.com/wicket-1.4---Localizer-getCacheKey-BUG-tp18421093p20449836.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: wicket 1.4 - Localizer getCacheKey BUG

2008-11-11 Thread Ned Collyer

I'm in the process of updating to 1.4m3.

The following is resulting in the same cache key for each item. (which did
not happen in 1.4m1)

ListView createLinks = new ListView("createLinks", links) {
protected void populateItem(ListItem item) {
Link link = item.getModelObject();
link.add(new Label("banana"))
item.add(link);
}
};

Is this the correct behaviour?  It's causing my links to all have the same
label (ie, whichever was hit first)


Rgds

Ned

igor.vaynberg wrote:
> 
> should be fixed in m3 which is coming out any hour
> 
> -igor
> 
> On Sat, Jul 12, 2008 at 9:07 AM, FakeBoy <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>> I migrate my app from wicket 1.3 to wicket 1.4.
>> Everything works fine, but one thing behaves strange.
>> I have BasePage and all others pages in my app extends this page.
>> BasePage have some responsibilities and one of them is set correct page
>> title.
>> Example:
>> public class BasePage ext WebPage {
>>
>>  public BasePage() {
>>add(new Label("title", getTitle()));
>>  }
>>
>>  protected IModel getTitle() {
>>return new ResourceModel("pageTitle");
>>  }
>> }
>> All pages, which extends BasePage need to define properties file with key
>> "pageTitle" if want to declare own page title.
>>
>> In Wicket 1.3 everythigs works correct, but in Wicket 1.4 NOT.
>> The problem is in constructing CacheKey for localizer's properties cache.
>>
>> In Wicket 1.3 CacheKey containts:
>> 1. component.getPageRelativePath()
>> 2. component.findPage() -> page.getClass().getName()
>> There is all suffcient information for correct cashing properties.
>>
>> But in Wicket 1.4 it changed and page class name missed in constructing
>> CacheKey.
>> CacheKey containts:
>> 1. resourceKey
>> 2. component class name
>> 3. component id
>> 4. locale
>> 5. style
>>
>> Result :
>> If page identifier missed, title on my pages are still same, they are
>> cached.
>> Reason is that CacheKey is same for all my pages, although they contains
>> properties file with own declared "pageTitle".
>> CacheKey is:
>> pageTitle-org.apache.wicket.markup.html.basic.Label:title-en_EN-null
>> This CacheKey is same for Page1, Page2, Page3 because it don't care about
>> page.
>>
>> What are you think about it?
>> Thanks
>>
> 

-- 
View this message in context: 
http://www.nabble.com/wicket-1.4---Localizer-getCacheKey-BUG-tp18421093p20449490.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: image link inside of table problem

2008-11-11 Thread Ned Collyer

if you have em's wrapped around the link, its probably disabled.

Eg, from
  if(poll.getStatus().equals(VidgetStatus.ACTIVE))
deleteLink.setEnabled(false); 

Rgds

Ned



itayh wrote:
> 
> Hi Charlie,
> You are correct, I removed some not relevant data.
> Here is my table full markup:
> 
> 
>   
>   
>key="poll.id">[id]
>key="poll.name">[name]
>  
> key="poll.description">[description]
>  
> key="poll.question">[question]
>  
> key="poll.maxVotes">[maxVotes]
>key="poll.active">[active]
>key="poll.delete">[delete]
>   
>   
>   
>   
>   < a href="#" wicket:id="edit-link">[id] 
>   < span wicket:id="poll.name">[name]
>   < span 
> wicket:id="poll.description">[description]
>   < span wicket:id="poll.question">[question]
>   < span wicket:id="poll.maxVotes">[maxVotes]
>   < a href="#" wicket:id="active-link">[active] 
>   < a href="#" wicket:id="delete-link">< img  src = 
> "images/delete_icon.png" />  
>   
>   
> 
> 
> here is the javacode parts that create the onclick actions for all the
> links. It work ok for all links except the delete link that I try to use
> image:
>   Link link = new Link("edit-link", 
> item.getModel()) {
>   public void onClick() {
>   onEditPoll((Poll) 
> getModelObject());
>   }
>   };
>   link.add(new Label("poll.id", 
> String.valueOf(poll.getId(;
>   item.add(link);
>   
>   item.add(new Label("poll.name", 
> poll.getName()));
>   item.add(new Label("poll.description", 
> poll.getDescription()));
>   item.add(new Label("poll.question", 
> poll.getQuestion()));
>   item.add(new Label("poll.maxVotes",
> String.valueOf(poll.getMaxVotes(;
>   //second link
>   Link activeLink = new Link("active-link", 
> item.getModel()) {
>   public void onClick() {
>   onActivePoll((Poll) 
> getModelObject());
>   }   
>   };
>   if 
> (poll.getStatus().equals(VidgetStatus.ACTIVE))
>   activeLink.add(new Label("poll.active", 
> "deactivate"));
>   else
>   activeLink.add(new Label("poll.active", 
> "activate"));
>   item.add(activeLink);
>   
>   Link deleteLink = new Link("delete-link", 
> item.getModel()) {
>   public void onClick() {
>   onDeletePoll((Poll) 
> getModelObject());
>   }   
>   };
>   
>   
>   if(poll.getStatus().equals(VidgetStatus.ACTIVE))
>   deleteLink.setEnabled(false);
>   item.add(deleteLink);
> 
> In the generated html page I dont see the delete link. All the other links
> in the generated html  look like:
> < a href="?wicket:interface=:2:polls:9:edit-link::ILinkListener::">2
> 
> 
> while for the delete I have:
> < img src="../images/delete_icon.png"/> 
> 
> Igor, I did not understand your comment.
> 
> Thanks in advance,
>   Itay
> 
> 
> Charlie Dobbie wrote:
>> 
>> That can't be your real markup - you've not closed the span or anchor
>> tags,
>> and Wicket won't accept that at all.
>> 
>> Please post your real markup!
>> 
>> Charlie.
>> 
>> 
>> 
>> 
>> 
>> 2008/11/11 Igor Vaynberg <[EMAIL PROTECTED]>
>> 
>>> what url is generated for that link (look in source). how is the url
>>> different from what it is supposed to be? you need to learn how to
>>> provide more *useful* information if you want help.
>>>
>>> -igor
>>>
>>> On Tue, Nov 11, 2008 at 8:09 AM, itayh <[EMAIL PROTECTED]> wrote:
>>> >
>>> > Hi,
>>> >
>>> > I am having a table with deactivate and delete link columns. In t

Re: RESTful Web Services with Wicket (and XStream)

2008-11-06 Thread Ned Collyer

As you probably are aware - this is just outputting XML using XStream.
This is a one way data feed.

I'm using XStream - but chose a different tech for our REST components
because wicket is not RESTy.

I'd be interested if you can make this 2 way web service, and support POST,
GET, PUT and DELETE.  Good luck :)



Bruno Borges wrote:
> 
> I've posted on my blog about how to create quickly and simple RESTful
> WebServices with Apache Wicket, using XStream to marshall XML from java
> Objects.
> 
> Take a look!
> 
> http://blog.brunoborges.com.br/2008/11/restful-web-services-with-wicket.html
> 

-- 
View this message in context: 
http://www.nabble.com/RESTful-Web-Services-with-Wicket-%28and-XStream%29-tp20370109p20374470.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Basic print.css question

2008-11-06 Thread Ned Collyer

Yep, wrong place to paste for CSS probs

That being said, given your CSS rule:

div#footer ul#navlist, #noprint
{
display: none;
}

its expecting navlist to be in the footer, but is not.
its expecting noprint to be an id, but it is not (its a class).

Feel free to ask wicket questions :)


Sorry this isn't so wicket specific, but I think I'm doing this media type
thing correctly - what am I missing?  Here's the view-source of my wicket
page:


  First Unitarian Universalist Church of Columbus Auction
2009
  
  


  
FirstUU Auction 2009


  
 ./ Home Page 

?wicket:bookmarkablePage=:org.firstuucolumbus.auction.page.CatalogPage
Auction
Catalog 
 CalendarPage.html Event Calendar 

?wicket:bookmarkablePage=:org.firstuucolumbus.auction.page.StatementPage My
Statement 
  

Welcome Jim Pinkham

yadda yadda yadda.

For some reason, when I do print-preview, I'm still seeing the  element and the last line 

-- 
View this message in context: 
http://www.nabble.com/Basic-print.css-question-tp20372842p20374019.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Pages or components... how do u decide?

2008-10-21 Thread Ned Collyer

Their constructor :)


Nav Che wrote:
> 
> Ned,
> 
> But then how do u pass parameters across the panels???
> 
> //nav
> 
-- 
View this message in context: 
http://www.nabble.com/Pages-or-components...-how-do-u-decide--tp20016807p20100652.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Pages or components... how do u decide?

2008-10-20 Thread Ned Collyer

I use those annotations - they are awesome :)

If you could annotate a panel to be bookmarkable.. that'd be interesting. 
So the panel COULD be embeded into other components, or used standalone as a
"page".

Currently I achieve this by creating a new page class which instantiates and
passes the panel to the super.

Anyway, i thought it was an interesting thing to discuss.


Jörn Zaefferer-2 wrote:
> 
> A URL is quite a strong argument for using pages. With the
> wicket-annotations project its dead-easy to make pages bookmarkable,
> just add @MountPath(path="/path/to/page").
> 
> Jörn
> 

-- 
View this message in context: 
http://www.nabble.com/Pages-or-components...-how-do-u-decide--tp20016807p20065174.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Pages or components... how do u decide?

2008-10-19 Thread Ned Collyer

I use markup inheritance for some pages, but I try to avoid making new pages
(after all, what do they give you that a panel does not (other than an
URL)?)

I do use markup inheritance for components A LOT!!



jwcarman wrote:
> 
> Are you using one page and just passing in your "content" component?
> Are you not using markup inheritance?
> 
> On Thu, Oct 16, 2008 at 5:16 PM, Ned Collyer <[EMAIL PROTECTED]>
> wrote:
>>
>> The system I'm building at the moment has almost everything pushed down
>> into
>> components.  Most of the functionality is achieved by a single base page
>> which takes a component in its constructor.
>>
>> For Bookmarkable pages, I extend this base page, and pass a component to
>> the
>> super.
>>
>> How do _you_ separate concerns?  Is there a best practice?
>>
>> A benefit of using a page is that it can be accessed with "getPage()"
>> regardless of how deep in the hierarchy you are... so I guess it could be
>> useful for storing the primary model for that section of the site.
>>
>> Anyway, I'm interested in hearing how others deal with Page vs
>> Components,
>> and how they structure their applications.
>>
>> So many ways of skinning a cat :)
>>
>> Rgds
>>
>> Ned
>> --
>> View this message in context:
>> http://www.nabble.com/Pages-or-components...-how-do-u-decide--tp20016807p20016807.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Pages-or-components...-how-do-u-decide--tp20016807p20060673.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: format in wicket generated html?

2008-10-16 Thread Ned Collyer

Use firebug.


Beyonder Unknown wrote:
> 
> Hi Guys,
> 
> I was wondering if there's a way that wicket can generate the html in with
> indentation? Right now, when we view-source our wicket page in the
> browser, it generates the html without tabs. All lines are left-aligned.
> 
> Thanks in advance.
> 
> Wen Tong
> 

-- 
View this message in context: 
http://www.nabble.com/format-in-wicket-generated-html--tp20022320p20026206.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Pages or components... how do u decide?

2008-10-16 Thread Ned Collyer

The system I'm building at the moment has almost everything pushed down into
components.  Most of the functionality is achieved by a single base page
which takes a component in its constructor.

For Bookmarkable pages, I extend this base page, and pass a component to the
super.

How do _you_ separate concerns?  Is there a best practice?

A benefit of using a page is that it can be accessed with "getPage()"
regardless of how deep in the hierarchy you are... so I guess it could be
useful for storing the primary model for that section of the site.

Anyway, I'm interested in hearing how others deal with Page vs Components,
and how they structure their applications.

So many ways of skinning a cat :)

Rgds

Ned
-- 
View this message in context: 
http://www.nabble.com/Pages-or-components...-how-do-u-decide--tp20016807p20016807.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How can I use the wicketdate-time stuff with DateTime on my model?

2008-10-10 Thread Ned Collyer

Yeah i saw that (the patch file and zips).  Interesting stuff.

I ended up getting the source from svn, and just replacing Date with
DateTime.  The datatype features a lot more than I'd expected.

I'm normally the type of person who likes rollin their own components, but I
just don't have the time right now.

I already don't have enough time to do the app bit :)

I would encourage everyone to use Joda for every project!!




Patrick Angeles wrote:
> 
> We use DateTime/LocalDate in our entities as well. It's easy enough to
> roll your own form components.
> 
> See the patch and zip file attached to this issue, you can probably just
> put those classes in your own project and run with it.
> 
> https://issues.apache.org/jira/browse/WICKET-466
> 
> The patch is meant to handle java.util.Date, and Joda DateTime and
> LocalDate all at the same time. Now that Wicket FormComponents are generic
> though, I think it's better to just have separate FormComponents and
> Converters for each class.
> 

-- 
View this message in context: 
http://www.nabble.com/How-can-I-use-the-wicketdate-time-stuff-with-DateTime-on-my-model--tp19872583p19913074.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How can I use the wicketdate-time stuff with DateTime on my model?

2008-10-09 Thread Ned Collyer

I was hoping to wait for the next milestone to see what the fallout of all
the generics mods are.

The change between m1, m2, and m3 were significant.
Is it staying as it is in m3? (Ive checked the generics page on the wiki).

Rgds

Ned


Martijn Dashorst wrote:
> 
> First, please upgrade to 1.4-m3. This is the future direction of
> Wicket, and has a lot of fixes and patches applied. You should not
> base your application on 1.4-m1.
> 
> Martijn
> 

-- 
View this message in context: 
http://www.nabble.com/How-can-I-use-the-wicketdate-time-stuff-with-DateTime-on-my-model--tp19872583p19907839.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How can I use the wicketdate-time stuff with DateTime on my model?

2008-10-07 Thread Ned Collyer

Its a requirement for me that my domain entities have DateTime.

I'd like to use wicket-datetime (as described here)
http://www.nabble.com/my-domain-model-and-Joda-Time-td15660961.html#a15660961

I can see its internals are all DateTimey which is AWESOME!!

What is the easiest / quickest way of getting this stuff to work with
DateTime in my domain model.

I'm running 1.4m1.

What I'm toying with is compiling the project and applying the patch from
http://issues.apache.org/jira/browse/WICKET-466

But I'd rather have a simpler way - eg, extend or reimplement a class.
-- 
View this message in context: 
http://www.nabble.com/How-can-I-use-the-wicketdate-time-stuff-with-DateTime-on-my-model--tp19872583p19872583.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: please review my CompoundPropertyModel use

2008-10-07 Thread Ned Collyer

Perhaps I don't understand your use case.

I'm using CPM all over the shop, and letting auto CPM propagation take care
of itself.

If the property is obtained from some other way, then obviously you would
need to supply it to the form field - in the same way there are multi
constructors for most form fields.  Perhaps open the source of "TextField"
and piece together how that behaves.

Rgds

Ned


dukehoops wrote:
> 
> I thought that as well, but turns out in that case
> MyFormComponent.getModelObject() returns MyPojo, and NOT MyProperty. That
> presents two problems:
> -MyFormComponent does not really need to know of MyPojo to begin with
> (what if MyProperty is obtained some other way)
> -in MyFormComponent.convertInput, I need to eventually
> setConvertedInput(MyProperty), and in onBeforeRender the corollary
> getModelObject.  
> 

-- 
View this message in context: 
http://www.nabble.com/please-review-my-CompoundPropertyModel-use-tp19868935p19871374.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: please review my CompoundPropertyModel use

2008-10-07 Thread Ned Collyer

You should be able to do

Form form = new Form("form", new CompoundPropertyModel(MyPojo));
page.add(form);

form.add(new MyFormComponent("myProperty"));


See
http://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-CompoundPropertyModels



dukehoops wrote:
> 
> The following code works (have unit tests) but I would appreciate a code
> review from someone.
> 
> Legend
> MyPojo - bean backing up form 
> MyProperty - another POJO that is property of MyPojo (MyPojo has field
> 'myProperty' of type MyProperty)
> MyFormComponent - custom form component that displays/manipulates
> MyProperty (myProperty == myFormComponent.getModelObject())
> 
> In particular, I want to ensure that when MyComponent's modelObject is
> updated, so is formBean's property (to be more precise, that the two
> reference the same object)
> 
> //inside page:
> 
> IModel formModel = new CompoundPropertyModel(MyPojo);
> Form form = new Form("form", formModel);
> page.add(form);
> 
> MyFormComponent myComp = new MyFormComponent("myProperty", new
> PropertyModel(formModel, "myProperty"));
> form.add(myComp);
> 
> and constructor:
> MyFormComponent(wicketId, model)
> {
> super(wicketId, model);
> }
> 

-- 
View this message in context: 
http://www.nabble.com/please-review-my-CompoundPropertyModel-use-tp19868935p19870462.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FileUpload - need to set a model to get updateModel working?

2008-09-03 Thread Ned Collyer


class MyObj {
transient FileUpload fileUpload;
String description;
}


Form form = new Form("form", new CompoundPropertyModel(new MyObj));
form.add(new TextField("description"));  <-- this works
form.add(new FileUploadField("fileUpload"));   <-- this doesnt
form.add(new FileUploadField("fileUpload"), getModel());   <-- this works


form.add(new FileUploadField("fileUpload"), null);  <-- havent tried this -
assume it may work.

hasexcplicitmodel is private, so the only way to toggle it is by calling one
of the methods on FileUpload.


The method in FileUploadField
@Override
public void updateModel()
{
// Only update the model if one was passed in
if (hasExplicitModel)
{
setModelObject(getFileUpload());
}
}

I'm using wicket 1.4-m1 at the moment.



igor.vaynberg wrote:
> 
> if you do not give it a model explicitly then it will try to stick the
> inputstream into the cpm, thats how cpms work...
> 
> if you set hasexcplicitmodel(false) then the model will not be
> updated, instead you will have to call getfileupload() yourself.
> 
> what exactly are you trying to do?
> 
> -igor
> 
> On Tue, Sep 2, 2008 at 11:22 PM, Ned Collyer <[EMAIL PROTECTED]>
> wrote:
>>
>> I have a form with a CompoundPropertyModel.  One of the fields inside
>> this
>> model is a FileUpload.
>>
>> Why do I need to pass a dummy model, (or the current model) through to
>> the
>> FileUploadField - is this an oversight?
>>
>> I cannot find details surrounding the private "hasExplicitModel" boolean
>> in
>> FileUploadField.
>>
>> Other fields - eg, TextField automatically use and update their parent
>> CPM.
>>
>> Rgds
>>
>> Ned
>> --
>> View this message in context:
>> http://www.nabble.com/FileUpload---need-to-set-a-model-to-get-updateModel-working--tp19283571p19283571.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/FileUpload---need-to-set-a-model-to-get-updateModel-working--tp19283571p19299551.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



FileUpload - need to set a model to get updateModel working?

2008-09-02 Thread Ned Collyer

I have a form with a CompoundPropertyModel.  One of the fields inside this
model is a FileUpload.

Why do I need to pass a dummy model, (or the current model) through to the
FileUploadField - is this an oversight?

I cannot find details surrounding the private "hasExplicitModel" boolean in
FileUploadField.

Other fields - eg, TextField automatically use and update their parent CPM.

Rgds

Ned
-- 
View this message in context: 
http://www.nabble.com/FileUpload---need-to-set-a-model-to-get-updateModel-working--tp19283571p19283571.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Form with tabbed panel: Tracking changes

2008-08-24 Thread Ned Collyer

I have adapted forms with flair, however I've found that the onbeforerender
of the form is not executed when its contents are updated with ajax.

It will depend on your impl i guess.


Kai Mütz wrote:
> 
> Nino Saturnino Martinez Vazquez Wael <> wrote:
>> Look at Ivisitor and add one to the form, that could add it for
>> you... I think theres a example pdf on jweekends homepage...
>> 
>> http://www.jweekend.com/dev/ArticlesPage/
> 
> I will try this. Thank you.
> 
> Kai
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Form-with-tabbed-panel%3A-Tracking-changes-tp19111738p19137226.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Inline-pdf generated on the fly using DynamicWebResource - Showing Custom FileName on "File -> Save As"

2008-08-22 Thread Ned Collyer

Firstly - sorry for my initial post - i didnt see the "inline" bit in the
subject - so I wasn't very helpful.

You could also use a MixedParamUrlCodingStrategy and mount the page as

http://[host-name]/wap/[id]/[filename]

- then you can put in a check that the filename matches the ID (ie, its a
valid URL).



Martin Makundi wrote:
> 
> Exactly. Use a bookmarkable page to render your dynamic resource which
> will give you an url
> 

-- 
View this message in context: 
http://www.nabble.com/Inline-pdf-generated-on-the-fly-using-DynamicWebResource---Showing-Custom-FileName-on-%22File--%3E-Save-As%22-tp19100081p19104872.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Inline-pdf generated on the fly using DynamicWebResource - Showing Custom FileName on "File -> Save As"

2008-08-21 Thread Ned Collyer

I don't have an environment at the moment, however I recall dealing with this
in struts by setting

Content-Disposition: attachment
or
Content-Type: download

(cant remember the exact)
basically forcing the download.

No one should be subjected to reading PDFs in a web browser!! DAMN YOU
ADOBE!


mfs wrote:
> 
> Guys,
> 
> I am struggling with an issue relating to PDF displayed inline on a
> browser window, hopefully someone can point me to the right
> direction.Below is the scenario
> 
> I am generating a pdf on the fly using DynamicWebResource, and the pdf is
> shown inline in a new browser window on the click of a button, as
> expected...
> 
> The problem i am facing is with the usage of "File->SaveAs" or
> "Adobe-Toolbar - Save Icon" when trying to save the file. Basically on
> clicking any of the above the file-name shown by-default on the "Save-As
> dialog" box is the context-path (the part before the url-parameters) i.e.
> "mypage" in case the url is http://[host-name]/wap/mypage?id=123";. 
> 
> Even setting the headers to "Content-Disposition", "inline; filename=\"" +
> filename + "\"" does doesn't work consistently across all browsers and to
> what it turns out, in most of the cases clicking "File-SaveAs" (or the
> save icon) results in context-path being shown in the save-as dialog box
> (as mentioned above) , and hence the only solution i see is to come up
> with a way where the url for the generated-pdf could modified/rendered
> such that it appears as
> http://[host-name]/wap/[custom-file-name-for-every-pdf]
> 
> Any suggestions would be highly appreciated..
> 
> Thanks in advance,
> 
> Farhan.
> 

-- 
View this message in context: 
http://www.nabble.com/Inline-pdf-generated-on-the-fly-using-DynamicWebResource---Showing-Custom-FileName-on-%22File--%3E-Save-As%22-tp19100081p19102300.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to use AjaxRequestTarget in conjunction with a FormComponent.AbstractVisitor?

2008-08-21 Thread Ned Collyer

Does anyone have any more opinions on this?
Can you share your wisdom Igor? :)

What I have at hte moment is

public class DefaultFormVisitor extends FormComponent.AbstractVisitor
implements Component.IVisitor, Serializable {
}

and I manually add this visitor in the onbeforerender of the ajax panels.
-- 
View this message in context: 
http://www.nabble.com/how-to-use-AjaxRequestTarget-in-conjunction-with-a-FormComponent.AbstractVisitor--tp19082965p19100221.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to use AjaxRequestTarget in conjunction with a FormComponent.AbstractVisitor?

2008-08-20 Thread Ned Collyer

Thanks for the reply - however some aspects of the panel are generated
dynamically based on the selection

eg, a dropdown for "Number of textfields" - if you choose 3, it adds 3 to
the panel then puts it into the page with ajax.

So I dont think this will work.

I could perhaps wrap these added fields in their own form and nest that with
its own visitor - just feels a bit nasty.


Timo Rantalaiho wrote:
> 
> On Wed, 20 Aug 2008, Ned Collyer wrote:
>> In the form I have a AjaxFormComponentUpdatingBehavior which adds another
>> panel into the form when certain conditions are met.  This new panel has
>> form fields.
>> 
>> The problem is - the items in the new panel the visitor during the ajax
>> request.
>> 
>> They do when I refresh the entire page.
>> 
>> How can I get the form visitor to be applied to these fields during an
>> ajax
>> request?
> 
> Add the new Panel always, but toggle its visibility in the 
> ajax event handler. Or move the visibility logic in the 
> isVisible() method of the Panel:
> 
>   @Override 
>   public boolean isVisible() {
>   return certainConditionsAreMet();
>   }
> 
> Best wishes,
> Timo
> 
> -- 
> Timo Rantalaiho   
> Reaktor Innovations Oyhttp://www.ri.fi/ >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-use-AjaxRequestTarget-in-conjunction-with-a-FormComponent.AbstractVisitor--tp19082965p19083160.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



how to use AjaxRequestTarget in conjunction with a FormComponent.AbstractVisitor?

2008-08-20 Thread Ned Collyer

I have a form that has its elements treated with various things (required
text, labels etc) - these get added by a FormComponent.AbstractVisitor in
the onBeforeRender of the form.

In the form I have a AjaxFormComponentUpdatingBehavior which adds another
panel into the form when certain conditions are met.  This new panel has
form fields.

The problem is - the items in the new panel the visitor during the ajax
request.

They do when I refresh the entire page.

How can I get the form visitor to be applied to these fields during an ajax
request?


Rgds

Ned



-- 
View this message in context: 
http://www.nabble.com/how-to-use-AjaxRequestTarget-in-conjunction-with-a-FormComponent.AbstractVisitor--tp19082965p19082965.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket merchandise?

2008-08-20 Thread Ned Collyer

A tshirt with

"Use IComponentBorder"

would be rad.



Nino.Martinez wrote:
> 
> We talked about this a loong time ago. But theres a service 
> CafePress.com (could have been there then aswell )which fairly easy lets 
> you produce wicket merchandise.. So do the community want mugs caps and 
> t-shirts? And what does the devs say?
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-merchandise--tp19066811p19080192.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Why does Settings.setResourceFinder null out resourceStreamLocator?

2008-07-30 Thread Ned Collyer

I found it strange that my custom resource stream locator was forcibly
nullified when running tests.

Is this a bug? or by design.
-- 
View this message in context: 
http://www.nabble.com/Why-does-Settings.setResourceFinder-null-out-resourceStreamLocator--tp18748752p18748752.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Internationalisation with custom folder

2008-07-28 Thread Ned Collyer

Not as simple as I'd hoped...

Looks like I need to copy/paste all of PropertiesFactory and reimplement
IPropertiesFactory with my mods.

Oh well :|
-- 
View this message in context: 
http://www.nabble.com/Internationalisation-with-custom-folder-tp18705254p18705484.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Internationalisation with custom folder

2008-07-28 Thread Ned Collyer

Hi,

I'm currently using wicket 1.4-m1

I need to be able to partially override a properties file.

Eg,

Classpath:
Application.properties
 key1=123
 key2=456

Filesystem:
Application.properties
 key2=444 
 key3=555
 

This should result in a resource which is like this
Application.properties
 key1=123
 key2=444
 key3=555


Basically merging the 2 properties together with the filesystem overriding
the classpath version.

Currently I'm adding a resource folder in my App.init() with 
getResourceSettings().addResourceFolder(configProperties.getCustomResourceBase());

>From looking through the code it looks like I will need to extend the
PropertiesFactory and override "load" to handle the merging, and also extend
the ResourceStreamLocator to make locateByClassLoader and
locateByResourceFinder public.

Would be a useful RFE or there is another way of achieving this?

Currently, if you add a property resource on the filesystem via
resourceSettings.addResourceFolder which does not include all the keys, you
will get errors - as the IResourceStream.locate method will never bother
trying to load the corresponding properties from the classpath.
-- 
View this message in context: 
http://www.nabble.com/Internationalisation-with-custom-folder-tp18705254p18705254.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket 1.4M3 migration

2008-07-23 Thread Ned Collyer

Thinking about this - generifying panel would probably fix it - or i can just
make my own base panel with generics.


Ned Collyer wrote:
> 
> I've just converted over a project to 1.4-m3 from m1.  I skipped m2
> because of the drastic changes between 1, 2 and 3.
> 
> I must say, I think generics at a component level - when I initially
> started using it felt like unneeded overhead - but it became more and more
> useful.
> 
> now that I've changed to 1.4-m3 - Many parts of the project start to feel
> like unneeded cast soup - even if it is just reimplementing "getModel or
> getModelObject" over and over.
> 
> It's a change that I found a bit hard to visualise the impact until I made
> the switch.
> 
> I must say m1 generics felt more powerful and appropriate for all the
> circumstances i've come across... with the exception of having to generify
> things like Label.
> 
> Anyway, 
> 
> Thats my feedback after the switch.
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-1.4M3-migration-tp18534534p18605749.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket 1.4M3 migration

2008-07-23 Thread Ned Collyer

I've just converted over a project to 1.4-m3 from m1.  I skipped m2
because of the drastic changes between 1, 2 and 3.

I must say, I think generics at a component level - when I initially started
using it felt like unneeded overhead - but it became more and more useful.

now that I've changed to 1.4-m3 - Many parts of the project start to feel
like unneeded cast soup - even if it is just reimplementing "getModel or
getModelObject" over and over.

It's a change that I found a bit hard to visualise the impact until I made
the switch.

I must say m1 generics felt more powerful and appropriate for all the
circumstances i've come across... with the exception of having to generify
things like Label.

Anyway, 

Thats my feedback after the switch.



Timo Rantalaiho wrote:
> 
> On Fri, 18 Jul 2008, Stefan Lindner wrote:
>> Thank you all for your work on wicket! Maybe we can see Wicket 1.4.0
>> final in the near future?
> 
> Thanks for the feedback and the thanks!
> 
> There are still 30+ open issues for 1.4
> 
>  
> https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&&pid=12310561&fixfor=12313295&resolution=-1&sorter/field=issuekey&sorter/order=DESC
> 
> and besides those, probably many places where raw versions 
> of generic types are used and which should be fixed. So I 
> wouldn't hold my breath :)
> 
> Best wishes,
> Timo
> 
> -- 
> Timo Rantalaiho   
> Reaktor Innovations Oyhttp://www.ri.fi/ >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-1.4M3-migration-tp18534534p18605674.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to identify if any of a page's components failed validation after a submit

2008-07-23 Thread Ned Collyer

er... form.hasError()?  form.onError()?

What do you mean by page? - are there lots of forms on the page all with
errors?
-- 
View this message in context: 
http://www.nabble.com/How-to-identify-if-any-of-a-page%27s-components-failed-validation-after-a-submit-tp18599562p18605378.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to handle conditional ordering of components

2008-07-21 Thread Ned Collyer

Hi,

What's the best way of doing simple reordering of components?

For example:

I have a form which is 

-
firstname
surname
--

and I want to change it to the following based on some condition (ie, a
checkbox being selected)

-
surname,
firstname
-


Obviously there are many ways of doing this - fragments, list views,
multiple panels.  Just wondering what is the nicest.
-- 
View this message in context: 
http://www.nabble.com/How-to-handle-conditional-ordering-of-components-tp18579919p18579919.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IFormValidator - I need some clarification please

2008-07-16 Thread Ned Collyer

So this is how i solved it - basically preserving wickets functionality as
much as I could, and only changing it in the event i have a spring
validator.

on my AbstractForm i did the following:

public void setSpringValidator(Validator validator) {
this.validator = validator;
}

@Override
public boolean process() {
boolean processed = super.process();

if (processed && validator != null) {
Serializable target = (Serializable) getModelObject();
try {
// handles validation of object to validator
ValidationUtils.validate(target,
target.getClass().getSimpleName(), validator);
} catch (ValidationException ve) {
markFormComponentsInvalid();
visitFormComponents(new SpringValidatorErrorVisitor(ve));
processed = false;
}
}

return processed;
}
-- 
View this message in context: 
http://www.nabble.com/IFormValidator---I-need-some-clarification-please-tp18481522p18501131.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IFormValidator - I need some clarification please

2008-07-16 Thread Ned Collyer

Yep, cool.  Thanks Igor.

Will see how I go :)



igor.vaynberg wrote:
> 
> you will have to at least use wicket's type conversion validators
> unless your beans only have string properties.
> 
> -igor
> 

-- 
View this message in context: 
http://www.nabble.com/IFormValidator---I-need-some-clarification-please-tp18481522p18498759.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IFormValidator - I need some clarification please

2008-07-16 Thread Ned Collyer

Thanks Lars,

That's the same *conclusion* I had come to :)

I'll have to override process I think (provided thats what's setting the
form elements back to the backing model).

The validators and the domain objects live in a module that has no wicket
dependencies, and I am not in a position to be able to introduce them.
(which means cannot just validate a wicket Form)

They will handle all input from the system (web services, rest, 3rd party
service calls, wicket app etc).

Not to fussed about the backing object getting updated to an invalid state -
because I will still be 
validating it - so it will never be persisted, or loaded as an invalid
model.

I have 95% of this working :) its just getting that damned modelObject
validated.  I "think" process is the only way.

Perhaps some event hooks could be added in future versions? - I dunno.

I'm getting more cosy with the wicket internals, but it takes time to
understand it all ;)


lars vonk wrote:
> 
> Hi Ned,
> 
> Here my 2 cents,
> 
> If you look at the Form.process method you'll see that only after
> validating the model object is updated. There is no hook that you can
> use to get a callback after the model object is updated. The only way
> I see is to override the process method itself (which is not
> recommended btw).
> 
> I think it might be a better solution to create a IFormValidator and
> call your SpringValidator from there. Then you can pass in the Form
> object itself into the Spring Validators and validate that instead of
> your Model objects.
> Also: When you allow invalid values in your Model you are basically
> putting you model classes in an illegal state which (depending on your
> code of course) can lead to strange behavior. In general it is good
> practice to only allow objects to be in a valid state, which of course
> depends on your definition of valid state :-).
> 
> Lars
> 

-- 
View this message in context: 
http://www.nabble.com/IFormValidator---I-need-some-clarification-please-tp18481522p18483780.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



IFormValidator - I need some clarification please

2008-07-16 Thread Ned Collyer

I've written some code that allow spring to validate objects for me using the
org.springframework.validation.Validator interface. 

I've also got some code that maps the ValidationErrors back to wicket
fields.

The spring validators take an entire object rather than field by field.   My
question is, during the validation phase, how should I invoke this
validator?

Basically I need the modelObject of the form to be updated (if possible)
with submitted values before I call the Spring validator.

How should I go about doing this?

I can see a todo in the javadoc for IFormValidator -  "make IFormValidator
extends IValidator where IValidatable's value is form.modelobject and error
reports on form - that way IBehaviorProvider can extend IValidator"

However currently the form.getModelObject is returning the non updated (from
submit) object.

Please help :)
-- 
View this message in context: 
http://www.nabble.com/IFormValidator---I-need-some-clarification-please-tp18481522p18481522.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: addResourceFolder in unit tests

2008-07-11 Thread Ned Collyer


Witold Czaplewski wrote:
> 
> i'm trying to use a custom ResourceStreamLocator to place the markup
> files in another directory. It is based on this wiki entry:
> http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html#ControlwhereHTMLfilesareloadedfrom-InWicket1.3
> 
> The deployed application works fine, but my test cases don't work.
> 
> With enabled debug messages for org.apache.wicket.util.resource i can
> see that the webapppaths are empty although the addResourceFolder
> method should be called.
> 

My guess would be you are not setting an application with the added resource
folder against the WicketTester


Try passing in your application to the tester.

eg,
WicketTester tester = new WicketTester(myAppWithResourceFolder);

thats my guess :)
-- 
View this message in context: 
http://www.nabble.com/addResourceFolder-in-unit-tests-tp18400757p18401762.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [PROPOSAL] Use path in URL when target is instance of BookmarkablePageRequestTarget

2008-07-01 Thread Ned Collyer

A possible added bonus to this that it *might* be possible to catch a session
expired, and re-login to the bookmarkable page.
-- 
View this message in context: 
http://www.nabble.com/-PROPOSAL--Use-path-in-URL-when-target-is-instance-of-BookmarkablePageRequestTarget-tp18188845p18228914.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to ... nicely wire "strings" through spring.

2008-06-29 Thread Ned Collyer

Just implemented that inbetween refreshes of here.

Thanks Igor.


igor.vaynberg wrote:
> 
> create an applicationpropreties bean and set its values via the ${}
> syntax. then inject that into wicket components.
> 
> -igor
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-...-nicely-wire-%22strings%22-through-spring.-tp18189203p18189313.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to ... nicely wire "strings" through spring.

2008-06-29 Thread Ned Collyer

Hi,

I'm using dependency injection via @SpringBean, and I need access to
configurable String value in my Application class.

My main context file is using a
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer which
allows me to use ${} syntax for wiring values from a set of properties files
directly to a bean definition.

Eg,
GenericNonWicketApp.properties
  configDir=/usr/banana/config

AppContext.xml

  

  
I'd like to be able to wire this value against the WebApplication in wicket,
and I have been able to do this as follows:





MyWebApplication.java
  @SpringBean(name = "configDir")
  private String configDir;


Is this the desired way of configuring these type of things (eg, simple
objects such as Strings and Integers)?
-- 
View this message in context: 
http://www.nabble.com/How-to-...-nicely-wire-%22strings%22-through-spring.-tp18189203p18189203.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IResourceFinder vs IResourceStreamLocator

2008-06-26 Thread Ned Collyer

All good - initially this was going to be a datastore (eg a database)
but it can now be filesystem - which means I dont need the answer.

getResourceSettings().addResourceFolder("configDir/override");

Still, those 2 interfaces seem very similar.

Rgds

Ned



Ned Collyer wrote:
> 
> I need to find resources (property resources)... from an external point
> and fall back to wickets inbuilt property resolution.
> 
> I'm a little baffled... when stumbling upon:
> IResourceFinder vs IResourceStreamLocator
> 
> I'm not sure which interface I should be implementing.
> I've checked the javadoc and the usage within wicket.
> 
> They seam destined to be the same thing judging from the javadoc... and
> the words "Locator" or "Finder" pretty much mean the same thing... and
> they both return IResourceStream
> 
> I've seen some posts from ... several years back outlining that they are
> named in a confusing manner (from Jonathan Locke)
> 
> Can someone shed some light on the subject please?  Which should I be
> implementing (or extending existing implementation).
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/IResourceFinder-vs-IResourceStreamLocator-tp18147722p18148901.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



IResourceFinder vs IResourceStreamLocator

2008-06-26 Thread Ned Collyer

I need to find resources (property resources)... from an external point and
fall back to wickets inbuilt property resolution.

I'm a little baffled... when stumbling upon:
IResourceFinder vs IResourceStreamLocator

I'm not sure which interface I should be implementing.
I've checked the javadoc and the usage within wicket.

They seam destined to be the same thing judging from the javadoc... and the
words "Locator" or "Finder" pretty much mean the same thing... and they both
return IResourceStream

I've seen some posts from ... several years back outlining that they are
named in a confusing manner (from Jonathan Locke)

Can someone shed some light on the subject please?  Which should I be
implementing (or extending existing implementation).


-- 
View this message in context: 
http://www.nabble.com/IResourceFinder-vs-IResourceStreamLocator-tp18147722p18147722.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Best way of validating FileUploadField

2008-06-05 Thread Ned Collyer


Michael Sparer wrote:
> 
> Might be a bit off-topic, but I just wanted to add that if you're
> validating if the file has the correct content-type you shouldn't rely on
> the getContentType method, as it determines the type just using the
> extension. I did rely on that and to prevent users from uploading annoying
> animated gifs, allowed only jpg and png. Only a few days in production
> someone uploaded an animated gif by just changing the extension .gif to
> .jpg. To check the real type you should use an external tool such as e.g.
> JMimeMagic.
> Just have a look at the proposed approaches on
> http://www.rgagnon.com/javadetails/java-0487.html
> 
> regards,
> Michael
> 

Thanks for the info.

The example I gave was simple and for demo purpose only :) - I'm going to do
a lot of different things  (like checking color depth, bytesize, dimensions
etc).
-- 
View this message in context: 
http://www.nabble.com/Best-way-of-validating-FileUploadField-tp17662018p1708.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Best way of validating FileUploadField

2008-06-04 Thread Ned Collyer

Thanks,

Raised as https://issues.apache.org/jira/browse/WICKET-1684

Curiously mentioned in https://issues.apache.org/jira/browse/WICKET-300 but
marked as resolved/invalid.

Rgds

Ned


igor.vaynberg wrote:
> 
> argh, didnt read closely enough. yes that is the right way to do it,
> in fact you shouldnt have to do that at all, fileuploadfield should be
> doing that...
> 
> please create a jira ticket, that component is pretty old so it
> probably got overlooked. multifileuploadfield does it properly
> already.
> 
> -igor
> 

-- 
View this message in context: 
http://www.nabble.com/Best-way-of-validating-FileUploadField-tp17662018p17662943.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Best way of validating FileUploadField

2008-06-04 Thread Ned Collyer

So the answer is:

protected void convertInput() {
setConvertedInput(getFileUpload());
} 

Is the right way of dealing with this?

I know the validators are used for validation ;)


igor.vaynberg wrote:
> 
> that is what validators are for
> 
> -igor
> 

-- 
View this message in context: 
http://www.nabble.com/Best-way-of-validating-FileUploadField-tp17662018p17662573.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Best way of validating FileUploadField

2008-06-04 Thread Ned Collyer

Hi,

I have the requirement where I need to validate things like image format,
height, width etc for a file upload.

I'd like to do this using validators, which I can do - but im curious if its
the right way.


Here is what I currently have. 



form.add(fileUploadField = new FileUploadField("fileInput") {
protected void convertInput() {
setConvertedInput(getFileUpload());
}
});

fileUploadField.add(new AbstractValidator() {
protected void onValidate(IValidatable validatable) {
FileUpload fileUpload = (FileUpload)validatable.getValue();
if (fileUpload.getContentType().equals("text/plain")) {
error(validatable);
}
}

protected String resourceKey() {
return "CustomFileError";
}
});


This works... but is it correct?

I'm not handling it in the onSubmit - and don't believe I should have to -
despite the examples.


I have double submit implemented on my base form in a similar fashion to
what igor recommends here
http://www.nabble.com/double-form-submission-handling---tp13816084p13850262.html
- which means I only execute the "submit" if all the validation passes. 
This works SUPER AWESOME thus far :)
-- 
View this message in context: 
http://www.nabble.com/Best-way-of-validating-FileUploadField-tp17662018p17662018.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: users, please give us your opinion: what is your take on generics with Wicket

2008-06-03 Thread Ned Collyer

1) Generifying* Wicket
   [X] Can best be done like currently in the 1.4 branch, where models
and components are both generified. I care most about the improved
static type checking generified models and components give Wicket.
   [X] Can best be done in a limited fashion, where we only generify
IModel but not components. I care more about what generifying can do
for API clarity (declaring a component to only accept certain models
for instance) than static type checking.

* I find anon inner classes can benefit a lot from generics.  - This means 
both imodel and component - but I think both are an improvement over not
having generics.


2) How strongly do you feel about your choice above?
   [X] Whatever choice ultimately made, I'll happily convert/ start
using 1.4 and up.

* Wicket is a breath of fresh air - with or without generics.  Just more
fresh air with ;).


** It needs generics!

-- 
View this message in context: 
http://www.nabble.com/users%2C-please-give-us-your-opinion%3A-what-is-your-take-on-generics-with-Wicket-tp17589984p17637897.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket and inline JavaScript

2008-05-22 Thread Ned Collyer

I can't give you a fix off the top of my head... that being said..

Your designer should forage into usability.

You can style buttons - in a limited fashion and its not consistent across
browser types - its a PITA!  Don't do it!

The last thing we need is buttons that don't look like buttons.  The reason
most apps (web and non web) use normal form controls is because users
understand them and are familiar because their OS will look the same.  In
the same way links should 99% of the time have a blue underline.  Instantly
you know what its behaviour is.  "Oh this submits a form, Oh this is a link
it will take me to a site"

I know there has been some "make web 2.0 button tutorial" stuff floating
around recently - perhaps they've seen these and want to add some drop
shadows and [EMAIL PROTECTED]

:) but if your design really needs custom form submits to make it
work...rethink the custom form design and make it standard.  Form controls
are a solved problem.

In summary - regardless of the technology in use - in my personal view..
from studying this stuff for years custom buttons is a waste of time and
is actually worse for your app from a usability stand point.

Given the right argument I might be swayed in certain circumstances - but
that's the general rule of thumb.

I work very closely with a designer who was initially into making everything
his canvas!  Now he understands usability concerns - and also that it
doesn't effect creativity, but actually makes the apps better.



Edvin Syse wrote:
> 
> Hi Ned,
> 
> thanks for your reply. I agree with your point of view. Today, however, 
> we got bitten because the designer wanted to change all buttons by 
> hiding them with jquery, and adding an anchor right after it in the 
> dom-tree, so he could style them the way he wanted it (not possible with 
> buttons he tells me).
> 
> You can see his lovely button on this page:
> 
> http://sd.tornado.no/domorder/search/query/testdomain
> 
> The way he then triggered the submit buttons is with the following 
> Jquery code:
> 
> $('.btn.submit').click(function(){
>   $(this).prev().click();
> });
> 
> This works most of the times, but sometimes, when the wicket ajax stuff 
> includes references to 'this', the approach doesn't work, and wicket 
> tells me that the ajax request was stopped 'because of precondition'.
> 
> That's when he started bitching about the Wicket way of inlining 
> JavaScript, so I thought I'd be nice to hear some opinions :))
> 
> -- Edvin
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-and-inline-JavaScript-tp17402101p17417072.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Testing using WicketTester

2008-05-22 Thread Ned Collyer

See the testing section here
http://cwiki.apache.org/WICKET/spring.html#Spring-UnitTestingtheProxyApproach

For testing spring.

Basically you make a context, and add it to the app.  You can load it up
with whatever real/mock beans you need.

Rgds

Ned



Eyal Golan wrote:
> 
> Thanks.
> I actually tried but got an error that it could not find the application
> context (we use Spring).
> 
> java.lang.IllegalStateException: No WebApplicationContext found: no
> ContextLoaderListener registered?
> 
> Instead this is what I did:
> tester = new WicketTester(new WebApplication() {
> @Override
> public Session newSession(Request request, Response response)
> {
> return new PortalSession(request);
> }
> 
> @Override
> public Class getHomePage() {
> // TODO Auto-generated method stub
> return null;
> }
> 
> });
> 
> What do you think?
> 

-- 
View this message in context: 
http://www.nabble.com/Testing-using-WicketTester-tp17403637p17404126.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket and inline JavaScript

2008-05-22 Thread Ned Collyer

Hi Edvin,

I am an advocate of JQuery :).  I even won their icon design contest, and
I've been using it for years!  I think it should be used in all projects
that require effects or cool DOM manipulation.

I love the "unobtrusive way" and xhtml strict!

That being said, when it comes to wicket AJAX - just use the wicket ajax and
be done with it.  No point mucking with something thats already excellent. 
It works and its easy.  Why reimplement that bit - and potentially open up
bugs that you need to go debug.

For effects and DOM manipulation, you can use JQuery by adding header
contributors.  It is cleaner.. and in many instances easier to debug.  It
makes development quick and painless.

If it wasn't wicket - id suggest using JQuery for ajax.


Edvin Syse wrote:
> 
> Hi,
> 
> I have a webdesigner who keeps harassing me with the way Wicket does 
> JavaScript, attaching behaviour to onclick events etc. instead of doing 
> it "the jquery way" of picking up the components and attaching the 
> events afterwards, thus keeping all the nasty bits away from the actual 
> markup.
> 
> Ofcourse the code looks a lot cleaner "the jquery way", and he tells me 
> that debugging and working with the code is also much easier. Personally 
> I don't know enough about html/javascript to decide what's the better 
> approach, but I just wanted to know if there are any plans to rework 
> this in Wicket, or if the current approach is just as good?
> 
> -- Edvin
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-and-inline-JavaScript-tp17402101p17404025.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Spring?

2008-05-20 Thread Ned Collyer

Bruce, short or long term you save time with spring.

I dont see it as extra effort - in fact it is a blessing removing the burden
of scoping of objects and (with wicket annotations) serialisation.

The wicket wiki makes implementing spring with wicket peanuts easy.

Rgds

Ned

Bruce McGuire-2 wrote:
> 
> Hello All.
> 
>  
> 
> We are just starting a new version of an existing app, moving toward open
> source technologies. We have decided on using Wicket based on some
> prototypes we have done, and are using Hibernate for the models.
> 
>  
> 
> Our question is this: do you recommend also adding Spring into the mix?
> 
>  
> 
> There are aspects (no pun intended) of Spring that we like, but are unsure
> if the benefits (AOP, IOC) are worth the added effort.
> 
>  
> 
> I appreciate your thoughts on this.
> 
>  
> 
> Thanks,
> 
>  
> 
> Bruce.
> 
> 
> 
Quoted from:  http://www.nabble.com/Spring--tp17353507p17353507.html

-- 
View this message in context: 
http://www.nabble.com/Spring--tp17353507p17354425.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hiding a border on a RepeatingView

2008-05-20 Thread Ned Collyer

Thank you :) yes I am an idiot.



igor.vaynberg wrote:
> 
> pass it in and keep it as a field? make it an anonymous class and a
> final variable? this is just java and these things are just java
> objects, so its entirely up to you.
> 
> -igor
> 

-- 
View this message in context: 
http://www.nabble.com/Hiding-a-border-on-a-RepeatingView-tp17340483p17353911.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hiding a border on a RepeatingView

2008-05-20 Thread Ned Collyer

Thanks Igor,

I'd been checking all the api for "getXXX" and skipped that.

How do I get the scope to the repeater inside the isVisible of the Border?



igor.vaynberg wrote:
> 
> repeatingview.size() should do it
> 
> -igor
> 
> 
> On Tue, May 20, 2008 at 6:39 AM, Ned Collyer <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi,
>> I have a border I've applied to a repeater.
>> When items are removed from the repeater - and its effectively empty, I'd
>> like to hide the border.
>>
>> I'm not sure how to go about doing this.
>>
>> I assume i should override isVisible on the border, but I'm unsure whats
>> the
>> best way of checking if it has an empty or unused RepeatingView.
>>
>> Rgds
>>
>> Ned
>> --
>> View this message in context:
>> http://www.nabble.com/Hiding-a-border-on-a-RepeatingView-tp17340483p17340483.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Hiding-a-border-on-a-RepeatingView-tp17340483p17343184.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Hiding a border on a RepeatingView

2008-05-20 Thread Ned Collyer

Hi, 
I have a border I've applied to a repeater.
When items are removed from the repeater - and its effectively empty, I'd
like to hide the border.

I'm not sure how to go about doing this.

I assume i should override isVisible on the border, but I'm unsure whats the
best way of checking if it has an empty or unused RepeatingView.

Rgds

Ned
-- 
View this message in context: 
http://www.nabble.com/Hiding-a-border-on-a-RepeatingView-tp17340483p17340483.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ListItem queries

2008-05-19 Thread Ned Collyer

Sorry, line 1 should be -
1/ It needs to be declared final if its used inside the anonymous class.


Ned Collyer wrote:
> 
> 1/ MyPanel needs to use it inside the anonymous class.
> 2/ if its final, you cant reassign it.
> 3/ if i remove a panel from the list (using something like
> MyPanel.remove()) then its not set to the correct panel.
> 
> Doesn't quite work - a bit more complicated than u'd first expect.
> 

-- 
View this message in context: 
http://www.nabble.com/ListItem-queries-tp17332693p17333024.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ListItem queries

2008-05-19 Thread Ned Collyer

1/ MyPanel needs to use it inside the anonymous class.
2/ if its final, you cant reassign it.
3/ if i remove a panel from the list (using something like MyPanel.remove())
then its not set to the correct panel.

Doesn't quite work - a bit more complicated than u'd first expect.




Scott Swank wrote:
> 
> MyPanel firstPanel = null;
> ListView featuresList = new ListView("listView", myList) {
>   protected void populateItem(ListItem item) {
>   MyPanel panel = new MyPanel("panel", item.getModelObject()));
>   if (firstPanel == null) firstPanel = panel;
>   item.add(panel);
>   }
> }.setReuseItems(true);
> 
> On Mon, May 19, 2008 at 8:46 PM, Ned Collyer <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi,
>>
>> I need to get access to the first panel added to a list item in
>> onBeforeRender from its parent.
>>
>> I have the following
>>
>> ListView featuresList = new ListView("listView", myList) {
>>protected void populateItem(ListItem item) {
>>MyPanel panel = new MyPanel("panel", item.getModelObject()));
>>item.add(panel);
>>}
>> }.setReuseItems(true);
>>
>>
>> How would I go about getting the first panel added?
>>
>> Rgds
>>
>> Ned
>> --
>> View this message in context:
>> http://www.nabble.com/ListItem-queries-tp17332693p17332693.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ListItem-queries-tp17332693p17333012.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ListItem queries

2008-05-19 Thread Ned Collyer

Hi,

I need to get access to the first panel added to a list item in
onBeforeRender from its parent.

I have the following

ListView featuresList = new ListView("listView", myList) {
protected void populateItem(ListItem item) {
MyPanel panel = new MyPanel("panel", item.getModelObject()));
item.add(panel);
}
}.setReuseItems(true);


How would I go about getting the first panel added?

Rgds

Ned 
-- 
View this message in context: 
http://www.nabble.com/ListItem-queries-tp17332693p17332693.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



State of 1.4-m1

2008-05-18 Thread Ned Collyer

I'm just curious as to an approximate release schedule for 1.4 getting out of
its milestone release.

Rough estimate - 1, 3, 6, 12 months type of thing so I can plan for the
upgrade.

Rgds

Ned
-- 
View this message in context: 
http://www.nabble.com/State-of-1.4-m1-tp17312118p17312118.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [announce] wicketstuff-annotation 1.0 released

2008-05-06 Thread Ned Collyer

Had a look at the wiki.  Well done, well thought out, simple to implement.

And a sensible license :)
-- 
View this message in context: 
http://www.nabble.com/-announce--wicketstuff-annotation-1.0-released-tp17090601p17093692.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   >