Form Processing problem on pages with Border - Wicket 1.4.1

2009-09-20 Thread Flavius

I am migrating a project from 1.3.6 to 1.4.1.  I've run into
a problem and I'm not sure if this is a bug or not.

Most of the pages have a border and the border has a DropDownChoice
in it (as well as other components).  Technically it's in a panel
in the border.

The Form objects are typically children of the border, like

add(border);
border.add(inputForm);

When the form is submitted, the DropDownChoice's value is being
reset.  I've traced through the code and it looks like the root
of the cause is in Form#internalUpdateFormComponentModels.

This is checking if there is a border and, if yes, then visiting all
the components of the border.

The internalUpdateFormComponentModels method in 1.3.6 didn't look
for the border and visit it's components.  It's not obvious to me
why this needs to be done now in 1.4.

So ultimately FormComponent#visitComponentsPostOrderHelper is being
called for all components whether they are inside the form or not.

It's returning visitor.component(component), which calls 
Form#component and that calls
((IFormModelUpdateListener)component).updateModel();

I looked through the nabble logs and noticed this entry here:
http://www.nabble.com/Form-processing-issues-and-questions-%28particularly-r
elated-to-Border-and-ListMultipleChoice%29-td25251849.html#a25251849


Is there something I need to do here?  I'm not seeing any way of
telling the Form not to visit the Border's controls, and again,
I'm not sure why it's doing this.

I'd greatly appreciate any insight that can be offered.


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



RE: Is it a bug that Enclosure is not invoking component resolver to resolve its children?

2009-09-20 Thread Chris Colman
> > >> as far as i rememember there is a collection registered in
> setttings
> > >> and then each component can also implement a resolver.
> > >>
> > >> the contract can be seen in markupcontainer#rendernext method
> > >> 1) first walk over the component hierarchy and check if any are
> > resolvers
> > >> 2) walk over collection of resolvers in the settings
> > >>
> > >> as soon as true is returned from resolve iteration is stopped.
> 
> What method should I override in Enclosure to invoke the above
process?
> 
> It would have to be a method that gets called prior to Enclosure
calling
> getChildComponent() which it does from onComponentBodyTag... does that
> represent a staging problem?

I've tried many different combinations over a frustrating 3 days now in
an attempt to get enclosure to fire off a 'resolve' on its children like
most other parent components do.

I'm beginning to wonder if what I'm doing is actually possible in
wicket.
Perhaps the retrieval of the dependent child component is happening to
early in the lifecycle i.e. before the resolve has had a chance to
instantiate and populate the children in the parent.

Any ideas on the relative chance of success of this endeavour?

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



Re: Update parent component from child component

2009-09-20 Thread Jeremy Thomerson
Well, one piece is to use findParent(SecureWebPage.class) rather than three
getParents  or getPage()

The question is why do you want to refresh the whole page via AJAX?  Doesn't
that sort of defeat the purpose.

Nonetheless, please turn your application from deployment to development
mode and use the ajax debug to debug this.

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



On Wed, Sep 16, 2009 at 2:30 PM, Ryan O'Hara  wrote:

> I'm trying to update a parent's, parent's, parent component using AJAX.  I
> tried combing the archives and came up with some seemingly useful stuff (
> http://www.nabble.com/How-to-update-base-page-panel-from-child-page--td20998486.html#a21015568),
> although I'm still have trouble.  Below is a code snippet:
>
> AjaxSubmitLink asl = new AjaxSubmitLink("submitButton") {
>public void onSubmit(AjaxRequestTarget target, Form form) {
>
>  target.addComponent(this.getParent().getParent().getParent());
>}
> };
>
> 'this' is an AjaxSubmitLink
> 1st getParent() is a Form
> 2nd getParent() is a Panel
> 3rd getParent() is a SecureWebPage
>
> I'd like to reload SecureWebPage, so that all of its Panel child components
> (and their child components) are reloaded.  I've tried explicitly calling
> setOutputMarkupId(true) on each Form, Panel, and SecureWebPage component.
>  I've also tried wrapping the Panels with a WebMarkupContainer and updating
> that, but that didn't seem to work either.  Any advice?
>
> Thanks,
> Ryan
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: post a form to external website

2009-09-20 Thread Jeremy Thomerson
Yeah - that would be slick.

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



On Sun, Sep 20, 2009 at 10:24 AM, Martin Grigorov wrote:

> thinking about this now I think it would be very elegant to first do
> Ajax submit and then in onSubmit() append a Javascript code to change
> the form's action (and the method too if needed) attribute and submit
> it.
>
> El sáb, 19-09-2009 a las 20:55 -0500, Jeremy Thomerson escribió:
> > If you actually want to redirect them to the other site (with a post, and
> > not just a get), you will just need to render a form and rely on
> javascript
> > to auto-submit it for you (likely with a "click here if not redirected"
> > link).  The hidden fields could be rendered with attribute modifiers on
> > webmarkupcontainers for example.  Or you could use an actual form and
> > override the action URL, but that's probably a little heavy-handed for
> this.
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
> >
> >
> > On Fri, Sep 18, 2009 at 7:21 AM, Martin Grigorov  >wrote:
> >
> > > El vie, 18-09-2009 a las 10:51 +, Vadim Tesis escribió:
> > > > all,
> > > >
> > > >
> > > >
> > > > i have a form with some input fields.  after the user populates the
> form
> > > and hits submit button, i'd like to do some processing on my website
> and
> > > then redirect the user to external website by posting another form with
> > > dynamically generated hidden fields.
> > > >
> > > > what's the best way to do it in wicket 1.4?
> > > There is no automatic Wicket way to do this.
> > > You could forward the data with UrlConnection or apache-httpclient in
> > > your onSubmit() callback method.
> > > >
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > Vadim
> > > >
> > > > _
> > > > Hotmail: Powerful Free email with security by Microsoft.
> > > > http://clk.atdmt.com/GBL/go/171222986/direct/01/
> > >
> > >
> > > -
> > > 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: keep on getting non-bookmarkable URL with QueryStringUrlCodingStrategy...

2009-09-20 Thread Erik Brakkee
There is definitely something strange going on. It appears that whenever I
use a parameter that has a '/' in it I get strange behavior. I do see the
'/' being encoded properly but still these '/' characters are in the way.
Typical behavior is to see an empty page with the default URL coding
strategy and to get a non-bookmarkable page with the querystring strategy.
As a workaround I am now replacing all '/' characters in the parameter by
something else and then changing it back when using it.

This is not the whole story because even if I apply this hack, the
QueryStringURLCoder strategy still generates a non-bookmarkable page for the
page I want to use. The way out was to use mountBookmarkablePage but I
really don't want to use that.

To reproduce it you would need to mount a page using the
QueryStringURLCoder:

   mount(new QueryStringUrlCodingStrategy("/gpx-from-url",
RemoteTrackMapPage.class));

make the RemoteTrackMapPage have either a default constructor or one with
PageParameters (does not matter which one) and do a
setResponsePage(RemoteTrackMapPage.class, new PageParameters()).

If I have the time I will make an example.

Cheers
  Erik


Re: defaultFormProcessing is no longer considered when processing multipart form in ajax request

2009-09-20 Thread Igor Vaynberg
the problem is that trunk did not have version numbers updated so it
was building as 1.4 for a while. this has been fixed so latest
snapshots should be properly built out of branch.

-igor

On Sat, Sep 19, 2009 at 10:50 PM, Vladimir K  wrote:
>
> The latest 1.4 snapshot does not define IComponentBorder interface in
> addition to disappeared form component persistence.
>
> Is it supposed that 1.4.2 breaks compatibility with 1.4.1?
>
> I see the only way to check the fix in wicket-ajax.js - mix it into wicket
> 1.4.1 jar.
>
>
>
> Vladimir K wrote:
>>
>> I use 1.4-snapshot from
>> http://wicketstuff.org/maven/repository/org/apache/wicket/wicket/1.4-SNAPSHOT/
>>
>> Persistence of form components has been removed from 1.4 as well.z
>>
>>
>> martin-g wrote:
>>>
>>> You have to use 1.4.x branch.
>>> trunk is for 1.5. form persistence is removed only in trunk
>>>
>>>
>>> El vie, 18-09-2009 a las 05:32 -0700, Vladimir K escribió:
 Igor, thanks for the fix.

 I tried to compile against 1.4.2-20090916 and obtained two compilation
 errors. Now FormComponent does not contain method setPersistent() and
 Page
 does not contain method removePersistedFormData().

 What API should be used instead?


 Vladimir K wrote:
 >
 > Igor, could you plan it for 1.4.2?
 >
 >
 > Vladimir K wrote:
 >>
 >> done
 >>
 >> https://issues.apache.org/jira/browse/WICKET-2463
 >>
 >>
 >> Vladimir K wrote:
 >>>
 >>> sure
 >>>
 >>>
 >>> igor.vaynberg wrote:
 
  i guess create a quickstart and attach it to a jira issue. when i
  tested buttons, while developing the feature, it seemed to work
 fine.
 
  -igor
 
  On Wed, Sep 9, 2009 at 10:40 PM, Vladimir K 
 wrote:
 >
 > it is attached to the  tag as follows:
 >
 >                        >>> > enctype='multipart/form-data'>
 >                                
 >                                        >>> wicket:id="cancelAction"
 > type="submit"
 > wicket:message="value:command.cancelAction">
 >                                
 >                        
 >
 > From my perspective the request is submitted very similar to as I
 > remember
 > submitting drop downs many years ago
 > 
 > The request parameters contain the name of the form instead of the
 > name of
 > the button.
 >
 >
 > igor.vaynberg wrote:
 >>
 >> this bit of javascript:
 >>
 >> if (submitButton != null) { s += Wicket.Form.encode(submitButton)
 +
 >> "=1";
 >> }
 >>
 >> is needed because we do perform a custom form serialization -
 really
 >> just constructing the query string - that we submit back to
 server
 >> via
 >> ajax. the multipart handling performs a regular post into a
 hidden
 >> iframe so the browser performs the serialization - and that
 should
 >> include the button. what markup is your button attached to?
 >>
 >> -igor
 >>
 >> On Wed, Sep 9, 2009 at 8:18 PM, Vladimir Kovalyuk
 >> 
 >> wrote:
 >>> I added
 AjaxFallbackButton("Cancel").setDefaultFormProcessing(false)
 >>> to
 >>> the
 >>> multipart form and when it is pressed the form is handled as
 well as
 >>> the
 >>> button would have defaultFormProcessing=true.
 >>>
 >>> It happens because request parameters does not contain the name
 of
 >>> the
 >>> submitting button.
 >>>
 >>> The magic is in the new code in wicket-ajax.js
 >>>
 >>>    // Submits a form using ajax.
 >>>    // This method serializes a form and sends it as POST body.
 >>>    submitForm: function(form, submitButton) {
 >>>        if (this.handleMultipart(form)) {
 >>>            return true;
 >>>        }
 >>>        var body = function() {
 >>>            var s = Wicket.Form.serialize(form);
 >>>            if (submitButton != null) {
 >>>                s += Wicket.Form.encode(submitButton) + "=1";
 >>>            }
 >>>            return s;
 >>>        }
 >>>        return this.request.post(body);
 >>>    },
 >>>
 >>> I believe the problem is caused by handleMultipart(form)
 invocation.
 >>> submitForm function accepts submitButton parameter but does not
 >>> passes it
 >>> to
 >>> handleMultipart function.
 >>>
 >>> Igor could you clarify that?
 >>>
 >>
 >>
 -
 >> To unsubscribe, e-mail: 

Re: keep on getting non-bookmarkable URL with QueryStringUrlCodingStrategy...

2009-09-20 Thread Martin Grigorov
El dom, 20-09-2009 a las 15:44 +0200, Erik Brakkee escribió:
> Hi,
> 
> I have mounted a specific page using QueryStringUrlCodingStrategy to a
> specific URL. Nevertheless, when I use setResponsePage(MyPage.class,
> pageParams), I keep on getting a URL that has a session-specific parameter
> with name 'x'. Is there anything I am doing wrong. I just have one parameter
> in the page parameters that I want to see appearing in the URL.
Should be OK.
Please create a quickstart application that reproduce the problem and
attach it to Jira ticket or upload it somewhere so we could take a look.
> 
> Cheers
>   Erik


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



Re: post a form to external website

2009-09-20 Thread Martin Grigorov
thinking about this now I think it would be very elegant to first do
Ajax submit and then in onSubmit() append a Javascript code to change
the form's action (and the method too if needed) attribute and submit
it.  

El sáb, 19-09-2009 a las 20:55 -0500, Jeremy Thomerson escribió:
> If you actually want to redirect them to the other site (with a post, and
> not just a get), you will just need to render a form and rely on javascript
> to auto-submit it for you (likely with a "click here if not redirected"
> link).  The hidden fields could be rendered with attribute modifiers on
> webmarkupcontainers for example.  Or you could use an actual form and
> override the action URL, but that's probably a little heavy-handed for this.
> 
> --
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> 
> On Fri, Sep 18, 2009 at 7:21 AM, Martin Grigorov wrote:
> 
> > El vie, 18-09-2009 a las 10:51 +, Vadim Tesis escribió:
> > > all,
> > >
> > >
> > >
> > > i have a form with some input fields.  after the user populates the form
> > and hits submit button, i'd like to do some processing on my website and
> > then redirect the user to external website by posting another form with
> > dynamically generated hidden fields.
> > >
> > > what's the best way to do it in wicket 1.4?
> > There is no automatic Wicket way to do this.
> > You could forward the data with UrlConnection or apache-httpclient in
> > your onSubmit() callback method.
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Vadim
> > >
> > > _
> > > Hotmail: Powerful Free email with security by Microsoft.
> > > http://clk.atdmt.com/GBL/go/171222986/direct/01/
> >
> >
> > -
> > 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



keep on getting non-bookmarkable URL with QueryStringUrlCodingStrategy...

2009-09-20 Thread Erik Brakkee
Hi,

I have mounted a specific page using QueryStringUrlCodingStrategy to a
specific URL. Nevertheless, when I use setResponsePage(MyPage.class,
pageParams), I keep on getting a URL that has a session-specific parameter
with name 'x'. Is there anything I am doing wrong. I just have one parameter
in the page parameters that I want to see appearing in the URL.

Cheers
  Erik


RE: Is it a bug that Enclosure is not invoking component resolver to resolve its children?

2009-09-20 Thread Chris Colman
> >> as far as i rememember there is a collection registered in
setttings
> >> and then each component can also implement a resolver.
> >>
> >> the contract can be seen in markupcontainer#rendernext method
> >> 1) first walk over the component hierarchy and check if any are
> resolvers
> >> 2) walk over collection of resolvers in the settings
> >>
> >> as soon as true is returned from resolve iteration is stopped.

What method should I override in Enclosure to invoke the above process?

It would have to be a method that gets called prior to Enclosure calling
getChildComponent() which it does from onComponentBodyTag... does that
represent a staging problem?

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



how to control visibility of Border's markup?

2009-09-20 Thread Vladimir Kovalyuk
I would like to control programmatically the visibility of the border
itself, meaning that components within the border are always visible.

I can create two different borders and switch between them but it looks too
complicated.


Re: rpc question

2009-09-20 Thread Petr Kobalíček
Hi all,

thanks for all responses. Currently I will solve my problem by
rewritting original qooxdoo-rpc-java server to be usable also from
wicket. I don't know if my solution is clear, but if I get feeling
that it's not bad I will share my code with community.

Regards
- Petr

2009/9/20 Jeremy Thomerson :
> And, if you want access to the session from within your web service, you can
> wrap the wicket session filter around your servlet, service, etc, so that it
> has access to Session.get().  There are a quite a few posts on this mailing
> list that will steer you in the right direction for that.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Fri, Sep 18, 2009 at 7:18 PM, Eelco Hillenius
> wrote:
>
>> While you could use Wicket for this, personally I think you're getting
>> close to viewing Wicket as the golden hammer :-)
>>
>> Why not use Jersey for instance. I just used that myself (in a project
>> where the UI is in Wicket), and especially together with Jackson for
>> JSON <--> Pojo serialization this seems to work pretty well. It's also
>> part of a standard (JaxRS), which imho should never be the main reason
>> to choose something, but is a nice little extra.
>>
>> Eelco
>>
>>
>> 2009/9/18 Petr Kobalíček :
>> > Thanks guys,
>> >
>> > the solution from Pedro
>> > (
>> http://blog.brunoborges.com.br/2008/11/restful-web-services-with-wicket.html
>> )
>> > is very close I talked about. I think that wicket supports to send
>> > JSON instead of XML, so I'm going to play with this.
>> >
>> > I have another question, maybe very OT, can I connect this solution
>> > with standard RPC server to check for types, etc? For example with
>> > http://jabsorb.org/ ? I'd like to use wicket sessions and request
>> > cycle with RPC services, or is my demand stupid (I mean that there are
>> > better solutions)?
>> >
>> > My problem is that I have quite big application in qooxdoo that
>> > communicates only through JSON (not strictly RPC). This is used for
>> > administration part. And second part of application is pure wicket
>> > solution. I'd like to stay with qooxdoo for administration, i like it.
>> >
>> > Cheers and thanks
>> > - Petr
>> >
>> > 2009/9/18 Marc Ende :
>> >> Hi Petr,
>> >>
>> >> sorry, I've misunderstood your mail... :)
>> >>
>> >> you've meant the other way round. May be you should try to
>> >> build a restful webservice. It's also possible with wicket if you
>> >> decide xml as a resultpage.
>> >>
>> >> For example:
>> >> http://java.dzone.com/news/wicket-creating-restful-urls
>> >>
>> >> Am Fri, 18 Sep 2009 17:48:01 +0200
>> >> schrieb Marc Ende :
>> >>
>> >>> Hi Petr,
>> >>>
>> >>> I think you should use a LoadableDetachableModel. Within the method
>> >>> load() you can execute your call to the webservice or other
>> >>> remote-service.
>> >>>
>> >>>
>> http://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-DetachableModels
>> >>>
>> >>> yours
>> >>> marc
>> >>>
>> >>> Am Fri, 18 Sep 2009 14:20:27 +
>> >>> schrieb Petr Kobalíček :
>> >>>
>> >>> > Hi list,
>> >>> >
>> >>> > is there a simple tutorial about making RPC services in wicket? I
>> >>> > mean all integrated with wicket RequestCycle and Sessions, ideally
>> >>> > that I can expose web services through some Wicket page like class.
>> >>> > I'm porting one application and we have admin interface in qooxdoo
>> >>> > toolkit (it communicates through json requests).
>> >>> >
>> >>> > I'd like to hear about "wicket" solution to this problem.
>> >>> >
>> >>> > Thanks for possibilities
>> >>> > - Petr
>> >>> >
>> >>> > -
>> >>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >>> >
>> >>
>> >>
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

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