Re: AccordionPanel works on web page but not in another panel

2010-08-23 Thread cole

Example of valid markup (component on a page):

wicket:panel
dl class=accordion-menu
 

wicket:panel
dt class=a-m-t 
wicket:id=titleMenuItem1/dt 
dd class=a-m-d
div class=bd 
wicket:id=content


wicket:panel

Give it some content!


/wicket:panel
 
/div 
/dd
/wicket:panel


 

wicket:panel
dt class=a-m-t 
wicket:id=titleMenuItem2/dt 
dd class=a-m-d
div class=bd 
wicket:id=content


wicket:panel

Give it some content!

/wicket:panel
 
/div 
/dd
/wicket:panel


/dl
wicket:child/
/wicket:panel



Example of invalid (component within another panel)
dl class=accordion-menu


dt class=a-m-tMenuItem1/dt 
dd class=a-m-d
div class=bd

Give it some content!
 
/div 
/dd




dt class=a-m-tMenuItem2/dt 
dd class=a-m-d
div class=bd

Give it some content!

 
/div 
/dd


/dl

as you can see I'm missing some key elements that are required to make the
markup complete. I'm missing something simple, I'm just not competent enough
to find it.



-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AccordionPanel-works-on-web-page-but-not-in-another-panel-tp2333034p2333185.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



Shortening a wicket:message

2010-08-23 Thread Michael Sparer

 Hey,

I have a component that constructs a wicket:message just like Erik does 
in his blog post 
(http://day-to-day-stuff.blogspot.com/2008/05/wicket-internationalization.html)


the .html is as follows:

wicket:message key=sentence
wicket:container wicket:id=userComponent/wicket:container
wicket:container wicket:id=actionComponent/wicket:container
wicket:container wicket:id=targetComponent/wicket:container
wicket:container wicket:id=donationTarget/wicket:container
/wicket:message

the .properties file is the following:

sentence=${userComponent}: I'll ${actionComponent} if ${targetComponent} 
${donationTarget}.

# replaces ${userComponent} in 'sentence'
userComponentText=${user.firstname} ${user.lastname}
# replaces ${actionComponent} in 'sentence'
actionComponentText.action=${sentenceActionText}
# replaces ${targetComponent} in 'sentence'
targetComponentText=${targetGroup} pay ${sum} Euros to ${target}

this results in nice sentences based on various cases handled in the 
java file - an example output might be:
John Jones: I'll climb on the highest mountain if my friends pay 100 
Euros to my Auntie



My problem now is, that on some pages the output should be shortened, so 
the above sentence should be something like:

John Jones: I'll climb on the highest mountain if my friends ... or
John Jones: I'll climb on the highest mountain if my friends pay 100 
Euros to


Anyone got an idea?

cheers,

Michael

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



Re: Wicket + Eclipse + Tomcat

2010-08-23 Thread John Krasnay

On 10-08-22 08:04 PM, James Carman wrote:

Do you have the maven plugin installed in Eclipse?  I know I needed
that to get it to understand the mavenized web structure.  I'm not an
Eclipse expert, but I seem to remember having to have that.


You don't need the Maven plug-in in Eclipse, and if you do have it 
installed you shouldn't need the mvn eclipse:eclipse step.


jk

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



Re: Wicket + Eclipse + Tomcat

2010-08-23 Thread James Carman
On Mon, Aug 23, 2010 at 12:05 AM, Mike Dee mdichiapp...@cardeatech.com wrote:
 In actuality, I'm failing to see the value in Maven.  I love the ease of use
 of Eclipse.  It takes care of the build and dependencies and integrates
 nicely with Tomcat for dev and debug.  I've spent a lot of time learning
 about Maven.  I must be missing something because I don't see how it is very
 useful.
 --

Try using Eclipse in an automated build system.

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



Re: Wicket + Eclipse + Tomcat

2010-08-23 Thread Mike Dee

Good point.  

In the case of automating or scripting builds, is there ever a worry about
keeping the Eclipse and Maven builds consistent?  I would imagine that one
could develop and debug in Eclipse.  But when it comes time to do an
official build (with Maven), the results could be a little different.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Eclipse-Tomcat-tp2333641p2335041.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: Wicket + Eclipse + Tomcat

2010-08-23 Thread James Carman
That's why you make sure that Eclipse understands your maven pom.xml
files with the plugin.

On Mon, Aug 23, 2010 at 8:41 AM, Mike Dee mdichiapp...@cardeatech.com wrote:

 Good point.

 In the case of automating or scripting builds, is there ever a worry about
 keeping the Eclipse and Maven builds consistent?  I would imagine that one
 could develop and debug in Eclipse.  But when it comes time to do an
 official build (with Maven), the results could be a little different.
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Eclipse-Tomcat-tp2333641p2335041.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



gmap2 numbered markers and autozoom

2010-08-23 Thread Christoph Grün
Hi,

is it possible to create numbered markers with gmap2?
Futhermore, I would like to autozoom and center the map window according to the 
visible markers.
Can someone give an example?

Thanks a lot,
Christoph




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



Re: Wicket + Eclipse + Tomcat

2010-08-23 Thread T Ames
In Eclipse I use the m2eclipse plugin.  It works pretty good and I
rarely use the command line.  To start a Wicket project, I create a
Maven project which is part of the m2eclipse plug in.  I then bring in
the org.apache.wicket quickstart archetype.  This creates a web
project. I then modify the pom.xml to remove the jetty stuff and add
is some of my own.

To build the war, I used to use the Export - War which worked fine,
but I then added some extra copy and clean-up procedures in my pom.xml
so now I just use Run As - Maven Package (part of m2eclipse plugin)


I should really look into using jetty someday, but our production
servers are all Tomcat so that is what I have stuck with so far.


On Mon, Aug 23, 2010 at 8:41 AM, Mike Dee mdichiapp...@cardeatech.com wrote:

 Good point.

 In the case of automating or scripting builds, is there ever a worry about
 keeping the Eclipse and Maven builds consistent?  I would imagine that one
 could develop and debug in Eclipse.  But when it comes time to do an
 official build (with Maven), the results could be a little different.
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Eclipse-Tomcat-tp2333641p2335041.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: Wicket + Eclipse + Tomcat

2010-08-23 Thread Mike Dee

The article (in prior message) mentioned that it is easier to go from an
Eclipse project to a Maven project (POM).  That is the first time I've heard
of that.  Almost everyone seems to create a Maven Eclipse archetype
(eclipse:eclipse) and then import that into Eclipse.  I wonder if the
article makes a valid point though?  It would be nice (for me, at least) to
work in Eclipse and make project changes there and then export to a POM. 
Otherwise when an Eclipse project is changed, I may forget to make the
corresponding change in Maven.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Eclipse-Tomcat-tp2333641p2335072.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



SV: Wicket + Eclipse + Tomcat

2010-08-23 Thread Wilhelmsen Tor Iver
 In the case of automating or scripting builds, is there ever a worry
 about
 keeping the Eclipse and Maven builds consistent?  I would imagine that
 one
 could develop and debug in Eclipse.  But when it comes time to do an
 official build (with Maven), the results could be a little different.

Depends on the setup. For instance, we have run into issues where the Eclipse 
project somehow managed to be set up with src/main/webapp/WEB-INF/classes as 
project output, so that Eclipse builds put classes there. However, then Maven 
picked up stuff from there overriding target/classes (if you had edited in 
Eclipse but not built automatically) even though the Maven plugin docs said it 
by default ignored WEB-INF/classes... the fix was to direct Eclipse to build to 
target/classes as well.

- Tor Iver


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



Re: Wicket + Eclipse + Tomcat

2010-08-23 Thread James Carman
On Mon, Aug 23, 2010 at 9:05 AM, T Ames tamesw...@gmail.com wrote:
 I should really look into using jetty someday, but our production
 servers are all Tomcat so that is what I have stuck with so far.


If you use the quickstart, you can easily use Jetty.  All you have to
do is run Start.java as a Java application.

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



Re: Wicket + Eclipse + Tomcat

2010-08-23 Thread Mike Dee

When I tried the m2eclipse plugin, it created a (WTP) java project.  Since it
wasn't a webapp (aka Dynamic Web Project in WTP lingo), it had no Run As
Server command.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Eclipse-Tomcat-tp2333641p2335123.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: Wicket + Eclipse + Tomcat

2010-08-23 Thread T Ames
I have never used that option when developing with Tomcat and the
m2eclipse plugin. I have my development Tomcat loaded on the same
machine as Eclipse, so the dynamic updates to Tomcat just happen when
I change a class.  You see this down in the Servers tab. It will say
[Started, Synchronized] or [Started, Restart]. If Restart shows, then
I click the restart on the Server tab.

Are you adding the project to the Server?  In the Server tab, right
click your Tomcat server and do and Add and Remove.

On Mon, Aug 23, 2010 at 9:40 AM, Mike Dee mdichiapp...@cardeatech.com wrote:

 When I tried the m2eclipse plugin, it created a (WTP) java project.  Since it
 wasn't a webapp (aka Dynamic Web Project in WTP lingo), it had no Run As
 Server command.
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Eclipse-Tomcat-tp2333641p2335123.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: Wicket + Eclipse + Tomcat

2010-08-23 Thread Mike Dee

That is the same setup I have.  Tomcat and Eclipse are on the same machine. 
The problem is that when creating the project through Maven and importing to
Eclipse, something goes wrong.  The end result is that a Java project is
created - not a web app (Dynamic Web Project).  Java projects can not be
added to the Tomcat list of apps.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Eclipse-Tomcat-tp2333641p2335146.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: Wicket + Eclipse + Tomcat

2010-08-23 Thread T Ames
Hmmm.  I would try a clean install of Eclipse (I am using 3.6.0) , the
m2eclipse plugin that goes with that version and a fresh workspace.
Create a Maven Project and then select a wicket archetype or the maven
web archetype.  I have used both archetypes and they should create
web projects upon completion.

On Mon, Aug 23, 2010 at 9:55 AM, Mike Dee mdichiapp...@cardeatech.com wrote:

 That is the same setup I have.  Tomcat and Eclipse are on the same machine.
 The problem is that when creating the project through Maven and importing to
 Eclipse, something goes wrong.  The end result is that a Java project is
 created - not a web app (Dynamic Web Project).  Java projects can not be
 added to the Tomcat list of apps.
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Eclipse-Tomcat-tp2333641p2335146.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: Error Message from ResourceLink within a portlet

2010-08-23 Thread joinow

sorry, two pieces of code are:

final WebResource csvsrc = new WebResource() {

/**
 * 
 */
private static final long serialVersionUID = 1L;

@Override
public IResourceStream getResourceStream() {
// TODO Auto-generated method stub
IStringResourceStream srs = null;
if (true) {
CharSequence cs = getCsvData();
srs = new StringResourceStream(cs,
text/csv);

srs.setCharset(Charset.forName(UTF-8));
} else {

}
return srs;
}   

};

ResourceLink rlink = new ResourceLink(myresource, csvsrc) {
@Override
public void onClick() {

}
};
this.add(rlink);

and:

/**
 * @see org.apache.wicket.IResourceListener#onResourceRequested()
 */
public final void onResourceRequested()
{

Random random = new Random();
if (random.nextBoolean()) {

this.error(blablabla);

} else {
resource.onResourceRequested();
}
onClick();
}
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Error-Message-from-ResourceLink-within-a-portlet-tp2335133p2335177.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: Shortening a wicket:message

2010-08-23 Thread Igor Vaynberg
you can copy wicket:message releated functionality into a new tag that
takes an extra maxlen attribute, or you can create a patch for the
core.

-igor

On Mon, Aug 23, 2010 at 3:16 AM, Michael Sparer michael.spa...@gmx.at wrote:
  Hey,

 I have a component that constructs a wicket:message just like Erik does in
 his blog post
 (http://day-to-day-stuff.blogspot.com/2008/05/wicket-internationalization.html)

 the .html is as follows:

 wicket:message key=sentence
 wicket:container wicket:id=userComponent/wicket:container
 wicket:container wicket:id=actionComponent/wicket:container
 wicket:container wicket:id=targetComponent/wicket:container
 wicket:container wicket:id=donationTarget/wicket:container
 /wicket:message

 the .properties file is the following:

 sentence=${userComponent}: I'll ${actionComponent} if ${targetComponent}
 ${donationTarget}.
 # replaces ${userComponent} in 'sentence'
 userComponentText=${user.firstname} ${user.lastname}
 # replaces ${actionComponent} in 'sentence'
 actionComponentText.action=${sentenceActionText}
 # replaces ${targetComponent} in 'sentence'
 targetComponentText=${targetGroup} pay ${sum} Euros to ${target}

 this results in nice sentences based on various cases handled in the java
 file - an example output might be:
 John Jones: I'll climb on the highest mountain if my friends pay 100 Euros
 to my Auntie


 My problem now is, that on some pages the output should be shortened, so the
 above sentence should be something like:
 John Jones: I'll climb on the highest mountain if my friends ... or
 John Jones: I'll climb on the highest mountain if my friends pay 100 Euros
 to

 Anyone got an idea?

 cheers,

 Michael

 -
 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: implementing a custom resource loader

2010-08-23 Thread Igor Vaynberg
show us your validator

-igor

On Sun, Aug 22, 2010 at 8:15 PM, Chris Merrill ch...@webperformance.com wrote:
 I need to implement our own resource loader in order to re-use our existing
 infrastructure for resolving localized strings.  I've implemented 
 IStringResourceLoader
 and have that working, but I've found I need a bit of a hack to get it to do 
 what
 I need.

 In two scenarios:
  wicket:message key=Merge_Customers/
 and
  new Button(submit_button, new StringResourceModel(Move_License, this, 
 null))...
 the resource is requested in my IStringResourceLoader.loadStringResource() by 
 the specified
 names (Merge_Customers and Move_License).  This is exactly what I 
 expected and is working
 great.

 However, in another area where I specify the resource in the onValidate() 
 method of a
 StringValidtor, like this:
     error(stringIValidatable, CustomerNameNotFound);
 IStringResourceLoader.loadStringResource() is called with
  name=target_customer_name.CustomerNameNotFound
 instead of
  name=CustomerNameNotFound
 (where target_customer_name is the name of the field).


 Is this the intended behavior?

 If yes, how do I know when Wicket will be adding something to the resource 
 key I specify
 and when it will not?  We want to specify a resource key in source or markup 
 and have the
 resource requested using that exact key.

 TIA!
 Chris



 --
  -
 Chris Merrill                           |  Web Performance, Inc.
 ch...@webperformance.com                |  http://webperformance.com
 919-433-1762                            |  919-845-7601

 Web Performance: Website Load Testing Software  Services
  -

 -
 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: AccordionPanel works on web page but not in another panel

2010-08-23 Thread nino martinez wael
did you take a look at these:

https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicket-1.3.x/wicket-contrib-accordion-examples/

?

2010/8/21 cole cmilli...@comcast.net


 Example of valid markup (component on a page):

wicket:panel
dl class=accordion-menu


wicket:panel
dt class=a-m-t
 wicket:id=titleMenuItem1/dt
dd class=a-m-d
div class=bd
 wicket:id=content


  wicket:panel

Give it some content!


  /wicket:panel

/div
/dd
/wicket:panel




wicket:panel
dt class=a-m-t
 wicket:id=titleMenuItem2/dt
dd class=a-m-d
div class=bd
 wicket:id=content


  wicket:panel

Give it some content!

  /wicket:panel

/div
/dd
/wicket:panel


/dl
wicket:child/
/wicket:panel



 Example of invalid (component within another panel)
 dl class=accordion-menu


dt class=a-m-tMenuItem1/dt
dd class=a-m-d
div class=bd

Give it some
 content!

/div
/dd




dt class=a-m-tMenuItem2/dt
dd class=a-m-d
div class=bd

Give it some
 content!


/div
/dd


/dl

 as you can see I'm missing some key elements that are required to make the
 markup complete. I'm missing something simple, I'm just not competent
 enough
 to find it.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AccordionPanel-works-on-web-page-but-not-in-another-panel-tp2333034p2333185.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: implementing a custom resource loader

2010-08-23 Thread Chris Merrill
On 8/23/2010 11:21 AM, Igor Vaynberg wrote:
 show us your validator


TextFieldString target_name_field = new 
TextFieldString(target_customer_name, _target_name);
target_name_field.setRequired(true);
target_name_field.add(new StringValidator()
{
@Override
protected void onValidate(IValidatableString stringIValidatable)
{
Customer customer = _manager.getCustomer(stringIValidatable.getValue());
if (customer == null)
error(stringIValidatable, CustomerNameNotFound);
}
});
form.add(target_name_field);



-- 
 -
Chris Merrill   |  Web Performance, Inc.
ch...@webperformance.com|  http://webperformance.com
919-433-1762|  919-845-7601

Web Performance: Website Load Testing Software  Services
 -

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



Re: implementing a custom resource loader

2010-08-23 Thread Igor Vaynberg
and the CustomerNameNotFound is never tried? it should be tried after
the formid.CustomerNameNotFound key

-igor

On Mon, Aug 23, 2010 at 9:47 AM, Chris Merrill ch...@webperformance.com wrote:
 On 8/23/2010 11:21 AM, Igor Vaynberg wrote:
 show us your validator


 TextFieldString target_name_field = new 
 TextFieldString(target_customer_name, _target_name);
 target_name_field.setRequired(true);
 target_name_field.add(new StringValidator()
    {
   �...@override
    protected void onValidate(IValidatableString stringIValidatable)
        {
        Customer customer = 
 _manager.getCustomer(stringIValidatable.getValue());
        if (customer == null)
            error(stringIValidatable, CustomerNameNotFound);
        }
    });
 form.add(target_name_field);



 --
  -
 Chris Merrill                           |  Web Performance, Inc.
 ch...@webperformance.com                |  http://webperformance.com
 919-433-1762                            |  919-845-7601

 Web Performance: Website Load Testing Software  Services
  -

 -
 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: implementing a custom resource loader

2010-08-23 Thread Chris Merrill
On 8/23/2010 12:59 PM, Igor Vaynberg wrote:
 and the CustomerNameNotFound is never tried? it should be tried after
 the formid.CustomerNameNotFound key

Yes, it does!

I violated one of the rules of IResourceLoader - I didn't return null if
something was not found.  I wrapped our existing framework, which returns a
version of the key, such as ##string-key##, and logs the missing key.

Once I changed my code to check the existence of the key and return null, it
eventually did ask by expected key name.


Two of the reasons our framework always returns something useful is to (1)
prevent catastrophic NPEs and (2) get a list of missing resources in our
diagnostic logs.  It looks like Wicket already handles missing resources
by providing the last key it tried, so I don't think #1 is needed in
the context of our new app.  But #2 would still be nice.

I'm currently adding our resource loader in app.init():
  getResourceSettings().addStringResourceLoader(0, new MyResourceLoader());
under the assumption that I want my resource loader to be first in the
chain.

If I want to get missing resources in a log file, would I instead do something
like this:
  getResourceSettings().addStringResourceLoader(0, new MyResourceLoader());
  getResourceSettings().addStringResourceLoader(new MyLoggingResourceLoader());
with the intention of putting a last resort resource loader at the end
of the chain to log anything that could not be found?

TIA!
Chris



 -igor
 
 On Mon, Aug 23, 2010 at 9:47 AM, Chris Merrill ch...@webperformance.com 
 wrote:
 On 8/23/2010 11:21 AM, Igor Vaynberg wrote:
 show us your validator


 TextFieldString target_name_field = new 
 TextFieldString(target_customer_name, _target_name);
 target_name_field.setRequired(true);
 target_name_field.add(new StringValidator()
{
@Override
protected void onValidate(IValidatableString stringIValidatable)
{
Customer customer = 
 _manager.getCustomer(stringIValidatable.getValue());
if (customer == null)
error(stringIValidatable, CustomerNameNotFound);
}
});
 form.add(target_name_field);



 --
  -
 Chris Merrill   |  Web Performance, Inc.
 ch...@webperformance.com|  http://webperformance.com
 919-433-1762|  919-845-7601

 Web Performance: Website Load Testing Software  Services
  -

 -
 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
 
 


-- 
 -
Chris Merrill   |  Web Performance, Inc.
ch...@webperformance.com|  http://webperformance.com
919-433-1762|  919-845-7601

Web Performance: Website Load Testing Software  Services
 -

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



Re: implementing a custom resource loader

2010-08-23 Thread Igor Vaynberg
wicket will already handle the logging and missing resources, see
iresourcesettings#setThrowExceptionOnMissingResource(false)

-igor

On Mon, Aug 23, 2010 at 10:28 AM, Chris Merrill
ch...@webperformance.com wrote:
 On 8/23/2010 12:59 PM, Igor Vaynberg wrote:
 and the CustomerNameNotFound is never tried? it should be tried after
 the formid.CustomerNameNotFound key

 Yes, it does!

 I violated one of the rules of IResourceLoader - I didn't return null if
 something was not found.  I wrapped our existing framework, which returns a
 version of the key, such as ##string-key##, and logs the missing key.

 Once I changed my code to check the existence of the key and return null, it
 eventually did ask by expected key name.


 Two of the reasons our framework always returns something useful is to (1)
 prevent catastrophic NPEs and (2) get a list of missing resources in our
 diagnostic logs.  It looks like Wicket already handles missing resources
 by providing the last key it tried, so I don't think #1 is needed in
 the context of our new app.  But #2 would still be nice.

 I'm currently adding our resource loader in app.init():
  getResourceSettings().addStringResourceLoader(0, new MyResourceLoader());
 under the assumption that I want my resource loader to be first in the
 chain.

 If I want to get missing resources in a log file, would I instead do something
 like this:
  getResourceSettings().addStringResourceLoader(0, new MyResourceLoader());
  getResourceSettings().addStringResourceLoader(new MyLoggingResourceLoader());
 with the intention of putting a last resort resource loader at the end
 of the chain to log anything that could not be found?

 TIA!
 Chris



 -igor

 On Mon, Aug 23, 2010 at 9:47 AM, Chris Merrill ch...@webperformance.com 
 wrote:
 On 8/23/2010 11:21 AM, Igor Vaynberg wrote:
 show us your validator


 TextFieldString target_name_field = new 
 TextFieldString(target_customer_name, _target_name);
 target_name_field.setRequired(true);
 target_name_field.add(new StringValidator()
    {
   �...@override
    protected void onValidate(IValidatableString stringIValidatable)
        {
        Customer customer = 
 _manager.getCustomer(stringIValidatable.getValue());
        if (customer == null)
            error(stringIValidatable, CustomerNameNotFound);
        }
    });
 form.add(target_name_field);



 --
  -
 Chris Merrill                           |  Web Performance, Inc.
 ch...@webperformance.com                |  http://webperformance.com
 919-433-1762                            |  919-845-7601

 Web Performance: Website Load Testing Software  Services
  -

 -
 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




 --
  -
 Chris Merrill                           |  Web Performance, Inc.
 ch...@webperformance.com                |  http://webperformance.com
 919-433-1762                            |  919-845-7601

 Web Performance: Website Load Testing Software  Services
  -

 -
 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



WicketStuff Push Changes.

2010-08-23 Thread Rodolfo Hansen
There are a couple of significant changes in the wicketstuff-push found
at:

https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-core/jdk-1.6-parent/push-parent

It is more tightly integrated to Wicket and the new javascript comet
code. 
It no longer depends on any external javascript library.
It requires the new servlet 3.0 standard.
It supports the HTML5 WebSocket class. 

Thanks to Martin Grigorov for his work on alot of these points!

There has been extremely little testing done on this new code base, it
is far from production ready; 
but it would be very nice to get feedback and bug reports on the new
changes... 

thanks, 


Re: URL pattern /app/* does not work for Wicket 1.4.6 and WebSphere 6.1

2010-08-23 Thread shetc

I have had to deal with the infamous
WebSphere-servlet-filter-implementation-sucks problem before.
As discussed, this requires that the WicketServlet be used instead of the
WicketFilter. Ok, no sweat
since WicketServlet calls the WicketFilter methods anyway. However, I have a
time-critical deliverable
so I'll have to live with it. Once that is completed, I plan to open a PMR
with IBM about this issue.

I really appreciate your help, guys!
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/URL-pattern-app-does-not-work-for-Wicket-1-4-6-and-WebSphere-6-1-tp1891723p2335590.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: implementing a custom resource loader

2010-08-23 Thread Chris Merrill
On 8/23/2010 1:32 PM, Igor Vaynberg wrote:
 wicket will already handle the logging and missing resources, see
 iresourcesettings#setThrowExceptionOnMissingResource(false)

Beautiful!  That is just what I needed.  I should have guessed that Wicket
already had this covered.


Thanks!
Chris


p.s. have I mentioned how much I LOVE WICKET ??   :

-- 
 -
Chris Merrill   |  Web Performance, Inc.
ch...@webperformance.com|  http://webperformance.com
919-433-1762|  919-845-7601

Web Performance: Website Load Testing Software  Services
 -

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



[1.5] new wicket URL-related questions

2010-08-23 Thread Major Péter
Hi!

As I'm testing wicket 1.5-SNAPSHOT, I'm seeing some strange behaviors:
With 1.4 I've used to have url's like:
showuser/id/1234
now when I open simply the page without params, I will see the following
URL:
showuser?[0-9]+
When I looked at the JavaDoc of the new MountMapper (which is the
replacement for mountBookmarkablePage), I saw that I'm having this URL,
because my page is not stateless.
Q1: with 1.4 this was possible, because the URL contained the pagemap
instance number, or is there something else?
Q2: (a little n00b question) how can I find out which component makes my
page stateful?

when I try to hit the URL now:
showuser/id/1234
then I'm going to have indexed parameters and not named parameter with
'id' name. Q3: Why is that?
if I have a page with URL in browser:
showuser?8id=123
and I rewrite the id to 124, then I'm going to still see the page for
123, which is really disturbing! Q4: is there a solution for this to
work? Or should I make my page stateless to be able to do this?? (How?)

Also how could I make Wicket to use by default the /id/1234 format
instead of ?3id=1234 for link creation??

Thanks for your help.

Best Regards,
Peter Major

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



Models not updating when submitting form with AjaxButton

2010-08-23 Thread Loren Cole
I can't seem to get my models to update when I submit a form using
AjaxButton.  Originally my code looked like this, and I though it should
just work, but when you click the submit link parentService is null and
bundles and elements are empty lists.:


class AddServices extends BasePage {

AbacusService parentService = new AbacusService();
ListServicePlan bundles = new ArrayList();
ListServicePlan elements = new ArrayList();

public AddServices(final ModalWindow window, final OrderModel order) {

add(new Label(id, new Model(order.getId(;
Form form = new Form(form);
add(form);
final FeedbackPanel feedback = new FeedbackPanel(feedback);
feedback.setOutputMarkupId(true);
form.add(feedback);

form.add(new DropDownChoice(parent, new PropertyModel(this,
parentService),
Application.orderDao.getPossibleParents(order.getId()),
new ChoiceRenderer(fullName)));
form.add(new ListMultipleChoice(bundles, new PropertyModel(this,
bundles),
Application.orderDao.getBundleTemplates(),
new ChoiceRenderer(serviceTypeAndName)));
form.add(new ListMultipleChoice(elements, new PropertyModel(this,
elements),
Application.orderDao.getBundleTemplates(),
new ChoiceRenderer(serviceTypeAndName)));

AjaxButton submit = new AjaxButton(submit, form) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
info(submitting form);
info(parent = + parentService.toString());
info(elements =  + elements.toString());
info(bundles =  + bundles.toString());
//Application.orderDao.addServices(elements, order.getId(),
parent, null);
//window.close(target);
}
@Override
protected void onError(AjaxRequestTarget target, Form form) {
error(Grrr Arrg);
target.addComponent(feedback);
}
};
form.add(submit);
}
}


So, I thought maybe I was expecting too much of AjaxButton and manually
updated these variables in an AjaxFormComponentUpdatingBehavior like so:

ListMultipleChoice bundleChoice = new ListMultipleChoice(bundles,
new Model(),
Application.orderDao.getBundleTemplates(),
new ChoiceRenderer(serviceTypeAndName));
bundleChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
info(model: +
this.getComponent().getModelObject().toString());
bundles = (ListServicePlan)
this.getComponent().getModelObject();
target.addComponent(feedback);
}
});
form.add(bundleChoice);

Now when I select things off the components the feedback panel updates with
the things I've selected, but when it gets to the submit method I still have
empty lists and a null, and I am seriously confused as to why.  Everything
works properly if I forgo submitting via Ajax and just override the form's
onSubmit(), but I'd like to shove this page into a modal window and so need
the ajax bit to close the window..

What am I missing?


Using AjaxCheckBox

2010-08-23 Thread Anna Simbirtsev
Hi,

I am trying to use AjaxCheckBox to update another checkbox model object when
this checkbox is clicked.

CheckBox b = new CheckBox(basicCreate,
new ModelBoolean());

AjaxCheckBox a = new AjaxCheckBox(create,
new ModelBoolean()) {

private static final long serialVersionUID =
288634742710645609L;

protected void onUpdate(AjaxRequestTarget target)
{
if (getModelObject()) {
b.setModelObject(true);
b.setOutputMarkupId(true);

target.addComponent(b);
}
}
};

So when checkbox a is checked, I want checkbox b to be checked as well.
But nothing happens. Am I doing something wrong?

Thanks,
Anna


Re: Using AjaxCheckBox

2010-08-23 Thread Sven Meier

Hi,

calling b.setOutputMarkupId(true) during Ajax request is too late. The 
HTML tag will not have a markup id, so nothing will be updated.


Call this method immediately after constructing the checkbox.

Regards

Sven


On 08/23/2010 09:18 PM, Anna Simbirtsev wrote:

Hi,

I am trying to use AjaxCheckBox to update another checkbox model object when
this checkbox is clicked.

CheckBox b = new CheckBox(basicCreate,
 new ModelBoolean());

AjaxCheckBox a = new AjaxCheckBox(create,
 new ModelBoolean()) {

 private static final long serialVersionUID =
288634742710645609L;

 protected void onUpdate(AjaxRequestTarget target)
 {
 if (getModelObject()) {
 b.setModelObject(true);
 b.setOutputMarkupId(true);

 target.addComponent(b);
 }
 }
 };

So when checkbox a is checked, I want checkbox b to be checked as well.
But nothing happens. Am I doing something wrong?

Thanks,
Anna

   



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



Re: Using AjaxCheckBox

2010-08-23 Thread Anna Simbirtsev
Thanks, this fixed a problem. But I thought, it would give me an error
message, if I am trying to update a component that does not have
setOutputMarkupId(true) ?

On Mon, Aug 23, 2010 at 3:26 PM, Sven Meier s...@meiers.net wrote:

 Hi,

 calling b.setOutputMarkupId(true) during Ajax request is too late. The HTML
 tag will not have a markup id, so nothing will be updated.

 Call this method immediately after constructing the checkbox.

 Regards

 Sven



 On 08/23/2010 09:18 PM, Anna Simbirtsev wrote:

 Hi,

 I am trying to use AjaxCheckBox to update another checkbox model object
 when
 this checkbox is clicked.

 CheckBox b = new CheckBox(basicCreate,
 new ModelBoolean());

 AjaxCheckBox a = new AjaxCheckBox(create,
 new ModelBoolean()) {

 private static final long serialVersionUID =
 288634742710645609L;

 protected void onUpdate(AjaxRequestTarget target)
 {
 if (getModelObject()) {
 b.setModelObject(true);
 b.setOutputMarkupId(true);

 target.addComponent(b);
 }
 }
 };

 So when checkbox a is checked, I want checkbox b to be checked as well.
 But nothing happens. Am I doing something wrong?

 Thanks,
 Anna





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




-- 
Anna Simbirtsev
(416) 729-7331


Re: Using AjaxCheckBox

2010-08-23 Thread Sven Meier

Yes, you did call it before #addComponent():

b.setOutputMarkupId(true);
target.addComponent(b);

But Wicket doesn't keep track of *when* you called the method, i.e. 
before or after the Ajax request.

IIRC there should be an error message in the Ajax debug window.

Regards

Sven


On 08/23/2010 09:30 PM, Anna Simbirtsev wrote:

Thanks, this fixed a problem. But I thought, it would give me an error
message, if I am trying to update a component that does not have
setOutputMarkupId(true) ?

On Mon, Aug 23, 2010 at 3:26 PM, Sven Meiers...@meiers.net  wrote:

   

Hi,

calling b.setOutputMarkupId(true) during Ajax request is too late. The HTML
tag will not have a markup id, so nothing will be updated.

Call this method immediately after constructing the checkbox.

Regards

Sven



On 08/23/2010 09:18 PM, Anna Simbirtsev wrote:

 

Hi,

I am trying to use AjaxCheckBox to update another checkbox model object
when
this checkbox is clicked.

CheckBox b = new CheckBox(basicCreate,
 new ModelBoolean());

AjaxCheckBox a = new AjaxCheckBox(create,
 new ModelBoolean()) {

 private static final long serialVersionUID =
288634742710645609L;

 protected void onUpdate(AjaxRequestTarget target)
 {
 if (getModelObject()) {
 b.setModelObject(true);
 b.setOutputMarkupId(true);

 target.addComponent(b);
 }
 }
 };

So when checkbox a is checked, I want checkbox b to be checked as well.
But nothing happens. Am I doing something wrong?

Thanks,
Anna



   


-
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



Up on selection of one DropDownChoice value one more DropDownChoice box should display

2010-08-23 Thread arunarapole

Hi

I have a requirement that i need to display one Dropdownchoice  on to the
form upon selection of one more dropdownchoice value 

Say example under manager dropdownchoice if i select IT manager  it has to
display one more dropdownchoice on form, and if i select Account Manager it
should not display any component on form

If any one has idea please share with me 
below is sample code 

please please share some idea 

Form form=new Form()
DropDwonchoice a=new DropDownChoice(,value,new IChoiceRender)
{
}
DropDwonchoice b=new DropDownChoice(,value,new IChoiceRender)
{
}


a.add(new AjaxFormComponentUpdatingBehavior(onchange)
{

/**
 * 
 */
private static final long serialVersionUID = 1L;

@Override
protected void onUpdate(AjaxRequestTarget target) {
// TODO Auto-generated method stub

if(a.getModelObject().equals(Manager))
{


here i have to display the b dropdownchoice componet  on form
}

else
{
 nothing shoundn't be displayed 


}

Thanks
Aruna


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Up-on-selection-of-one-DropDownChoice-value-one-more-DropDownChoice-box-should-display-tp2335747p2335747.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



[JOB POST] Senior User Interface Developer - Folsom, CA, USA

2010-08-23 Thread Michael Hosier
Forgive me if this is inappropriate but I have seen other job postings here
so assume this is acceptable on this list.

My company is looking for a Senior User Interface Developer.  Our products
heavily use Wicket and we are looking to expand our web application
offerings while creating a better user experience on the client side.

More information can be found in the job posting:
http://careers.joelonsoftware.com/Jobs/8150?campaign=List

Pay is very good for an experienced candidate.  If interested, please apply
through the job posting.  My company is a telecommunications software
provider that serves many large telecom companies including very large
customers in the fortune 100.

Once again, I hope this post is acceptable on this mail list and I apologize
if this is frowned upon.

Thanks,
Michael


Re: Up on selection of one DropDownChoice value one more DropDownChoice box should display

2010-08-23 Thread James Carman
Try fragments.  Or use a different panel for the different selections.

On Mon, Aug 23, 2010 at 4:07 PM, arunarapole arunakumm...@gmail.com wrote:

 Hi

 I have a requirement that i need to display one Dropdownchoice  on to the
 form upon selection of one more dropdownchoice value

 Say example under manager dropdownchoice if i select IT manager  it has to
 display one more dropdownchoice on form, and if i select Account Manager it
 should not display any component on form

 If any one has idea please share with me
 below is sample code

 please please share some idea

 Form form=new Form()
 DropDwonchoice a=new DropDownChoice(,value,new IChoiceRender)
 {
 }
 DropDwonchoice b=new DropDownChoice(,value,new IChoiceRender)
 {
 }


 a.add(new AjaxFormComponentUpdatingBehavior(onchange)
 {

        /**
         *
         */
        private static final long serialVersionUID = 1L;

       �...@override
        protected void onUpdate(AjaxRequestTarget target) {
                // TODO Auto-generated method stub

        if(a.getModelObject().equals(Manager))
        {


                here i have to display the b dropdownchoice componet  on form
        }

        else
        {
             nothing shoundn't be displayed


        }

 Thanks
 Aruna


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Up-on-selection-of-one-DropDownChoice-value-one-more-DropDownChoice-box-should-display-tp2335747p2335747.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: Problem to replace panel

2010-08-23 Thread Igor Vaynberg
your example is too complicated, create a simple quickstart using the
wicket archetype and only add the necessary bits to replicate the
problem

-igor

On Sun, Aug 22, 2010 at 8:03 AM, zoran jeremy...@gmail.com wrote:

 Hi Martin,

 I finally made a some kind of quickstart. I removed all unnecessary code
 from the application, and at the same time the problem is still there.
 The code is available at
 http://zoranjeremic.org/files/intelleo-mavenized.rar.
 It is maven application. Main class that starts everything is
 org.intelleo.app.Run. After application start you should call
 http://localhost:8080/intelleo/index.html and click the first button in
 dockbar.
 There are two panels on the page. Update panels link should update both of
 them, but only one is updated.

 The Wicket page that contains this panels is PreviewGoals.

 I hope this will works for you.

 Zoran
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Problem-to-replace-panel-tp2333462p2334184.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



How to show error msg from ResourLink and abort processing?

2010-08-23 Thread joinow

I am using wicket for our portlets now. I use a ResourceLink for downloading
CSV file. I used the code as shown below. But some exception may be thrown
from the method getCsvData(). How can I catch the exception and display some
error message by FeedbackPanel? 

 final WebResource csvsrc = new WebResource() { 

/** 
 * 
 */ 
private static final long serialVersionUID = 1L; 

@Override 
public IResourceStream getResourceStream() { 
// TODO Auto-generated method stub 
IStringResourceStream srs = null; 
if (true) { 
CharSequence cs = getCsvData(); 
srs = new StringResourceStream(cs, 
text/csv); 
   
srs.setCharset(Charset.forName(UTF-8)); 
} else { 

} 
return srs; 
} 

}; 

ResourceLink rlink = new ResourceLink(myresource, csvsrc)
{ 
@Override 
public void onClick() { 

} 
}; 
this.add(rlink); 

I tried to rewrite the onResourceRequest() method of ResourceLink, but 
1) the code error(blablabla); does not take effect. 
2) when I remove resource.onResourceRequested(); from the if branch,
server interal exception will appear on the web page.(JBoss Portal said the
response is empty which it is not implemented for.) Here is my changed code
to onResourceRequested(): 

 /** 
 * @see org.apache.wicket.IResourceListener#onResourceRequested() 
 */ 
public final void onResourceRequested() 
{ 

Random random = new Random(); 
if (random.nextBoolean()) { 

this.error(blablabla); 

} else { 
resource.onResourceRequested(); 
} 
onClick(); 
} 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-show-error-msg-from-ResourLink-and-abort-processing-tp2335870p2335870.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: wicket-extensions alive?

2010-08-23 Thread gnugrf

Thank you JT, the day I was working on this when I checked the maven
repository, the first search result returns the older versions of
wicket-extensions based off the groupid = wicket. It was my mistake, I
didn't realize at the time there was a newer branch based off groupid =
org.apache.wicket, but your response forced me to do a sanity-check and go
back to the maven repo. Thank You.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-extensions-alive-tp2324725p2335894.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: [1.5] new wicket URL-related questions

2010-08-23 Thread bht
Hi,

A2:

http://blog.armstrongconsulting.com/?p=14

A4:

I will look at this in 1.5 myself at some stage as well, so please
keep in touch. Meanwhile, have you seen

http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html

I have a special use case for this where I don't want to create
browser history entries of different versions of a stateful page (back
button problem solution).


Regards,

Bernard



On Mon, 23 Aug 2010 20:53:26 +0200, you wrote:

Hi!

As I'm testing wicket 1.5-SNAPSHOT, I'm seeing some strange behaviors:
With 1.4 I've used to have url's like:
showuser/id/1234
now when I open simply the page without params, I will see the following
URL:
showuser?[0-9]+
When I looked at the JavaDoc of the new MountMapper (which is the
replacement for mountBookmarkablePage), I saw that I'm having this URL,
because my page is not stateless.
Q1: with 1.4 this was possible, because the URL contained the pagemap
instance number, or is there something else?
Q2: (a little n00b question) how can I find out which component makes my
page stateful?

when I try to hit the URL now:
showuser/id/1234
then I'm going to have indexed parameters and not named parameter with
'id' name. Q3: Why is that?
if I have a page with URL in browser:
showuser?8id=123
and I rewrite the id to 124, then I'm going to still see the page for
123, which is really disturbing! Q4: is there a solution for this to
work? Or should I make my page stateless to be able to do this?? (How?)

Also how could I make Wicket to use by default the /id/1234 format
instead of ?3id=1234 for link creation??

Thanks for your help.

Best Regards,
Peter Major

-
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: How to show error msg from ResourLink and abort processing?

2010-08-23 Thread joinow

If I remove resource.onResourceRequest(), Jboss said
javax.servlet.ServletException: org.jboss.portal.common.NotYetImplemented:
Feature: handling of empty ContentResponse is not yet implemented
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-show-error-msg-from-ResourLink-and-abort-processing-tp2335870p2335984.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: [1.5] new wicket URL-related questions

2010-08-23 Thread Matej Knopp
Hi,

see the replies below

2010/8/23 Major Péter majorpe...@sch.bme.hu:
 Hi!

 As I'm testing wicket 1.5-SNAPSHOT, I'm seeing some strange behaviors:
 With 1.4 I've used to have url's like:
 showuser/id/1234
 now when I open simply the page without params, I will see the following
 URL:
 showuser?[0-9]+

The number after ? is page id. Since wicket is a stateful framework
(by default) we need to track page instances.

 When I looked at the JavaDoc of the new MountMapper (which is the
 replacement for mountBookmarkablePage), I saw that I'm having this URL,
 because my page is not stateless.

In a way, yes. Stateless pages generally do not have page ids in URL.

 Q1: with 1.4 this was possible, because the URL contained the pagemap
 instance number, or is there something else?
 Q2: (a little n00b question) how can I find out which component makes my
 page stateful?

Usually it is a component that returns false in isStateless or
generates a stateful listener interface URL.


 when I try to hit the URL now:
 showuser/id/1234
 then I'm going to have indexed parameters and not named parameter with
 'id' name. Q3: Why is that?

Because it's not a named paramerer (by default). The URL in question
will have two indexed parameters. id and 1234.
Big problem in 1.4 was that there was no distinction between indexed
parameters (part of path) and named parameters (usually part query
string). So it was difficult to build URLs such as
showpage/13?sort=asc

1.5 fixes this by defining URL scheme like this:

/page/mount/path/indexed-param0/indexed-param1?named1=value1name2=value2

Btw. you should be able to mount the url in question as
showuser/id/{user-id}

wicket should then make user-id a named parameter.

 if I have a page with URL in browser:
 showuser?8id=123
 and I rewrite the id to 124, then I'm going to still see the page for
 123, which is really disturbing! Q4: is there a solution for this to
 work? Or should I make my page stateless to be able to do this?? (How?)

It is still the same page instance. Obviously in your case you take
the page parameters into account only in page constructor. So when you
later change the id value (but leave page id the same) nothing
changes.

However if  you for example override page onBeforeRender() and call
getPageParameters() there the id parameter will have proper value.


 Also how could I make Wicket to use by default the /id/1234 format
 instead of ?3id=1234 for link creation??

You can either set id and 1234 as indexed parameters or mount the page
as /showuser/id/{user-id}

-Matej


 Thanks for your help.

 Best Regards,
 Peter Major

 -
 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