Re: Model question ?

2009-08-16 Thread Martijn Dashorst
Just don't pass the model to another page (also don't do this for
anon-inner classes, or nested classes that carry a this pointer to the
page)

Martijn

On Sun, Aug 16, 2009 at 4:04 AM, Warren Bell wrote:
> Is there any issues you need to be concerned with when using the page
> itself as the model object?
>
> Warren
>
> -Original Message-
> From: jWeekend [mailto:jweekend_for...@cabouge.com]
> Sent: Friday, August 14, 2009 5:43 PM
> To: users@wicket.apache.org
> Subject: RE: Model question ?
>
>
> Warren,
>
> If you don't mind your "wicket:id"s becoming rather misleading and
> arguably slightly harder to follow (magical) Java, you can even do ...
>
> public class HomePage extends WebPage {
>    private List vendors = Arrays.asList(new Vendor("v1"),
>            new Vendor("v2"));
>    private Vendor vendor = new Vendor("default vendor");
>    public HomePage(final PageParameters parameters) {
>        setDefaultModel(new CompoundPropertyModel(this));
>        Form form = new Form("form");
>        add(form);
>        form.add(new ListChoice("vendor", vendors));
>        Form editForm = new Form("vendorEditForm");
>        add(editForm);
>        editForm.add(new TextField("vendor.name"));
>    }
>    private class Vendor {
>        private String name;
>        Vendor(String name) {this.name = name;}
>       �...@override public String toString() {return name;}
>    }
> }
>
> I haven't worked out how to properly paste html into nabble, so drop me
> a line at the jWeekend site if you want the template code to go with
> this, or a QuickStart.
>
> Any comments on the type-parameters used above anybody?!
>
> Regards - Cemal
> jWeekend
> OO & Java Technologies, Wicket Training and Development
> http://jWeekend.com
>
>
> Warren Bell-3 wrote:
>>
>> In your second example the Vendor in the vendorModel becomes the
>> selected Vendor from the ListChoice and that Vendor name property
>> becomes the value of the TextField?
>>
>> -Original Message-
>> From: jWeekend [mailto:jweekend_for...@cabouge.com]
>> Sent: Friday, August 14, 2009 3:47 PM
>> To: users@wicket.apache.org
>> Subject: Re: Model question ?
>>
>>
>> Warren,
>>
>> ... and if you prefer using a CPM for your "vendorEditForm"s:
>>
>> public class HomePage extends WebPage {
>>     private List vendors = Arrays.asList(new Vendor("v1"),
>>                                                                  new
>> Vendor("v2"));
>>     private Vendor vendor = new Vendor("default vendor");
>>     public HomePage(final PageParameters parameters) {
>>         IModel vendorModel = new PropertyModel(this,
> "vendor");
>>         Form form = new Form("form");
>>         add(form);
>>         // use your existing LDM instead of this hard-wired
>>         // List of vendors but
>>         // make sure you merge your edits properly!
>>         form.add(new ListChoice("vendors",
>>                                          vendorModel, vendors));
>>         // using a PropertyModel per field
>>         Form editForm1 = new Form("vendorEditForm1");
>>         add(editForm1);
>>         editForm1.add(new TextField("name",
>>                 new PropertyModel(this, "vendor.name")));
>>         // using a CompoundPropertyModel
>>         Form editForm2 = new Form("vendorEditForm2",
>>                 new CompoundPropertyModel(vendorModel));
>>         add(editForm2);
>>         editForm2.add(new TextField("name"));
>>     }
>>
>>     private class Vendor implements Serializable{
>>         private String name;
>>         protected Vendor(String name) {this.name = name;}
>>         public String toString(){return name;}
>>         // safer to have accessors & mutators
>>     }
>>     // safer to have accessors & mutators }
>>
>> Regards - Cemal
>> jWeekend
>> OO & Java Technologies, Wicket Training and Development
>> http://jWeekend.com
>>
>>
>>
>> Warren Bell-3 wrote:
>>>
>>> How should I set up my model for the following situation. I have a
>>> form with a ListChoice and a TextField. The TextField needs to access
>
>>> a property of the object selected of the ListChoice. I have it all
>>> working using a ValueMap, but that seems like overkill to use a
>>> ValueMap for one object. Here is how I have it:
>>>
>>> super(new CompoundPropertyModel(new ValueMap()));
>>>
>>> ListChoice vendorListChoice = new
>>> ListChoice("vendor",
>>
>>> new LoadableDetachableModel>(){...}, new
>>> IChoiceRenderer(){...});
>>>
>>> TextField accountNumberField = new
>>> TextField("vendor.accountNumber");
>>>
>>> I thought I could do something like this:
>>>
>>> super(new CompoundPropertyModel(new Vendor()));
>>>
>>> The ListChoice is the same as above and the TextField like this:
>>>
>>> TextField accountNumberField = new
>>> TextField("accountNumber");
>>>
>>> The problem with this is that the ListChoice is trying to set a
>>> property on the model named vendor when I realy want the selected
>>> ListChoice vendor object be the model object and have the TextField
>>> access the accountN

Design of components utilizing JS, was: Wicket and JQuery - lavalamp

2009-08-16 Thread Uwe Schäfer

Eyal Golan schrieb:

hi Eyal


Hi all,I've created a small Wicket module for the lavalamp JQuery library
(some links below).


nice. why not on wicketstuff?


Please be kind and give me any suggestion and insights.


i just looked at it quickly, but two things strike me:

1st: afaik you should not use
$(document).ready(... as it would break compatibility with other JS 
frameworks redefining the $


jQuery(document).ready(...
or

(function($) { /* some code that uses $ */ })(jQuery)

would be better. please keep in mind, you only contribute one component 
to the page, so there might be a bunch of others ;)


2nd is more general and valid with about any wicket component that uses 
a JS lib. I´m making the jQuery case here:


as it is a good practice to add functions (aka plugins) to the jQuery 
object, including the jQuery script more than once in a page is not only 
 useless waste of bandwidth and lowers user experience, but does 
severel harm (last wins).


so adding your component to a page potentially breaks most of the nice 
other components that relied on plugins loaded before your (bundled) 
jQuery script.


duh!

there is only one way out, i think. as we all know that wicket is clever 
enough to sort out duplicate header contributors, we should make use of 
them!


so, what we could do instead of bundling jquery with every damn 
component whould be to just express the dependency to it.
i suggest to use wicketstuff-core/jslibraries in order to have a common 
ground to create these header contributors.


so instead of

CompressedResourceReference JQUERY_JS = new 
CompressedResourceReference(			JQueryLavaLampBehavior.class, "jquery.js");

response.renderJavascriptReference(JQUERY_JS);

you could simply put
add(JSLib.getHeaderContribution(VersionDescriptor
.alwayLatest(Library.JQUERY));
into your component, and make our lives much easier.


a good side effect is to give the user of your component a chance to use 
a CDN instead of a bundled version to optimize loadtime



cu uwe

oh, and PS: i don´t get LockButton/ResetButton/validate in the global 
namespace?! (see jquery.lavalamp.js) :)


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



jQuery+Wicket+Form

2009-08-16 Thread Martin Makundi
Hi!

I need to implement a "custom drop down" -select component, because I
need to display more information than can be fit onto a single line.

I am considering using jQuery or similar RIA widgets on a web page
running on Wicket.

My problem is: how do I bind the custom select into wicket form
processing model? Is that the right way to go at it at all?

I tried looking around and came across:
* 
http://stackoverflow.com/questions/34705/best-practices-with-jquery-form-binding-code-in-an-application
* http://www.wickext.org/documentation/ui/jquery-ui-wicket-integration.html

.. but I haven't really found any example having RIA form components.
Date picker is simple, because it sets the value of an existing
 element. But what if I have a custome select that is not a
select at all.. how would that work with wicket?

**
Martin

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



Re: Announcing: Scala-Wicket Extensions Project

2009-08-16 Thread Jörn Zaefferer
Its not quite as good as the Java Tools, but it has come a long way:
http://www.scala-lang.org/node/94

Jörn

On Sat, Aug 15, 2009 at 1:14 PM, Martin Sachs wrote:
> Thanks for that variant of programming wicket-application!
>
> I like scala and its concepts, very much.  Using scala with wicket would
> properbly make wicketapplications a little faster, more refactor-safe
> and better maintainable.
>
> Do you have good IDE for scala ? If the IDE (e.g. Plugin for eclipse) is
> as well as java-IDE, scala would be the better java. But without IDE,
> many enterprises wont use scala.
>
> Martin
>
> Antony Stubbs schrieb:
>> Hello People,
>>
>> Today, I am proud to announce that I have now uploaded the first
>> version of the new Scala-Wicket Extensions.
>>
>> The project aims to be a central point for Scala related extensions to
>> the Wicket framework.
>>
>> At the moment, the project consists of an Archetype, Sample
>> application and Core libraries.
>>
>> The core libraries at this point consist of some useful implicit
>> conversation functions (Scala -> Java list conversion, Closure ->
>> Fodel conversion, etc... ScalaWicket.scala) a collection of simple
>> extensions to existing components and the Fodel class. The Fodel class
>> allows us to use closures and pass by name parameters in Scala to
>> avoid some explicit construction of Models.
>>
>> For example:
>> new SLabel("name", person.name )
>> This actually constructs a Model which just like a Property Model
>> looks up and re-evaluates the name property of the Person during each
>> render time (i.e. this is a dynamic model, not a static model as it
>> may appear to be, or would be if it were Java).
>> Also:
>> new SPropertyListView[String]("presentations", list, _.add(new
>> SLabel("name", "asdp name")))
>>
>> There are a whole lot of examples in the Specification files, as the
>> whole library as it stands is covered by Specs unit tests.
>>
>> It also includes SBT (simple build tool) code AND Maven build code
>> (take your pick).
>>
>> I invite all those who are currently using Scala with Wicket to submit
>> there odds and ends that make life easy for them - I'm sure there's a
>> whole bunch of stuff out there!
>>
>> Special thanks to Stuq.nl
>>
>> P.s. it seems wicketstuff team city is stuck, so the SNAPSHOT won't be
>> on the Wicket Stuff repo atm, but I'll try and get that sorted out asap.
>>
>> Maven signature:
>>         
>>             org.wicketstuff.scala
>>             wicket-scala
>>             1.4-SNAPSHOT
>>         
>>
>> Cheers,
>> Antony Stubbs,
>>
>> sharca.com
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: jQuery+Wicket+Form

2009-08-16 Thread Martin Makundi
Hmm.. this might actually work, it uses the original form component to
store the value:

http://v2.easy-designs.net/articles/replaceSelect/

However.. that's a "hand-made" one. Anybody know of a similary library
solution that is skinnable etc.?

**
Martin

2009/8/16 Martin Makundi :
> Hi!
>
> I need to implement a "custom drop down" -select component, because I
> need to display more information than can be fit onto a single line.
>
> I am considering using jQuery or similar RIA widgets on a web page
> running on Wicket.
>
> My problem is: how do I bind the custom select into wicket form
> processing model? Is that the right way to go at it at all?
>
> I tried looking around and came across:
> * 
> http://stackoverflow.com/questions/34705/best-practices-with-jquery-form-binding-code-in-an-application
> * http://www.wickext.org/documentation/ui/jquery-ui-wicket-integration.html
>
> .. but I haven't really found any example having RIA form components.
> Date picker is simple, because it sets the value of an existing
>  element. But what if I have a custome select that is not a
> select at all.. how would that work with wicket?
>
> **
> Martin
>

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



RE: jQuery+Wicket+Form

2009-08-16 Thread Stefan Lindner
I Just made a custom Formcomonent with jQuery and I followed the guidelines 
shiown in WIA. I use a local model for my costum component, put it into a 
FormComponent
 
 public class Clock extends FormComponentPanel implements 
IHeaderContributor {
 
and use the 
 
 onBeforeRender()
 
method to synchronize the required flag of my internal fields (not needed it 
there are no formfields at all
and the
 
 @Override
 protected void convertInput() {
setConvertedInput(internalModel.getObject());
 }
 
to pass my internal model to the 'Component's model.
 
I hope i did not forgeth anything. But, as mentioned, take a look at WIA. the 
mechanisms described for the date adn time component worked for me.
 
Stefan






Von: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
Gesendet: So 16.08.2009 12:53
An: users@wicket.apache.org
Betreff: Re: jQuery+Wicket+Form



Hmm.. this might actually work, it uses the original form component to
store the value:

http://v2.easy-designs.net/articles/replaceSelect/

However.. that's a "hand-made" one. Anybody know of a similary library
solution that is skinnable etc.?

**
Martin

2009/8/16 Martin Makundi :
> Hi!
>
> I need to implement a "custom drop down" -select component, because I
> need to display more information than can be fit onto a single line.
>
> I am considering using jQuery or similar RIA widgets on a web page
> running on Wicket.
>
> My problem is: how do I bind the custom select into wicket form
> processing model? Is that the right way to go at it at all?
>
> I tried looking around and came across:
> * 
> http://stackoverflow.com/questions/34705/best-practices-with-jquery-form-binding-code-in-an-application
> * http://www.wickext.org/documentation/ui/jquery-ui-wicket-integration.html
>
> .. but I haven't really found any example having RIA form components.
> Date picker is simple, because it sets the value of an existing
>  element. But what if I have a custome select that is not a
> select at all.. how would that work with wicket?
>
> **
> Martin
>

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





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

RE: jQuery+Wicket+Form

2009-08-16 Thread Stefan Lindner
I see that I synchronize the model too in onBeforeRender:
 
@Override

protected void onBeforeRender() {

   internalModel.setObject(getModelObject());

   internalField.setRequired(isRequired());

   super.onBeforeRender();

}

 
Stefan



Von: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
Gesendet: So 16.08.2009 12:53
An: users@wicket.apache.org
Betreff: Re: jQuery+Wicket+Form



Hmm.. this might actually work, it uses the original form component to
store the value:

http://v2.easy-designs.net/articles/replaceSelect/

However.. that's a "hand-made" one. Anybody know of a similary library
solution that is skinnable etc.?

**
Martin

2009/8/16 Martin Makundi :
> Hi!
>
> I need to implement a "custom drop down" -select component, because I
> need to display more information than can be fit onto a single line.
>
> I am considering using jQuery or similar RIA widgets on a web page
> running on Wicket.
>
> My problem is: how do I bind the custom select into wicket form
> processing model? Is that the right way to go at it at all?
>
> I tried looking around and came across:
> * 
> http://stackoverflow.com/questions/34705/best-practices-with-jquery-form-binding-code-in-an-application
> * http://www.wickext.org/documentation/ui/jquery-ui-wicket-integration.html
>
> .. but I haven't really found any example having RIA form components.
> Date picker is simple, because it sets the value of an existing
>  element. But what if I have a custome select that is not a
> select at all.. how would that work with wicket?
>
> **
> Martin
>

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





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

Re: Design of components utilizing JS, was: Wicket and JQuery - lavalamp

2009-08-16 Thread egolan74


Uwe Schäfer-2 wrote:
> 
> nice. why not on wicketstuff?
> 

I'll be glad putting it there. It's my intention.
I've checked out wicketstuff. Should I just add my code and check in?
Who should I contact to about this?


Uwe Schäfer-2 wrote:
> 
> 1st: afaik you should not use
> $(document).ready(... as it would break compatibility with other JS 
> frameworks redefining the $
> 
> jQuery(document).ready(...
> or
> 
> (function($) { /* some code that uses $ */ })(jQuery)
> 
> would be better. please keep in mind, you only contribute one component 
> to the page, so there might be a bunch of others ;)
> 
I am a totally newbie in the JS domain so your ramark really helps me
learning this stuff.


Uwe Schäfer-2 wrote:
> 
> as it is a good practice to add functions (aka plugins) to the jQuery 
> object, including the jQuery script more than once in a page is not only 
>   useless waste of bandwidth and lowers user experience, but does 
> severel harm (last wins).
> 

I think that when I add it to the wicketstuff-jquery module, this problem
will vanish.
I've noticed that the parent behavior of the Wicket-JQuery checks (in the
responseHead method) checks if it's already been added.
My behavior will extend this one so it shouldn't harm anything.

Or am I wrong?


Uwe Schäfer-2 wrote:
> 
> oh, and PS: i don´t get LockButton/ResetButton/validate in the global 
> namespace?! (see jquery.lavalamp.js) :)
> 

I'll look into that as well.

And many thanks.

I'll tell you the truth, I'm pretty exited adding a (even as small as it is)
module and to contribute something I picked up...

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



-
Eyal Golan
egola...@gmail.com

Visit:  http://jvdrums.sourceforge.net/ JVDrums 
LinkedIn:  http://www.linkedin.com/in/egolan74 LinkedIn 
-- 
View this message in context: 
http://www.nabble.com/Wicket-and-JQuery---lavalamp-tp24985566p24993063.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: Improving maven/wicket deployment process

2009-08-16 Thread Jeremy Thomerson
I have a shell script that does most of this stuff.  Here's my steps:

1 - mvn clean package
2 - scp package to server(s)
3 - on server, run deploy script
3a - script makes temp working directory
3b - script copies web.xml, application.properties, etc from prod into temp dir
3c - script unzips war into proper location
3d - script copies the production web.xml, etc, back into place
3e - script restarts tomcat / apache (not necessary depending on your
config, it's just how I like to do it)

Most of the applications that I currently maintain can be deployed to
production within about five minutes, including build, upload time,
etc. (of course the automated tests take longer on some applications -
this is excluding test time)

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




On Sat, Aug 15, 2009 at 10:33 PM, Tauren Mills wrote:
> I currently don't have an automated deployment process in place for a
> wicket/spring/hibernate/maven project and am looking for suggestions
> on how to best implement one.  I'm open to any suggestions as well as
> references to helpful URLs and other resources.
>
> When it is time to deploy my project, I manually go through the following 
> steps:
>
> 1.  Edit application.properties and comment out my local development
> database configuration and uncomment the production database
> configuration. The settings in this file (jdbc.driver, jdbc.url,
> jdbc.username, jdbc.password, hibernate.dialect,
> hibernate.hbm2ddl.auto) are used in my spring configuration files to
> create a datasource and sessionfactory.
>
> 2.  Edit web.xml and change the configuration context-param from
> development to deployment.
>
> 3.  Run mvn install
>
> 4.  scp the newly built war file from my local maven repo to the
> jetty/webapps folder on my deployment server.
>
> 5.  Remove the existing ROOT.war file from the deployment server.
>
> 6.  Rename the new war file to ROOT.war
>
> 7.  Restart the deployment jetty server
>
> Of course, this assumes there are no complex database changes required
> by the new version that can't be handled by hbm2ddl.auto=update.  If
> there are, then I also need to apply an sql update script to the
> database.
>
> I'm sure that this process can be streamlined.  I plan to look into
> mvn deploy and see what I can accomplish.  I believe there are also
> ways to use maven to have development and deployment versions of
> different files such as application.properties.
>
> If you have already solved these types of problems, I'd love to hear
> how you did it.
>
> Thanks!
> Tauren
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: jQuery+Wicket+Form

2009-08-16 Thread Martin Makundi
Hi, by WIA you mean Wicket in Action?

**
Martin

2009/8/16 Stefan Lindner :
> I Just made a custom Formcomonent with jQuery and I followed the guidelines 
> shiown in WIA. I use a local model for my costum component, put it into a 
> FormComponent
>
>     public class Clock extends FormComponentPanel implements 
> IHeaderContributor {
>
> and use the
>
>     onBeforeRender()
>
> method to synchronize the required flag of my internal fields (not needed it 
> there are no formfields at all
> and the
>
>     @Override
>     protected void convertInput() {
>        setConvertedInput(internalModel.getObject());
>     }
>
> to pass my internal model to the 'Component's model.
>
> I hope i did not forgeth anything. But, as mentioned, take a look at WIA. the 
> mechanisms described for the date adn time component worked for me.
>
> Stefan
>
>
>
>
> 
>
> Von: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
> Gesendet: So 16.08.2009 12:53
> An: users@wicket.apache.org
> Betreff: Re: jQuery+Wicket+Form
>
>
>
> Hmm.. this might actually work, it uses the original form component to
> store the value:
>
> http://v2.easy-designs.net/articles/replaceSelect/
>
> However.. that's a "hand-made" one. Anybody know of a similary library
> solution that is skinnable etc.?
>
> **
> Martin
>
> 2009/8/16 Martin Makundi :
>> Hi!
>>
>> I need to implement a "custom drop down" -select component, because I
>> need to display more information than can be fit onto a single line.
>>
>> I am considering using jQuery or similar RIA widgets on a web page
>> running on Wicket.
>>
>> My problem is: how do I bind the custom select into wicket form
>> processing model? Is that the right way to go at it at all?
>>
>> I tried looking around and came across:
>> * 
>> http://stackoverflow.com/questions/34705/best-practices-with-jquery-form-binding-code-in-an-application
>> * http://www.wickext.org/documentation/ui/jquery-ui-wicket-integration.html
>>
>> .. but I haven't really found any example having RIA form components.
>> Date picker is simple, because it sets the value of an existing
>>  element. But what if I have a custome select that is not a
>> select at all.. how would that work with wicket?
>>
>> **
>> Martin
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



WARN - Couldn't resolve model type, please set the type yourself.

2009-08-16 Thread Mostafa Mohamed
Hi,

i have a form to add an item, i can select the type of this item from
a drop down choice and accordingly the fields specific to the item
will be replaced. before adding this line:

AjaxFormValidatingBehavior.addToAllFormComponents(form, "onblur");

everything worked perfectly, i would have my form validated. i'd find
the items added to the database and no problem seems to appear.

when i added this line to get ajax validation, after clicking on the
type in the drop down choice i'd get the following warning:

WARN org.apache.wicket.markup.html.form.AbstractTextComponent -
Couldn't resolve model type of
Model:classname=[org.apache.wicket.model.CompoundPropertyModel$AttachedCompoundPropertyModel]:nestedModel=[Model:classname=[org.apache.wicket.model.CompoundPropertyModel]:nestedModel=[Model:classname=[main.java.web.components.addedit.AddPublicationPanel$10]:attached=true:tempmodelobject=[main.java.domain.publication.arti...@745f]]]
for [MarkupContainer [Component id = ISBN]], please set the type
yourself.

followed by this exception:

WicketMessage: No get method defined for class: class
main.java.domain.publication.Article expression: ISBN

Root cause:

org.apache.wicket.WicketRuntimeException: No get method defined for
class: class main.java.domain.publication.Article expression: ISBN

the weird thing is that model of the form when printed is correct.

here is my .java:

public class AddPublicationPanel extends BasicPanel {

// services
@SpringBean
private IDepartmentAccessService departmentAccessService;
@SpringBean
private IPublicationAccessService publicationAccessService;
@SpringBean
private IUserAccessService userAccessService;

// lists used for DropDownChoice
private List listYear;
private List listMonth;

// components
private Form form;
private FeedbackPanel feedback;
private AjaxFallbackButton clear;
private WebMarkupContainer detailsBook, detailsConferencePaper,
detailsTechnicalReport, detailsWorkshop, detailsArticle,
detailsBookChapter, detailsCurrent;
private LoadableDetachableModel book, conferencePaper, technicalReport,
workshop, article, bookChapter;
private FormComponentFeedbackBorder publicationTypeBorder;

// common fields
private DropDownChoice publicationType, year, month;
private TextField title, keywords;
private AutoCompleteTextFieldUser[] authors;
private AjaxFallbackLink addAuthor, removeAuthor;
private TextArea abstractText;
private ListMultipleChoice departments;
private CheckBox reproducible, passwordProtected;

// book details
private TextField bookISBN, bookSeries, bookEdition, bookVolume,
bookPublisherName, bookPublisherAddress;

// conference paper details
private TextField conferencePaperBookTitle, conferencePaperPages,
conferencePaperPublisherName, 
conferencePaperPublisherAddress,
conferencePaperEditors, conferencePaperAddress,
conferencePaperSponsors;

// technical report details
private DropDownChoice technicalReportType;
private TextField technicalReportInstitutionName,
technicalReportInstitutionAddress;

// workshop details
private TextField workshopName, workshopNumber, workshopAddress;

// article details
private TextField articleJournalName, articleVolume, articleIssue,
articlePages;

// book chapter details
private TextField bookChapterTitle, bookChapterISBN, bookChapterSeries,
bookChapterEdition, bookChapterVolume, 
bookChapterPublisherName,
bookChapterPublisherAddress;

// custom validators
private PatternValidator pagesPatternValidator, 
keywordsPatternValidator;

public AddPublicationPanel() {
super("block", "Add Publication");

initPatternValidators();
initLists();
initModels();
initCommon();
initDetails();

AjaxFormValidatingBehavior.addToAllFormComponents(form, 
"onblur");
}

private void initCommon() {
add((feedback = new 
FeedbackPanel("feedback")).setOutputMarkupId(true));
add(form = new Form("form", new CompoundPropertyModel(book)) {
protected void onSubmit() {

setPublicationAuthors();
setPublicationKeywords();
setPublicationCreationDate();


publicationAccessService.savePublication((IPublication) form
   

RE: jQuery+Wicket+Form

2009-08-16 Thread Stefan Lindner
Yes!



Von: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
Gesendet: So 16.08.2009 15:50
An: users@wicket.apache.org
Betreff: Re: jQuery+Wicket+Form



Hi, by WIA you mean Wicket in Action?

**
Martin

2009/8/16 Stefan Lindner :
> I Just made a custom Formcomonent with jQuery and I followed the guidelines 
> shiown in WIA. I use a local model for my costum component, put it into a 
> FormComponent
>
> public class Clock extends FormComponentPanel implements 
> IHeaderContributor {
>
> and use the
>
> onBeforeRender()
>
> method to synchronize the required flag of my internal fields (not needed it 
> there are no formfields at all
> and the
>
> @Override
> protected void convertInput() {
>setConvertedInput(internalModel.getObject());
> }
>
> to pass my internal model to the 'Component's model.
>
> I hope i did not forgeth anything. But, as mentioned, take a look at WIA. the 
> mechanisms described for the date adn time component worked for me.
>
> Stefan
>
>
>
>
> 
>
> Von: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
> Gesendet: So 16.08.2009 12:53
> An: users@wicket.apache.org
> Betreff: Re: jQuery+Wicket+Form
>
>
>
> Hmm.. this might actually work, it uses the original form component to
> store the value:
>
> http://v2.easy-designs.net/articles/replaceSelect/
>
> However.. that's a "hand-made" one. Anybody know of a similary library
> solution that is skinnable etc.?
>
> **
> Martin
>
> 2009/8/16 Martin Makundi :
>> Hi!
>>
>> I need to implement a "custom drop down" -select component, because I
>> need to display more information than can be fit onto a single line.
>>
>> I am considering using jQuery or similar RIA widgets on a web page
>> running on Wicket.
>>
>> My problem is: how do I bind the custom select into wicket form
>> processing model? Is that the right way to go at it at all?
>>
>> I tried looking around and came across:
>> * 
>> http://stackoverflow.com/questions/34705/best-practices-with-jquery-form-binding-code-in-an-application
>> * http://www.wickext.org/documentation/ui/jquery-ui-wicket-integration.html
>>
>> .. but I haven't really found any example having RIA form components.
>> Date picker is simple, because it sets the value of an existing
>>  element. But what if I have a custome select that is not a
>> select at all.. how would that work with wicket?
>>
>> **
>> Martin
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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





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

Re: jQuery+Wicket+Form

2009-08-16 Thread Martin Makundi
Ok, have that, never had time to read. Tnx for the tip.

**
Martin

2009/8/16 Stefan Lindner :
> Yes!
>
> 
>
> Von: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
> Gesendet: So 16.08.2009 15:50
> An: users@wicket.apache.org
> Betreff: Re: jQuery+Wicket+Form
>
>
>
> Hi, by WIA you mean Wicket in Action?
>
> **
> Martin
>
> 2009/8/16 Stefan Lindner :
>> I Just made a custom Formcomonent with jQuery and I followed the guidelines 
>> shiown in WIA. I use a local model for my costum component, put it into a 
>> FormComponent
>>
>>     public class Clock extends FormComponentPanel implements 
>> IHeaderContributor {
>>
>> and use the
>>
>>     onBeforeRender()
>>
>> method to synchronize the required flag of my internal fields (not needed it 
>> there are no formfields at all
>> and the
>>
>>     @Override
>>     protected void convertInput() {
>>        setConvertedInput(internalModel.getObject());
>>     }
>>
>> to pass my internal model to the 'Component's model.
>>
>> I hope i did not forgeth anything. But, as mentioned, take a look at WIA. 
>> the mechanisms described for the date adn time component worked for me.
>>
>> Stefan
>>
>>
>>
>>
>> 
>>
>> Von: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
>> Gesendet: So 16.08.2009 12:53
>> An: users@wicket.apache.org
>> Betreff: Re: jQuery+Wicket+Form
>>
>>
>>
>> Hmm.. this might actually work, it uses the original form component to
>> store the value:
>>
>> http://v2.easy-designs.net/articles/replaceSelect/
>>
>> However.. that's a "hand-made" one. Anybody know of a similary library
>> solution that is skinnable etc.?
>>
>> **
>> Martin
>>
>> 2009/8/16 Martin Makundi :
>>> Hi!
>>>
>>> I need to implement a "custom drop down" -select component, because I
>>> need to display more information than can be fit onto a single line.
>>>
>>> I am considering using jQuery or similar RIA widgets on a web page
>>> running on Wicket.
>>>
>>> My problem is: how do I bind the custom select into wicket form
>>> processing model? Is that the right way to go at it at all?
>>>
>>> I tried looking around and came across:
>>> * 
>>> http://stackoverflow.com/questions/34705/best-practices-with-jquery-form-binding-code-in-an-application
>>> * http://www.wickext.org/documentation/ui/jquery-ui-wicket-integration.html
>>>
>>> .. but I haven't really found any example having RIA form components.
>>> Date picker is simple, because it sets the value of an existing
>>>  element. But what if I have a custome select that is not a
>>> select at all.. how would that work with wicket?
>>>
>>> **
>>> Martin
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: Datepicker popup when textfield is selected

2009-08-16 Thread Jan Grathwohl

Hi Cem,

I don't know how this can be done with the wicket datepicker, but the  
JQuery datepicker has that already built in, without the need to write  
any additional JavaScript (only one line to init the datepicker and  
attach it to a text field).


Maybe you could just add that one to a normal Wicket TextField,  
instead of using the wicket datepicker?


See here: http://jqueryui.com/demos/datepicker/


Am 14.08.2009 um 12:20 schrieb copenhag copenhagen:


Hi,

Would it be possible to make the datepicker popup whenever a  
textfield is

selected?

Thereby the textfield will be no editable, but only the datepicker  
will

modify the textfield value.

Here is an example on the behaviour i am looking for with the wicket
datepicker object:

http://blog.davglass.com/files/yui/cal2/

Best Regards
Cem...



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



Re: Sending data to a wicket form through a POST from an external site

2009-08-16 Thread NYSophia

We came across the same question.  Did you end-up finding a solution?

Thanks

Rahul Pilani-3 wrote:
> 
> I need to get data from an external site via a POST. Is there a way that
> wicket will trigger a form submit on the posted data? Otherwise I have to
> handle the params myself. I looked through the forum archives, and
> previous posts on a similar topic went unreplied.
> 
> Any answer is appreciated.
> 
> - R
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Sending-data-to-a-wicket-form-through-a-POST-from-an-external-site-tp21338922p25000777.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: Send file from external page to wicket

2009-08-16 Thread NYSophia

Were you able to find a solution?

Vit Rozkovec-2 wrote:
> 
> Hallo,
> 
> I have an applet, which is run on users computer. In this applet I scan 
> some photo and describe it.
> I would like to send this foto along with the data to a wicket
> application.
> How should I do that?
> 
> I thought of setting the form action parameter in the external 
> non-wicket page to point to a bookmarkable wicket page, where I would 
> handle the POST, but I do not know how should I extract the parameters 
> and file from the POST.
> 
> How would you do it?
> 
> Thank you.
> 
> Vitek
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Send-file-from-external-page-to-wicket-tp18007245p25000788.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: Populating a model with form data from external site

2009-08-16 Thread NYSophia

Were you able to find a solution?


LLehtinen wrote:
> 
> Hi -
> 
> I have "normal" POST requests coming from an external website. I would 
> like to have a model object's members populated with the matching HTTP 
> parameter values sent in the request. I have a feeling that there is an 
> obvious an elegant way of having Wicket do this for me, but I can't seem 
> to figure it out at this late hour. I would appreciate it if someone 
> could point me to the right direction!
> 
> Right now I'm depending on a bunch of getRequest().getParameter() calls 
> which seems way too servlet-ish to be the "right" way of doing this.
> 
> For clarity:
> 
> Let's say the incoming POST request contains the following parameters: 
> id and name.
> 
> I would like to have Wicket populate a POJO (a model object) like this 
> for me:
> 
> public class ModelObject {
>   private Long id;
>   private String name;
> 
>   .. getters & setters ..
> 
> }
> 
> instead of doing
> 
> Long id = Long.parseLong(getRequest().getParameter("id"));
> String name = getRequest().getParameter("name");
> 
> Thank you all for your quick responses to my earlier questions.
> 
> --
> LL
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Populating-a-model-with-form-data-from-external-site-tp17395075p25000791.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



MarkupnotFoundException in eclipse 3.4.2

2009-08-16 Thread Dale Ogilvie
Hello,

The quickstart is proving anything but. I run quickstart:

mvn archetype:create -DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart
-DarchetypeVersion=1.4.0 -DgroupId=nz.co.acme -DartifactId=myproject

Then generate and eclipse project:

mvn eclipse:eclipse -DdownloadSources=true

Then I import the project into eclipse, leaving copy into workspace
unchecked, and Run As Junit test on TestHomePage.java...

Markup of type 'html' for component 'nz.co.acme.HomePage' not found.
Enable debug messages for org.apache.wicket.util.resource to get a list
of all filenames tried.: [Page class = nz.co.acme.HomePage, id = 0,
version = 0] org.apache.wicket.markup.MarkupNotFoundException: Markup of
type 'html' for component 'nz.co.acme.HomePage' not found.

Eclipse is not copying the .html file alongside the .class. But the Java
| Compiler | Output Folder | Filtered Resources is only *.launch. How do
I make eclipse copy the html file next to the class?

No doubt there is a simple explanation, but I'm not seeing it. Can
anyone help me out?

Thanks

Dale


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



Enforcing CSS Styles to be Loaded From Server ?

2009-08-16 Thread FaRHaN
I want to customize themes for my website for each Valid User, for that purpose 
i have a unique StyleSheet for each user. When a user Logs IN, a respective CSS 
file turned ON. The problem exist when a user Logs IN again after modifying 
styles (theme) of his website, the latest CSS file not being applied on the 
Website but preexisting styles for that user applied on the Website. 
When I Logs IN after clearing History (Cache) of the Browser(IE or FireFox), 
the latest styles are being applied. So I believe, problem exist in the Browser 
Cache. I have tried all Cache Headers for that purpose but it didn't work at 
all.
That's why i want to create a Random number in my URL (for HomePage) so that 
request to HomePage after Logging IN will go to Server (enforcing Styles to be 
loaded from Server, not from cache).

Is this a valid approach, and how i can add random number to my URL ?
Is there exist any other solution for clearing Browser's Cache ? 

Thanks...



  

Re: pannels with diffrent width and height

2009-08-16 Thread burnst...@burnstone.ch

Gerald Fernando schrieb:

i used table but it will not be placed in the full page even i put table
height and width = 100%
if possible please explain little bit about

div with CSS float: etc. in the page template.


div with CSS float means, that you use the float: CSS attribute to 
layout the div elements, like this:



left
right
center


You can find more information about that here:
* http://webdesign.about.com/od/advancedcss/a/aa010107.htm
* http://www.w3schools.com/css/pr_class_float.asp


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



Re: Populating a model with form data from external site

2009-08-16 Thread bgooren

Sophia,

There are a number of solutions to this. I will name two:

1) Use a stateless form, take a look at the HTML (and form action) it
generates, and post to that form from an external site. I have not tested
this myself, but I expect it will work like a charm. Since the form is
stateless, it should always be handle a post, wherever it comes from

2) mount a custom handler on a URL and process the form fields manually.
This is a two-fold process:
- extend (e.g.) URIRequestTargetUrlCodingStrategy, and mount that @
application init
- decode() is most important to you in this case, you should return an
instance of your IRequestTarget implementation here (see my next point)
- create a second class which implements IRequestTarget and handles the form
submit
- in respond( RequestCycle ) you can access the HttpServlet through
   HttpServletRequest request = ( (WebRequest) requestCycle.getRequest()
).getHttpServletRequest();

Hope this helps.

Bas


NYSophia wrote:
> 
> Were you able to find a solution?
> 
> 
> LLehtinen wrote:
>> 
>> Hi -
>> 
>> I have "normal" POST requests coming from an external website. I would 
>> like to have a model object's members populated with the matching HTTP 
>> parameter values sent in the request. I have a feeling that there is an 
>> obvious an elegant way of having Wicket do this for me, but I can't seem 
>> to figure it out at this late hour. I would appreciate it if someone 
>> could point me to the right direction!
>> 
>> Right now I'm depending on a bunch of getRequest().getParameter() calls 
>> which seems way too servlet-ish to be the "right" way of doing this.
>> 
>> For clarity:
>> 
>> Let's say the incoming POST request contains the following parameters: 
>> id and name.
>> 
>> I would like to have Wicket populate a POJO (a model object) like this 
>> for me:
>> 
>> public class ModelObject {
>>   private Long id;
>>   private String name;
>> 
>>   .. getters & setters ..
>> 
>> }
>> 
>> instead of doing
>> 
>> Long id = Long.parseLong(getRequest().getParameter("id"));
>> String name = getRequest().getParameter("name");
>> 
>> Thank you all for your quick responses to my earlier questions.
>> 
>> --
>> LL
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Populating-a-model-with-form-data-from-external-site-tp17395075p25001556.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: Enforcing CSS Styles to be Loaded From Server ?

2009-08-16 Thread bgooren

Farhan,

Please take a look at IResourceSettings (accessible from the application
object). More specifically at 

http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/settings/IResourceSettings.html#setAddLastModifiedTimeToResourceReferenceUrl(boolean)
setAddLastModifiedTimeToResourceReferenceUrl(boolean) 

Bas


Farhan Bajwa wrote:
> 
> I want to customize themes for my website for each Valid User, for that
> purpose i have a unique StyleSheet for each user. When a user Logs IN, a
> respective CSS file turned ON. The problem exist when a user Logs IN again
> after modifying styles (theme) of his website, the latest CSS file not
> being applied on the Website but preexisting styles for that user applied
> on the Website. 
> When I Logs IN after clearing History (Cache) of the Browser(IE or
> FireFox), the latest styles are being applied. So I believe, problem exist
> in the Browser Cache. I have tried all Cache Headers for that purpose but
> it didn't work at all.
> That's why i want to create a Random number in my URL (for HomePage) so
> that request to HomePage after Logging IN will go to Server (enforcing
> Styles to be loaded from Server, not from cache).
> 
> Is this a valid approach, and how i can add random number to my URL ?
> Is there exist any other solution for clearing Browser's Cache ? 
> 
> Thanks...
> 
> 
> 
>   
> 

-- 
View this message in context: 
http://www.nabble.com/Enforcing-CSS-Styles-to-be-Loaded-From-Server---tp25001539p25001595.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: Enforcing CSS Styles to be Loaded From Server ?

2009-08-16 Thread FaRHaN
Thanks Bas...
It really works.





From: bgooren 
To: users@wicket.apache.org
Sent: Monday, August 17, 2009 11:27:12 AM
Subject: Re: Enforcing CSS Styles to be Loaded From Server ?


Farhan,

Please take a look at IResourceSettings (accessible from the application
object). More specifically at 

http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/settings/IResourceSettings.html#setAddLastModifiedTimeToResourceReferenceUrl(boolean)
setAddLastModifiedTimeToResourceReferenceUrl(boolean) 

Bas


Farhan Bajwa wrote:
> 
> I want to customize themes for my website for each Valid User, for that
> purpose i have a unique StyleSheet for each user. When a user Logs IN, a
> respective CSS file turned ON. The problem exist when a user Logs IN again
> after modifying styles (theme) of his website, the latest CSS file not
> being applied on the Website but preexisting styles for that user applied
> on the Website. 
> When I Logs IN after clearing History (Cache) of the Browser(IE or
> FireFox), the latest styles are being applied. So I believe, problem exist
> in the Browser Cache. I have tried all Cache Headers for that purpose but
> it didn't work at all.
> That's why i want to create a Random number in my URL (for HomePage) so
> that request to HomePage after Logging IN will go to Server (enforcing
> Styles to be loaded from Server, not from cache).
> 
> Is this a valid approach, and how i can add random number to my URL ?
> Is there exist any other solution for clearing Browser's Cache ? 
> 
> Thanks...
> 
> 
> 
>  
> 

-- 
View this message in context: 
http://www.nabble.com/Enforcing-CSS-Styles-to-be-Loaded-From-Server---tp25001539p25001595.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

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com