Re: Field level Authorization strategy suggestions?

2008-07-21 Thread Gabor Szokoli
Hi,

On Sat, Jul 19, 2008 at 12:13 AM, David Nedrow <[EMAIL PROTECTED]> wrote:
> I'd like to automatically expose additional functionality or field
> visibility depending on the authorization level of the user (session). For
> example, editable fields for "admin" users.
> [...]
> Has anyone done something similar or is there an example somewhere that I'm
> overlooking?

We have an application with similar features. We had to disable and
skip components instead of columns, but the principle might be
relevant:

We created custom components for all form field types we use
(textfield, dropdown, radiochioce, etc.)
The component consists of an "editable" and a "read-only" variant of
the underlying control, but only one or the other is visible depending
on the "enabled" flag of the composite component. (unauthorised users
wouldn't be much interested in what they can not set a radiochoice
field to for example. Disabled textfields are hard to copy-paste
from.)
The "visible" flag is obeyed too. (the markup is a bit nasty because
of this: the form is a table, and the components are table rows so
they can be omitted without visual glitches. Shouldn't be a problem
with table rows.)

We also added convenience constructors to the components, passing the
"enabled" and "visible" flags, matching with convenience service
methods on the logged in user meeting authorisation criteria.

Here we are implicitly relying on wicket being "safe" in the sense
that no client side forgery can result in the activation of a missing
or disabled component. (all operations are double-checked in the
service layer nonetheless.)

We didn't use wicket-auth-roles because the categories were too simple
at first (but then project scope drift started...)

You'll have to substitute table columns for components, it already has
isVisible, and you can just add isEnabled.


Hope it helps!

Gabor Szokoli

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



Re: why are we coding Web apps?

2008-07-16 Thread Gabor Szokoli
On Wed, Jul 16, 2008 at 8:00 PM, Michael Allan <[EMAIL PROTECTED]> wrote:
>  1. The user can seamlessly click into the application from external
> sites, and click back out again.
>
>  1 a. A Web client is good for demonstrating a new application,
>   because it's convenient for casual users, who wish to try out
>   the app.  Most users have Web browsers pre-installed.  They may
>   not have Java, etc.

Good enough for me :-)

Gabor Szokoli

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



Re: Running a huge wicket site(1m + users)

2008-07-16 Thread Gabor Szokoli
Hi,

Everybody think happy thoughts, flowers, waterfalls, idle servers :-)

On Wed, Jul 16, 2008 at 11:34 AM, Martijn Dashorst
<[EMAIL PROTECTED]> wrote:
> On Wed, Jul 16, 2008 at 10:33 AM, Daan van Etten <[EMAIL PROTECTED]> wrote:
>> In my opinion it depends on your use case, but in high-load environments I'd
>> suggest to keep the state at the client.
>
> As long as you have 1 page that uses the server as an RPC service,
> this works.

Yes, and that's a (non-)web programming model some of us are
considering currently.
I would summarise the principle as "RESTful service, stateful GUI",
the former being 100% server-side, the later being 100% browser-side.
I said non-web model because it uses the browser not as a web browser
but as a platform to download and execute the stateful client. Some of
that state might be made bookmarkable with some tricks, but that's
probably just a way to pass initial parameters to the client, ignored
by the (static) server.

At the risk of getting increasingly off topic, I'd like to continue
this discussion for the off chance of inspiring somebody to extend the
wicket AJAX functionality in this direction (of which I have very
little understanding currently).

I for example been looking to broaden our web GUI development skill
portfolio (currently wicket only :-) ) by experimenting with something
more "rapid". Sometimes I just don't need an elaborate,
server-controlled application, just some JS-heavy HTML kicking around
simple web services which already exist or I have to provide anyway.
I'm about to plunge into GWT, hoping to replace its built-in
server-side components, XML-RPC and serialization mechanism with
external JSON-encoded REST services if possible. (Same Origin Policy
is one obstacle, authentication is another...)

So assuming this works (and it does seem to work similarly in GMail
which I right now use to compose this message along with possibly
hundreds of thousands of others at the same time), can wicket be
extended with this principle? Wicket could work as it does now as
fallback and for the parts of the application that fit the wicket
model better, but have some of its AJAX callbacks "outsourced" to pure
data services. The fallback could call the same or a more direct
(trusted or an EJB even) service from the server side.

Oh well, just a thought.


Gabor Szokoli

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



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

2008-06-03 Thread Gabor Szokoli
On 6/3/08, Jan Kriesten <[EMAIL PROTECTED]> wrote:
>
>
> > If only we had type inference :-)
> > Is this any nicer in scala?
> >
>
>  in scala you wouldn't have to have the getModel/getModelObject within
> Component in the first place (you could use mixins for this purpose).

I was thinking about using the existing wicket 1.4 API from scala, if
that's any more comfortable.


Gabor Szokoli

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



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

2008-06-03 Thread Gabor Szokoli
Hi,

We haven't worked with 1.4 enough to form an opinion, but we'll
definitely upgrade to it for the next project.

On 6/3/08, Johan Compagner <[EMAIL PROTECTED]> wrote:
> If only... if only
>  we had this construct:
>
>  class Component

If only we had type inference :-)
Is this any nicer in scala?


Gabor Szokoli

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



Re: problem when reading properties file

2008-06-02 Thread Gabor Szokoli
On 6/2/08, wenm <[EMAIL PROTECTED]> wrote:
>  But my label only show the message when the web service returns error, not
>  constant showing. So it is not a good idea to use resourceModel.

I know I'm not answering your original question, but until someone
does, you could look at either the FeedbackPanel which you might be
reimplementing, or at overriding the isVisible function of the label
to make it show up conditionally.


Gabor Szokoli

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



Re: sortable column with overriden getCssClass

2008-06-02 Thread Gabor Szokoli
Ooops, I goofed, everything works fine, the second class= attribute is
on an inner element :-)
Can we have wicket tabulate the html output in developement mode please? :-)


  
[...]

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



sortable column with overriden getCssClass

2008-06-02 Thread Gabor Szokoli
Hi,

We use sortable AbstractColumn derivatives in our DataTable.
I added this recently to the column to add a custom CSS class to the
TD elements in this column (see IStyledColumn):

@Override getCssClass {return "colmn_class";}

Now my TH elements have an aggregate class list with the sortedness
class and mine as expected, and another class attribute with the
sortedness class only:



Now that can't be right, did I do something wrong or could this be a bug?


Gabor Szokoli

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



Re: Best Wicket Books or Tutorials

2008-03-31 Thread Gabor Szokoli
Hi,

On 3/31/08, Gareth Segree <[EMAIL PROTECTED]> wrote:
>
>  If Wicket then
>  I'm looking for good tutorials on wicket or books.

Make sure you understand Models before everything else,
and CompoundPropertyModel right after Hello World.

That's what I've learned from introducing wicket to my team.

We also had a good understanding of the basics before meddling with
Ajax. It probably would have confused us a lot otherwise.


Gabor Szokoli

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



Re: Clearing Form inputs

2008-03-28 Thread Gabor Szokoli
Hi,

On 3/28/08, freak182 <[EMAIL PROTECTED]> wrote:
>
>  Hi Igor,
>  Any code exampleim such a newbie on this...form.detachModels?
>  Thanks a lot...cheers...

I think he meant you should also clear the value from the model of the
component, for example like this:
stubbornTextField.setModelObject("");
Or if you have a CompundPropertyModel for the form instead of
individual models on the fileds, update that directly.

(I never used ajax to clear a form myself, so I'm just translating :-) )


Szocske

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



Re: [vote] Release 1.4 with only generics and stop support for 1.3

2008-03-18 Thread Gabor Szokoli
+1

On 3/17/08, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
>  Everybody is invited to vote! Please use
>
>  [ ] +1, Wicket 1.4 is 1.3 + generics, drop support for 1.3
>  [ ] -1, I need a supported version running on Java 1.4
>
>  Let your voices be heard!
>
>  Martijn
>
> --
>  Buy Wicket in Action: http://manning.com/dashorst
>  Apache Wicket 1.3.2 is released
>  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2
>
>  -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Planning Wicket Next Generation

2008-03-15 Thread Gabor Szokoli
Hi,

Your conclusion covers our case, but I'd debate your reasoning:

We use java 5, deploy to GlassFish.
No nostalgic attachments to pre-generics Java :-)
But we believe these (including wicket) to be established
technologies, and would hate to jump to significantly less mature
platforms (like java 7 :-) )


Gabor Szokoli

On 3/15/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I'd say people using wicket now who did not mind switching
>  from other framework  might not mind upgrading web server
>  to java5 (even 7:-), or deploy it on a new web server instead
>  of mixing them with the old app servers.

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



Re: ajax popup on traditional form

2008-03-04 Thread Gabor Szokoli
On 3/4/08, Gabor Szokoli <[EMAIL PROTECTED]> wrote:
>  In the ajax debug window, I can only see the modalwindow form
>  submission, and no further activity.

Woops, this part was wrong. The  component was sent in the
ajax response, but without the new choices added to the model by the
modalwindow from submission.

So we looked deeper, and we found the mistake we made:
It has nothind to do with ajax.
It was passing the model to the ListMultipleChoice:

new ListMultipleChoice(wicketId,
PropertyModel(parentsCompundPropertyModel, wicketId))
did the trick.
With other components, this is equivalent to the wicketId-only constructor.
Browsing the sources it seems to me that AbstractChoice breaks this convention:
If you supply a model, that's your "choices" model.
If you don't, your choices model is the empty list.

I understand the reason (the choices model is only the secondary
model), just wanted to point out the possible (and now actual) source
of misunderstanding.


Thanks for your help, sorry about the goosechase episode in the end.


Gabor Szokoli

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



Re: ajax popup on traditional form

2008-03-04 Thread Gabor Szokoli
On 3/3/08, Maurice Marrink <[EMAIL PROTECTED]> wrote:
> Just using ajax to update one form field should not wipe out all the
>  other form fields, unless you add the entire form to your ajaxtarget.
>  It is sufficient to only add the formcomponent you are updating to
>  your ajaxtarget that way anything the user typed in will be preserved.
>  Could you check if this is the case, and if not provide us with some
>  code?

You are right, adding the specific component to the ajaxtarget
prevents the unaffected fileds from being effected, thanks.

But now nothing gets updated :-)

The component added to the target is not a textfield as I remembered,
but a ListMultipleChoice, whose "choices" model got updated by the
form on the modalwindow.
(It's not even its own model, but its parents CompoundPropertyModel...)
In the ajax debug window, I can only see the modalwindow form
submission, and no further activity.

I tried to call modelChanged() on the ListMultipleChoice instance.

Should I be using a different widget if I don't care about selection,
just want to display a list?

Should I surround the  tag with a  and add that to the ajaxtarget?

We're preparing a code example, the actual code is a bit convolved.


Thanks!

Gabor Szokoli

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



ajax popup on traditional form

2008-03-03 Thread Gabor Szokoli
Hi there,

We have a regular form with an ajax modal window as popup helper for
populating one of the form fields, looks a bit like a datepicker.
Except the helper produces the form data in a non-trivial manner,
involving server roundtrip.

The field does get populated nicely, but all entries in all other
fields on the same form are lost.

What behavior should I put on what component to make form fields
silently persist their current, unsubmitted values to the server when
the modalwindow is opened?

Any pointers would be aprechiated.

And on top of that, some kind of general "roundtrip-less wicket for
the ajax illiterate" guide document would be nice. Something brief
enough as a javadoc to the wicket ajax package would suffice.

We love wicket because we got by with it fine without substantial html
knowledge.
Until we stumbled into ajax.
Now we suddenly have to catch up on html, javascript, DOM,
xmlhttprequest, etc just to figure out what's what.
And then in the end the solution never involves any of that, just
passing the right thingie hadler as the whotsit to the doohickey.

We still love it, just need some help :-)


Gabor Szokoli

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



Re: GET method parameters as List or Map?

2008-02-29 Thread Gabor Szokoli
On 2/29/08, Johan Compagner <[EMAIL PROTECTED]> wrote:
> What is your question exactly? What do you want todo in wicket?
>

Woops, wrong users list, sorry about the noise!
(should have been the jersey list...)


Gabor Szokoli

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



GET method parameters as List or Map?

2008-02-29 Thread Gabor Szokoli
Hi,

I have a GET method which takes a bunch of optional search parameters.
I then put these in a map, keyed by the .
A cool servlet framework we use (wicket) has a construct called
PageParameters. Is there anything similar in Jersey?


Gabor Szokoli

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



Re: CompoundModel based on proxies

2008-02-27 Thread Gabor Szokoli
On 2/26/08, Sebastiaan van Erk <[EMAIL PROTECTED]> wrote:

>  The proxy based approach solves exactly this problem.

Wow, fancy! :-)
Thanks for sharing it, we'll probably use it too.

The rest is by no means ment to discredit your effort, more like the
devils advocate grumbling in front of the TV about Java in general:

Isn't the JavaBean as key-value datastructure the real problem?
We were lucky to be able to use a Map at one place in our wicket code
for a "reflective" model object instead: CompoundPropertyModel
supports it uniformly.

Do people ever use non trivial getters and setters in their JavaBeans?
We don't. Type safety and JPA are nice though, so we use JavaBeans
everywhere else :-)

But I just can't help wondering how the complexity (and performance)
of current reflection/bytecode generation efforts would compare to
porting all the JavaBean based tools and utilities to some different
datastructure convention? One designed for programmatic manipulation.
Like a Map where the key contains the type of the value.
Some EnumMap-like optimisation could be employed when the keys are
known compile-time.

Would cover 90% of the cases people use reflection for currently I expect.

Just imagine, JAXB could be a utility class with 2 static methods:
encode and decode :-)


Gabor Szokoli

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



Re: loosely coupled panels: react to model object change

2008-02-05 Thread Gabor Szokoli
On 2/5/08, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> see https://issues.apache.org/jira/browse/WICKET-1312

Wow, pre-cognitive feature request fulfillment :-)

In the meantime, we managed to put the UI logic in question into a
non-conventional IModel.getObject() implementation. I can not foresee
a situation in our current application where we couldn't follow the
same pattern.

We keep underestimating wicket :-)


Gabor Szokoli

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



Re: nice URLs (was: Short Design Question)

2008-02-05 Thread Gabor Szokoli
On 2/5/08, Erik van Oosten <[EMAIL PROTECTED]> wrote:
> Hi Johan,
>
> Anyways, the fact remains that nice URLs can be important for some
> Wicket projects, despite what average Joes may look at.

A big "me too" to that!

We have a specific (and I beleive wise) requirement for bookmarkable,
human readable URLs representing the user interaction state. REST if
you will :-)

We are just now looking into a full AJAX redesign of the application
(not all our requirements are wise :-) ), reading up on the required
trickery like this:
http://ajaxpatterns.org/Unique_URLs


Gabor Szokoli

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



loosely coupled panels: react to model object change

2008-02-05 Thread Gabor Szokoli
Hi!

We are trying to build our application from loosely coupled panels,
sharing models here and there as needed.
It works wounderfully 90% of the time: as long as the panels contain
wicket components only, and no further UI logic. One panel can update
a model, and the data is reflected in the components of the other
panel, as it should.

But sometimes one panel needs to perform an action when its model
object is changed from an onClick handler on another panel.
OnModelChanged is not called, because the other panel has no direct
reference to this panel to perform a setObject on it, they only share
a model, and do setObject on that.

Where do I put my OnModelObjectChanged event handling code without
sacrificing too much from my lovely loosely coupling?

Any advice is warmly welcome.


Gabor Szokoli

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



Re: PageParameter backed models?

2007-12-21 Thread Gabor Szokoli
On Dec 21, 2007 2:03 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:
>  Look at HybridUrlCodingStrategy and mount the pages with that.

Found that one, thank you!
We'll look at it in detail.

>
> I guess you want them on the url so that the user can bookmark it right?

Exactly.

(You can look at my original-original message multi-quoted on the
bottom of my first mail from today...)


Gabor Szokoli

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



Re: PageParameter backed models?

2007-12-21 Thread Gabor Szokoli
On Dec 21, 2007 1:09 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:
> maybe you could do setResponsePage(new MyPage())
> and use HyrbidUrlEncoding for a nice redirect url..

I am unable to find any reference to HyrbidUrlEncoding, could you help
me out a notch more with a pointer?
Also, we use the class-based setResponsePage variant because we need
to set a few page parameters to store some of the state in the URL.


Thanks!

Gabor Szokoli

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



Re: PageParameter backed models?

2007-12-21 Thread Gabor Szokoli
Hi,

We have been happy with the below suggestion for keeping our search
criteria in the URL:

 onsubmit() {
   setresponsepage(searchpage.class, crit.topageparameterrs());
   };

Now we are beginning to experience the downsides: non-parameter backed
models on the page (how many rows to display per page for example) get
lost in this cycle.

Could you guys suggest some in-between approach, where part of the
state is stored in the URL, but the rest is kept in the components
(models)?


Thanks:

Gabor Szokoli


On Nov 28, 2007 9:46 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> why not just
>
>
> class searchpage extends webpage {
>   private PageParameters params;
>
>   private criteria crit=new criteria();
>
>   public searchpage(pageparameters params) {
> this.params=params;
>
>   add(new dataview("results", new dataprovider()) {... });
>
>   form form=new form("form", new compoundproperty(new
> propertymodel(this, "crit"))) {
>onsubmit() {
>   setresponsepage(searchpage.class, crit.topageparameterrs());
>   };
>   add(form);
>form.add(new textfield("name")); 
>
>
>   }
>
>
>
>   private class dataprovider implements idataprovider {
> public iterator iterator(...) {
>return dao.search(params);
>} public int size() { return dao.size(params); }
>   }
>
>
> done
>
> -igor
>
>
>
> On Nov 28, 2007 12:34 PM, Gabor Szokoli <[EMAIL PROTECTED]> wrote:
> > Hi there,
> >
> > I'd like to have a search form, which keeps the last submitted search
> > parameters in PageParameters in a bookmarkable fashion.
> > I am wondering about the "wicket way" of doing this, and I keep coming
> > back to an imaginary LoadableDetachableModel variant which would store
> > a unique key, and load/store its object value from/to the
> > PageParameters.
> > I'd appreciate some advice: What would be the nicest way to get hold
> > of the pageparameters in the current request from a model, and to set
> > one in the next response?
> > Or Is there some better way to achieve bookmarkable (partial) form state?
> >
> >
> > Thanks in advance:
> >
> > Gabor Szokoli
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: How to flush the markup stream in getMarkupResourceStream() method

2007-12-19 Thread Gabor Szokoli
Me Too!

Well, not exactly, but similar issue:

We read markup files from the file systems, and consider implementing
a JMX trigger for reloading them, but what should the triggered method
actually do?

(In the mean time I realised the solution to my problem is probably
different from vekys, but I assume mine resembles "flush" more, so
dibs on his subject line! :-) )


Gabor Szokoli

On Dec 19, 2007 9:26 PM, venky221 <[EMAIL PROTECTED]> wrote:
>
> If I restart my tomcat between the two requests, it works fine but I can not
> flush the markup content that I was getting from getMarkupResourceStream()
> method if I am making the two requests without restarting my server.

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



Re: "Streaming" a huge ZIP file

2007-12-17 Thread Gabor Szokoli
Hi,

This looks completely straight-forward, we'll switch to it as soon as
move to rc3.

On Dec 16, 2007 8:33 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:

> RequestCycle.get().setRequestTarget(new ResourceStreamRequestTarget(writer,"
> test.zip"));

Maybe this is dumb, but if I encounter an exception in the write
method (during content generation), can I "unsnatch" the stream and
hand it back to wicket for displaying regular pages? I realise the
headers like content type and even some content might have been
streamed out already, but who knows.

Slightly related, what would be the best way for a single onclick()
event to result in both a wicket page refresh and a download?


Gabor Szokoli

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



Re: How to make a WebPage Application aware?

2007-12-15 Thread Gabor Szokoli
On Dec 15, 2007 11:56 PM, chickabee <[EMAIL PROTECTED]> wrote:
>
> Hi Gabor,

> However, still I wondered that this might very well be a hidden core wicket
> functionality where a webpage knows by itself about the application it
> belongs to.

But what you ask for is a class in one application to know an awful
lot of things about another class which has the same bytecode, but I
beleive has been loaded separately by a different (sibling!) class
loader, among other things the service context of the other servlet
the other class loader runs in, isn't it?

You could of course share this knowledge between your servlets in many
ways from JNDI to a web service depending on the level of isolation
between them.


Gabor Szokoli, possibly misunderstanding the issue

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



Re: How to make a WebPage Application aware?

2007-12-15 Thread Gabor Szokoli
On Dec 15, 2007 9:41 PM, chickabee <[EMAIL PROTECTED]> wrote:
> I have a tomcat webapp with two Wicket Applications, say A and B.
>
> Now, if I create a bookmarkable link in application A for a WebPage which
> actually belongs to application B then it balks out for obvious reasons.

I'm not sure I understand 100%, but maybe this helps:
Register the bookmarkable page in application B, and use a
configuration parameter in applicaton A-s web.xml with B-s base URL.
Try to remember you did this the next time you deploy application B to
a different context root, or set up a reverse proxy.

Or the two servlets could talk to each other and share the registered
bookmarkable URLs dynamically

> I wonder if there is a way to make a WebPage application aware, so that it
> resolves it's owner application automatically.

Application.get() ?


Gabor Szokoli, guessing

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



Re: The Textis incomprehensible

2007-12-15 Thread Gabor Szokoli
Hi!

I do not know what could cause the difference between operation on
Linux and on XP, (perhaps some locale is not installed)  but here is a
workaround you could try:

On Dec 15, 2007 2:49 AM, JohnSmith333 <[EMAIL PROTECTED]> wrote:
>
> My wicket code in xp  show normally.  The text isn't incomprehensible.
> But when I deploy the code to linux os and in weblogic ap server.
...
>  Label lblTest=new Label("lblTest","測試");

Instead of embedding localised strings into the java code, you could
try to put them into property files, and use a StringResourceModel to
reference them:
Label lblTest=new Label("lblTest",new StringResourceModel("testKey"));

This is a good strategy to prepare your application for multi-language
support anyway.


Gabor

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



Re: IUnauthorizedComponentInstantiationListener: keep the page paramaters

2007-12-13 Thread Gabor Szokoli
Solved in-house, sorry about the noise.

I was looking at the wrong place, I should have used
continueToOriginalDestination in the login form submit code.

Again, for the sake of completeness, here's the pattern to preserve
the bookmarkable URL complete with page parameters across the login
procedure:

@Override
public void onSubmit() {
if (authenticateUser(...)) {
 if(!continueToOriginalDestination()) {
  setResponsePage( defaultPage... );
 } else {...}
}

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



Re: wicket:message and HTML

2007-12-13 Thread Gabor Szokoli
On Dec 12, 2007 6:51 PM, Marco Aurélio Silva <[EMAIL PROTECTED]> wrote:
> Hi
> Is there a way to use html code from a language file using, like
> setEscapeModelStrings(false) on a label?

I read about the wicket:message implementation recently (to see if I
could do something similar for  headers and element attributes like
title)
You could change WicketMessageResolver, it uses a label inside.
I'd use a new attribute (defaulting to the old behavior when missing)
if I were you:



Gabor Szokoli

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



Re: "Streaming" a huge ZIP file

2007-12-12 Thread Gabor Szokoli
On Dec 12, 2007 11:58 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> ((WebResponse)r.getResponse).setAttachmentHeader("foo.xls");

Indeed!
Thank you.


Gabor Szokoli

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



IUnauthorizedComponentInstantiationListener: keep the page paramaters

2007-12-12 Thread Gabor Szokoli
Hi again,

My WebApplication implements
IUnauthorizedComponentInstantiationListener. (wicket 1.3)
My problem is I can't access the page parameters in the
onUnauthorizedInstantiation(final Component component) method,
((Page)component).getPageParameters() returns null.

Is there a pattern for saving which page the user attempted to access
with what parameters, and delivering it after a successful login?


Thanks:

Gabor Szokoli

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



Re: "Streaming" a huge ZIP file

2007-12-12 Thread Gabor Szokoli
On Dec 12, 2007 7:23 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> correct. only that one user will have to wait for the download to
> complete. if that is undesired then use a shared resource.

This is what we experience, and it is fine.
Good natural limit on the amount of load each user can cause by accident :-)

Here's Igors previous pseudocode in Java for the sake of completeness.
My question is: how do I set the downloaded filename now?

@Override
public void onSubmit() {

getRequestCycle().setRequestTarget(new IRequestTarget() 
{

public void detach(RequestCycle arg0) {
// TODO Auto-generated method stub  

}

public void respond(RequestCycle r) {
Response response = r.getResponse();

response.setContentType("application/zip");
OutputStream 
out=response.getOutputStream();
ZipOutputStream zout = new 
ZipOutputStream(out);

for (Entry f : getFileList()) {
addFileToZip(zout, f);
}
try {
zout.finish();
zout.close();
} catch (IOException e) {
LOGGER.warn("IO exception while 
streaming ZIP file: ", e);
}

}});

}

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



Re: "Streaming" a huge ZIP file

2007-12-12 Thread Gabor Szokoli
Thanks all!

On Dec 12, 2007 8:48 AM, Thomas Singer <[EMAIL PROTECTED]> wrote:
> IIRC, DownloadLink and Igor's anonymous class will lock the session, so if
> you have one downloading over a very slow connection, other users will get a
> timeout.

I beleive I have separate sessions for each user, so only the same
users other tabs would experience unresponsiveness, right?

We'll test and report back soon.

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



Re: "Streaming" a huge ZIP file

2007-12-11 Thread Gabor Szokoli
I guess I forgot to mentionthe single most important aspect of my question:
The archive not present on the file system, it is dynamically
assembled on the fly from individual files.
(the whole point is downloading multiple files in one go.)


Gabor Szokoli

On Dec 11, 2007 11:45 PM, Jeremy Levy <[EMAIL PROTECTED]> wrote:
> Gabor,
>
> Try DownloadLink
> http://wicket.sourceforge.net/apidocs/wicket/markup/html/link/DownloadLink.html
>
> J
>
>
> On Dec 11, 2007 5:39 PM, Gabor Szokoli <[EMAIL PROTECTED]> wrote:
>
> > Hi there,
> >
> > The downside of an easy-to-use framework is the influx of users with
> > little understanding of the underlying servlet technology, like me.
> > Observe:
> >
> > I'd like to provide a ZIP file (could be TAR, anything Windows PCs can
> > save and later extract from) as a download, one that is potentially
> > too big to be kept in memory in full.
> > So I guess I'd need to "stream" it in chunks, or as a java stream or
> > channel.
> > Can I do that from wicket?
> > Or does the servlet interface require a fully assembled response in
> > memory?
> >
> > Currently I assemble the ZIP file in a byte array in full, but it
> > feels awkward. Would extending WebResource fit the bill?
> >
> >ByteArrayOutputStream bout = new
> > ByteArrayOutputStream();
> >ZipOutputStream zout = new ZipOutputStream(bout);
> >// Add entries
> >zout.finish();
> >zout.close();
> >
> >Resource resource = new
> > ByteArrayResource("application/zip",
> > bout.toByteArray());
> >ResourceStreamRequestTarget target = new
> > ResourceStreamRequestTarget(resource.getResourceStream());
> >    target.setFileName(new
> > SimpleDateFormat("MMddHHmmss").format(Calendar.getInstance
> > ().getTime())
> > + ".zip");
> >getRequestCycle().setRequestTarget(target);
> >
> >
> > All suggestions are welcome.
> >
> >
> > Gabor Szokoli
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

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



"Streaming" a huge ZIP file

2007-12-11 Thread Gabor Szokoli
Hi there,

The downside of an easy-to-use framework is the influx of users with
little understanding of the underlying servlet technology, like me.
Observe:

I'd like to provide a ZIP file (could be TAR, anything Windows PCs can
save and later extract from) as a download, one that is potentially
too big to be kept in memory in full.
So I guess I'd need to "stream" it in chunks, or as a java stream or channel.
Can I do that from wicket?
Or does the servlet interface require a fully assembled response in memory?

Currently I assemble the ZIP file in a byte array in full, but it
feels awkward. Would extending WebResource fit the bill?

ByteArrayOutputStream bout = new 
ByteArrayOutputStream();
ZipOutputStream zout = new ZipOutputStream(bout);
// Add entries
zout.finish();
zout.close();

Resource resource = new 
ByteArrayResource("application/zip",
bout.toByteArray());
ResourceStreamRequestTarget target = new
ResourceStreamRequestTarget(resource.getResourceStream());
target.setFileName(new
SimpleDateFormat("MMddHHmmss").format(Calendar.getInstance().getTime())
+ ".zip");
getRequestCycle().setRequestTarget(target);


All suggestions are welcome.


Gabor Szokoli

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



Re: Silly problem with button model

2007-11-29 Thread Gabor Szokoli
Butterfingers.

On Nov 29, 2007 9:21 PM, Gabor Szokoli <[EMAIL PROTECTED]> wrote:
> toggle.true=Disable
> toggle.false=Disable
The second one should be "Enable" of course.

> IModel action = new StringResourceModel("toggle.${account.enabled}",
> this,  new Model(user));

and the embedded model must reference the live user object instead of
copying it, so new PropertyModel(user) would make more sense.

I sure hope I got it right this time :-)


Gabor Szokoli

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



Re: Silly problem with button model

2007-11-29 Thread Gabor Szokoli
On Nov 29, 2007 7:17 PM, loren <[EMAIL PROTECTED]> wrote:
>   What am I missing?

I think the problem is you set the enabled/disabled model value once,
statically, in the constructor, so it forever maintains the value
correct at that time.

The simplest way to work around this is to set the model object every
time from the  buttons @Override onSubmit() method.

Now a nicer (but more advanced) way would be to keep your strings for
the button captions in (localised) property files in the form of
toggle.true=Disable
toggle.false=Disable

and then the buttons model can be something like this:

IModel action = new StringResourceModel("toggle.${account.enabled}",
this,  new Model(user));

Not 100% sure, I'm just making it up :-)


Gabor Szokoli

>
>
> //Set the model for the enable/disable account button also known
> as "toggle"
> Model action = new Model();
> if(user.getAccount().getEnabled()){
> action.setObject("Disable");
> }else action.setObject("Enable");
>

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



Re: YUI DatePicker - does it support hours and minutes ?

2007-11-29 Thread Gabor Szokoli
Hi!

We use DateTimeField for hours and minutes.


Gabor Szokoli

On Nov 29, 2007 8:38 AM, Nili Adoram <[EMAIL PROTECTED]> wrote:
> Hi all,
> I am upgrading wicket from 1.2.2 to 1.3 (Cheers for 1.3).
> The previous DatePicker was able to display hours and minutes.
> However, I could not support the same feature with the new YUI DatePicker .
> I used the following code:
> DateTextField startDate = new DateTextField("start", "MM/dd/yy
> HH:mm");
> startDate.add(new DatePicker());
> The DatePicker was properly displayed however, when I clicked on some
> date the following was copied to the DateTextField:
> 11/08/07 HH:mm
>
> How can I properly select hours and minutes with the YUI DatePicker ?
> Thanks,
> Nili
>
>
> Best,
> Nili Adoram
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: PageParameter backed models?

2007-11-29 Thread Gabor Szokoli
Indeed!

Thank you.

On Nov 28, 2007 9:46 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> why not just
>  ...

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



PageParameter backed models?

2007-11-28 Thread Gabor Szokoli
Hi there,

I'd like to have a search form, which keeps the last submitted search
parameters in PageParameters in a bookmarkable fashion.
I am wondering about the "wicket way" of doing this, and I keep coming
back to an imaginary LoadableDetachableModel variant which would store
a unique key, and load/store its object value from/to the
PageParameters.
I'd appreciate some advice: What would be the nicest way to get hold
of the pageparameters in the current request from a model, and to set
one in the next response?
Or Is there some better way to achieve bookmarkable (partial) form state?


Thanks in advance:

Gabor Szokoli

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



Re: ListMultipleChoice to take choices model from parent

2007-11-27 Thread Gabor Szokoli
On Nov 27, 2007 5:52 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> you can create your own subclass that does what you want...but thats
> about it short of writing your own component

Thanks, just wanted to make sure I'm not overlooking some more
straight-forward way of doing this.


Gabor Szokoli

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



ListMultipleChoice to take choices model from parent

2007-11-27 Thread Gabor Szokoli
Hi there,

We sometimes need a component for editing sets of arbitrary strings.
We currently use a ListMultipleChoice component, whose choices model
contains the actual set, and selected elements can be deleted with a
button.
Is there a simple way to instruct ListMultipleChoice to use the model
looked up from its parents CompoundPropertyModel by its wicket:id as
its "choices" model instead of its "selected elements" model? I can do
new PropertyModel(parentModel,"myWicketId"), but its clumsy and more
static.
Or is there some other component we should be using to make a
"free-text palette" set editor?
(regular palette does not work, as we must have a text entry field for
adding new elements, there is no finite universal set to chose from.)


Thank you in advance for any ideas!

Gabor Szokoli

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



Re: Matt Raible's ApacheCon presentation

2007-11-16 Thread Gabor Szokoli
These two are the exact same things I have in mind about wicket:

On Nov 15, 2007 10:18 PM, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> I've always had in my mind that the perfect
> approach to state handling would be to give users the choice between
> server managed and client managed (i.e. by passing parameters/ rest)
> on a component level.

Yes! Taking after the database-backed DetatchableModel, there could be
a PageParameterModel. We could use it to store the search form values
and the DefaultDataTable sort parameters and such to make application
state bookmarkable (and preferably human readable).

> * Java. I'm getting tired of Java's limitations and plain inelegance

Same here, too much academic language programming on my mind :-)
I hope I can get around to replicate and your scala-wicket experiments
in the holiday season.

Oh, and type-safe models are a must, I was surprised to read in this
thread not everybody agrees with that. Especially since type erasure
ensures backwards compatibility, and lets the cast-fans stick to their
habits :-)


Szocske

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



Re: Readonly checkbox

2007-11-16 Thread Gabor Szokoli
On Nov 16, 2007 6:06 PM, mclev <[EMAIL PROTECTED]> wrote:
>
> I have a case where I'm using a checkbox to show boolean data in a table.
> However I want the data to be readonly.

Try setEnabled(false), works on any Component.


Szocske

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



Re: Wicket Web Beans 1.0-rc1 Released

2007-09-17 Thread Gabor Szokoli
On 9/15/07, Zenrique Steckelberg <[EMAIL PROTECTED]> wrote:
> - allow constructor to accept models besides beans too, if possible.

Me too! :-)

Or is there some other way to use DetachableModels backed by JPA with WWB?
(The abbreviation conjures images of a tiny but venerable local
railroad company somewhere in Germany :-) )


Gabor

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



Re: Re: First Day Disgust!

2007-09-08 Thread Gabor Szokoli
With all due respect:

On 9/8/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> Do note however, that we presume basic knowledge of Java programming

...fair enough...

> and Java web applications (what is a war, what is a web.xml file).

Wicket, being component based, has great appeal for people with
non-web GUI experience only.
It does not make it your job to introduce them to this technology of course.


Gabor

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



Re: How to set wicket's locale?

2007-09-07 Thread Gabor Szokoli
I'm planing to have a little celebration in our office when our webapp
is officially released to customers.
I was thinking about ordering pizza to be delivered to the wicket
developers who have helped us so much here on the list, so they can
share our joy, not just our problems.
How hard can it be to order pizza online in any language, I thought.
But sushi is probably a bit more tricky, and you miss all the
atmosphere if you just have it delivered, so I might have to ask you
guys to go out to have some, and send us the bill :-)


Gabor

On 9/6/07, Johan Compagner <[EMAIL PROTECTED]> wrote:
> can you send some over?
>
> On 9/6/07, Evan Chooly <[EMAIL PROTECTED]> wrote:
> >
> > T-37 minutes until sushi time!
> >
> > On 9/6/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > >
> > >  sushi
> > >
> > >
> > > -igor
> > >
> > >
> > > On 9/6/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> > > >
> > > > new PropertyModel(Page.this, "session.foo.sushi.bar");
> > > >
> > > > ?
> > > >
> > > >
> > > > On 9/6/07, Gabor Szokoli <[EMAIL PROTECTED]> wrote:
> > > > > On 9/5/07, Johan Compagner <[EMAIL PROTECTED]> wrote:
> > > > > > can  you make an jira issue for this?
> > > > >
> > > > > https://issues.apache.org/jira/browse/WICKET-936
> > > > >
> > > > > Any ideas on encapsulating the session as a propertymodel for
> > > components
> > > > in 1.2?
> > > > >
> > > > >
> > > > > Gabor
> > > > >
> > > > >
> > -
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Buy Wicket in Action: http://manning.com/dashorst
> > > > Apache Wicket 1.3.0-beta3 is released
> > > > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
> > > >
> > > > -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> >
>

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



Re: How to set wicket's locale?

2007-09-06 Thread Gabor Szokoli
On 9/6/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> new PropertyModel(Page.this, "session.foo.sushi.bar");
>
> ?

Wow.

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



Re: How to set wicket's locale?

2007-09-06 Thread Gabor Szokoli
On 9/5/07, Johan Compagner <[EMAIL PROTECTED]> wrote:
> can  you make an jira issue for this?

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

Any ideas on encapsulating the session as a propertymodel for components in 1.2?


Gabor

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



Re: How to set wicket's locale?

2007-09-04 Thread Gabor Szokoli
Uh, oh, one more quick thing:

I'm still on wicket 1.2, and my wicket:message labels retain their
text in the locale they were first rendered in.

Is there anything I can do on locale changes to make them change their text?

Is this behavior the same under 1.3?


Gabor

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



Re: How to set wicket's locale?

2007-09-04 Thread Gabor Szokoli
On 9/3/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:

> Just go with overriding getLocale on your custom session object. If
> you need to support just one locale, that's easy: just always let it
> return that locale. Otherwise, you'll have to do some more work (e.g.
> using request.getLocale()), but it shouldn't be very difficult.

Hardcoding a locale was just an experiment, but I might end up using it :-)

I'd like your input on where my SessionModel approach goes wrong?


Gabor

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



Re: How to set wicket's locale?

2007-09-03 Thread Gabor Szokoli
On 9/3/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > I use wicket 1.2 for now.
>
> Yeah, unfortunately it doesn't work for 1.2. It's one of the
> improvements for 1.3.

We'll upgrade for the next release once this one is out...

> But either override getLocale in your session, or set it using a
> custom session factory.

Thanks for the  support and ideas.
But for the record:
Overriding getLocale() would surely work, but sounds like even worse
of a hack than setLocale(_), and when I set the locale in the
ISessionFactory it gets reset by the locale in the request just like
when I set it in the session constructor. (which is to be expected,
really.)

Here's my current plan to manage the locale (and to display the logged
in user while I'm at it), please tell me what's wrong with it, I get
an exception about the model being a null object:

public class DetachableSessionModel extends LoadableDetachableModel {

@Override
protected Object load() {
return Session.get();
}
}

public class LocalePanel extends MCCNPanel {

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

Form form = new Form("form");
add(form);

form.setModel(new DetachableSessionModel());

List locales = new Vector();
locales.add(new Locale("hu"));
locales.add(new Locale("sr"));
locales.add(CentrexSession.get().getLocale());

form.add(new DropDownChoice("locale", locales, new
ChoiceRenderer("language", "language") ));

form.add(new Button("submit"));

}
}

When I submit:

java.lang.IllegalStateException: Attempt to set model object on null
model of component: topLeftPanel:form:locale
at wicket.Component.setModelObject(Component.java:2013)
at wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:840)
at wicket.markup.html.form.Form$11.formComponent(Form.java:923)
at wicket.markup.html.form.Form$4.component(Form.java:465)
at wicket.MarkupContainer.visitChildren(MarkupContainer.java:744)
at wicket.markup.html.form.Form.visitFormComponents(Form.java:461)
at wicket.markup.html.form.Form.updateFormComponentModels(Form.java:914)
at wicket.markup.html.form.Form.process(Form.java:896)
at wicket.markup.html.form.Form.onFormSubmitted(Form.java:310)
at java.lang.reflect.Method.invoke(Method.java:597)
at wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:187)
at 
wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:74)
at 
wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:65)
at 
wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents(AbstractCompoundRequestCycleProcessor.java:57)
at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:896)
at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
at wicket.RequestCycle.step(RequestCycle.java:1010)
at wicket.RequestCycle.steps(RequestCycle.java:1084)
at wicket.RequestCycle.request(RequestCycle.java:454)
at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
at wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:262)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at 
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:268)
at 
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(Defaul

Re: How to set wicket's locale?

2007-09-03 Thread Gabor Szokoli
On 8/22/07, Nino Saturnino Martinez Vazquez Wael
<[EMAIL PROTECTED]> wrote:
> There are some different approaches you could use...
>
> But why not make a parent page class where you do it in? And then
> inherit from that? Or just use a custom session which does it by it
> self(check out the quickstart project to see how to create a session class).


I saved this message from a few weeks ago, and I finally got around to
localize my application.

I use wicket 1.2 for now.

I extended the wicket.WebSession class, and set the locale in its
constructor, just to see if it works.
It does not: the request overrides my setting, so I get my pages in
the language I configured the browser to prefer.
I do not want this, think internet cafes or locked down corporate machines.
I can't override setLocale/1 to disable this feature, because it is
declared final in wicket.Session.
So what is the wicket way to make my application ignore the locale in
the request?


Thanks in advance, and thanks for the great framework!

Gabor

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



Re: Presentation and application logic separation

2007-08-29 Thread Gabor Szokoli
On 8/28/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> well, what wicket does is version the state if you keep it inside its model,
> so it all Just Works. But because you are keeping your state outside of
> wicket you have to build your own versioning mechanism, or remove your state
> machine and use wicket.

Assuming the SM state is not too big,  you could keep it in your base
page object.
Then it would get replicated along with the page in the cache, wouldn't it?
Make sure it is serialisable.
Or to get bookmarkable pages, keep it in the PageParameters.

Except for the variables which truly belong to the session, like
logged in user, of course.

More experienced people please correct me if I'm wrong.


Gabor

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



Re: Re[2]: [Wicket-user] Wicket in Action now available through Manning Early Access Program

2007-08-24 Thread Gabor Szokoli
On 8/24/07, Oleg Taranenko <[EMAIL PROTECTED]> wrote:
>
> moreover the payment through a paypal account, that withdraws money from card 
> emitted by a
> russian bank, failed too! :|

They seem to accept visa, mastercard and AMEX, you don't have to use paypal.

Gabor Szokoli

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



Re: [Wicket-user] Wicket in Action now available through Manning Early Access Program

2007-08-24 Thread Gabor Szokoli
On 7/26/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> Eelco and I are really happy to announce the availability of our first
> two chapters of our forthcoming book "Wicket in Action".

Manning does not accept orders from Hungary, where I happen to live and work.
Normally we don't bother with such businesses and buy from amazon.com
instead, but the online preview of the Wicket book is worth making an
exception.
Any suggestions?


Gabor Szokol

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



Re: Wicket vs. ZK

2007-08-16 Thread Gabor Szokoli
Hi,

Slightly off topic, but this is the summer vacation season on this
hemisphere, so I'm sure no one will mind:

On 8/16/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> Wicket assumes that UI designers are *designers* (and not
> half-programmers like ZK assumes) only dealing with laying out, and
> that UI logic can best be coded in Java (by programmers obviously).

We've been using wicket for a couple of months now, our first
application is about to be deployed, so I looked back at the templates
and started wondering how much this separation of concerns applies to
us.
We have a base page with some panels supplied by subclasses, then
those panels are made up of subpanels, fragments, datatables, all with
their respective HTML templates. We have a wrapper panel for each form
input component to add a label and a nicer read-only view. All this
even before we introduced a navigation border!

We did start from a single HTML page from a designer, and all we had
to do was slice that up, so there is some truth to the separation of
concerns, but it is was a one-way road, there's no way the designer
will understand all these HTML sniplets: We can only ask him to
beautify a full, rendered page, and slice that up again to update the
small template files.

I'm not complaining or anything, haven't used any other web framework,
and still can't see any I'd switch to, (well, theoretically, if
designers could do OpenLaszlo all by themselves and we only had to
supply the business logic via a web service...) just wanted to share
my thoughts on the separation of concerns slogan.


Gabor Szokoli

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



Re: Radio problem

2007-08-13 Thread Gabor Szokoli
Hi!

On 8/13/07, shumbola <[EMAIL PROTECTED]> wrote:
> If I use RadioGroup, then having problem with my Model. Appreciate if
> someone show me the right way with a sample code.

We use RadioGroup for something similar and it works fine.
The form has a CompoundPropertyModel with attributes including
"radioGroup", "panel0", "panel1", which the subcomponents can find
even when they are nested into each other.
Here's a simplified example:



 
  



 
  

 

form constructor:

RadioGroup radioGroup = new RadioGroup("radioGroup");

Panel panel0 = new Panel("panel0");
Radio choice0 = new Radio("0", new Model(new 
Integer(0)));
radioGroup.add(panel0);
radioGroup.add(choice0);

Panel panel1 = new Panel("panel1");
Radio choice1 = new Radio("1", new Model(new 
Integer(1)));
radioGroup.add(panel1);
radioGroup.add(choice1);

form.add(radioGroup);

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



Re: WicketTester vs Component.error()

2007-08-08 Thread Gabor Szokoli
On 8/7/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> in 1.2 you cannot call error/info/etc from component's constructor because
> you havent added that component to the page yet. in 1.3 it just works.

Indeed.
I was under the false impression that this function worked on regular
deployment, but the error message is exactly the same.
Yay for unit testing! :-)


Gabor

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



WicketTester vs Component.error()

2007-08-07 Thread Gabor Szokoli
Hi,

I'm using wicket 1.2, and use the WicketTester startPage(...) method
in a unit test.
(In fact there's nothing else in it, I just want to test if the markup
matches the component hierarchy.)
Problem is, a component on the page uses its error(...) method to
display its dissatisfaction with the mock data in a feedbackpanel,
which is perfectly normal operation.
But that causes an exception:

java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = signInForm, page = , path =
signInForm.LoginPanel$SignInForm]]

Is this expected? Did I do something wrong?

Any advice is appreciated.
Upgrading to wicket 1.3 is planned, but I'd rather have tests even before that.


Thank you for your attention and the great framework!

Gabor

Ps: Here's the full output:


SEVERE: tester: unexpected
wicket.WicketRuntimeException: tester: unexpected
at 
wicket.util.tester.WicketTester.convertoUnexpect(WicketTester.java:381)
at wicket.util.tester.WicketTester.access$200(WicketTester.java:178)
at wicket.util.tester.WicketTester$3.getTestPanel(WicketTester.java:365)
at wicket.util.tester.DummyPanelPage.(DummyPanelPage.java:40)
at wicket.util.tester.WicketTester$2.getTestPage(WicketTester.java:336)
at 
wicket.util.tester.DummyHomePage$TestLink.onClick(DummyHomePage.java:84)
at wicket.markup.html.link.Link.onLinkClicked(Link.java:254)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:187)
at 
wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:74)
at 
wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:65)
at 
wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents(AbstractCompoundRequestCycleProcessor.java:57)
at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:896)
at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
at wicket.RequestCycle.step(RequestCycle.java:1010)
at wicket.RequestCycle.steps(RequestCycle.java:1084)
at wicket.RequestCycle.request(RequestCycle.java:454)
at 
wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:318)
at 
wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:307)
at 
wicket.util.tester.WicketTester.newRequestToComponent(WicketTester.java:248)
at wicket.util.tester.WicketTester.startPage(WicketTester.java:235)
at wicket.util.tester.WicketTester.startPanel(WicketTester.java:330)
at 
com.deverto.centrex.panels.LoginPanelTest.testForm(LoginPanelTest.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:228)
at junit.framework.TestSuite.run(TestSuite.java:223)
at 
org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
at 
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
Caused by: java.lang.reflect.InvocationTargetException
at sun.re

Re: editable form saw a similar issue fixed with forms and pallettes in 1.3

2007-07-31 Thread Gabor Szokoli
On 7/30/07, Ed_ <[EMAIL PROTECTED]> wrote:
>
> http://mail-archives.apache.org/mod_mbox/wicket-commits/200707.mbox/[EMAIL 
> PROTECTED]
> Is there any correlation?

I don't think so, but I'm not much more experienced with wicket than
you are :-)

> > Thanks the toString override  seems to work in that the correct values/ids
> > that I want do get posted back.
> > Like you mentioned is this the right way to do it?

No, I think it's a quick hack to get it working in the
component->model direction :-)
I think the design of DropDownChoice implies you use a list of the
same class for choices as the actual model. Then you use a
ChoiceRenderer to pretty print them on the user-visible choice list.
But I could be wrong because I don't remember seeing this in any
documentation or tutorial :-)

Or is there a way to express "this" in the property expression
language? "." maybe?
Because the rating string in your model object is the choice id itself.


Gabor

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



Fwd: [Wicket-user] editable form

2007-07-30 Thread Gabor Szokoli
Hi,

Sorry if duplicated:

On 7/29/07, Ed _ <[EMAIL PROTECTED]> wrote:
>
> I am trying to create an editable form - this has a drop down list. in it
>
> List ratingList = cfg.getContentRatingList();
> DropDownChoice ratingChoice = new DropDownChoice("rating", new
> PropertyModel(form, "category"), ratingList, new
> ChoiceRenderer("label", "id"));

I think what happens here is form.setCategory(ratingList.get(chosenOne)).
That's why you see generic toString output as the assigned value.
As a simple hack, you could override the toString() method of the rating class.
For a semi-decent solution, override the convertValue method of DropDownChoice.
I think what you really need is to add a Converter to ratingChoice.
(but IConverter does not extend IBehavior, so I don't know how to do
that properly)

I also don't know how these conversion tricks will work in the reverse
direction, when displaying the rating already in the model.

And in an unrelated note, you could call this component "category"
instead of "rating", and give a CompoundProertyModel to the form.
Saves a lot of typing in the long run,

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