Re: A bug in picking up resource strings for PatternValidator in 1.4-rc7

2009-07-30 Thread Jason Wang
Ohhh, god! I took one day off and then 1.4.0 came out!!! Thanks for 
telling me and good job wicket team!


Igor Vaynberg wrote:

1.4.0 is out, why dont you try with that...

-igor

On Thu, Jul 30, 2009 at 6:58 PM, Jason Wang wrote:
  

Hi, all,


I recently rebuild a small site with 1.4-rc7 and found that the resource
strings for PatternValidator cannot be recognized by wicket and the default
one is always used.

Change back to 1.4-rc1 problem solved.(havnt tried rc2,rc6)

I have created a jira ticket at
https://issues.apache.org/jira/browse/WICKET-2405

Just send this email here so other people can be aware of it.

Code:

final RequiredTextField mobile = new
RequiredTextField("mobile");
mobile.setLabel(new Model("mobile")).add(new
PatternValidator("^[1-9]([0-9]{8,14})"));

Properties file:

mobile.PatternValidator = Please input a valid international phone number.

Results:

always output " does not match pattern '^[1-9]([0-9]{8,14})'. "


WIth the same code, build with 1.4 rc1, worked fine, build with rc7, problem
occurred


Thanks

Jason Wang

-
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: Apache Wicket 1.4 takes type safety to the next level

2009-07-30 Thread James Carman
Congrats, Wicket team!  Another great milestone.  Keep up the good work!

On Thu, Jul 30, 2009 at 6:54 AM, Martijn Dashorst wrote:
> The Apache Wicket project is proud to announce the release of Apache
> Wicket 1.4. Apache Wicket is an open source, component oriented Java
> web application framework. With overwhelming support from the user
> community, this release marks a departure from the past where we leave
> Java 1.4 behind and we require Java 5 as the minimum JDK version. By
> moving to Java 5 as the required minimum platform, we were able to
> utilize Java 5 idioms and increase the type safety of our APIs. Using
> Java generics you can now write typesafe web applications and create
> typesafe, self documenting, reusable custom components.
>
> The full announcement for this release can be found here:
> http://wicket.apache.org/apache-wicket-14-takes-type-safety-to-the-next-level.html
>
> Download Apache Wicket 1.4
>
> You can download the release here:
> http://www.apache.org/dyn/closer.cgi/wicket/1.4.0
>
> Or use this in your Maven pom’s to upgrade to the new version:
>
> 
>    org.apache.wicket
>    wicket
>    1.4.0
> 
>
> You will need to upgrade all modules (i.e. wicket, wicket-extensions)
> to their 1.4 counterparts. It is not possible to mix Wicket 1.3
> libraries with 1.4 libraries due to API changes.
>
> Most notable changes
>
> From all the changes that went into this release, the following are
> the most important ones:
>
>  * Generified IModel interface and implementations increases type
> safety in your Wicket applications
>  * Component#getModel() and Component#setModel() have been renamed to
> getDefaultModel() and setDefaultModel() to better support generified
> models
>  * The Spring modules have been merged (wicket-spring-annot is now
> obsolete, all you need is wicket-spring)
>  * Many API’s have been altered to better work with Java 5’s idioms
>  * Wicket jars are now packaged with metadata that makes them OSGI bundles
>
> Apart from these changes, the release is mostly compatible with Wicket
> 1.3 and upgrading shouldn’t take too long. Early adopters report about
> a days work to upgrade medium to large applications to Wicket 1.4.
> Read the migration guide to learn more about the changes in our APIs.
> To learn more about all the improvements and new features that went
> into this release, check the solved issue list in our JIRA instance.
>
> If you want to learn more about this release, please refer to the full
> release announcement:
> http://wicket.apache.org/apache-wicket-14-takes-type-safety-to-the-next-level.html
>
> -
> 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: A bug in picking up resource strings for PatternValidator in 1.4-rc7

2009-07-30 Thread Igor Vaynberg
1.4.0 is out, why dont you try with that...

-igor

On Thu, Jul 30, 2009 at 6:58 PM, Jason Wang wrote:
> Hi, all,
>
>
> I recently rebuild a small site with 1.4-rc7 and found that the resource
> strings for PatternValidator cannot be recognized by wicket and the default
> one is always used.
>
> Change back to 1.4-rc1 problem solved.(havnt tried rc2,rc6)
>
> I have created a jira ticket at
> https://issues.apache.org/jira/browse/WICKET-2405
>
> Just send this email here so other people can be aware of it.
>
> Code:
>
> final RequiredTextField mobile = new
> RequiredTextField("mobile");
> mobile.setLabel(new Model("mobile")).add(new
> PatternValidator("^[1-9]([0-9]{8,14})"));
>
> Properties file:
>
> mobile.PatternValidator = Please input a valid international phone number.
>
> Results:
>
> always output " does not match pattern '^[1-9]([0-9]{8,14})'. "
>
>
> WIth the same code, build with 1.4 rc1, worked fine, build with rc7, problem
> occurred
>
>
> Thanks
>
> Jason Wang
>
> -
> 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



A bug in picking up resource strings for PatternValidator in 1.4-rc7

2009-07-30 Thread Jason Wang

Hi, all,


I recently rebuild a small site with 1.4-rc7 and found that the resource 
strings for PatternValidator cannot be recognized by wicket and the 
default one is always used.


Change back to 1.4-rc1 problem solved.(havnt tried rc2,rc6)

I have created a jira ticket at 
https://issues.apache.org/jira/browse/WICKET-2405


Just send this email here so other people can be aware of it.

Code:

final RequiredTextField mobile = new 
RequiredTextField("mobile");
mobile.setLabel(new Model("mobile")).add(new 
PatternValidator("^[1-9]([0-9]{8,14})"));


Properties file:

mobile.PatternValidator = Please input a valid international phone number.

Results:

always output " does not match pattern '^[1-9]([0-9]{8,14})'. "


WIth the same code, build with 1.4 rc1, worked fine, build with rc7, 
problem occurred



Thanks

Jason Wang

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



Re: reloading DropDownChoice choices

2009-07-30 Thread Troy Cauble
Here's a minimal example of my problem.
Again, the LDM::getObject() call AFTER the onSubmit()
call that changes the data does not result in a LDM::load().

There's a load() before the onSubmit(), but that's too early.

Anyone?  What am I missing?

Thanks,
-troy


[jetty] DDC choices LDM: getObject
[jetty] DDC choices LDM: load(reading choices)
[jetty] DDC choices LDM: onAttach
[jetty] Form onSubmit
[jetty] DDC choices LDM: getObject
[jetty] DDC choices LDM: onDetach
[jetty]





  
  
  Pressing the button adds an entry to the drop down list,
  but you can't see it without reloading the page.
  
  What am I missing?
  


  


  
  


package dummy;

import java.util.*;

import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.*;
import org.apache.wicket.model.*;

public class Dummy extends WebPage
{
private static final long serialVersionUID = 1L;

private ArrayListchoices = new ArrayList();
private Integeritem = new Integer(1);

public Dummy(final PageParameters parameters)
{
super(parameters);

choices.add(item.toString());

IModel choicesModel = new LoadableDetachableModel() {
private static final long serialVersionUID = 1L;
@Override
protected void onAttach() {
System.out.println("DDC choices LDM: onAttach");
super.onAttach();
}
@Override
protected void onDetach() {
System.out.println("DDC choices LDM: onDetach\n");
super.onDetach();
}
@Override
public Object getObject() {
System.out.println("DDC choices LDM: getObject");
return super.getObject();
}
@Override
protected Object load() {
System.out.println("DDC choices LDM: load(reading
choices)");
// Note the clone() --
// to simulate a hibernate pull
return choices.clone();
}
};

final DropDownChoice ddc = new DropDownChoice("ddc",
new Model(), choicesModel);

Form form = new Form("form") {

private static final long serialVersionUID = 1L;

@Override
protected void onSubmit()
{
System.err.printf("Form onSubmit\n");
ddc.setModelObject(null);
choices.add((++item).toString());
}
};

add(form);
form.add(ddc);
}
}


Re: Persistence Error with Wicket.

2009-07-30 Thread Erik Post
Hi Raphael,

You're using JPA, which complains that it can't find a persistence
provider (i.e. Hibernate). Have you added the JPA-specific Hibernate
jars such as hibernate-entitymanager.jar (and, while you're at it,
hibernate-annotations.jar) as well? And where did you put your
persistence.xml? Also, please include the relevant bits of your
persistence.xml file, in particular:

  
org.hibernate.ejb.HibernatePersistence
 
  

This does not seem to be a Wicket-specific problem btw, althoug it may
have something to do with your project's directory structure.

Cheers,
Erik


On Thu, Jul 30, 2009 at 10:07 PM, Raphael Monroe - Leucotron
(DES) wrote:
> Hi everyone,
>
> It愀 my first post to the list so I'm sorry if I'm broking any rules or
> writing in a wrong text format.
> I'm here to learn and I hope I'll with you guys.
>
> Firstly, I should explain my huge(or not?) problem.
> Since 2 days ago, I'm having this persistence error in my project.
>
> I mean, when I get my program running, I have this follow message:
>
> javax.persistence.PersistenceException: No Persistence provider for
> EntityManager named classePer
> at 
> javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:56)
>       at 
> com.leucotron.database.JDataBaseConnection.(JDataBaseConnection.java:34)
>       at  
> com.leucotron.database.JDataBaseConnection.getInstance(JDataBaseConnection.java:41)
>       at com.leucotron.exemplowicket.Testando.(Testando.java:24)

>
> I have no idea why I'm having this. Then, I have thought that is a wicket
> problem because when I use the same codes in a Desktop application I can run
> that very normal.
>
> I've tried to put the persistence.xml in several places, but I didn't have
> any sucess so far.
> I've also tried to add (even manually), all the .jars related to the
> hibernate lib. However, I still continued with the same problem.
>
> I kinda lost myself and I do not know how to fix my code or even how to do
> any modification to get my web application running as normal as my desktop
> application.
>
> Thank you guys,
>
> []s
>
> -
> 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: Apache Wicket 1.4 takes type safety to the next level

2009-07-30 Thread David Chang


Fabulous framework!

--- On Thu, 7/30/09, Juan Carlos Garcia M.  wrote:

> From: Juan Carlos Garcia M. 
> Subject: Re: Apache Wicket 1.4 takes type safety to the next level
> To: users@wicket.apache.org
> Date: Thursday, July 30, 2009, 4:57 PM
> 
> Congratulations to the Wicket Team, and everyone who
> contributed to make this
> happens.
> 
> Thanks for this great Framework.
> 
> 
> Carl-Eric Menzel-5 wrote:
> > 
> > On Thu, 30 Jul 2009 12:54:29 +0200
> > Martijn Dashorst 
> wrote:
> > 
> >> The Apache Wicket project is proud to announce the
> release of Apache
> >> Wicket 1.4.
> > 
> > Congratulations to the team and all contributors, and
> a big thank you!
> > 
> > Carl-Eric
> > 
> >
> -
> > 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/Apache-Wicket-1.4-takes-type-safety-to-the-next-level-tp24736219p24747196.html
> Sent from the Wicket - User mailing list archive at
> Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 


  

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



Re: Apache Wicket 1.4 takes type safety to the next level

2009-07-30 Thread Juan Carlos Garcia M.

Congratulations to the Wicket Team, and everyone who contributed to make this
happens.

Thanks for this great Framework.


Carl-Eric Menzel-5 wrote:
> 
> On Thu, 30 Jul 2009 12:54:29 +0200
> Martijn Dashorst  wrote:
> 
>> The Apache Wicket project is proud to announce the release of Apache
>> Wicket 1.4.
> 
> Congratulations to the team and all contributors, and a big thank you!
> 
> Carl-Eric
> 
> -
> 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/Apache-Wicket-1.4-takes-type-safety-to-the-next-level-tp24736219p24747196.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



Persistence Error with Wicket.

2009-07-30 Thread Raphael Monroe - Leucotron (DES)

Hi everyone,

It´s my first post to the list so I'm sorry if I'm broking any rules or 
writing in a wrong text format.

I'm here to learn and I hope I'll with you guys.

Firstly, I should explain my huge(or not?) problem.
Since 2 days ago, I'm having this persistence error in my project.

I mean, when I get my program running, I have this follow message:

javax.persistence.PersistenceException: No Persistence provider for 
EntityManager named classePer
   at 
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:56)
   at 
com.leucotron.database.JDataBaseConnection.(JDataBaseConnection.java:34)
   at 
com.leucotron.database.JDataBaseConnection.getInstance(JDataBaseConnection.java:41)

   at com.leucotron.exemplowicket.Testando.(Testando.java:24)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
   at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at 
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:192)
   at 
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:57)
   at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:299)
   at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:321)
   at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
   at 
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
   at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1241)

   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1320)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
   at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
   at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)



I have no idea why I'm having this. Then, I have thought that is a 
wicket problem because when I use the same codes in a Desktop 
application I can run that very normal.


I've tried to put the persistence.xml in several places, but I didn't 
have any sucess so far.
I've also tried to add (even manually), all the .jars related to the 
hibernate lib. However, I still continued with the same problem.


I kinda lost myself and I do not know how to fix my code or even how to 
do any modification to get my web application running as normal as my 
desktop application.


Thank you guys,

[]s

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



Re: Onclick method for DefaultDataTable cells

2009-07-30 Thread Michael O'Cleirigh

Hello,

Another way is to add an onclick listener to each row in the table by 
overriding newRowItem(...) in DefaultDataTable like this:


DefaultDataTable table = new DefaultDataTable newRowItem(String id, int index,
   IModel model) {

   Item rowItem = super.newRowItem(id, index,
   model);
  
  rowItem.add(new AjaxEventBehavior ("onclick") {

 @Override
  protected void onEvent(AjaxRequestTarget target) {
   // pass the model object for the selected row to the
   editor

editOverlay.setModelObject (model.getObject());
   		target.addComponent (editOverlay);
}



   });
  


   return rowItem;
   }
   };


Regards,

Mike


http://wicketstuff.org/wicket/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.DataTablePage

-igor

On Thu, Jul 30, 2009 at 11:14 AM, Elad Katz wrote:
  

Hi, I have a DefaultDataTable with 5 columns, I want to be able to register
to an onclick method that fires when the user will click a specific row\cell
in the table.
In other words, I need to be able to open an edit screen when the user
clicks the row he wants to edit, and for that I need the row to be clickable
(or just the name cell) and I need to be able to be able to hook up to that
event.

My Code:
*Please bear in mind that I've only started developing in wicket a week ago
so if you see anything that doesn't make sense, please let me know so I can
fix it.*
*WebPage.java:*



locationsEntityFacade =
LookupHelper.getInstance().lookupLocationsEntityFacade();
List locations = locationsEntityFacade.findAll();
int count = locations.size();

add(new Label("locationsCount", String.valueOf(count)));

LocationsProvider locationsProvider = new LocationsProvider();

IColumn[] columns = new IColumn[5];
columns[0] = new PropertyColumn(new Model("Name"), "name", "name");
columns[1] = new PropertyColumn(new Model("Address 1"),
"streetAddress1", "streetAddress1");
columns[2] = new PropertyColumn(new Model("Address 2"),
"streetAddress2", "streetAddress2");
columns[3] = new PropertyColumn(new Model("City"), "city", "city");
columns[4] = new PropertyColumn(new Model("State"), "usState",
"usState");

DefaultDataTable table = new DefaultDataTable("datatable", columns,
locationsProvider, 10);
add(table);
  

* Location Provider:*

public class LocationsProvider extends SortableDataProvider{


List list = new ArrayList();
LocationsEntityFacadeLocal locationsEntityFacade;

  


public LocationsProvider()  {
setSort("id", true);
locationsEntityFacade =
LookupHelper.getInstance().lookupLocationsEntityFacade();
list = locationsEntityFacade.findAll();
}

public Iterator iterator(int first, int count) {
List newList = new ArrayList();
newList.addAll(list.subList(first, first + count));
final String sortColumn = this.getSort().getProperty();
final boolean ascending = this.getSort().isAscending();
Collections.sort(newList, new Comparator() {

public int compare(Object obj1, Object obj2) {
PropertyModel model1 = new PropertyModel(obj1, sortColumn);
PropertyModel model2 = new PropertyModel(obj2, sortColumn);

Object modelObject1 = model1.getObject();
Object modelObject2 = model2.getObject();

int compare = ((Comparable)
modelObject1).compareTo(modelObject2);

if (!ascending)
compare *= -1;

return compare;
}
});

return newList.iterator();
}

public int size() {
return list.size();

}

public IModel model(final Object object) {
   return new CompoundPropertyModel((LocationsEntity)object);
}
  

*webpage.html:

*


...
  



...

Thanks,

Elad




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

  




Re: reloading DropDownChoice choices

2009-07-30 Thread Troy Cauble
It seems my problem may be with the use of LoadableDetachableModel.
Below is print statement debugging of a Button action that alters
the DDC choices.

[jetty] DDC choices LDM: getObject
[jetty] DDC choices LDM: load(reading docs)
[jetty] DDC choices LDM: onAttach
[jetty] delete doc Button submit
[jetty] DDC choices LDM: getObject
[jetty] DDC choices LDM: onDetach

The Button submit changes the list, the following LDM getObject() does
not result in a load() call.  Am I using LDM wrong?  Do I need to be
tickling the LDM or DDC somehow?

Thanks,
-troy

On Thu, Jul 30, 2009 at 12:45 AM, Troy Cauble  wrote:

> I have the following
>
> Page
>   Form
>  DDC
>  TextFields
>  Buttons
>
> The DDC has a LoadableDetachableModel with a hibernate call for
> the *choices* model and "new Model()" for the DDC model.
>
> Changing the DDC selection, changes the TextFields appropriately.
>
> But I have a Button and a form submit that change the hibernate data for
> the choices.  They also clear the DDC selection with
> ddc.setModelObject(null).
>
> How do I get the DDC to reload the choices?  The old choices are visible
> unless I reload the page.  I have a printf in ldm.load() that tells me it
> is not
> being called until I reload the page.
>
> Thanks!
> -troy
>


Re: Onclick method for DefaultDataTable cells

2009-07-30 Thread Igor Vaynberg
http://wicketstuff.org/wicket/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.DataTablePage

-igor

On Thu, Jul 30, 2009 at 11:14 AM, Elad Katz wrote:
> Hi, I have a DefaultDataTable with 5 columns, I want to be able to register
> to an onclick method that fires when the user will click a specific row\cell
> in the table.
> In other words, I need to be able to open an edit screen when the user
> clicks the row he wants to edit, and for that I need the row to be clickable
> (or just the name cell) and I need to be able to be able to hook up to that
> event.
>
> My Code:
> *Please bear in mind that I've only started developing in wicket a week ago
> so if you see anything that doesn't make sense, please let me know so I can
> fix it.*
> *WebPage.java:*
>
>> locationsEntityFacade =
>> LookupHelper.getInstance().lookupLocationsEntityFacade();
>>         List locations = locationsEntityFacade.findAll();
>>         int count = locations.size();
>>
>>         add(new Label("locationsCount", String.valueOf(count)));
>>
>>         LocationsProvider locationsProvider = new LocationsProvider();
>>
>>         IColumn[] columns = new IColumn[5];
>>         columns[0] = new PropertyColumn(new Model("Name"), "name", "name");
>>         columns[1] = new PropertyColumn(new Model("Address 1"),
>> "streetAddress1", "streetAddress1");
>>         columns[2] = new PropertyColumn(new Model("Address 2"),
>> "streetAddress2", "streetAddress2");
>>         columns[3] = new PropertyColumn(new Model("City"), "city", "city");
>>         columns[4] = new PropertyColumn(new Model("State"), "usState",
>> "usState");
>>
>>         DefaultDataTable table = new DefaultDataTable("datatable", columns,
>> locationsProvider, 10);
>>         add(table);
>
> * Location Provider:*
>
> public class LocationsProvider extends SortableDataProvider{
>>
>>     List list = new ArrayList();
>>     LocationsEntityFacadeLocal locationsEntityFacade;
>>
>
>
>>     public LocationsProvider()  {
>>         setSort("id", true);
>>         locationsEntityFacade =
>> LookupHelper.getInstance().lookupLocationsEntityFacade();
>>         list = locationsEntityFacade.findAll();
>>     }
>>
>>     public Iterator iterator(int first, int count) {
>>         List newList = new ArrayList();
>>         newList.addAll(list.subList(first, first + count));
>>         final String sortColumn = this.getSort().getProperty();
>>         final boolean ascending = this.getSort().isAscending();
>>         Collections.sort(newList, new Comparator() {
>>
>>             public int compare(Object obj1, Object obj2) {
>>                 PropertyModel model1 = new PropertyModel(obj1, sortColumn);
>>                 PropertyModel model2 = new PropertyModel(obj2, sortColumn);
>>
>>                 Object modelObject1 = model1.getObject();
>>                 Object modelObject2 = model2.getObject();
>>
>>                 int compare = ((Comparable)
>> modelObject1).compareTo(modelObject2);
>>
>>                 if (!ascending)
>>                     compare *= -1;
>>
>>                 return compare;
>>             }
>>         });
>>
>>         return newList.iterator();
>>     }
>>
>>     public int size() {
>>         return list.size();
>>
>>     }
>>
>>     public IModel model(final Object object) {
>>        return new CompoundPropertyModel((LocationsEntity)object);
>>     }
>
>
> *webpage.html:
>
> *
>>
>> ...
>
> 
>>
> ...
>>
>
> Thanks,
> Elad
>

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



Re: Problem with SortableDataProvider

2009-07-30 Thread elad katz

Thanks, that was kind of right, I did package it, but I did it wrong.

igor.vaynberg wrote:
> 
> make sure you packaged wicket-extensions.jar in your ear or war
> 
> -igor
> 
> On Mon, Jul 27, 2009 at 10:18 AM, Elad Katz wrote:
>> Hi there,
>> this is my first post on this list, so please be gentle :)
>> I have a wicket application that uses SortableDataProvider
>> (org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider).
>> The source compiles nicely on my machine but when i try to deploy it I
>> get
>> the following error:
>> 16:51:47,546 INFO  [STDOUT] 16:51:47,545 INFO  [AutoDeployDir:183]
>> Processing PmcLocations-war.war
>> 16:51:47,549 INFO  [STDOUT] 16:51:47,548 INFO
>> [PortletAutoDeployListener:77] Copying portlets for
>> /opt/deploy/PmcLocations-war.war
>> 16:51:47,563 INFO  [STDOUT]   Expanding: /opt/deploy/PmcLocations-war.war
>> into /tmp/20090727165147563
>> 16:51:47,582 INFO  [warupdater] PSPL_CSPPCWU0014 : Updating the Portlet
>> Application PmcLocations-war with Portlet Container specific artifacts
>> 16:51:47,673 INFO  [STDOUT]   Copying 1 file to
>> /tmp/20090727165147563/WEB-INF/classes
>> 16:51:47,695 INFO  [STDOUT]   Copying 1 file to
>> /tmp/20090727165147563/WEB-INF/classes
>> 16:51:47,862 INFO  [STDOUT]   Copying 19 files to /opt/
>> jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war
>> 16:51:47,896 INFO  [STDOUT]   Copying 1 file to /opt/
>> jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war
>> 16:51:47,897 INFO  [STDOUT]   Deleting directory /tmp/20090727165147563
>> 16:51:47,902 INFO  [STDOUT] 16:51:47,901 INFO
>> [PortletAutoDeployListener:87] Portlets for
>> /opt/deploy/PmcLocations-war.war
>> copied successfully. Deployment will start in a few seconds.
>> 16:51:53,649 ERROR [AbstractKernelController] Error installing to
>> PostClassLoader: name=vfsfile:/opt/
>> jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war/
>> state=ClassLoader
>> mode=Manual requiredState=PostClassLoader
>> org.jboss.deployers.spi.DeploymentException: Error during deploy:
>> vfsfile:/opt/jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war/
>>    at
>> org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
>>    at
>> org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)
>>    at
>> org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
>>    at
>> org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
>>    at
>> org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
>>    at
>> org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
>>    at
>> org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
>>    at
>> org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
>>    at
>> org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
>>    at
>> org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
>>    at
>> org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
>>    at
>> org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
>>    at
>> org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
>>    at
>> org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
>>    at
>> org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
>>    at
>> org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
>>    at
>> org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
>>    at
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>>    at
>> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
>>    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>>    at
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
>>    at
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
>>    at
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
>>    at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>    at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>    at java.lang.Thread.run(Thread.java:619)
>> Caused by: java.lang.NoClassDefFoundError:
>> org/apache/wicket/extensions/markup/html/repeater/util/SortableDataProvider
>>    at java.lang.ClassLoader.defineClass1(Native Method)
>>    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
>>    at
>> org.jbo

Onclick method for DefaultDataTable cells

2009-07-30 Thread Elad Katz
Hi, I have a DefaultDataTable with 5 columns, I want to be able to register
to an onclick method that fires when the user will click a specific row\cell
in the table.
In other words, I need to be able to open an edit screen when the user
clicks the row he wants to edit, and for that I need the row to be clickable
(or just the name cell) and I need to be able to be able to hook up to that
event.

My Code:
*Please bear in mind that I've only started developing in wicket a week ago
so if you see anything that doesn't make sense, please let me know so I can
fix it.*
*WebPage.java:*

> locationsEntityFacade =
> LookupHelper.getInstance().lookupLocationsEntityFacade();
> List locations = locationsEntityFacade.findAll();
> int count = locations.size();
>
> add(new Label("locationsCount", String.valueOf(count)));
>
> LocationsProvider locationsProvider = new LocationsProvider();
>
> IColumn[] columns = new IColumn[5];
> columns[0] = new PropertyColumn(new Model("Name"), "name", "name");
> columns[1] = new PropertyColumn(new Model("Address 1"),
> "streetAddress1", "streetAddress1");
> columns[2] = new PropertyColumn(new Model("Address 2"),
> "streetAddress2", "streetAddress2");
> columns[3] = new PropertyColumn(new Model("City"), "city", "city");
> columns[4] = new PropertyColumn(new Model("State"), "usState",
> "usState");
>
> DefaultDataTable table = new DefaultDataTable("datatable", columns,
> locationsProvider, 10);
> add(table);

* Location Provider:*

public class LocationsProvider extends SortableDataProvider{
>
> List list = new ArrayList();
> LocationsEntityFacadeLocal locationsEntityFacade;
>


> public LocationsProvider()  {
> setSort("id", true);
> locationsEntityFacade =
> LookupHelper.getInstance().lookupLocationsEntityFacade();
> list = locationsEntityFacade.findAll();
> }
>
> public Iterator iterator(int first, int count) {
> List newList = new ArrayList();
> newList.addAll(list.subList(first, first + count));
> final String sortColumn = this.getSort().getProperty();
> final boolean ascending = this.getSort().isAscending();
> Collections.sort(newList, new Comparator() {
>
> public int compare(Object obj1, Object obj2) {
> PropertyModel model1 = new PropertyModel(obj1, sortColumn);
> PropertyModel model2 = new PropertyModel(obj2, sortColumn);
>
> Object modelObject1 = model1.getObject();
> Object modelObject2 = model2.getObject();
>
> int compare = ((Comparable)
> modelObject1).compareTo(modelObject2);
>
> if (!ascending)
> compare *= -1;
>
> return compare;
> }
> });
>
> return newList.iterator();
> }
>
> public int size() {
> return list.size();
>
> }
>
> public IModel model(final Object object) {
>return new CompoundPropertyModel((LocationsEntity)object);
> }


*webpage.html:

*
>
> ...


>
...
>

Thanks,
Elad


Re: Components and nullable data

2009-07-30 Thread Igor Vaynberg
add(new Link("editgroup", user) {
  onclick() {
   ...
  }

  isvisible() {
   return user.getgroup()!=null;
  }
}

?

-igor

2009/7/30 Iain Reddick :
> Hi all,
>
> One of the difficulties I am finding with wicket is the best practice when
> displaying/using data that is potentially null.
>
> Example:
>
> I have a "user" object which has a nullable "group" property. I want to show
> a link to the group details page when the "group" property is not null, but
> show nothing otherwise (let's keep this simple).
>
> My issue is that either way, I have to construct the link component and add
> it to the page, whether I want it is visible or not. This is tricky at the
> best of times, as I must always carry out a lot of  "is null" logic.
>
> The construction issue becomes multiplied if I want the same behaviour on a
> stateful page (i.e. the link, etc. can be appropriate for linking to the
> group, or be null and not visible and can switch between the two states).
>
> My question is - am I missing something, or do I just need to have a better
> strategy for this type of situation?
>
> If the answer is the latter, does anyone have any tips and/or components
> that would cut down on the extra coding?
>
> Thanks
>
> -
> 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



Components and nullable data

2009-07-30 Thread Iain Reddick

Hi all,

One of the difficulties I am finding with wicket is the best practice 
when displaying/using data that is potentially null.


Example:

I have a "user" object which has a nullable "group" property. I want to 
show a link to the group details page when the "group" property is not 
null, but show nothing otherwise (let's keep this simple).


My issue is that either way, I have to construct the link component and 
add it to the page, whether I want it is visible or not. This is tricky 
at the best of times, as I must always carry out a lot of  "is null" logic.


The construction issue becomes multiplied if I want the same behaviour 
on a stateful page (i.e. the link, etc. can be appropriate for linking 
to the group, or be null and not visible and can switch between the two 
states).


My question is - am I missing something, or do I just need to have a 
better strategy for this type of situation?


If the answer is the latter, does anyone have any tips and/or components 
that would cut down on the extra coding?


Thanks

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



Re: Beginner problems with TabbedPanel

2009-07-30 Thread Igor Vaynberg
completely untrue. see my sample that works with a regular tabbed panel.

-igor

On Thu, Jul 30, 2009 at 3:06 AM, Gajo Csaba wrote:
> Hi Iain,
>
> I solved the problem thanks to martin-g from ##wicket. Seems like the
> problem was I was using a non-ajax tabbed panel with an ajax button. When I
> switched to an ajax panel, it worked great.
> I've also tried using a non-ajax tabbed panel with a non-ajax button like
> you suggested, and it also seems to work.
>
> Looks like the only problem here is that you shouldn't mix ajax components
> with non-ajax ones.
>
> Regards,
> Csaba
>
>
> Iain Reddick wrote:
>>
>> Surely this is what you want for a non-ajax solution:
>>
>> class MyPage extends Page {
>>  private TabbedPanel tabPanel;
>>  ...
>>  public MyPage() {
>>   tabPanel = new TabPanel(...);
>>   add( tabPanel );
>>   ...
>>   confirmBtn = new Button("confirm") {
>>     private static final long serialVersionUID = 1L;
>>
>>     @Override
>>     public void onSubmit() {
>>       tabPanel.setSelectedTab(0);
>>     }
>>   };
>>   add( confirmBtn );
>>  }
>> }
>>
>> And for an ajax solution, just add tabPanel to the ajax request in the
>> submit handler?
>>
>> Sorry if this isn't right, but I don't see what the issue is.
>>
>> Gajo Csaba wrote:
>>>
>>> That may be true Igor, but there doesn't seem to be any other solution to
>>> make this work:
>>>
>>> confirmBtn = new Button("confirm") {
>>>   private static final long serialVersionUID = 1L;
>>>   @Override
>>>   public void onSubmit() {
>>>       Page page = getPage();
>>>       TabbedPanel tabPanel = ((HomePage)getWebPage()).getTabbedPanel();
>>>                    tabPanel.setSelectedTab(0);
>>>       setResponsePage(page);
>>>   }
>>> };
>>>
>>> I cannot repaint the tabPanel (either with render() or
>>> renderComponent()), cannot repaint the whole page, cannot go with Linda's
>>> suggestion because even after Martin's fix it still generates an error. I
>>> just want to set the tabbedpanel's selected tab to be #0. It's not that
>>> complicated. In Swing, I would write: tabPanel.setSelectedTab(0); and that
>>> would be it.
>>>
>>> Now I'm not very critical about how software systems are constructed, and
>>> don't care if some features may cause minor side-effects, or cause the
>>> programmer to write a bit hacky code. But having the setSelectedTab() method
>>> detach the page for no apparent reason and without any warning is as bad as
>>> having a goto command in a programming language. "Side effects" are one of
>>> the first thing that you learn in college, and why you should avoid them at
>>> all cost. The documentation for the setSelectedTab() says "sets the selected
>>> tab". What it's missing is a big warning sign "WARNING IT DETACHES THE
>>> PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"
>>>
>>> So what is your suggestion Igor? How should I use the framework properly?
>>>
>>> Regards,
>>> Csaba
>>>
>>>
>>> Igor Vaynberg wrote:

 of course there is no reason to use an ajax link if all you are going
 to do is repaint the entire page anyways...

 also code like this: setresponsepage(getpage()) is always suspect. by
 default wicket repaints the same page so there is no need to call
 this. when inside ajax you should add components you want repainted to
 the request target that is passed in to you.

 setresponsepage should only be used when actually going to a different
 page. you are not using the framework properly...

 -igor

 2009/7/29 Martin Makundi :

>
> 1.
>
> You can fix linda's suggestion by calling setOutputMarkupId(true) on
> your tabbedpanel.
>
> 2. The reason for:
>
> 10:42:27 ERROR [RequestCycle] - No Page found for component
> [MarkupContainer [Component id = panel]]
> java.lang.IllegalStateException: No Page found for component
> [MarkupContainer [Component id = panel]]
>     at org.apache.wicket.Component.getPage(Component.java:1729)
>
> Is that you just called setSelectedTab() which DISCONNECTS the current
> tab from the page hierarcy. Try getting the page before that:
> onClick() {
>  Page page = getPage();
>  tabbedPanel.setSelectedTab(0);
>  setREsponsePage(page);
> }
>
>
> **
> Martin
>
>
> **
> Martin
>
> 2009/7/29 Gajo Csaba :
>
>>
>> Hmm there's something very wrong here...
>>
>> I try to refresh the page like this:
>> setResponsePage(getPage());
>>
>> When this is the only action, the current page is refreshed. When I
>> write
>> setSelectedTab(0) above it, I get an error.
>>
>> 10:42:27 ERROR [RequestCycle] - No Page found for component
>> [MarkupContainer
>> [Component id = panel]]
>> java.lang.IllegalStateException: No Page found for component
>> [MarkupContainer [Component id = panel]]
>>      at org.apache.wicket.Component.getPage(Component.java:1729)
>>      at
>>

Re: Beginner problems with TabbedPanel

2009-07-30 Thread Igor Vaynberg
TabbedPanel tb=new TabbedPanel("tb");
tb.setOutputMarkupId(true);



on panel 2...

add(new AjaxFallbackLink("switch"){
public void onClick(AjaxRequestTarget target) {
TabbedPanel tb = findParent(TabbedPanel.class);
tb.setSelectedTab(0);
if (target != null){target.addComponent(tb);}
}
});

this is how the framework is meant to be used. the following works
with ajax when js is enabled and a regular refresh when js is
disabled.

clean and simple.

-igor

On Thu, Jul 30, 2009 at 1:35 AM, Gajo Csaba wrote:
> That may be true Igor, but there doesn't seem to be any other solution to
> make this work:
>
> confirmBtn = new Button("confirm") {
>   private static final long serialVersionUID = 1L;
>   @Override
>   public void onSubmit() {
>       Page page = getPage();
>       TabbedPanel tabPanel = ((HomePage)getWebPage()).getTabbedPanel();
>                 tabPanel.setSelectedTab(0);
>       setResponsePage(page);
>   }
> };
>
> I cannot repaint the tabPanel (either with render() or renderComponent()),
> cannot repaint the whole page, cannot go with Linda's suggestion because
> even after Martin's fix it still generates an error. I just want to set the
> tabbedpanel's selected tab to be #0. It's not that complicated. In Swing, I
> would write: tabPanel.setSelectedTab(0); and that would be it.
>
> Now I'm not very critical about how software systems are constructed, and
> don't care if some features may cause minor side-effects, or cause the
> programmer to write a bit hacky code. But having the setSelectedTab() method
> detach the page for no apparent reason and without any warning is as bad as
> having a goto command in a programming language. "Side effects" are one of
> the first thing that you learn in college, and why you should avoid them at
> all cost. The documentation for the setSelectedTab() says "sets the selected
> tab". What it's missing is a big warning sign "WARNING IT DETACHES THE
> PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"
>
> So what is your suggestion Igor? How should I use the framework properly?
>
> Regards,
> Csaba
>
>
> Igor Vaynberg wrote:
>>
>> of course there is no reason to use an ajax link if all you are going
>> to do is repaint the entire page anyways...
>>
>> also code like this: setresponsepage(getpage()) is always suspect. by
>> default wicket repaints the same page so there is no need to call
>> this. when inside ajax you should add components you want repainted to
>> the request target that is passed in to you.
>>
>> setresponsepage should only be used when actually going to a different
>> page. you are not using the framework properly...
>>
>> -igor
>>
>> 2009/7/29 Martin Makundi :
>>
>>>
>>> 1.
>>>
>>> You can fix linda's suggestion by calling setOutputMarkupId(true) on
>>> your tabbedpanel.
>>>
>>> 2. The reason for:
>>>
>>> 10:42:27 ERROR [RequestCycle] - No Page found for component
>>> [MarkupContainer [Component id = panel]]
>>> java.lang.IllegalStateException: No Page found for component
>>> [MarkupContainer [Component id = panel]]
>>>     at org.apache.wicket.Component.getPage(Component.java:1729)
>>>
>>> Is that you just called setSelectedTab() which DISCONNECTS the current
>>> tab from the page hierarcy. Try getting the page before that:
>>> onClick() {
>>>  Page page = getPage();
>>>  tabbedPanel.setSelectedTab(0);
>>>  setREsponsePage(page);
>>> }
>>>
>>>
>>> **
>>> Martin
>>>
>>>
>>> **
>>> Martin
>>>
>>> 2009/7/29 Gajo Csaba :
>>>

 Hmm there's something very wrong here...

 I try to refresh the page like this:
 setResponsePage(getPage());

 When this is the only action, the current page is refreshed. When I
 write
 setSelectedTab(0) above it, I get an error.

 10:42:27 ERROR [RequestCycle] - No Page found for component
 [MarkupContainer
 [Component id = panel]]
 java.lang.IllegalStateException: No Page found for component
 [MarkupContainer [Component id = panel]]
      at org.apache.wicket.Component.getPage(Component.java:1729)
      at

 si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160)
      at

 si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45)
      at

 si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95)
      at

 org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74)
      at

 org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140)
      at

 org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
      at

 org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
      at

 org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105)
      at
>>

Re: Bug in AbstractOptions of Palette?

2009-07-30 Thread Igor Vaynberg
open a jira issue

-igor

On Thu, Jul 30, 2009 at 1:39 AM, Eyal Golan wrote:
> Hello,
> We encountered a small problem in our Palette.
> Some of the values that were supposed to be in the choices (available and/or
> selected) had the '<' and '>' .
> Because of that the options weren't rendererd correctly.
> Looking at AbstractAction#onComponentTagBody I saw that it takes the value
> as it is and put it in the html:
> String value = getConverter(displayClass).convertToString(displayValue,
> getLocale());
> where displayValue is Object displayValue =
> renderer.getDisplayValue(choice);
>
> In my code I overridden the getDisplayValue and getDisplayId of the
> renderer:
>        IChoiceRenderer choiceRenderer = new ChoiceRenderer("getFieldName",
> "getFieldName") {
>            private static final long serialVersionUID = 1L;
>
>           �...@override
>            public Object getDisplayValue(Object object) {
>                final String result = (String)
> super.getDisplayValue(object);
>                return Strings.escapeMarkup(result, true, true).toString();
>            }
>
>           �...@override
>            public String getIdValue(Object object, int index) {
>                final String result = (String) super.getIdValue(object,
> index);
>                return Strings.escapeMarkup(result, true, true).toString();
>            }
>        };
> As you can see I took the result  and changed it with the Strings utility.
>
> Do you think it's a bug in Wicket and I should open a Jira issue? Or is the
> Palette works as wanted and my change is normal?
>
> BTW, we use Wicket 1.3.6
>
> Thanks
>
> Eyal Golan
> egola...@gmail.com
>
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
>
> P  Save a tree. Please don't print this e-mail unless it's really necessary
>

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



Re: currency symbol in windows and unix different for a label model

2009-07-30 Thread Jonas
You shouldn't use methods that rely on the vm's default locale, as it
might be set
to something unexpected - use the methods with a locale parameter instead, and
pass the Session#getLocale in, e.g.
NumberFormat.getCurrencyInstance(Session.get().getLocale())

this is probably a serious amount of work, so if you only need to support one
locale, and the servlet container is under your control, just set its
default locale
using vm arguments like -Duser.country=us -Duser.language=en

setting the default locale from within a servlet (or wicket) will probably
fail if your servlet container runs with a security manager


On Thu, Jul 30, 2009 at 4:08 PM, fachhoch wrote:
>
> I am assuming its some kind of java   setting in unix box,  I am  a foreigner
> to unix please help me resolve this.
>
> fachhoch wrote:
>>
>> I have a Label
>>
>> new
>> Label("recommendedAmt",NumberFormat.getCurrencyInstance().format(stgFinding.getFindingAmt()==null
>> ? new BigDecimal(0): stgFinding.getFindingAmt()));
>>
>> this works fine but when deployed in windows I get the label as
>> $0.00   and when deployed in unix   i Get this as   ¤0.00   and I also
>> get strange symbols   ��
>> please help me resolve this.
>>
>> -
>> 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/currency-symbol-in-windows-and-unix-different-for-a-label-model-tp24726638p24739192.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: currency symbol in windows and unix different for a label model

2009-07-30 Thread Martin Makundi
Your system default locale might be off. Always remember to initialize
it somewhere...

  public static void resetLocale() {
TimeZone.setDefault(TimeZone.getTimeZone("EET"));
Locale.setDefault(new Locale("fi", "FI"));
  }

  // Joda time
DateTimeZone.setDefault(DateTimeZone.forTimeZone(TimeZone.getDefault()));


**
Martin

2009/7/30 fachhoch :
>
> I am assuming its some kind of java   setting in unix box,  I am  a foreigner
> to unix please help me resolve this.
>
> fachhoch wrote:
>>
>> I have a Label
>>
>> new
>> Label("recommendedAmt",NumberFormat.getCurrencyInstance().format(stgFinding.getFindingAmt()==null
>> ? new BigDecimal(0): stgFinding.getFindingAmt()));
>>
>> this works fine but when deployed in windows I get the label as
>> $0.00   and when deployed in unix   i Get this as   ¤0.00   and I also
>> get strange symbols   ��
>> please help me resolve this.
>>
>> -
>> 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/currency-symbol-in-windows-and-unix-different-for-a-label-model-tp24726638p24739192.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Apache Wicket 1.4 takes type safety to the next level

2009-07-30 Thread Carl-Eric Menzel
On Thu, 30 Jul 2009 12:54:29 +0200
Martijn Dashorst  wrote:

> The Apache Wicket project is proud to announce the release of Apache
> Wicket 1.4.

Congratulations to the team and all contributors, and a big thank you!

Carl-Eric

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



Re: currency symbol in windows and unix different for a label model

2009-07-30 Thread fachhoch

I am assuming its some kind of java   setting in unix box,  I am  a foreigner
to unix please help me resolve this.

fachhoch wrote:
> 
> I have a Label
> 
> new
> Label("recommendedAmt",NumberFormat.getCurrencyInstance().format(stgFinding.getFindingAmt()==null
> ? new BigDecimal(0): stgFinding.getFindingAmt()));
> 
> this works fine but when deployed in windows I get the label as
> $0.00   and when deployed in unix   i Get this as   ¤0.00   and I also
> get strange symbols   ��
> please help me resolve this.
> 
> -
> 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/currency-symbol-in-windows-and-unix-different-for-a-label-model-tp24726638p24739192.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: Tree and TabbedPanel components

2009-07-30 Thread Zhubin Salehi

Hi Raj,

I think you need to refresh 'detailPanel' instead of 'panelOnClick'.
Something like this:

.
.
.
Panel panelOnClick = new DetailTabbedPanel("detailPanel", defNode);
panelOnClick.setOutputMarkupId(true);
this.detailPanel.replaceWith(panelOnClick);
this.detailPanel = panelOnClick;
target.addComponent(detailPanel);
.
.
.

panelOnClick panel is not rendered when you add it to detailPanel.

Zhubin




rajkaushik wrote:
> 
> Yes I understand this is a refresh problem. 
> 
> 1. By repainting I am assuming you mean that the right panel should invoke
> the setOutputMarkupId. With this parameter set, the repainting is taken
> care of by Ajaxified component. Please inform if you have different view.
> 
> 2. If I have invalid markups, what would be the efficient way of debugging
> and pin-pointing the problem.
> 
> I really appreciate your prompt answers. Please bear with me for the time
> being.
> 
> Raj
> 
> 
> 
> igor.vaynberg wrote:
>> 
>> sounds like you are either not repainting the right component, or you
>> have invalid markup and the browser is puking on replacing the dom.
>> 
>> -igor
>> 
>> 
>> On Tue, Jul 28, 2009 at 11:02 AM, rajkaushik wrote:
>>>
>>> Yes Igor,
>>>
>>> I am using the Ajax. Here is my partial code. Please suggest me the
>>> possible
>>> misses - Raj
>>>
>>>
>>> protected void onNodeLinkClicked(AjaxRequestTarget target, TreeNode
>>> node)
>>> ...
>>>        Panel panelOnClick = new DetailTabbedPanel("detailPanel",
>>> defNode);
>>>        panelOnClick.setOutputMarkupId(true);
>>>        this.detailPanel.replaceWith(panelOnClick);
>>>        this.detailPanel = panelOnClick;
>>>        target.addComponent(panelOnClick);
>>> 
>>>
>>> }
>>>
>>>
>>> -
>>> public class DetailTabbedPanel extends Panel {
>>>
>>>
>>>        private  JMXMutableTreeNode nodeDef;
>>>        private AjaxTabbedPanel ajaxTabbedPanel;
>>>
>>>
>>>    public DetailTabbedPanel(String id, JMXMutableTreeNode nodeDef) {
>>>        super(id);
>>>        this.nodeDef = nodeDef;
>>>        getTabbedPanel("detailTabbedPanel");
>>>        }
>>>
>>>    public void getTabbedPanel(String tabbedId) {
>>>
>>>                List  tabs=new ArrayList();
>>>
>>> /*          tabs.add(new AbstractTab(new
>>> StringResourceModel("tab.conprops",
>>> DetailTabbedPanel.this, null)){
>>>                **//**
>>>                         *
>>>                         *//*
>>>                        private static final long serialVersionUID = 1L;
>>>
>>>                        public Panel getPanel(String panelId){
>>>
>>>                                if(nodeDef.getUserObject() instanceof
>>> ObjectInstanceNodeInfo){
>>>                                        return new
>>> SMBeanTabConnectionPanel(panelId, nodeDef);
>>>                                } else {
>>>                                        return new
>>> SMTabConnectionPanel(panelId, nodeDef);
>>>                                }
>>>                        //return new EmptyPanel(panelId);
>>>                }
>>>            });*/
>>>
>>>            tabs.add(new PanelCachingTab(new AbstractTab(new
>>> StringResourceModel("tab.smprops", DetailTabbedPanel.this, null)){
>>>                /**
>>>                         *
>>>                         */
>>>                        private static final long serialVersionUID = 1L;
>>>
>>>                        public Panel getPanel(String panelId)
>>>                {
>>>                                SMTabSMPanel panel1 = new
>>> SMTabSMPanel(panelId, nodeDef);
>>>                                panel1.setOutputMarkupId(true);
>>>                        return panel1;
>>>
>>>                }
>>>            }));
>>>
>>>            tabs.add(new PanelCachingTab(new AbstractTab(new
>>> StringResourceModel("tab.mobiprops", DetailTabbedPanel.this, null)){
>>>                /**
>>>                         *
>>>                         */
>>>                        private static final long serialVersionUID = 1L;
>>>
>>>                        public Panel getPanel(String panelId)
>>>                {
>>>                                SMTabMobiPanel panel2 = new
>>> SMTabMobiPanel(panelId, nodeDef);
>>>                                panel2.setOutputMarkupId(true);
>>>                        return panel2;
>>>
>>>                }
>>>            }));
>>>
>>>
>>>            tabs.add(new PanelCachingTab(new AbstractTab(new
>>> StringResourceModel("tab.vcprops", DetailTabbedPanel.this, null)){
>>>                /**
>>>                        *
>>>                        */
>>>                        private static final long serialVersionUID = 1L;
>>>
>>>                        public Panel getPanel(String panelId)
>>>                {
>>>                                SMTabVCPanel panel3 = new
>>> SMTabVCPanel(panelId, nodeDef);
>>>                                panel3.setOutputMarkupId(true);
>>>                        return panel3;
>>>
>>>                }
>>>       

Re: Resource without sessionId

2009-07-30 Thread Gatos
Igor, You're right! This 302 depends on server or server configuration. For
example tomcat just sets cookie without redirect.

I guess the correct question will be - how to generate url without sessionId
from WebResource?

I'm trying to generate url to an application page from a .csv file. If I
request .csv file from a browser that doesn't support cookies then links in
this file are generated with jsessionid.

String url = RequestCycle.get().urlFor(AnnouncementViewPage.class,
pageParams).toString();
String absoluteUrl = RequestUtils.toAbsolutePath(url);



On Wed, Jul 29, 2009 at 6:50 PM, Igor Vaynberg wrote:

> doesnt look like that url is even handled by wicket
>
> -igor
>
> On Tue, Jul 28, 2009 at 12:16 AM, Gatos wrote:
> > When I try to request a resource using url
> http://domain.com/resource.csv
> > then I get 302 to http://domain.com/resource.csv;jsessionid=joiadfadsfad
> > and all generated links it csv file with 'jsessionid' parameter.
> >
> > How to use resource without sessionid?
> >
> > Thank you
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Apache Wicket 1.4 takes type safety to the next level

2009-07-30 Thread Peter Thomas
great news. congrats to the wicket team !

the link is on DZone:
http://www.dzone.com/links/apache_wicket_14_released_takes_type_safety_to_th.html

On Thu, Jul 30, 2009 at 4:40 PM, Paul Szulc  wrote:

> finally out  :) !!
>
> thx wicket team!
>
> On Thu, Jul 30, 2009 at 12:54 PM, Martijn Dashorst  >wrote:
>
> > The Apache Wicket project is proud to announce the release of Apache
> > Wicket 1.4. Apache Wicket is an open source, component oriented Java
> > web application framework. With overwhelming support from the user
> > community, this release marks a departure from the past where we leave
> > Java 1.4 behind and we require Java 5 as the minimum JDK version. By
> > moving to Java 5 as the required minimum platform, we were able to
> > utilize Java 5 idioms and increase the type safety of our APIs. Using
> > Java generics you can now write typesafe web applications and create
> > typesafe, self documenting, reusable custom components.
> >
> > The full announcement for this release can be found here:
> >
> >
> http://wicket.apache.org/apache-wicket-14-takes-type-safety-to-the-next-level.html
> >
>
>  
>


Re: Apache Wicket 1.4 takes type safety to the next level

2009-07-30 Thread Paul Szulc
finally out  :) !!

thx wicket team!

On Thu, Jul 30, 2009 at 12:54 PM, Martijn Dashorst wrote:

> The Apache Wicket project is proud to announce the release of Apache
> Wicket 1.4. Apache Wicket is an open source, component oriented Java
> web application framework. With overwhelming support from the user
> community, this release marks a departure from the past where we leave
> Java 1.4 behind and we require Java 5 as the minimum JDK version. By
> moving to Java 5 as the required minimum platform, we were able to
> utilize Java 5 idioms and increase the type safety of our APIs. Using
> Java generics you can now write typesafe web applications and create
> typesafe, self documenting, reusable custom components.
>
> The full announcement for this release can be found here:
>
> http://wicket.apache.org/apache-wicket-14-takes-type-safety-to-the-next-level.html
>
> Download Apache Wicket 1.4
>
> You can download the release here:
> http://www.apache.org/dyn/closer.cgi/wicket/1.4.0
>
> Or use this in your Maven pom’s to upgrade to the new version:
>
> 
>org.apache.wicket
>wicket
>1.4.0
> 
>
> You will need to upgrade all modules (i.e. wicket, wicket-extensions)
> to their 1.4 counterparts. It is not possible to mix Wicket 1.3
> libraries with 1.4 libraries due to API changes.
>
> Most notable changes
>
> From all the changes that went into this release, the following are
> the most important ones:
>
>  * Generified IModel interface and implementations increases type
> safety in your Wicket applications
>  * Component#getModel() and Component#setModel() have been renamed to
> getDefaultModel() and setDefaultModel() to better support generified
> models
>  * The Spring modules have been merged (wicket-spring-annot is now
> obsolete, all you need is wicket-spring)
>  * Many API’s have been altered to better work with Java 5’s idioms
>  * Wicket jars are now packaged with metadata that makes them OSGI bundles
>
> Apart from these changes, the release is mostly compatible with Wicket
> 1.3 and upgrading shouldn’t take too long. Early adopters report about
> a days work to upgrade medium to large applications to Wicket 1.4.
> Read the migration guide to learn more about the changes in our APIs.
> To learn more about all the improvements and new features that went
> into this release, check the solved issue list in our JIRA instance.
>
> If you want to learn more about this release, please refer to the full
> release announcement:
>
> http://wicket.apache.org/apache-wicket-14-takes-type-safety-to-the-next-level.html
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Best regards,
Paul Szulc

http://paulszulc.wordpress.com


Apache Wicket 1.4 takes type safety to the next level

2009-07-30 Thread Martijn Dashorst
The Apache Wicket project is proud to announce the release of Apache
Wicket 1.4. Apache Wicket is an open source, component oriented Java
web application framework. With overwhelming support from the user
community, this release marks a departure from the past where we leave
Java 1.4 behind and we require Java 5 as the minimum JDK version. By
moving to Java 5 as the required minimum platform, we were able to
utilize Java 5 idioms and increase the type safety of our APIs. Using
Java generics you can now write typesafe web applications and create
typesafe, self documenting, reusable custom components.

The full announcement for this release can be found here:
http://wicket.apache.org/apache-wicket-14-takes-type-safety-to-the-next-level.html

Download Apache Wicket 1.4

You can download the release here:
http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

Or use this in your Maven pom’s to upgrade to the new version:


org.apache.wicket
wicket
1.4.0


You will need to upgrade all modules (i.e. wicket, wicket-extensions)
to their 1.4 counterparts. It is not possible to mix Wicket 1.3
libraries with 1.4 libraries due to API changes.

Most notable changes

>From all the changes that went into this release, the following are
the most important ones:

 * Generified IModel interface and implementations increases type
safety in your Wicket applications
 * Component#getModel() and Component#setModel() have been renamed to
getDefaultModel() and setDefaultModel() to better support generified
models
 * The Spring modules have been merged (wicket-spring-annot is now
obsolete, all you need is wicket-spring)
 * Many API’s have been altered to better work with Java 5’s idioms
 * Wicket jars are now packaged with metadata that makes them OSGI bundles

Apart from these changes, the release is mostly compatible with Wicket
1.3 and upgrading shouldn’t take too long. Early adopters report about
a days work to upgrade medium to large applications to Wicket 1.4.
Read the migration guide to learn more about the changes in our APIs.
To learn more about all the improvements and new features that went
into this release, check the solved issue list in our JIRA instance.

If you want to learn more about this release, please refer to the full
release announcement:
http://wicket.apache.org/apache-wicket-14-takes-type-safety-to-the-next-level.html

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



Re: Beginner problems with TabbedPanel

2009-07-30 Thread Iain Reddick


confirmBtn = new Button("confirm") {
  private static final long serialVersionUID = 1L;
  @Override
  public void onSubmit() {
  Page homePage = (HomePage)getPage();
  homePage.getTabbedPanel().setSelectedTab(0);
  }
};

Iain Reddick wrote:

Sorry - I've re-read your initial post and see what your issue is.

Iain Reddick wrote:

Surely this is what you want for a non-ajax solution:

class MyPage extends Page {
 private TabbedPanel tabPanel;
 ...
 public MyPage() {
   tabPanel = new TabPanel(...);
   add( tabPanel );
   ...
   confirmBtn = new Button("confirm") {
 private static final long serialVersionUID = 1L;

 @Override
 public void onSubmit() {
   tabPanel.setSelectedTab(0);
 }
   };
   add( confirmBtn );
 }
}

And for an ajax solution, just add tabPanel to the ajax request in 
the submit handler?


Sorry if this isn't right, but I don't see what the issue is.

Gajo Csaba wrote:
That may be true Igor, but there doesn't seem to be any other 
solution to make this work:


confirmBtn = new Button("confirm") {
   private static final long serialVersionUID = 1L;
   @Override
   public void onSubmit() {
   Page page = getPage();
   TabbedPanel tabPanel = 
((HomePage)getWebPage()).getTabbedPanel();  
tabPanel.setSelectedTab(0);

   setResponsePage(page);
   }
};

I cannot repaint the tabPanel (either with render() or 
renderComponent()), cannot repaint the whole page, cannot go with 
Linda's suggestion because even after Martin's fix it still 
generates an error. I just want to set the tabbedpanel's selected 
tab to be #0. It's not that complicated. In Swing, I would write: 
tabPanel.setSelectedTab(0); and that would be it.


Now I'm not very critical about how software systems are 
constructed, and don't care if some features may cause minor 
side-effects, or cause the programmer to write a bit hacky code. But 
having the setSelectedTab() method detach the page for no apparent 
reason and without any warning is as bad as having a goto command in 
a programming language. "Side effects" are one of the first thing 
that you learn in college, and why you should avoid them at all 
cost. The documentation for the setSelectedTab() says "sets the 
selected tab". What it's missing is a big warning sign "WARNING 
IT DETACHES THE PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"


So what is your suggestion Igor? How should I use the framework 
properly?


Regards,
Csaba


Igor Vaynberg wrote:

of course there is no reason to use an ajax link if all you are going
to do is repaint the entire page anyways...

also code like this: setresponsepage(getpage()) is always suspect. by
default wicket repaints the same page so there is no need to call
this. when inside ajax you should add components you want repainted to
the request target that is passed in to you.

setresponsepage should only be used when actually going to a different
page. you are not using the framework properly...

-igor

2009/7/29 Martin Makundi :
 

1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
 at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the 
current

tab from the page hierarcy. Try getting the page before that:
onClick() {
 Page page = getPage();
 tabbedPanel.setSelectedTab(0);
 setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :
 

Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When 
I write

setSelectedTab(0) above it, I get an error.

10:42:27 ERROR [RequestCycle] - No Page found for component 
[MarkupContainer

[Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)
  at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160) 


  at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45) 


  at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95) 


  at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74) 


  at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140) 


  at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166) 


  at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299) 


  at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105) 


  

Re: Beginner problems with TabbedPanel

2009-07-30 Thread Gajo Csaba

Hi Iain,

I solved the problem thanks to martin-g from ##wicket. Seems like the 
problem was I was using a non-ajax tabbed panel with an ajax button. 
When I switched to an ajax panel, it worked great.
I've also tried using a non-ajax tabbed panel with a non-ajax button 
like you suggested, and it also seems to work.


Looks like the only problem here is that you shouldn't mix ajax 
components with non-ajax ones.


Regards,
Csaba


Iain Reddick wrote:

Surely this is what you want for a non-ajax solution:

class MyPage extends Page {
 private TabbedPanel tabPanel;
 ...
 public MyPage() {
   tabPanel = new TabPanel(...);
   add( tabPanel );
   ...
   confirmBtn = new Button("confirm") {
 private static final long serialVersionUID = 1L;

 @Override
 public void onSubmit() {
   tabPanel.setSelectedTab(0);
 }
   };
   add( confirmBtn );
 }
}

And for an ajax solution, just add tabPanel to the ajax request in the 
submit handler?


Sorry if this isn't right, but I don't see what the issue is.

Gajo Csaba wrote:
That may be true Igor, but there doesn't seem to be any other 
solution to make this work:


confirmBtn = new Button("confirm") {
   private static final long serialVersionUID = 1L;
   @Override
   public void onSubmit() {
   Page page = getPage();
   TabbedPanel tabPanel = 
((HomePage)getWebPage()).getTabbedPanel();  
tabPanel.setSelectedTab(0);

   setResponsePage(page);
   }
};

I cannot repaint the tabPanel (either with render() or 
renderComponent()), cannot repaint the whole page, cannot go with 
Linda's suggestion because even after Martin's fix it still generates 
an error. I just want to set the tabbedpanel's selected tab to be #0. 
It's not that complicated. In Swing, I would write: 
tabPanel.setSelectedTab(0); and that would be it.


Now I'm not very critical about how software systems are constructed, 
and don't care if some features may cause minor side-effects, or 
cause the programmer to write a bit hacky code. But having the 
setSelectedTab() method detach the page for no apparent reason and 
without any warning is as bad as having a goto command in a 
programming language. "Side effects" are one of the first thing that 
you learn in college, and why you should avoid them at all cost. The 
documentation for the setSelectedTab() says "sets the selected tab". 
What it's missing is a big warning sign "WARNING IT DETACHES THE 
PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"


So what is your suggestion Igor? How should I use the framework 
properly?


Regards,
Csaba


Igor Vaynberg wrote:

of course there is no reason to use an ajax link if all you are going
to do is repaint the entire page anyways...

also code like this: setresponsepage(getpage()) is always suspect. by
default wicket repaints the same page so there is no need to call
this. when inside ajax you should add components you want repainted to
the request target that is passed in to you.

setresponsepage should only be used when actually going to a different
page. you are not using the framework properly...

-igor

2009/7/29 Martin Makundi :
 

1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
 at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the current
tab from the page hierarcy. Try getting the page before that:
onClick() {
 Page page = getPage();
 tabbedPanel.setSelectedTab(0);
 setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :
  

Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When 
I write

setSelectedTab(0) above it, I get an error.

10:42:27 ERROR [RequestCycle] - No Page found for component 
[MarkupContainer

[Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)
  at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160) 


  at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45) 


  at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95) 


  at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74) 


  at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140) 


  at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166) 


  at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299) 


  at
org.apache.wi

Re: Beginner problems with TabbedPanel

2009-07-30 Thread Iain Reddick

Sorry - I've re-read your initial post and see what your issue is.

Iain Reddick wrote:

Surely this is what you want for a non-ajax solution:

class MyPage extends Page {
 private TabbedPanel tabPanel;
 ...
 public MyPage() {
   tabPanel = new TabPanel(...);
   add( tabPanel );
   ...
   confirmBtn = new Button("confirm") {
 private static final long serialVersionUID = 1L;

 @Override
 public void onSubmit() {
   tabPanel.setSelectedTab(0);
 }
   };
   add( confirmBtn );
 }
}

And for an ajax solution, just add tabPanel to the ajax request in the 
submit handler?


Sorry if this isn't right, but I don't see what the issue is.

Gajo Csaba wrote:
That may be true Igor, but there doesn't seem to be any other 
solution to make this work:


confirmBtn = new Button("confirm") {
   private static final long serialVersionUID = 1L;
   @Override
   public void onSubmit() {
   Page page = getPage();
   TabbedPanel tabPanel = 
((HomePage)getWebPage()).getTabbedPanel();  
tabPanel.setSelectedTab(0);

   setResponsePage(page);
   }
};

I cannot repaint the tabPanel (either with render() or 
renderComponent()), cannot repaint the whole page, cannot go with 
Linda's suggestion because even after Martin's fix it still generates 
an error. I just want to set the tabbedpanel's selected tab to be #0. 
It's not that complicated. In Swing, I would write: 
tabPanel.setSelectedTab(0); and that would be it.


Now I'm not very critical about how software systems are constructed, 
and don't care if some features may cause minor side-effects, or 
cause the programmer to write a bit hacky code. But having the 
setSelectedTab() method detach the page for no apparent reason and 
without any warning is as bad as having a goto command in a 
programming language. "Side effects" are one of the first thing that 
you learn in college, and why you should avoid them at all cost. The 
documentation for the setSelectedTab() says "sets the selected tab". 
What it's missing is a big warning sign "WARNING IT DETACHES THE 
PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"


So what is your suggestion Igor? How should I use the framework 
properly?


Regards,
Csaba


Igor Vaynberg wrote:

of course there is no reason to use an ajax link if all you are going
to do is repaint the entire page anyways...

also code like this: setresponsepage(getpage()) is always suspect. by
default wicket repaints the same page so there is no need to call
this. when inside ajax you should add components you want repainted to
the request target that is passed in to you.

setresponsepage should only be used when actually going to a different
page. you are not using the framework properly...

-igor

2009/7/29 Martin Makundi :
 

1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
 at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the current
tab from the page hierarcy. Try getting the page before that:
onClick() {
 Page page = getPage();
 tabbedPanel.setSelectedTab(0);
 setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :
  

Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When 
I write

setSelectedTab(0) above it, I get an error.

10:42:27 ERROR [RequestCycle] - No Page found for component 
[MarkupContainer

[Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)
  at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160) 


  at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45) 


  at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95) 


  at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74) 


  at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140) 


  at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166) 


  at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299) 


  at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105) 


  at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) 


  at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192) 


  at org.apache.wicket.RequestCycle.step(R

Re: Beginner problems with TabbedPanel

2009-07-30 Thread Iain Reddick

Surely this is what you want for a non-ajax solution:

class MyPage extends Page {
 private TabbedPanel tabPanel;
 ...
 public MyPage() {
   tabPanel = new TabPanel(...);
   add( tabPanel );
   ...
   confirmBtn = new Button("confirm") {
 private static final long serialVersionUID = 1L;

 @Override
 public void onSubmit() {
   tabPanel.setSelectedTab(0);
 }
   };
   add( confirmBtn );
 }
}

And for an ajax solution, just add tabPanel to the ajax request in the 
submit handler?


Sorry if this isn't right, but I don't see what the issue is.

Gajo Csaba wrote:
That may be true Igor, but there doesn't seem to be any other solution 
to make this work:


confirmBtn = new Button("confirm") {
   private static final long serialVersionUID = 1L;
   @Override
   public void onSubmit() {
   Page page = getPage();
   TabbedPanel tabPanel = 
((HomePage)getWebPage()).getTabbedPanel();  
tabPanel.setSelectedTab(0);

   setResponsePage(page);
   }
};

I cannot repaint the tabPanel (either with render() or 
renderComponent()), cannot repaint the whole page, cannot go with 
Linda's suggestion because even after Martin's fix it still generates 
an error. I just want to set the tabbedpanel's selected tab to be #0. 
It's not that complicated. In Swing, I would write: 
tabPanel.setSelectedTab(0); and that would be it.


Now I'm not very critical about how software systems are constructed, 
and don't care if some features may cause minor side-effects, or cause 
the programmer to write a bit hacky code. But having the 
setSelectedTab() method detach the page for no apparent reason and 
without any warning is as bad as having a goto command in a 
programming language. "Side effects" are one of the first thing that 
you learn in college, and why you should avoid them at all cost. The 
documentation for the setSelectedTab() says "sets the selected tab". 
What it's missing is a big warning sign "WARNING IT DETACHES THE 
PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"


So what is your suggestion Igor? How should I use the framework properly?

Regards,
Csaba


Igor Vaynberg wrote:

of course there is no reason to use an ajax link if all you are going
to do is repaint the entire page anyways...

also code like this: setresponsepage(getpage()) is always suspect. by
default wicket repaints the same page so there is no need to call
this. when inside ajax you should add components you want repainted to
the request target that is passed in to you.

setresponsepage should only be used when actually going to a different
page. you are not using the framework properly...

-igor

2009/7/29 Martin Makundi :
 

1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
 at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the current
tab from the page hierarcy. Try getting the page before that:
onClick() {
 Page page = getPage();
 tabbedPanel.setSelectedTab(0);
 setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :
   

Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When I 
write

setSelectedTab(0) above it, I get an error.

10:42:27 ERROR [RequestCycle] - No Page found for component 
[MarkupContainer

[Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)
  at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160) 


  at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45) 


  at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95) 


  at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74) 


  at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140) 


  at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166) 


  at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299) 


  at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105) 


  at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) 


  at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192) 


  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271)
  at org.apache.wicket.RequestCycle.steps(RequestCycle.java:137

Re: Thanks Wicket-Team!

2009-07-30 Thread Jeremy Thomerson
Well, I must say that this is an impressive site for four months of
development time if you had no web, html, or js experience before!  I
think your version of "steep learning curve" may be different than
most.  I've seen people who write webapps for a living not be able to
fully grasp a framework in three or four months.

Thanks for the input!

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




On Thu, Jul 30, 2009 at 2:31 AM, okrohne wrote:
>
> Hi Jeremy,
>
> let me add that I had no web-framework/spring/html/js experience before,
> so this is my first web application. In addition I have no swing background
> which would have been helpful to better get started with the wicket
> programming model.
> This has definitly contributed to my learning curve.
>
> When I started to look at different frameworks, js-libs, etc. I often asked
> myself how
> to do it with wicket? Especially how to integrate json js libs, if I look at
> the wicket examples:
> no js in any markup file (but many js examples in the web are in html
> files),
> yes everything is done from java, now I know and it is powerfull as I have
> easy access to all my business objects, services etc. So customizing
> existing wicket ajax
> components or adding ajax to components was not so easy for me.
>
> Thanks,
> Oliver
>
>
> jthomerson wrote:
>>
>> I'd be interested in knowing from your viewpoint what parts had a high
>> learning curve?  And what background are you coming from (that may
>> effect your individual curve)?  In my experience, Wicket has a MUCH
>> lower learning curve than Spring Web Flow and Tapestry (any
>> incarnation).  So, as someone who teaches Wicket, I'd be interested in
>> seeing what parts stumped you.
>>
>> Good looking site by the way!
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>>
>> On Wed, Jul 29, 2009 at 2:07 AM, okrohne wrote:
>>>
>>> Hi José
>>>
>>> just me as developer and my co-founder who did
>>> the design.
>>>
>>> Wicket has quite a high learning curve but after a while one can be so
>>> productive
>>> that is makes just fun :)
>>>
>>> Thanks,
>>> Oliver
>>>
>>>
>>>
>>> José Antonio Matute wrote:

 Wow Only four months?  How many developers?

 I'm very impressed :)

 Fantastic work 

 Best regards
 -Mensaje original-
 De: Oliver Krohne [mailto:okro...@yahoo.de]
 Enviado el: martes, 28 de julio de 2009 13:02
 Para: users@wicket.apache.org
 Asunto: Thanks Wicket-Team!

 Hi,

 Many thanks to the Wicket-Team for the great Framework and
 of course for the support I have received from the mailinglist.

 I started with zero-Wicket knowledge and now 4 month later
 we have launched a new community website:

 http://fytch.com

 It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL.

 I would be glad if you try out Fytch and of course any feedback is
 welcome.
 Should I put Fytch on the wiki "Sites using Wicket"?

 Thanks for the fabulous Wicket,
 Oliver





 -
 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/Thanks-Wicket-Team%21-tp24697082p24713643.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Thanks-Wicket-Team%21-tp24697082p24733524.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Apache Wicket 1.3.7 marks end of life for Wicket 1.3!

2009-07-30 Thread Martijn Dashorst
The Apache Wicket team is proud to present the release of Apache Wicket 1.3.7.

This will be the last feature release for the 1.3.x branch. Going forward, only
security fixes will be released in the 1.3.x branch - meaning that
1.3.7 may be the
last release in this branch. All users are encouraged to upgrade to
1.4.0 as soon as
possible. As work begins on 1.5 in the near future, we will be
supporting 1.4.x and 1.5.x.

Eager people click here to download the distribution, others can read further:

* http://www.apache.org/dyn/closer.cgi/wicket/1.3.7

We thank you for your patience and support.

 -= The Wicket Team =-

Apache Wicket

Apache Wicket is a component oriented Java web application framework. With
proper mark-up/logic separation, a POJO data model, and a refreshing lack of
XML, Apache Wicket makes developing web-apps simple and enjoyable again. Swap
the boilerplate, complex debugging and brittle code for powerful, reusable
components written with plain Java and HTML.

You can find out more about Apache Wicket on our website:

http://wicket.apache.org

This release

This will be the last feature release for the 1.3.x branch. Going
forward, only security fixes will be released in the 1.3.x branch -
meaning that 1.3.7 may be the last release in this branch. All users are
encouraged to upgrade to 1.4.0 as soon as possible. As work begins on
1.5 in the near future, we will be supporting 1.4.x and 1.5.x.

Migrating from 1.2

If you are coming from Wicket 1.2, you really want to read our migration
guide, found on the wiki:

http://cwiki.apache.org/WICKET/migrate-13.html

Downloading the release

You can download the release from the official Apache mirror system, and you
can find it through the following link:

http://www.apache.org/dyn/closer.cgi/wicket/1.3.7/

For the Maven and Ivy fans out there: update your pom's to the following, and
everything will be downloaded automatically:


org.apache.wicket
wicket
1.3.7


Substitute the artifact ID with the projects of your liking to get the other
projects.

Please note that we don't prescribe a Logging implementation for SLF4J. You
need to specify yourself which one you prefer. Read more about SLF4J here:
http://slf4j.org

Validating the release

The release has been signed by Igor Vaynberg, your release manager for
today. The public key can be found in the KEYS file in the download area.
Download the KEYS file only from the Apache website.

http://www.apache.org/dist/wicket/1.3.7/KEYS

Instructions on how to validate the release can be found here:

http://www.apache.org/dev/release-signing.html#check-integrity

Reporting bugs

In case you do encounter a bug, we would appreciate a report in our JIRA:

http://issues.apache.org/jira/browse/WICKET

The distribution

In the distribution you will find a README. The README contains instructions
on how to build from source yourself. You also find a CHANGELOG-1.3 which
contains a list of all things that have been fixed, added and/or removed since
Wicket 1.3.0.

Release Notes - Wicket - Version 1.3.7

Bugs

* [WICKET-1912] - StatelessForm problems with query string
* [WICKET-1922] - AbstractTree - setting root to null causes
NullPointerException
* [WICKET-1960] - AutoCompleteTextField - gives a type mismatch error
on IE - version wicket-1.4-rc1
* [WICKET-1992] - SharedResourceRequestTarget allows access to almost
arbitrary files under WEB-INF.
* [WICKET-2215] - WebClientInfo does not set browerMajorVersion for IE8
* [WICKET-2252] - Autocomplete text fields don't call existing
JavaScript event handlers properly
* [WICKET-2268] - NullPointerException NPE in DiskPageStore after
Session Timeout
* [WICKET-2289] - AutoCompleteBehavior: Selected input not modiefied
when selected with keyboard
* [WICKET-2308] - Append lastmodified to Resources shouldnt append
when the resource is a directory (ends with /)
* [WICKET-2313] - BaseWicketTester doesn't invoke
Application.newAjaxRequestTarget for ajax request target
* [WICKET-2337] - IndexOutOfBoundsException when PropertyResolver is
using an invalid list index
* [WICKET-2354] - PropertyModel does not support index only property ("[0]")
* [WICKET-2371] - jre 1.5 method used in wicket-extensions
* [WICKET-2384] - OutOfMemoryError occur for memory leak on
FeedbackPanel & FeedbackMessages
* [WICKET-2385] - BigDecimalConverter uses jdk5

Improvements

* [WICKET-2168] - TableTree.html is not XHTML valid
* [WICKET-2315] - Backport PageReference from trunk

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



Re: Thanks Wicket-Team!

2009-07-30 Thread Petr Fejfar
On Thu, Jul 30, 2009 at 9:31 AM, okrohne wrote:

> So customizing existing wicket ajax components or adding
> ajax to components was not so easy for me.

Hi Oliver,

please, could you share with us what ajaxified compontets you have finally
used in your project?

This stuff seems to be the most difficult for us as well.

Thanks, Petr

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



Re: Thanks Wicket-Team!

2009-07-30 Thread okrohne

Csaba,

indeed a quick test some weeks ago with opera showed no problems but we had
not
the time to fully test opera yet. We must not only test the wicket part but
the bookmarklet as well.
I am sure we will get this solved within in the next days and then I will
let you know.

Thanks,
Oliver



Csaba Gajo wrote:
> 
> Oliver, good website, I can see you've put a lot of work in it. Could 
> you please make it work fully with Opera too? At one page I got a 
> message telling me to come back with IE or Firefox. I think wicket works 
> without problems on Opera 9...
> 
> Regards,
> Csaba
> 
> 
> okrohne wrote:
>> Hi Jeremy,
>>
>> let me add that I had no web-framework/spring/html/js experience before,
>> so this is my first web application. In addition I have no swing
>> background
>> which would have been helpful to better get started with the wicket
>> programming model.
>> This has definitly contributed to my learning curve. 
>>
>> When I started to look at different frameworks, js-libs, etc. I often
>> asked
>> myself how
>> to do it with wicket? Especially how to integrate json js libs, if I look
>> at
>> the wicket examples:
>> no js in any markup file (but many js examples in the web are in html
>> files), 
>> yes everything is done from java, now I know and it is powerfull as I
>> have
>> easy access to all my business objects, services etc. So customizing
>> existing wicket ajax
>> components or adding ajax to components was not so easy for me. 
>>
>> Thanks,
>> Oliver
>>
>>
>> jthomerson wrote:
>>   
>>> I'd be interested in knowing from your viewpoint what parts had a high
>>> learning curve?  And what background are you coming from (that may
>>> effect your individual curve)?  In my experience, Wicket has a MUCH
>>> lower learning curve than Spring Web Flow and Tapestry (any
>>> incarnation).  So, as someone who teaches Wicket, I'd be interested in
>>> seeing what parts stumped you.
>>>
>>> Good looking site by the way!
>>>
>>> --
>>> Jeremy Thomerson
>>> http://www.wickettraining.com
>>>
>>>
>>>
>>>
>>> On Wed, Jul 29, 2009 at 2:07 AM, okrohne wrote:
>>> 
 Hi José

 just me as developer and my co-founder who did
 the design.

 Wicket has quite a high learning curve but after a while one can be so
 productive
 that is makes just fun :)

 Thanks,
 Oliver



 José Antonio Matute wrote:
   
> Wow Only four months?  How many developers?
>
> I'm very impressed :)
>
> Fantastic work 
>
> Best regards
> -Mensaje original-
> De: Oliver Krohne [mailto:okro...@yahoo.de]
> Enviado el: martes, 28 de julio de 2009 13:02
> Para: users@wicket.apache.org
> Asunto: Thanks Wicket-Team!
>
> Hi,
>
> Many thanks to the Wicket-Team for the great Framework and
> of course for the support I have received from the mailinglist.
>
> I started with zero-Wicket knowledge and now 4 month later
> we have launched a new community website:
>
> http://fytch.com
>
> It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL.
>
> I would be glad if you try out Fytch and of course any feedback is
> welcome.
> Should I put Fytch on the wiki "Sites using Wicket"?
>
> Thanks for the fabulous Wicket,
> Oliver
>
>
>
>
>
> -
> 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/Thanks-Wicket-Team%21-tp24697082p24713643.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/Thanks-Wicket-Team%21-tp24697082p24734695.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: Thanks Wicket-Team!

2009-07-30 Thread Gajo Csaba
Oliver, good website, I can see you've put a lot of work in it. Could 
you please make it work fully with Opera too? At one page I got a 
message telling me to come back with IE or Firefox. I think wicket works 
without problems on Opera 9...


Regards,
Csaba


okrohne wrote:

Hi Jeremy,

let me add that I had no web-framework/spring/html/js experience before,
so this is my first web application. In addition I have no swing background
which would have been helpful to better get started with the wicket
programming model.
This has definitly contributed to my learning curve. 


When I started to look at different frameworks, js-libs, etc. I often asked
myself how
to do it with wicket? Especially how to integrate json js libs, if I look at
the wicket examples:
no js in any markup file (but many js examples in the web are in html
files), 
yes everything is done from java, now I know and it is powerfull as I have

easy access to all my business objects, services etc. So customizing
existing wicket ajax
components or adding ajax to components was not so easy for me. 


Thanks,
Oliver


jthomerson wrote:
  

I'd be interested in knowing from your viewpoint what parts had a high
learning curve?  And what background are you coming from (that may
effect your individual curve)?  In my experience, Wicket has a MUCH
lower learning curve than Spring Web Flow and Tapestry (any
incarnation).  So, as someone who teaches Wicket, I'd be interested in
seeing what parts stumped you.

Good looking site by the way!

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




On Wed, Jul 29, 2009 at 2:07 AM, okrohne wrote:


Hi José

just me as developer and my co-founder who did
the design.

Wicket has quite a high learning curve but after a while one can be so
productive
that is makes just fun :)

Thanks,
Oliver



José Antonio Matute wrote:
  

Wow Only four months?  How many developers?

I'm very impressed :)

Fantastic work 

Best regards
-Mensaje original-
De: Oliver Krohne [mailto:okro...@yahoo.de]
Enviado el: martes, 28 de julio de 2009 13:02
Para: users@wicket.apache.org
Asunto: Thanks Wicket-Team!

Hi,

Many thanks to the Wicket-Team for the great Framework and
of course for the support I have received from the mailinglist.

I started with zero-Wicket knowledge and now 4 month later
we have launched a new community website:

http://fytch.com

It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL.

I would be glad if you try out Fytch and of course any feedback is
welcome.
Should I put Fytch on the wiki "Sites using Wicket"?

Thanks for the fabulous Wicket,
Oliver





-
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/Thanks-Wicket-Team%21-tp24697082p24713643.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


  

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






  



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



Re: Thanks Wicket-Team!

2009-07-30 Thread ivilis
very impressive idea and amazing implementation.
Thanks for this great stuff.

Cheers!
cvl

Oliver Krohne wrote:
> Hi,
> 
> Many thanks to the Wicket-Team for the great Framework and 
> of course for the support I have received from the mailinglist.
> 
> I started with zero-Wicket knowledge and now 4 month later
> we have launched a new community website:
> 
> http://fytch.com 
> 
> It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL.
> 
> I would be glad if you try out Fytch and of course any feedback is welcome.
> Should I put Fytch on the wiki "Sites using Wicket"?
> 
> Thanks for the fabulous Wicket,
> Oliver
> 
> 
>   

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



Bug in AbstractOptions of Palette?

2009-07-30 Thread Eyal Golan
Hello,
We encountered a small problem in our Palette.
Some of the values that were supposed to be in the choices (available and/or
selected) had the '<' and '>' .
Because of that the options weren't rendererd correctly.
Looking at AbstractAction#onComponentTagBody I saw that it takes the value
as it is and put it in the html:
String value = getConverter(displayClass).convertToString(displayValue,
getLocale());
where displayValue is Object displayValue =
renderer.getDisplayValue(choice);

In my code I overridden the getDisplayValue and getDisplayId of the
renderer:
IChoiceRenderer choiceRenderer = new ChoiceRenderer("getFieldName",
"getFieldName") {
private static final long serialVersionUID = 1L;

@Override
public Object getDisplayValue(Object object) {
final String result = (String)
super.getDisplayValue(object);
return Strings.escapeMarkup(result, true, true).toString();
}

@Override
public String getIdValue(Object object, int index) {
final String result = (String) super.getIdValue(object,
index);
return Strings.escapeMarkup(result, true, true).toString();
}
};
As you can see I took the result  and changed it with the Strings utility.

Do you think it's a bug in Wicket and I should open a Jira issue? Or is the
Palette works as wanted and my change is normal?

BTW, we use Wicket 1.3.6

Thanks

Eyal Golan
egola...@gmail.com

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

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


Re: Beginner problems with TabbedPanel

2009-07-30 Thread Gajo Csaba
That may be true Igor, but there doesn't seem to be any other solution 
to make this work:


confirmBtn = new Button("confirm") {
   private static final long serialVersionUID = 1L;
   @Override
   public void onSubmit() {
   Page page = getPage();
   TabbedPanel tabPanel = 
((HomePage)getWebPage()).getTabbedPanel();   
   tabPanel.setSelectedTab(0);

   setResponsePage(page);
   }
};

I cannot repaint the tabPanel (either with render() or 
renderComponent()), cannot repaint the whole page, cannot go with 
Linda's suggestion because even after Martin's fix it still generates an 
error. I just want to set the tabbedpanel's selected tab to be #0. It's 
not that complicated. In Swing, I would write: 
tabPanel.setSelectedTab(0); and that would be it.


Now I'm not very critical about how software systems are constructed, 
and don't care if some features may cause minor side-effects, or cause 
the programmer to write a bit hacky code. But having the 
setSelectedTab() method detach the page for no apparent reason and 
without any warning is as bad as having a goto command in a programming 
language. "Side effects" are one of the first thing that you learn in 
college, and why you should avoid them at all cost. The documentation 
for the setSelectedTab() says "sets the selected tab". What it's missing 
is a big warning sign "WARNING IT DETACHES THE PAGE WILL CAUSE 
UNRELATED ERROR MESSAGES!!!"


So what is your suggestion Igor? How should I use the framework properly?

Regards,
Csaba


Igor Vaynberg wrote:

of course there is no reason to use an ajax link if all you are going
to do is repaint the entire page anyways...

also code like this: setresponsepage(getpage()) is always suspect. by
default wicket repaints the same page so there is no need to call
this. when inside ajax you should add components you want repainted to
the request target that is passed in to you.

setresponsepage should only be used when actually going to a different
page. you are not using the framework properly...

-igor

2009/7/29 Martin Makundi :
  

1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
 at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the current
tab from the page hierarcy. Try getting the page before that:
onClick() {
 Page page = getPage();
 tabbedPanel.setSelectedTab(0);
 setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :


Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When I write
setSelectedTab(0) above it, I get an error.

10:42:27 ERROR [RequestCycle] - No Page found for component [MarkupContainer
[Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)
  at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160)
  at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45)
  at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95)
  at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74)
  at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140)
  at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
  at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
  at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105)
  at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
  at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192)
  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271)
  at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1370)
  at org.apache.wicket.RequestCycle.request(RequestCycle.java:501)
  at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:455)
  at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:288)
  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  at
org.apache.catalina.core.StandardContextValve.invoke(StandardContex

Re: Fancy URL

2009-07-30 Thread uud ashr
Okay thx, I'll read it

On Wed, Jul 29, 2009 at 9:34 PM, Mathias Nilsson <
wicket.program...@gmail.com> wrote:

>
> take a look at HybridUrlCodingStrategy
> --
> View this message in context:
> http://www.nabble.com/Fancy-URL-tp24715302p24720044.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: Thanks Wicket-Team!

2009-07-30 Thread okrohne

Hi Jeremy,

let me add that I had no web-framework/spring/html/js experience before,
so this is my first web application. In addition I have no swing background
which would have been helpful to better get started with the wicket
programming model.
This has definitly contributed to my learning curve. 

When I started to look at different frameworks, js-libs, etc. I often asked
myself how
to do it with wicket? Especially how to integrate json js libs, if I look at
the wicket examples:
no js in any markup file (but many js examples in the web are in html
files), 
yes everything is done from java, now I know and it is powerfull as I have
easy access to all my business objects, services etc. So customizing
existing wicket ajax
components or adding ajax to components was not so easy for me. 

Thanks,
Oliver


jthomerson wrote:
> 
> I'd be interested in knowing from your viewpoint what parts had a high
> learning curve?  And what background are you coming from (that may
> effect your individual curve)?  In my experience, Wicket has a MUCH
> lower learning curve than Spring Web Flow and Tapestry (any
> incarnation).  So, as someone who teaches Wicket, I'd be interested in
> seeing what parts stumped you.
> 
> Good looking site by the way!
> 
> --
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> 
> 
> On Wed, Jul 29, 2009 at 2:07 AM, okrohne wrote:
>>
>> Hi José
>>
>> just me as developer and my co-founder who did
>> the design.
>>
>> Wicket has quite a high learning curve but after a while one can be so
>> productive
>> that is makes just fun :)
>>
>> Thanks,
>> Oliver
>>
>>
>>
>> José Antonio Matute wrote:
>>>
>>> Wow Only four months?  How many developers?
>>>
>>> I'm very impressed :)
>>>
>>> Fantastic work 
>>>
>>> Best regards
>>> -Mensaje original-
>>> De: Oliver Krohne [mailto:okro...@yahoo.de]
>>> Enviado el: martes, 28 de julio de 2009 13:02
>>> Para: users@wicket.apache.org
>>> Asunto: Thanks Wicket-Team!
>>>
>>> Hi,
>>>
>>> Many thanks to the Wicket-Team for the great Framework and
>>> of course for the support I have received from the mailinglist.
>>>
>>> I started with zero-Wicket knowledge and now 4 month later
>>> we have launched a new community website:
>>>
>>> http://fytch.com
>>>
>>> It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL.
>>>
>>> I would be glad if you try out Fytch and of course any feedback is
>>> welcome.
>>> Should I put Fytch on the wiki "Sites using Wicket"?
>>>
>>> Thanks for the fabulous Wicket,
>>> Oliver
>>>
>>>
>>>
>>>
>>>
>>> -
>>> 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/Thanks-Wicket-Team%21-tp24697082p24713643.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Thanks-Wicket-Team%21-tp24697082p24733524.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