You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by nino martinez wael <ni...@gmail.com> on 2011/03/04 20:15:11 UTC

visural-wicket running on wicket 1.5?

So does has anybody run it on wicket 1.5, or is there something in the works
for it?

regards Nino

Re: visural-wicket running on wicket 1.5?

Posted by nino martinez wael <ni...@gmail.com>.
Doh my bad, I had the components markup in my html as well as in the
fragment, so when I removed them from the html everything works as wanted:)

2011/3/10 nino martinez wael <ni...@gmail.com>

> I've added generics.. Still not working though, it's as if the components
> get added twice (and the fragment never gets added or something like that)
>
>
>
>
> Index:
> branches/1.5/visural-wicket/src/com/visural/wicket/component/viewmode/ViewOrEdit.java
> ===================================================================
> ---
> branches/1.5/visural-wicket/src/com/visural/wicket/component/viewmode/ViewOrEdit.java (revision
> 266)
> +++
> branches/1.5/visural-wicket/src/com/visural/wicket/component/viewmode/ViewOrEdit.java (working
> copy)
> @@ -14,11 +14,8 @@
>   *  limitations under the License.
>   *  under the License.
>   */
> -package com.visural.wicket.component.viewmode;
> +package com.netdesign.ccadmin.components.vieworedit;
>
> -import com.visural.wicket.security.IPrivilege;
> -import com.visural.wicket.security.ISecureEnableInstance;
> -import com.visural.wicket.security.ISecureRenderInstance;
>  import org.apache.wicket.Component;
>  import org.apache.wicket.markup.html.basic.Label;
>  import org.apache.wicket.markup.html.form.AbstractChoice;
> @@ -35,19 +32,19 @@
>  import org.apache.wicket.model.Model;
>
>  /**
> - * A wrapper for a FormComponent which replaces the component with a Label
> - * when the wrapped control is in "view mode".
> - *
> + * A wrapper for a FormComponent which replaces the component with a Label
> when
> + * the wrapped control is in "view mode".
> + *
>   * Apply to a containing DOM element, e.g. `<span></span>` or
> `<div></div>`
>   *
>   * The component you provide to the constructor must be given as ID
> matching
>   * `ViewOrEdit.COMP_ID`.
> - *
> + *
>   * The idea is to allow the rendering of web-like modern applications
> where
>   * non-editable elements are represented in text form, using the same
> wicket
>   * page / form implementation.
> - *
> - * What is "view mode" for a given component is determined by the method
> + *
> + * What is "view mode" for a given component is determined by the method
>   * `isViewMode()`. The default implementation of this method uses the
> component
>   * and its form's `isEnabled()` state to determine view or edit.
>   *
> @@ -59,194 +56,194 @@
>   * apply to form elements wrapped in a `ViewOrEdit` container. Just name
> your
>   * `ViewOrEdit` element as per the property you wish to apply to the child
>   * control.
> - *
> + *
>   * @version $Id$
>   * @author Richard Nichols
>   */
> -public class ViewOrEdit extends FormComponentPanel implements
> ISecureRenderInstance, ISecureEnableInstance {
> -    private static final long serialVersionUID = 1L;
> -    /**
> -     * This is the id of the component to be contained within the
> ViewOrEdit container.
> -     * Any component provided to the ViewOrEdit component should be
> identified as ViewOrEdit.COMP_ID
> -     */
> -    public final static String COMP_ID = "component";
> +public class ViewOrEdit<T> extends FormComponentPanel<T> {
> + private static final long serialVersionUID = 1L;
> + /**
> + * This is the id of the component to be contained within the ViewOrEdit
> + * container. Any component provided to the ViewOrEdit component should
> be
> + * identified as ViewOrEdit.COMP_ID
> + */
> + public final static String COMP_ID = "component";
>
> -    private final FormComponent component;
> -    private Label label;
> + private final FormComponent<T> component;
> + private Label label;
>
> -    public ViewOrEdit(String id, FormComponent component) {
> -        this(id, component, null, null);
> -    }
> + public ViewOrEdit(String id, FormComponent<T> component) {
> + this(id, component, null, null);
> + }
>
> -    public ViewOrEdit(String id, FormComponent component, IModel
> labelModel) {
> -        this(id, component, labelModel, null);
> -    }
> + public ViewOrEdit(String id, FormComponent<T> component,
> + IModel<T> labelModel) {
> + this(id, component, labelModel, null);
> + }
>
> -    public ViewOrEdit(String id, FormComponent component,
> ComponentModelToLabel componentModelToLabel) {
> -        this(id, component, null, componentModelToLabel);
> -    }
> + public ViewOrEdit(String id, FormComponent<T> component,
> + ComponentModelToLabel<T> componentModelToLabel) {
> + this(id, component, null, componentModelToLabel);
> + }
>
> -    protected ViewOrEdit(final String id, final FormComponent component,
> IModel labelModel, final ComponentModelToLabel componentModelToLabel) {
> -        super(id);
> -        this.component = component;
> -
> -        if (labelModel == null && componentModelToLabel != null) {
> -            labelModel = new AbstractReadOnlyModel() {
> + protected ViewOrEdit(final String id, final FormComponent<T> component,
> + IModel labelModel,
> + final ComponentModelToLabel<T> componentModelToLabel) {
> + super(id);
> + this.component = component;
>
> -                private final ComponentModelToLabel converter =
> componentModelToLabel;
> + if (labelModel == null && componentModelToLabel != null) {
> + labelModel = new AbstractReadOnlyModel<String>() {
>
> -                @Override
> -                public Object getObject() {
> -                    return
> converter.convertToLabel(component.getModelObject());
> -                }
> -            };
> -        }
> + private final ComponentModelToLabel<T> converter =
> componentModelToLabel;
>
> -        if (component == null || !component.getId().equals(COMP_ID)) {
> -            throw new IllegalArgumentException("The component provided to
> LabelOnViewOnly(...) must have the id \"" + COMP_ID + "\"");
> -        }
> + @Override
> + public String getObject() {
> + return converter.convertToLabel(component.getModelObject());
> + }
> + };
> + }
>
> -        Fragment f = resolveComponentFragment(labelModel);
> -        if (f == null) {
> -            throw new UnsupportedOperationException("No view mode fragment
> for component of type " + component.getClass().getName());
> -        }
> -        add(f);
> -    }
> + if (component == null || !component.getId().equals(COMP_ID)) {
> + throw new IllegalArgumentException(
> + "The component provided to LabelOnViewOnly(...) must have the id \""
> + + COMP_ID + "\"");
> + }
>
> -    /**
> -     * Provide support for using CompountPropertyModel or similar on form
> -     * and having that property model chain to the form component being
> wrapped
> -     * in a ViewOrEdit.
> -     *
> -     * @return
> -     */
> -    @Override
> -    protected IModel<?> initModel() {
> -        final IModel parentModel = super.initModel();
> -        if (parentModel != null && parentModel instanceof IWrapModel) {
> -            // we want to set this model to wrap the form component
> -            return new WrappedParentModel((IWrapModel)parentModel);
> -        }
> -        // we do this in case there is no parent model to avoid
> -        // "Attempt to set model object on null model of component" errors
> -        return new Model();
> -    }
> + Fragment f = resolveComponentFragment(labelModel);
> + // f.setVisible(false);
> + if (f == null) {
> + throw new UnsupportedOperationException(
> + "No view mode fragment for component of type "
> + + component.getClass().getName());
> + }
> + add(f);
> + }
>
> -    @Override
> -    protected void convertInput() {
> -        // this forces a call to initModel()
> -        getDefaultModel();
> -    }
> + /**
> + * Provide support for using CompountPropertyModel or similar on form and
> + * having that property model chain to the form component being wrapped
> in a
> + * ViewOrEdit.
> + *
> + * @return
> + */
> + @Override
> + protected IModel<?> initModel() {
> + final IModel parentModel = super.initModel();
> + if (parentModel != null && parentModel instanceof IWrapModel) {
> + // we want to set this model to wrap the form component
> + return new WrappedParentModel((IWrapModel<T>) parentModel);
> + }
> + // we do this in case there is no parent model to avoid
> + // "Attempt to set model object on null model of component" errors
> + return new Model();
> + }
>
> -    /**
> -     * Determine whether the component is in view mode or not.
> -     *
> -     * By default, the implementation will assume view mode when this
> component
> -     * is not enabled or the form component is not enabled or the form
> itself
> -     * is not enabled, however this behaviour may be overriden as req'd.
> -     *
> -     * @return
> -     */
> -    public boolean isViewMode() {
> -        return !this.isEnabled() || !component.isEnabled() ||
> !component.getForm().isEnabled();
> -    }
> + @Override
> + protected void convertInput() {
> + // this forces a call to initModel()
> + getDefaultModel();
> + }
>
> -    @Override
> -    protected void onBeforeRender() {
> -        // this forces a call to initModel()
> -        getDefaultModel();
> -        // now proceed as normal
> -        super.onBeforeRender();
> -        boolean isView = this.isViewMode();
> -        label.setVisible(isView);
> -        component.setVisible(!isView);
> -    }
> + /**
> + * Determine whether the component is in view mode or not.
> + *
> + * By default, the implementation will assume view mode when this
> component
> + * is not enabled or the form component is not enabled or the form itself
> is
> + * not enabled, however this behaviour may be overriden as req'd.
> + *
> + * @return
> + */
> + public boolean isViewMode() {
> + return !this.isEnabled() || !component.isEnabled()
> + || !component.getForm().isEnabled();
> + }
>
> -    private Fragment resolveComponentFragment(IModel labelModel) {
> -        if (labelModel == null) {
> -            // TODO: rather than doing this, maybe lookup converter?
> -            labelModel = new IModel() {
> + @Override
> + protected void onBeforeRender() {
> + // this forces a call to initModel()
> + getDefaultModel();
> + // now proceed as normal
> + super.onBeforeRender();
>
> -                public Object getObject() {
> -                    return (component.getModelObject() == null ? null :
> component.getModelObject().toString());
> -                }
> + boolean isView = this.isViewMode();
> + label.setVisible(isView);
> + component.setVisible(!isView);
> + }
>
> -                public void setObject(Object arg0) {
> -                }
> + private Fragment resolveComponentFragment(IModel<String> labelModel) {
> + if (labelModel == null) {
> + // TODO: rather than doing this, maybe lookup converter?
> + labelModel = new AbstractReadOnlyModel<String>() {
> + public String getObject() {
> + return (component.getModelObject() == null ? null
> + : component.getModelObject().toString());
> + }
>
> -                public void detach() {
> -                }
> -            };
> -        }
> -        label = new Label("viewLabel", labelModel);
> -        label.setEscapeModelStrings(isEscapeLabelModelStrings());
> -        if (TextField.class.isAssignableFrom(component.getClass())) {
> -            Fragment f = new Fragment("controlPair", "textfield", this);
> -            f.add(label);
> -            f.add(component);
> -            return f;
> -        }
> -        if (CheckBox.class.isAssignableFrom(component.getClass())) {
> -            Fragment f = new Fragment("controlPair", "checkbox", this);
> -            f.add(label);
> -            f.add(component);
> -            return f;
> -        }
> -        if (TextArea.class.isAssignableFrom(component.getClass())) {
> -            Fragment f = new Fragment("controlPair", "textarea", this);
> -            f.add(label);
> -            f.add(component);
> -            return f;
> -        }
> -        if (AbstractChoice.class.isAssignableFrom(component.getClass())) {
> -            Fragment f = new Fragment("controlPair", "choice", this);
> -            f.add(label);
> -            f.add(component);
> -            return f;
> -        }
> -        return null;
> -    }
> + };
> + }
>
> -    public FormComponent getComponent() {
> -        return component;
> -    }
> + label = new Label("viewLabel", labelModel);
> + label.setEscapeModelStrings(isEscapeLabelModelStrings());
> + if (TextField.class.isAssignableFrom(component.getClass())) {
> + Fragment f = new Fragment("controlPair", "textfield", this);
> + f.add(label);
> + f.add(component);
> + return f;
> + }
> + if (CheckBox.class.isAssignableFrom(component.getClass())) {
> + Fragment f = new Fragment("controlPair", "checkbox", this);
> + f.add(label);
> + f.add(component);
> + return f;
> + }
> + if (TextArea.class.isAssignableFrom(component.getClass())) {
> + Fragment f = new Fragment("controlPair", "textarea", this);
> + f.add(label);
> + f.add(component);
> + return f;
> + }
> + if (AbstractChoice.class.isAssignableFrom(component.getClass())) {
> + Fragment f = new Fragment("controlPair", "choice", this);
> + f.add(label);
> + f.add(component);
> + return f;
> + }
> + return null;
> + }
>
> -    public boolean isEscapeLabelModelStrings() {
> -        return false;
> -    }
> + public FormComponent<T> getComponent() {
> + return component;
> + }
>
> -    class WrappedParentModel implements IComponentInheritedModel {
> -        private final IWrapModel realParent;
> + public boolean isEscapeLabelModelStrings() {
> + return false;
> + }
>
> -        public WrappedParentModel(IWrapModel realParent) {
> -            this.realParent = realParent;
> -        }
> + class WrappedParentModel implements IComponentInheritedModel {
> + private final IWrapModel realParent;
>
> -        public IWrapModel wrapOnInheritance(Component arg0) {
> -            if (arg0 == ViewOrEdit.this.component) {
> -                return realParent;
> -            } else {
> -                return null;
> -            }
> -        }
> + public WrappedParentModel(IWrapModel realParent) {
> + this.realParent = realParent;
> + }
>
> -        public Object getObject() {
> -            return null;
> -        }
> + public IWrapModel wrapOnInheritance(Component arg0) {
> + if (arg0 == ViewOrEdit.this.component) {
> + return realParent;
> + } else {
> + return null;
> + }
> + }
>
> -        public void setObject(Object arg0) {
> -        }
> + public Object getObject() {
> + return null;
> + }
>
> -        public void detach() {
> -        }
> -    }
> + public void setObject(Object arg0) {
> + }
>
> -    public IPrivilege getRenderPrivilege() {
> -        return IPrivilege.NULL;
> -    }
> + public void detach() {
> + }
> + }
>
> -    public IPrivilege getEnablePrivilege() {
> -        return IPrivilege.NULL;
> -    }
> -
> -}
> +}
> \ No newline at end of file
>
>
> 2011/3/10 nino martinez wael <ni...@gmail.com>
>
> Ok I've given it a run.. And are having problems :(
>>
>> It still does'nt seem like ViewOrEdit honors the fact that it is either
>> ViewOrEdit.
>> So it either looks like:
>> http://img826.imageshack.us/i/greenshot20110310111030.png/
>> Or
>> http://img689.imageshack.us/i/greenshot20110310111207.png/
>>
>> If I try to run the examples I get and error:
>> http://img833.imageshack.us/i/greenshot20110310111126.png/
>>
>>
>> Also I had to add the servlet api inorder to run the ant build, as well as
>> putting the jar files besides the other wicket dependencies.
>>
>> Index: branches/1.5/visural-wicket-examples/lib/nblibraries.properties
>> ===================================================================
>> --- branches/1.5/visural-wicket-examples/lib/nblibraries.properties (revision
>> 266)
>> +++ branches/1.5/visural-wicket-examples/lib/nblibraries.properties (working
>> copy)
>> @@ -20,6 +20,7 @@
>>  libs.visural-wicket.src=\
>>      ${base}/visural-wicket/visural-wicket-0.5-sources.jar
>>  libs.Wicket.classpath=\
>> + ${base}/Wicket/servlet-api-2.5-20081211.jar;\
>>      ${base}/Wicket/slf4j-api-1.4.2.jar;\
>>      ${base}/Wicket/slf4j-jdk14-1.4.2.jar;\
>>      ${base}/Wicket/wicket-core-1.5-rc2.jar;\
>>
>>
>>
>>
>>
>> 2011/3/9 nino martinez wael <ni...@gmail.com>
>>
>> Thanks. I'll give feedback if needed
>>> On Mar 9, 2011 4:22 AM, "Richard Nichols" <rn...@visural.com> wrote:
>>> > I've committed what appears to be a mostly working visural-wicket with
>>> 1.5
>>> > (rc2) compatibility.
>>> >
>>> >
>>> http://code.google.com/p/visural-wicket/source/browse/#svn%2Fbranches%2F1.5
>>> >
>>> > If there are any issues found, please report them at
>>> > http://code.google.com/p/visural-wicket/
>>> >
>>> > cheers,
>>> > Richard.
>>> >
>>> > On Wed, Mar 9, 2011 at 4:30 AM, nino martinez wael <
>>> > nino.martinez.wael@gmail.com> wrote:
>>> >
>>> >> ok great.. I'll probably take at look at it monday then..
>>> >>
>>> >> 2011/3/8 Richard Nichols <rn...@visural.com>
>>> >>
>>> >> > Hi Nino,
>>> >> >
>>> >> > The version in the public respository 1.5 branch is still a direct
>>> copy
>>> >> of
>>> >> > 1.4 - sorry I haven't commited the WIP 1.5 changes yet.
>>> >> >
>>> >> > I'll aim to get the WIP committed in this week.
>>> >> >
>>> >> > cheers,
>>> >> > Richard.
>>> >> >
>>> >> > On Mon, Mar 7, 2011 at 6:47 PM, nino martinez wael <
>>> >> > nino.martinez.wael@gmail.com> wrote:
>>> >> >
>>> >> > > Strange it compiles well, but does not work as wanted.. Any idea
>>> on
>>> >> which
>>> >> > > parts are causing the problems? On my dropdowns the dropdowns are
>>> >> empty,
>>> >> > > and in my textfields both the text and the span are added if in
>>> view
>>> >> > mode,
>>> >> > > and if not 2 textfields are added.
>>> >> > >
>>> >> > > 2011/3/5 Richard Nichols <rn...@richardnichols.net>
>>> >> > >
>>> >> > > > I've created a 1.5 branch and it's in the works. 1.5 broke more
>>> stuff
>>> >> > > > than expected :)
>>> >> > > >
>>> >> > > > Hopefully I can have a beta 1.5 branch functional within a few
>>> weeks
>>> >> > > >
>>> >> > > > Sent from my iPhone
>>> >> > > >
>>> >> > > > On 05/03/2011, at 6:15 AM, nino martinez wael
>>> >> > > > <ni...@gmail.com> wrote:
>>> >> > > >
>>> >> > > > > So does has anybody run it on wicket 1.5, or is there
>>> something in
>>> >> > the
>>> >> > > > works
>>> >> > > > > for it?
>>> >> > > > >
>>> >> > > > > regards Nino
>>> >> > > >
>>> >> > > >
>>> ---------------------------------------------------------------------
>>> >> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> >> > > > For additional commands, e-mail: users-help@wicket.apache.org
>>> >> > > >
>>> >> > > >
>>> >> > >
>>> >> >
>>> >> >
>>> >> >
>>> >> > --
>>> >> > Richard Nichols
>>> >> > http://www.richardnichols.net/ :: http://onmydoorstep.com.au/
>>> >> >
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > Richard Nichols
>>> > http://www.richardnichols.net/ :: http://onmydoorstep.com.au/
>>>
>>
>>
>

Re: Wicket in Action: problem with redirection

Posted by Martin Grigorov <mg...@apache.org>.
Better check the behavior with the quickstart with Wicket 1.4.16
1.5-M3 may had a bug.

On Fri, Mar 18, 2011 at 8:50 PM, Jim Pinkham <pi...@gmail.com> wrote:

> Martin,
>
> Thanks, no I hadn't seen that... but now I think this is just because I
> over-simplified the quickstart - it still doesn't explain why it was
> working
> properly up thru 1.5-M3   (using examples from wicket-auth-roles to have
> login link hander throw this restart exception, so if that's not a bug, I
> must be missing something else...
>
> So I've got my kludge fix for now, and it works in both the quickstart and
> my own app, so it'll get me along for a while..  I'm happy to assist
> further
> but feeling a bit past my level of experience.
>
> Thanks,
> -- Jim.
>
> On Fri, Mar 18, 2011 at 3:41 PM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
>
> > On Fri, Mar 18, 2011 at 8:39 PM, Jim Pinkham <pi...@gmail.com> wrote:
> >
> > > .. and I also attached a fairly ugly patched version of
> > >
> > > RestartResponseAtInterceptPageException
> > >
> > >  that seem to work for me, but use at your own risk.
> > >
> > > Did you see Igor's response ?
> >
> >
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: Wicket in Action: problem with redirection

Posted by Jim Pinkham <pi...@gmail.com>.
Martin,

Thanks, no I hadn't seen that... but now I think this is just because I
over-simplified the quickstart - it still doesn't explain why it was working
properly up thru 1.5-M3   (using examples from wicket-auth-roles to have
login link hander throw this restart exception, so if that's not a bug, I
must be missing something else...

So I've got my kludge fix for now, and it works in both the quickstart and
my own app, so it'll get me along for a while..  I'm happy to assist further
but feeling a bit past my level of experience.

Thanks,
-- Jim.

On Fri, Mar 18, 2011 at 3:41 PM, Martin Grigorov <mg...@apache.org>wrote:

> On Fri, Mar 18, 2011 at 8:39 PM, Jim Pinkham <pi...@gmail.com> wrote:
>
> > .. and I also attached a fairly ugly patched version of
> >
> > RestartResponseAtInterceptPageException
> >
> >  that seem to work for me, but use at your own risk.
> >
> > Did you see Igor's response ?
>
>

Re: Wicket in Action: problem with redirection

Posted by Martin Grigorov <mg...@apache.org>.
On Fri, Mar 18, 2011 at 8:39 PM, Jim Pinkham <pi...@gmail.com> wrote:

> .. and I also attached a fairly ugly patched version of
>
> RestartResponseAtInterceptPageException
>
>  that seem to work for me, but use at your own risk.
>
> Did you see Igor's response ?


> Hope this helps,
> -- Jim.
>
>
> On Thu, Mar 17, 2011 at 11:12 AM, Jim Pinkham <pi...@gmail.com> wrote:
>
>> OK, I just attached a quickstart (my first) - hope it helps with
>> resolution (soon).
>>
>>
>> On Wed, Mar 16, 2011 at 5:03 PM, Martin Grigorov <mg...@apache.org>wrote:
>>
>>> Thanks Jim,
>>>
>>> But without a quickstart it is hard to debug it.
>>> There is a ticket which sounds to be related to what you described:
>>> https://issues.apache.org/jira/browse/WICKET-3493
>>>
>>> On Wed, Mar 16, 2011 at 9:54 PM, Jim Pinkham <pi...@gmail.com> wrote:
>>>
>>> > FYI - rc2 still has this problem.  It works OK on a
>>>  BookmarkablePageLink
>>> > to
>>> > a page that implement IAuthorizationStrategy, but not on the new
>>> > Link<MyLoginPage> on a panel on my home page.  After login is complete,
>>> the
>>> > link is hidden and replaced with a logout link, so the user gets an
>>> > AccessDenied page after login as they try to 'restart the response' to
>>> the
>>> > (wrong) onClick handler url for the now-invisible login link.
>>> >
>>> > Not sure when I'll get to making quickstart, but I thought I'd give at
>>> > least
>>> > this brief info for now.
>>> > Thanks,
>>> > -- Jim.
>>> >
>>> > On Wed, Mar 16, 2011 at 5:01 AM, Martin Grigorov <mgrigorov@apache.org
>>> > >wrote:
>>> >
>>> > > Try with RC2 and if it still fails please create a ticket with a
>>> > quickstart
>>> > >
>>> > > On Tue, Mar 15, 2011 at 11:27 PM, Jim Pinkham <pi...@gmail.com>
>>> > wrote:
>>> > >
>>> > > > I think I've got the same situation happening.
>>> > > >
>>> > > > It's a login link on my home page, whose onClick
>>> > > > uses the usual:
>>> > > >                throw new RestartResponseAtInterceptPageException(
>>> > > >                    AuctionApplication.get().getSignInPageClass());
>>> > > >
>>> > > > I've stepped thru this a bit, and I find a problematic point in:
>>> > > > RestartResponseAtInterceptPageException.InterceptData.set() where
>>> it
>>> > > > captures what I think is supposed to be the home page url, which it
>>> is
>>> > > > saving as follows:
>>> > > > ...
>>> > > >            data.originalUrl = request.getOriginalUrl();
>>> > > >
>>> > > > However, in my debugger, this is instead the Url of the link:
>>> > > >
>>> > > >
>>> > >
>>> >
>>> http://localhost:8080/myapp/wicket/page?0-1.ILinkListener-userPanel-signIn
>>> > > >
>>> > > > If I manually change it in the debugger to just my home page Url,
>>> it
>>> > > seems
>>> > > > to work fine.
>>> > > >
>>> > > > This was working last for me in 1.5-M3, and now in 1.5-RC1 it
>>> appears
>>> > to
>>> > > > have broken.
>>> > > >
>>> > > > Hope this helps narrow the search...
>>> > > >
>>> > > > Thanks,
>>> > > > -- Jim.
>>> > > >
>>> > > > On Thu, Mar 10, 2011 at 1:50 PM, Jeremy Thomerson <
>>> > > > jeremy@wickettraining.com
>>> > > > > wrote:
>>> > > >
>>> > > > > On Thu, Mar 10, 2011 at 12:36 PM, Jim Goodwin <
>>> sophinken@comcast.net
>>> > >
>>> > > > > wrote:
>>> > > > >
>>> > > > > > I'm a Wicket newbie, working my way through /Wicket in Action.
>>> > > > > >
>>> > > > > > /I don't understand redirection too clearly yet, but there is
>>> > > > > > an example in the book which doesn't work right when I
>>> > > > > > try it and I'd like to ask if the book example code makes
>>> > > > > > sense to more experienced folks.
>>> > > > > >
>>> > > > > > Page 271 Listing 11.3 line 4: The onSubmit() method calls
>>> > > > > > !continueToOriginalDestination().
>>> > > > > >
>>> > > > >
>>> > > > > continueToOriginalDestination() lets the user continue on to the
>>> > place
>>> > > > they
>>> > > > > were going before being interrupted by the security mechanism if
>>> they
>>> > > > > aren't
>>> > > > > logged in.  i.e:
>>> > > > >
>>> > > > > user on home page
>>> > > > > user clicks "restricted page" link
>>> > > > > security strategy says "can't go there without being logged in as
>>> X",
>>> > > > > redirects user to login page
>>> > > > > user logs in, and continueToOriginalDestination() redirects to
>>> > > > "restricted
>>> > > > > page" (original dest) and returns true.
>>> > > > >
>>> > > > > another example:
>>> > > > > user clicks bookmarked link in a new tab in their browser to
>>> login
>>> > page
>>> > > > (or
>>> > > > > goes to unrestricted home page and clicks link for login page)
>>> > > > > user logs in, and continueToOriginalDestination() can't redirect
>>> them
>>> > > > > anywhere, because there is no "original destination" that was
>>> > > interrupted
>>> > > > >
>>> > > > > Page 272 Listing 11.4 , new Link(...){ ... method onClick():
>>> > > > > > throws new RestartResponseAtInterceptPageException(signInPage)
>>> > > > > >
>>> > > > >
>>> > > > > This is a way to stop processing at ANY point in your application
>>> and
>>> > > > > redirect the user to a certain page.
>>> > > > >
>>> > > > >
>>> > > > > > How is this supposed to work?
>>> > > > > >
>>> > > > > > Suppose the user is on the Home page, and the Home Page
>>> > > > > > has a UserPanel, and the user clicks on the "Sign In" link.
>>> > > > > > Then  the link itself sets an intercept to the sign-in page
>>> > > > > > (that is how the link arranges to take you there, as far as I
>>> can
>>> > > > > > understand).
>>> > > > > >
>>> > > > > > But then, when the user enters name/password and submits, and
>>> > > > > > the submit method  calls continueToOriginalDestination(), it
>>> will
>>> > > > > > always succceed, and find the "original destination" to be the
>>> > signIn
>>> > > > > > page, regardless of where it really originated (the Home Page,
>>> in
>>> > > > > > this case).
>>> > > > > >
>>> > > > >
>>> > > > > You're a bit confused by "original" and "destination".  Since the
>>> > user
>>> > > > > clicked the "signin page" link, the *destination* was the signin
>>> page
>>> > -
>>> > > > > which is unrestricted, so the continueToOriginalDestination()
>>> method
>>> > > can
>>> > > > > not
>>> > > > > redirect them anywhere, and thus returns false.  You now need to
>>> > > redirect
>>> > > > > them somewhere manually or the signin page will re-render.
>>> > > > >
>>> > > > > The *origin* was the home page - but that doesn't matter.  Don't
>>> be
>>> > > > thrown
>>> > > > > off by "original" (destination) and "origin" - which are two
>>> > different
>>> > > > > things.  :)
>>> > > > >
>>> > > > > For a while my code was working like that: Signing in worked,
>>> > > > > > i.e. it did sign you in, but you were returned to a blank
>>> sign-in
>>> > > page.
>>> > > > > > (My code doesn't work like that just this minute, but that is
>>> only
>>> > > > > > because I've been enhancing it with other bugs.)
>>> > > > > >
>>> > > > > > Can anyone explain how the book-example is supposed to work?
>>> > > > > >
>>> > > > > > Thanks
>>> > > > > > Jim
>>> > > > > >
>>> > > > >
>>> > > > >
>>> > > > > --
>>> > > > > Jeremy Thomerson
>>> > > > > http://wickettraining.com
>>> > > > > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>>> > > > >
>>> > > >
>>> > >
>>> > >
>>> > >
>>> > > --
>>> > > Martin Grigorov
>>> > > jWeekend
>>> > > Training, Consulting, Development
>>> > > http://jWeekend.com <http://jweekend.com/>
>>> > >
>>> >
>>>
>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.com <http://jweekend.com/>
>>>
>>
>>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: Wicket in Action: problem with redirection

Posted by Jim Pinkham <pi...@gmail.com>.
OK, I just attached a quickstart (my first) - hope it helps with resolution
(soon).

On Wed, Mar 16, 2011 at 5:03 PM, Martin Grigorov <mg...@apache.org>wrote:

> Thanks Jim,
>
> But without a quickstart it is hard to debug it.
> There is a ticket which sounds to be related to what you described:
> https://issues.apache.org/jira/browse/WICKET-3493
>
> On Wed, Mar 16, 2011 at 9:54 PM, Jim Pinkham <pi...@gmail.com> wrote:
>
> > FYI - rc2 still has this problem.  It works OK on a  BookmarkablePageLink
> > to
> > a page that implement IAuthorizationStrategy, but not on the new
> > Link<MyLoginPage> on a panel on my home page.  After login is complete,
> the
> > link is hidden and replaced with a logout link, so the user gets an
> > AccessDenied page after login as they try to 'restart the response' to
> the
> > (wrong) onClick handler url for the now-invisible login link.
> >
> > Not sure when I'll get to making quickstart, but I thought I'd give at
> > least
> > this brief info for now.
> > Thanks,
> > -- Jim.
> >
> > On Wed, Mar 16, 2011 at 5:01 AM, Martin Grigorov <mgrigorov@apache.org
> > >wrote:
> >
> > > Try with RC2 and if it still fails please create a ticket with a
> > quickstart
> > >
> > > On Tue, Mar 15, 2011 at 11:27 PM, Jim Pinkham <pi...@gmail.com>
> > wrote:
> > >
> > > > I think I've got the same situation happening.
> > > >
> > > > It's a login link on my home page, whose onClick
> > > > uses the usual:
> > > >                throw new RestartResponseAtInterceptPageException(
> > > >                    AuctionApplication.get().getSignInPageClass());
> > > >
> > > > I've stepped thru this a bit, and I find a problematic point in:
> > > > RestartResponseAtInterceptPageException.InterceptData.set() where it
> > > > captures what I think is supposed to be the home page url, which it
> is
> > > > saving as follows:
> > > > ...
> > > >            data.originalUrl = request.getOriginalUrl();
> > > >
> > > > However, in my debugger, this is instead the Url of the link:
> > > >
> > > >
> > >
> >
> http://localhost:8080/myapp/wicket/page?0-1.ILinkListener-userPanel-signIn
> > > >
> > > > If I manually change it in the debugger to just my home page Url, it
> > > seems
> > > > to work fine.
> > > >
> > > > This was working last for me in 1.5-M3, and now in 1.5-RC1 it appears
> > to
> > > > have broken.
> > > >
> > > > Hope this helps narrow the search...
> > > >
> > > > Thanks,
> > > > -- Jim.
> > > >
> > > > On Thu, Mar 10, 2011 at 1:50 PM, Jeremy Thomerson <
> > > > jeremy@wickettraining.com
> > > > > wrote:
> > > >
> > > > > On Thu, Mar 10, 2011 at 12:36 PM, Jim Goodwin <
> sophinken@comcast.net
> > >
> > > > > wrote:
> > > > >
> > > > > > I'm a Wicket newbie, working my way through /Wicket in Action.
> > > > > >
> > > > > > /I don't understand redirection too clearly yet, but there is
> > > > > > an example in the book which doesn't work right when I
> > > > > > try it and I'd like to ask if the book example code makes
> > > > > > sense to more experienced folks.
> > > > > >
> > > > > > Page 271 Listing 11.3 line 4: The onSubmit() method calls
> > > > > > !continueToOriginalDestination().
> > > > > >
> > > > >
> > > > > continueToOriginalDestination() lets the user continue on to the
> > place
> > > > they
> > > > > were going before being interrupted by the security mechanism if
> they
> > > > > aren't
> > > > > logged in.  i.e:
> > > > >
> > > > > user on home page
> > > > > user clicks "restricted page" link
> > > > > security strategy says "can't go there without being logged in as
> X",
> > > > > redirects user to login page
> > > > > user logs in, and continueToOriginalDestination() redirects to
> > > > "restricted
> > > > > page" (original dest) and returns true.
> > > > >
> > > > > another example:
> > > > > user clicks bookmarked link in a new tab in their browser to login
> > page
> > > > (or
> > > > > goes to unrestricted home page and clicks link for login page)
> > > > > user logs in, and continueToOriginalDestination() can't redirect
> them
> > > > > anywhere, because there is no "original destination" that was
> > > interrupted
> > > > >
> > > > > Page 272 Listing 11.4 , new Link(...){ ... method onClick():
> > > > > > throws new RestartResponseAtInterceptPageException(signInPage)
> > > > > >
> > > > >
> > > > > This is a way to stop processing at ANY point in your application
> and
> > > > > redirect the user to a certain page.
> > > > >
> > > > >
> > > > > > How is this supposed to work?
> > > > > >
> > > > > > Suppose the user is on the Home page, and the Home Page
> > > > > > has a UserPanel, and the user clicks on the "Sign In" link.
> > > > > > Then  the link itself sets an intercept to the sign-in page
> > > > > > (that is how the link arranges to take you there, as far as I can
> > > > > > understand).
> > > > > >
> > > > > > But then, when the user enters name/password and submits, and
> > > > > > the submit method  calls continueToOriginalDestination(), it will
> > > > > > always succceed, and find the "original destination" to be the
> > signIn
> > > > > > page, regardless of where it really originated (the Home Page, in
> > > > > > this case).
> > > > > >
> > > > >
> > > > > You're a bit confused by "original" and "destination".  Since the
> > user
> > > > > clicked the "signin page" link, the *destination* was the signin
> page
> > -
> > > > > which is unrestricted, so the continueToOriginalDestination()
> method
> > > can
> > > > > not
> > > > > redirect them anywhere, and thus returns false.  You now need to
> > > redirect
> > > > > them somewhere manually or the signin page will re-render.
> > > > >
> > > > > The *origin* was the home page - but that doesn't matter.  Don't be
> > > > thrown
> > > > > off by "original" (destination) and "origin" - which are two
> > different
> > > > > things.  :)
> > > > >
> > > > > For a while my code was working like that: Signing in worked,
> > > > > > i.e. it did sign you in, but you were returned to a blank sign-in
> > > page.
> > > > > > (My code doesn't work like that just this minute, but that is
> only
> > > > > > because I've been enhancing it with other bugs.)
> > > > > >
> > > > > > Can anyone explain how the book-example is supposed to work?
> > > > > >
> > > > > > Thanks
> > > > > > Jim
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Jeremy Thomerson
> > > > > http://wickettraining.com
> > > > > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Martin Grigorov
> > > jWeekend
> > > Training, Consulting, Development
> > > http://jWeekend.com <http://jweekend.com/>
> > >
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com <http://jweekend.com/>
>

Re: Wicket in Action: problem with redirection

Posted by Martin Grigorov <mg...@apache.org>.
Thanks Jim,

But without a quickstart it is hard to debug it.
There is a ticket which sounds to be related to what you described:
https://issues.apache.org/jira/browse/WICKET-3493

On Wed, Mar 16, 2011 at 9:54 PM, Jim Pinkham <pi...@gmail.com> wrote:

> FYI - rc2 still has this problem.  It works OK on a  BookmarkablePageLink
> to
> a page that implement IAuthorizationStrategy, but not on the new
> Link<MyLoginPage> on a panel on my home page.  After login is complete, the
> link is hidden and replaced with a logout link, so the user gets an
> AccessDenied page after login as they try to 'restart the response' to the
> (wrong) onClick handler url for the now-invisible login link.
>
> Not sure when I'll get to making quickstart, but I thought I'd give at
> least
> this brief info for now.
> Thanks,
> -- Jim.
>
> On Wed, Mar 16, 2011 at 5:01 AM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
>
> > Try with RC2 and if it still fails please create a ticket with a
> quickstart
> >
> > On Tue, Mar 15, 2011 at 11:27 PM, Jim Pinkham <pi...@gmail.com>
> wrote:
> >
> > > I think I've got the same situation happening.
> > >
> > > It's a login link on my home page, whose onClick
> > > uses the usual:
> > >                throw new RestartResponseAtInterceptPageException(
> > >                    AuctionApplication.get().getSignInPageClass());
> > >
> > > I've stepped thru this a bit, and I find a problematic point in:
> > > RestartResponseAtInterceptPageException.InterceptData.set() where it
> > > captures what I think is supposed to be the home page url, which it is
> > > saving as follows:
> > > ...
> > >            data.originalUrl = request.getOriginalUrl();
> > >
> > > However, in my debugger, this is instead the Url of the link:
> > >
> > >
> >
> http://localhost:8080/myapp/wicket/page?0-1.ILinkListener-userPanel-signIn
> > >
> > > If I manually change it in the debugger to just my home page Url, it
> > seems
> > > to work fine.
> > >
> > > This was working last for me in 1.5-M3, and now in 1.5-RC1 it appears
> to
> > > have broken.
> > >
> > > Hope this helps narrow the search...
> > >
> > > Thanks,
> > > -- Jim.
> > >
> > > On Thu, Mar 10, 2011 at 1:50 PM, Jeremy Thomerson <
> > > jeremy@wickettraining.com
> > > > wrote:
> > >
> > > > On Thu, Mar 10, 2011 at 12:36 PM, Jim Goodwin <sophinken@comcast.net
> >
> > > > wrote:
> > > >
> > > > > I'm a Wicket newbie, working my way through /Wicket in Action.
> > > > >
> > > > > /I don't understand redirection too clearly yet, but there is
> > > > > an example in the book which doesn't work right when I
> > > > > try it and I'd like to ask if the book example code makes
> > > > > sense to more experienced folks.
> > > > >
> > > > > Page 271 Listing 11.3 line 4: The onSubmit() method calls
> > > > > !continueToOriginalDestination().
> > > > >
> > > >
> > > > continueToOriginalDestination() lets the user continue on to the
> place
> > > they
> > > > were going before being interrupted by the security mechanism if they
> > > > aren't
> > > > logged in.  i.e:
> > > >
> > > > user on home page
> > > > user clicks "restricted page" link
> > > > security strategy says "can't go there without being logged in as X",
> > > > redirects user to login page
> > > > user logs in, and continueToOriginalDestination() redirects to
> > > "restricted
> > > > page" (original dest) and returns true.
> > > >
> > > > another example:
> > > > user clicks bookmarked link in a new tab in their browser to login
> page
> > > (or
> > > > goes to unrestricted home page and clicks link for login page)
> > > > user logs in, and continueToOriginalDestination() can't redirect them
> > > > anywhere, because there is no "original destination" that was
> > interrupted
> > > >
> > > > Page 272 Listing 11.4 , new Link(...){ ... method onClick():
> > > > > throws new RestartResponseAtInterceptPageException(signInPage)
> > > > >
> > > >
> > > > This is a way to stop processing at ANY point in your application and
> > > > redirect the user to a certain page.
> > > >
> > > >
> > > > > How is this supposed to work?
> > > > >
> > > > > Suppose the user is on the Home page, and the Home Page
> > > > > has a UserPanel, and the user clicks on the "Sign In" link.
> > > > > Then  the link itself sets an intercept to the sign-in page
> > > > > (that is how the link arranges to take you there, as far as I can
> > > > > understand).
> > > > >
> > > > > But then, when the user enters name/password and submits, and
> > > > > the submit method  calls continueToOriginalDestination(), it will
> > > > > always succceed, and find the "original destination" to be the
> signIn
> > > > > page, regardless of where it really originated (the Home Page, in
> > > > > this case).
> > > > >
> > > >
> > > > You're a bit confused by "original" and "destination".  Since the
> user
> > > > clicked the "signin page" link, the *destination* was the signin page
> -
> > > > which is unrestricted, so the continueToOriginalDestination() method
> > can
> > > > not
> > > > redirect them anywhere, and thus returns false.  You now need to
> > redirect
> > > > them somewhere manually or the signin page will re-render.
> > > >
> > > > The *origin* was the home page - but that doesn't matter.  Don't be
> > > thrown
> > > > off by "original" (destination) and "origin" - which are two
> different
> > > > things.  :)
> > > >
> > > > For a while my code was working like that: Signing in worked,
> > > > > i.e. it did sign you in, but you were returned to a blank sign-in
> > page.
> > > > > (My code doesn't work like that just this minute, but that is only
> > > > > because I've been enhancing it with other bugs.)
> > > > >
> > > > > Can anyone explain how the book-example is supposed to work?
> > > > >
> > > > > Thanks
> > > > > Jim
> > > > >
> > > >
> > > >
> > > > --
> > > > Jeremy Thomerson
> > > > http://wickettraining.com
> > > > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> > > >
> > >
> >
> >
> >
> > --
> > Martin Grigorov
> > jWeekend
> > Training, Consulting, Development
> > http://jWeekend.com <http://jweekend.com/>
> >
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: Wicket in Action: problem with redirection

Posted by Jim Pinkham <pi...@gmail.com>.
FYI - rc2 still has this problem.  It works OK on a  BookmarkablePageLink to
a page that implement IAuthorizationStrategy, but not on the new
Link<MyLoginPage> on a panel on my home page.  After login is complete, the
link is hidden and replaced with a logout link, so the user gets an
AccessDenied page after login as they try to 'restart the response' to the
(wrong) onClick handler url for the now-invisible login link.

Not sure when I'll get to making quickstart, but I thought I'd give at least
this brief info for now.
Thanks,
-- Jim.

On Wed, Mar 16, 2011 at 5:01 AM, Martin Grigorov <mg...@apache.org>wrote:

> Try with RC2 and if it still fails please create a ticket with a quickstart
>
> On Tue, Mar 15, 2011 at 11:27 PM, Jim Pinkham <pi...@gmail.com> wrote:
>
> > I think I've got the same situation happening.
> >
> > It's a login link on my home page, whose onClick
> > uses the usual:
> >                throw new RestartResponseAtInterceptPageException(
> >                    AuctionApplication.get().getSignInPageClass());
> >
> > I've stepped thru this a bit, and I find a problematic point in:
> > RestartResponseAtInterceptPageException.InterceptData.set() where it
> > captures what I think is supposed to be the home page url, which it is
> > saving as follows:
> > ...
> >            data.originalUrl = request.getOriginalUrl();
> >
> > However, in my debugger, this is instead the Url of the link:
> >
> >
> http://localhost:8080/myapp/wicket/page?0-1.ILinkListener-userPanel-signIn
> >
> > If I manually change it in the debugger to just my home page Url, it
> seems
> > to work fine.
> >
> > This was working last for me in 1.5-M3, and now in 1.5-RC1 it appears to
> > have broken.
> >
> > Hope this helps narrow the search...
> >
> > Thanks,
> > -- Jim.
> >
> > On Thu, Mar 10, 2011 at 1:50 PM, Jeremy Thomerson <
> > jeremy@wickettraining.com
> > > wrote:
> >
> > > On Thu, Mar 10, 2011 at 12:36 PM, Jim Goodwin <so...@comcast.net>
> > > wrote:
> > >
> > > > I'm a Wicket newbie, working my way through /Wicket in Action.
> > > >
> > > > /I don't understand redirection too clearly yet, but there is
> > > > an example in the book which doesn't work right when I
> > > > try it and I'd like to ask if the book example code makes
> > > > sense to more experienced folks.
> > > >
> > > > Page 271 Listing 11.3 line 4: The onSubmit() method calls
> > > > !continueToOriginalDestination().
> > > >
> > >
> > > continueToOriginalDestination() lets the user continue on to the place
> > they
> > > were going before being interrupted by the security mechanism if they
> > > aren't
> > > logged in.  i.e:
> > >
> > > user on home page
> > > user clicks "restricted page" link
> > > security strategy says "can't go there without being logged in as X",
> > > redirects user to login page
> > > user logs in, and continueToOriginalDestination() redirects to
> > "restricted
> > > page" (original dest) and returns true.
> > >
> > > another example:
> > > user clicks bookmarked link in a new tab in their browser to login page
> > (or
> > > goes to unrestricted home page and clicks link for login page)
> > > user logs in, and continueToOriginalDestination() can't redirect them
> > > anywhere, because there is no "original destination" that was
> interrupted
> > >
> > > Page 272 Listing 11.4 , new Link(...){ ... method onClick():
> > > > throws new RestartResponseAtInterceptPageException(signInPage)
> > > >
> > >
> > > This is a way to stop processing at ANY point in your application and
> > > redirect the user to a certain page.
> > >
> > >
> > > > How is this supposed to work?
> > > >
> > > > Suppose the user is on the Home page, and the Home Page
> > > > has a UserPanel, and the user clicks on the "Sign In" link.
> > > > Then  the link itself sets an intercept to the sign-in page
> > > > (that is how the link arranges to take you there, as far as I can
> > > > understand).
> > > >
> > > > But then, when the user enters name/password and submits, and
> > > > the submit method  calls continueToOriginalDestination(), it will
> > > > always succceed, and find the "original destination" to be the signIn
> > > > page, regardless of where it really originated (the Home Page, in
> > > > this case).
> > > >
> > >
> > > You're a bit confused by "original" and "destination".  Since the user
> > > clicked the "signin page" link, the *destination* was the signin page -
> > > which is unrestricted, so the continueToOriginalDestination() method
> can
> > > not
> > > redirect them anywhere, and thus returns false.  You now need to
> redirect
> > > them somewhere manually or the signin page will re-render.
> > >
> > > The *origin* was the home page - but that doesn't matter.  Don't be
> > thrown
> > > off by "original" (destination) and "origin" - which are two different
> > > things.  :)
> > >
> > > For a while my code was working like that: Signing in worked,
> > > > i.e. it did sign you in, but you were returned to a blank sign-in
> page.
> > > > (My code doesn't work like that just this minute, but that is only
> > > > because I've been enhancing it with other bugs.)
> > > >
> > > > Can anyone explain how the book-example is supposed to work?
> > > >
> > > > Thanks
> > > > Jim
> > > >
> > >
> > >
> > > --
> > > Jeremy Thomerson
> > > http://wickettraining.com
> > > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> > >
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com <http://jweekend.com/>
>

Re: Wicket in Action: problem with redirection

Posted by Martin Grigorov <mg...@apache.org>.
Try with RC2 and if it still fails please create a ticket with a quickstart

On Tue, Mar 15, 2011 at 11:27 PM, Jim Pinkham <pi...@gmail.com> wrote:

> I think I've got the same situation happening.
>
> It's a login link on my home page, whose onClick
> uses the usual:
>                throw new RestartResponseAtInterceptPageException(
>                    AuctionApplication.get().getSignInPageClass());
>
> I've stepped thru this a bit, and I find a problematic point in:
> RestartResponseAtInterceptPageException.InterceptData.set() where it
> captures what I think is supposed to be the home page url, which it is
> saving as follows:
> ...
>            data.originalUrl = request.getOriginalUrl();
>
> However, in my debugger, this is instead the Url of the link:
>
> http://localhost:8080/myapp/wicket/page?0-1.ILinkListener-userPanel-signIn
>
> If I manually change it in the debugger to just my home page Url, it seems
> to work fine.
>
> This was working last for me in 1.5-M3, and now in 1.5-RC1 it appears to
> have broken.
>
> Hope this helps narrow the search...
>
> Thanks,
> -- Jim.
>
> On Thu, Mar 10, 2011 at 1:50 PM, Jeremy Thomerson <
> jeremy@wickettraining.com
> > wrote:
>
> > On Thu, Mar 10, 2011 at 12:36 PM, Jim Goodwin <so...@comcast.net>
> > wrote:
> >
> > > I'm a Wicket newbie, working my way through /Wicket in Action.
> > >
> > > /I don't understand redirection too clearly yet, but there is
> > > an example in the book which doesn't work right when I
> > > try it and I'd like to ask if the book example code makes
> > > sense to more experienced folks.
> > >
> > > Page 271 Listing 11.3 line 4: The onSubmit() method calls
> > > !continueToOriginalDestination().
> > >
> >
> > continueToOriginalDestination() lets the user continue on to the place
> they
> > were going before being interrupted by the security mechanism if they
> > aren't
> > logged in.  i.e:
> >
> > user on home page
> > user clicks "restricted page" link
> > security strategy says "can't go there without being logged in as X",
> > redirects user to login page
> > user logs in, and continueToOriginalDestination() redirects to
> "restricted
> > page" (original dest) and returns true.
> >
> > another example:
> > user clicks bookmarked link in a new tab in their browser to login page
> (or
> > goes to unrestricted home page and clicks link for login page)
> > user logs in, and continueToOriginalDestination() can't redirect them
> > anywhere, because there is no "original destination" that was interrupted
> >
> > Page 272 Listing 11.4 , new Link(...){ ... method onClick():
> > > throws new RestartResponseAtInterceptPageException(signInPage)
> > >
> >
> > This is a way to stop processing at ANY point in your application and
> > redirect the user to a certain page.
> >
> >
> > > How is this supposed to work?
> > >
> > > Suppose the user is on the Home page, and the Home Page
> > > has a UserPanel, and the user clicks on the "Sign In" link.
> > > Then  the link itself sets an intercept to the sign-in page
> > > (that is how the link arranges to take you there, as far as I can
> > > understand).
> > >
> > > But then, when the user enters name/password and submits, and
> > > the submit method  calls continueToOriginalDestination(), it will
> > > always succceed, and find the "original destination" to be the signIn
> > > page, regardless of where it really originated (the Home Page, in
> > > this case).
> > >
> >
> > You're a bit confused by "original" and "destination".  Since the user
> > clicked the "signin page" link, the *destination* was the signin page -
> > which is unrestricted, so the continueToOriginalDestination() method can
> > not
> > redirect them anywhere, and thus returns false.  You now need to redirect
> > them somewhere manually or the signin page will re-render.
> >
> > The *origin* was the home page - but that doesn't matter.  Don't be
> thrown
> > off by "original" (destination) and "origin" - which are two different
> > things.  :)
> >
> > For a while my code was working like that: Signing in worked,
> > > i.e. it did sign you in, but you were returned to a blank sign-in page.
> > > (My code doesn't work like that just this minute, but that is only
> > > because I've been enhancing it with other bugs.)
> > >
> > > Can anyone explain how the book-example is supposed to work?
> > >
> > > Thanks
> > > Jim
> > >
> >
> >
> > --
> > Jeremy Thomerson
> > http://wickettraining.com
> > *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
> >
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: Wicket in Action: problem with redirection

Posted by Jim Pinkham <pi...@gmail.com>.
I think I've got the same situation happening.

It's a login link on my home page, whose onClick
uses the usual:
                throw new RestartResponseAtInterceptPageException(
                    AuctionApplication.get().getSignInPageClass());

I've stepped thru this a bit, and I find a problematic point in:
RestartResponseAtInterceptPageException.InterceptData.set() where it
captures what I think is supposed to be the home page url, which it is
saving as follows:
...
            data.originalUrl = request.getOriginalUrl();

However, in my debugger, this is instead the Url of the link:

http://localhost:8080/myapp/wicket/page?0-1.ILinkListener-userPanel-signIn

If I manually change it in the debugger to just my home page Url, it seems
to work fine.

This was working last for me in 1.5-M3, and now in 1.5-RC1 it appears to
have broken.

Hope this helps narrow the search...

Thanks,
-- Jim.

On Thu, Mar 10, 2011 at 1:50 PM, Jeremy Thomerson <jeremy@wickettraining.com
> wrote:

> On Thu, Mar 10, 2011 at 12:36 PM, Jim Goodwin <so...@comcast.net>
> wrote:
>
> > I'm a Wicket newbie, working my way through /Wicket in Action.
> >
> > /I don't understand redirection too clearly yet, but there is
> > an example in the book which doesn't work right when I
> > try it and I'd like to ask if the book example code makes
> > sense to more experienced folks.
> >
> > Page 271 Listing 11.3 line 4: The onSubmit() method calls
> > !continueToOriginalDestination().
> >
>
> continueToOriginalDestination() lets the user continue on to the place they
> were going before being interrupted by the security mechanism if they
> aren't
> logged in.  i.e:
>
> user on home page
> user clicks "restricted page" link
> security strategy says "can't go there without being logged in as X",
> redirects user to login page
> user logs in, and continueToOriginalDestination() redirects to "restricted
> page" (original dest) and returns true.
>
> another example:
> user clicks bookmarked link in a new tab in their browser to login page (or
> goes to unrestricted home page and clicks link for login page)
> user logs in, and continueToOriginalDestination() can't redirect them
> anywhere, because there is no "original destination" that was interrupted
>
> Page 272 Listing 11.4 , new Link(...){ ... method onClick():
> > throws new RestartResponseAtInterceptPageException(signInPage)
> >
>
> This is a way to stop processing at ANY point in your application and
> redirect the user to a certain page.
>
>
> > How is this supposed to work?
> >
> > Suppose the user is on the Home page, and the Home Page
> > has a UserPanel, and the user clicks on the "Sign In" link.
> > Then  the link itself sets an intercept to the sign-in page
> > (that is how the link arranges to take you there, as far as I can
> > understand).
> >
> > But then, when the user enters name/password and submits, and
> > the submit method  calls continueToOriginalDestination(), it will
> > always succceed, and find the "original destination" to be the signIn
> > page, regardless of where it really originated (the Home Page, in
> > this case).
> >
>
> You're a bit confused by "original" and "destination".  Since the user
> clicked the "signin page" link, the *destination* was the signin page -
> which is unrestricted, so the continueToOriginalDestination() method can
> not
> redirect them anywhere, and thus returns false.  You now need to redirect
> them somewhere manually or the signin page will re-render.
>
> The *origin* was the home page - but that doesn't matter.  Don't be thrown
> off by "original" (destination) and "origin" - which are two different
> things.  :)
>
> For a while my code was working like that: Signing in worked,
> > i.e. it did sign you in, but you were returned to a blank sign-in page.
> > (My code doesn't work like that just this minute, but that is only
> > because I've been enhancing it with other bugs.)
> >
> > Can anyone explain how the book-example is supposed to work?
> >
> > Thanks
> > Jim
> >
>
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>

Re: Wicket in Action: problem with redirection

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Thu, Mar 10, 2011 at 12:36 PM, Jim Goodwin <so...@comcast.net> wrote:

> I'm a Wicket newbie, working my way through /Wicket in Action.
>
> /I don't understand redirection too clearly yet, but there is
> an example in the book which doesn't work right when I
> try it and I'd like to ask if the book example code makes
> sense to more experienced folks.
>
> Page 271 Listing 11.3 line 4: The onSubmit() method calls
> !continueToOriginalDestination().
>

continueToOriginalDestination() lets the user continue on to the place they
were going before being interrupted by the security mechanism if they aren't
logged in.  i.e:

user on home page
user clicks "restricted page" link
security strategy says "can't go there without being logged in as X",
redirects user to login page
user logs in, and continueToOriginalDestination() redirects to "restricted
page" (original dest) and returns true.

another example:
user clicks bookmarked link in a new tab in their browser to login page (or
goes to unrestricted home page and clicks link for login page)
user logs in, and continueToOriginalDestination() can't redirect them
anywhere, because there is no "original destination" that was interrupted

Page 272 Listing 11.4 , new Link(...){ ... method onClick():
> throws new RestartResponseAtInterceptPageException(signInPage)
>

This is a way to stop processing at ANY point in your application and
redirect the user to a certain page.


> How is this supposed to work?
>
> Suppose the user is on the Home page, and the Home Page
> has a UserPanel, and the user clicks on the "Sign In" link.
> Then  the link itself sets an intercept to the sign-in page
> (that is how the link arranges to take you there, as far as I can
> understand).
>
> But then, when the user enters name/password and submits, and
> the submit method  calls continueToOriginalDestination(), it will
> always succceed, and find the "original destination" to be the signIn
> page, regardless of where it really originated (the Home Page, in
> this case).
>

You're a bit confused by "original" and "destination".  Since the user
clicked the "signin page" link, the *destination* was the signin page -
which is unrestricted, so the continueToOriginalDestination() method can not
redirect them anywhere, and thus returns false.  You now need to redirect
them somewhere manually or the signin page will re-render.

The *origin* was the home page - but that doesn't matter.  Don't be thrown
off by "original" (destination) and "origin" - which are two different
things.  :)

For a while my code was working like that: Signing in worked,
> i.e. it did sign you in, but you were returned to a blank sign-in page.
> (My code doesn't work like that just this minute, but that is only
> because I've been enhancing it with other bugs.)
>
> Can anyone explain how the book-example is supposed to work?
>
> Thanks
> Jim
>


-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Wicket in Action: problem with redirection

Posted by Jim Goodwin <so...@comcast.net>.
I'm a Wicket newbie, working my way through /Wicket in Action.

/I don't understand redirection too clearly yet, but there is
an example in the book which doesn't work right when I
try it and I'd like to ask if the book example code makes
sense to more experienced folks.

Page 271 Listing 11.3 line 4: The onSubmit() method calls
!continueToOriginalDestination().

Page 272 Listing 11.4 , new Link(...){ ... method onClick():
throws new RestartResponseAtInterceptPageException(signInPage)

How is this supposed to work?

Suppose the user is on the Home page, and the Home Page
has a UserPanel, and the user clicks on the "Sign In" link.
Then  the link itself sets an intercept to the sign-in page
(that is how the link arranges to take you there, as far as I can
understand).

But then, when the user enters name/password and submits, and
the submit method  calls continueToOriginalDestination(), it will
always succceed, and find the "original destination" to be the signIn
page, regardless of where it really originated (the Home Page, in
this case).

For a while my code was working like that: Signing in worked,
i.e. it did sign you in, but you were returned to a blank sign-in page.
(My code doesn't work like that just this minute, but that is only
because I've been enhancing it with other bugs.)

Can anyone explain how the book-example is supposed to work?

Thanks
Jim

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


Re: visural-wicket running on wicket 1.5?

Posted by nino martinez wael <ni...@gmail.com>.
I've added generics.. Still not working though, it's as if the components
get added twice (and the fragment never gets added or something like that)




Index:
branches/1.5/visural-wicket/src/com/visural/wicket/component/viewmode/ViewOrEdit.java
===================================================================
---
branches/1.5/visural-wicket/src/com/visural/wicket/component/viewmode/ViewOrEdit.java
(revision
266)
+++
branches/1.5/visural-wicket/src/com/visural/wicket/component/viewmode/ViewOrEdit.java
(working
copy)
@@ -14,11 +14,8 @@
  *  limitations under the License.
  *  under the License.
  */
-package com.visural.wicket.component.viewmode;
+package com.netdesign.ccadmin.components.vieworedit;

-import com.visural.wicket.security.IPrivilege;
-import com.visural.wicket.security.ISecureEnableInstance;
-import com.visural.wicket.security.ISecureRenderInstance;
 import org.apache.wicket.Component;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.form.AbstractChoice;
@@ -35,19 +32,19 @@
 import org.apache.wicket.model.Model;

 /**
- * A wrapper for a FormComponent which replaces the component with a Label
- * when the wrapped control is in "view mode".
- *
+ * A wrapper for a FormComponent which replaces the component with a Label
when
+ * the wrapped control is in "view mode".
+ *
  * Apply to a containing DOM element, e.g. `<span></span>` or `<div></div>`
  *
  * The component you provide to the constructor must be given as ID
matching
  * `ViewOrEdit.COMP_ID`.
- *
+ *
  * The idea is to allow the rendering of web-like modern applications where
  * non-editable elements are represented in text form, using the same
wicket
  * page / form implementation.
- *
- * What is "view mode" for a given component is determined by the method
+ *
+ * What is "view mode" for a given component is determined by the method
  * `isViewMode()`. The default implementation of this method uses the
component
  * and its form's `isEnabled()` state to determine view or edit.
  *
@@ -59,194 +56,194 @@
  * apply to form elements wrapped in a `ViewOrEdit` container. Just name
your
  * `ViewOrEdit` element as per the property you wish to apply to the child
  * control.
- *
+ *
  * @version $Id$
  * @author Richard Nichols
  */
-public class ViewOrEdit extends FormComponentPanel implements
ISecureRenderInstance, ISecureEnableInstance {
-    private static final long serialVersionUID = 1L;
-    /**
-     * This is the id of the component to be contained within the
ViewOrEdit container.
-     * Any component provided to the ViewOrEdit component should be
identified as ViewOrEdit.COMP_ID
-     */
-    public final static String COMP_ID = "component";
+public class ViewOrEdit<T> extends FormComponentPanel<T> {
+ private static final long serialVersionUID = 1L;
+ /**
+ * This is the id of the component to be contained within the ViewOrEdit
+ * container. Any component provided to the ViewOrEdit component should be
+ * identified as ViewOrEdit.COMP_ID
+ */
+ public final static String COMP_ID = "component";

-    private final FormComponent component;
-    private Label label;
+ private final FormComponent<T> component;
+ private Label label;

-    public ViewOrEdit(String id, FormComponent component) {
-        this(id, component, null, null);
-    }
+ public ViewOrEdit(String id, FormComponent<T> component) {
+ this(id, component, null, null);
+ }

-    public ViewOrEdit(String id, FormComponent component, IModel
labelModel) {
-        this(id, component, labelModel, null);
-    }
+ public ViewOrEdit(String id, FormComponent<T> component,
+ IModel<T> labelModel) {
+ this(id, component, labelModel, null);
+ }

-    public ViewOrEdit(String id, FormComponent component,
ComponentModelToLabel componentModelToLabel) {
-        this(id, component, null, componentModelToLabel);
-    }
+ public ViewOrEdit(String id, FormComponent<T> component,
+ ComponentModelToLabel<T> componentModelToLabel) {
+ this(id, component, null, componentModelToLabel);
+ }

-    protected ViewOrEdit(final String id, final FormComponent component,
IModel labelModel, final ComponentModelToLabel componentModelToLabel) {
-        super(id);
-        this.component = component;
-
-        if (labelModel == null && componentModelToLabel != null) {
-            labelModel = new AbstractReadOnlyModel() {
+ protected ViewOrEdit(final String id, final FormComponent<T> component,
+ IModel labelModel,
+ final ComponentModelToLabel<T> componentModelToLabel) {
+ super(id);
+ this.component = component;

-                private final ComponentModelToLabel converter =
componentModelToLabel;
+ if (labelModel == null && componentModelToLabel != null) {
+ labelModel = new AbstractReadOnlyModel<String>() {

-                @Override
-                public Object getObject() {
-                    return
converter.convertToLabel(component.getModelObject());
-                }
-            };
-        }
+ private final ComponentModelToLabel<T> converter = componentModelToLabel;

-        if (component == null || !component.getId().equals(COMP_ID)) {
-            throw new IllegalArgumentException("The component provided to
LabelOnViewOnly(...) must have the id \"" + COMP_ID + "\"");
-        }
+ @Override
+ public String getObject() {
+ return converter.convertToLabel(component.getModelObject());
+ }
+ };
+ }

-        Fragment f = resolveComponentFragment(labelModel);
-        if (f == null) {
-            throw new UnsupportedOperationException("No view mode fragment
for component of type " + component.getClass().getName());
-        }
-        add(f);
-    }
+ if (component == null || !component.getId().equals(COMP_ID)) {
+ throw new IllegalArgumentException(
+ "The component provided to LabelOnViewOnly(...) must have the id \""
+ + COMP_ID + "\"");
+ }

-    /**
-     * Provide support for using CompountPropertyModel or similar on form
-     * and having that property model chain to the form component being
wrapped
-     * in a ViewOrEdit.
-     *
-     * @return
-     */
-    @Override
-    protected IModel<?> initModel() {
-        final IModel parentModel = super.initModel();
-        if (parentModel != null && parentModel instanceof IWrapModel) {
-            // we want to set this model to wrap the form component
-            return new WrappedParentModel((IWrapModel)parentModel);
-        }
-        // we do this in case there is no parent model to avoid
-        // "Attempt to set model object on null model of component" errors
-        return new Model();
-    }
+ Fragment f = resolveComponentFragment(labelModel);
+ // f.setVisible(false);
+ if (f == null) {
+ throw new UnsupportedOperationException(
+ "No view mode fragment for component of type "
+ + component.getClass().getName());
+ }
+ add(f);
+ }

-    @Override
-    protected void convertInput() {
-        // this forces a call to initModel()
-        getDefaultModel();
-    }
+ /**
+ * Provide support for using CompountPropertyModel or similar on form and
+ * having that property model chain to the form component being wrapped in
a
+ * ViewOrEdit.
+ *
+ * @return
+ */
+ @Override
+ protected IModel<?> initModel() {
+ final IModel parentModel = super.initModel();
+ if (parentModel != null && parentModel instanceof IWrapModel) {
+ // we want to set this model to wrap the form component
+ return new WrappedParentModel((IWrapModel<T>) parentModel);
+ }
+ // we do this in case there is no parent model to avoid
+ // "Attempt to set model object on null model of component" errors
+ return new Model();
+ }

-    /**
-     * Determine whether the component is in view mode or not.
-     *
-     * By default, the implementation will assume view mode when this
component
-     * is not enabled or the form component is not enabled or the form
itself
-     * is not enabled, however this behaviour may be overriden as req'd.
-     *
-     * @return
-     */
-    public boolean isViewMode() {
-        return !this.isEnabled() || !component.isEnabled() ||
!component.getForm().isEnabled();
-    }
+ @Override
+ protected void convertInput() {
+ // this forces a call to initModel()
+ getDefaultModel();
+ }

-    @Override
-    protected void onBeforeRender() {
-        // this forces a call to initModel()
-        getDefaultModel();
-        // now proceed as normal
-        super.onBeforeRender();
-        boolean isView = this.isViewMode();
-        label.setVisible(isView);
-        component.setVisible(!isView);
-    }
+ /**
+ * Determine whether the component is in view mode or not.
+ *
+ * By default, the implementation will assume view mode when this component
+ * is not enabled or the form component is not enabled or the form itself
is
+ * not enabled, however this behaviour may be overriden as req'd.
+ *
+ * @return
+ */
+ public boolean isViewMode() {
+ return !this.isEnabled() || !component.isEnabled()
+ || !component.getForm().isEnabled();
+ }

-    private Fragment resolveComponentFragment(IModel labelModel) {
-        if (labelModel == null) {
-            // TODO: rather than doing this, maybe lookup converter?
-            labelModel = new IModel() {
+ @Override
+ protected void onBeforeRender() {
+ // this forces a call to initModel()
+ getDefaultModel();
+ // now proceed as normal
+ super.onBeforeRender();

-                public Object getObject() {
-                    return (component.getModelObject() == null ? null :
component.getModelObject().toString());
-                }
+ boolean isView = this.isViewMode();
+ label.setVisible(isView);
+ component.setVisible(!isView);
+ }

-                public void setObject(Object arg0) {
-                }
+ private Fragment resolveComponentFragment(IModel<String> labelModel) {
+ if (labelModel == null) {
+ // TODO: rather than doing this, maybe lookup converter?
+ labelModel = new AbstractReadOnlyModel<String>() {
+ public String getObject() {
+ return (component.getModelObject() == null ? null
+ : component.getModelObject().toString());
+ }

-                public void detach() {
-                }
-            };
-        }
-        label = new Label("viewLabel", labelModel);
-        label.setEscapeModelStrings(isEscapeLabelModelStrings());
-        if (TextField.class.isAssignableFrom(component.getClass())) {
-            Fragment f = new Fragment("controlPair", "textfield", this);
-            f.add(label);
-            f.add(component);
-            return f;
-        }
-        if (CheckBox.class.isAssignableFrom(component.getClass())) {
-            Fragment f = new Fragment("controlPair", "checkbox", this);
-            f.add(label);
-            f.add(component);
-            return f;
-        }
-        if (TextArea.class.isAssignableFrom(component.getClass())) {
-            Fragment f = new Fragment("controlPair", "textarea", this);
-            f.add(label);
-            f.add(component);
-            return f;
-        }
-        if (AbstractChoice.class.isAssignableFrom(component.getClass())) {
-            Fragment f = new Fragment("controlPair", "choice", this);
-            f.add(label);
-            f.add(component);
-            return f;
-        }
-        return null;
-    }
+ };
+ }

-    public FormComponent getComponent() {
-        return component;
-    }
+ label = new Label("viewLabel", labelModel);
+ label.setEscapeModelStrings(isEscapeLabelModelStrings());
+ if (TextField.class.isAssignableFrom(component.getClass())) {
+ Fragment f = new Fragment("controlPair", "textfield", this);
+ f.add(label);
+ f.add(component);
+ return f;
+ }
+ if (CheckBox.class.isAssignableFrom(component.getClass())) {
+ Fragment f = new Fragment("controlPair", "checkbox", this);
+ f.add(label);
+ f.add(component);
+ return f;
+ }
+ if (TextArea.class.isAssignableFrom(component.getClass())) {
+ Fragment f = new Fragment("controlPair", "textarea", this);
+ f.add(label);
+ f.add(component);
+ return f;
+ }
+ if (AbstractChoice.class.isAssignableFrom(component.getClass())) {
+ Fragment f = new Fragment("controlPair", "choice", this);
+ f.add(label);
+ f.add(component);
+ return f;
+ }
+ return null;
+ }

-    public boolean isEscapeLabelModelStrings() {
-        return false;
-    }
+ public FormComponent<T> getComponent() {
+ return component;
+ }

-    class WrappedParentModel implements IComponentInheritedModel {
-        private final IWrapModel realParent;
+ public boolean isEscapeLabelModelStrings() {
+ return false;
+ }

-        public WrappedParentModel(IWrapModel realParent) {
-            this.realParent = realParent;
-        }
+ class WrappedParentModel implements IComponentInheritedModel {
+ private final IWrapModel realParent;

-        public IWrapModel wrapOnInheritance(Component arg0) {
-            if (arg0 == ViewOrEdit.this.component) {
-                return realParent;
-            } else {
-                return null;
-            }
-        }
+ public WrappedParentModel(IWrapModel realParent) {
+ this.realParent = realParent;
+ }

-        public Object getObject() {
-            return null;
-        }
+ public IWrapModel wrapOnInheritance(Component arg0) {
+ if (arg0 == ViewOrEdit.this.component) {
+ return realParent;
+ } else {
+ return null;
+ }
+ }

-        public void setObject(Object arg0) {
-        }
+ public Object getObject() {
+ return null;
+ }

-        public void detach() {
-        }
-    }
+ public void setObject(Object arg0) {
+ }

-    public IPrivilege getRenderPrivilege() {
-        return IPrivilege.NULL;
-    }
+ public void detach() {
+ }
+ }

-    public IPrivilege getEnablePrivilege() {
-        return IPrivilege.NULL;
-    }
-
-}
+}
\ No newline at end of file


2011/3/10 nino martinez wael <ni...@gmail.com>

> Ok I've given it a run.. And are having problems :(
>
> It still does'nt seem like ViewOrEdit honors the fact that it is either
> ViewOrEdit.
> So it either looks like:
> http://img826.imageshack.us/i/greenshot20110310111030.png/
> Or
> http://img689.imageshack.us/i/greenshot20110310111207.png/
>
> If I try to run the examples I get and error:
> http://img833.imageshack.us/i/greenshot20110310111126.png/
>
>
> Also I had to add the servlet api inorder to run the ant build, as well as
> putting the jar files besides the other wicket dependencies.
>
> Index: branches/1.5/visural-wicket-examples/lib/nblibraries.properties
> ===================================================================
> --- branches/1.5/visural-wicket-examples/lib/nblibraries.properties (revision
> 266)
> +++ branches/1.5/visural-wicket-examples/lib/nblibraries.properties (working
> copy)
> @@ -20,6 +20,7 @@
>  libs.visural-wicket.src=\
>      ${base}/visural-wicket/visural-wicket-0.5-sources.jar
>  libs.Wicket.classpath=\
> + ${base}/Wicket/servlet-api-2.5-20081211.jar;\
>      ${base}/Wicket/slf4j-api-1.4.2.jar;\
>      ${base}/Wicket/slf4j-jdk14-1.4.2.jar;\
>      ${base}/Wicket/wicket-core-1.5-rc2.jar;\
>
>
>
>
>
> 2011/3/9 nino martinez wael <ni...@gmail.com>
>
> Thanks. I'll give feedback if needed
>> On Mar 9, 2011 4:22 AM, "Richard Nichols" <rn...@visural.com> wrote:
>> > I've committed what appears to be a mostly working visural-wicket with
>> 1.5
>> > (rc2) compatibility.
>> >
>> >
>> http://code.google.com/p/visural-wicket/source/browse/#svn%2Fbranches%2F1.5
>> >
>> > If there are any issues found, please report them at
>> > http://code.google.com/p/visural-wicket/
>> >
>> > cheers,
>> > Richard.
>> >
>> > On Wed, Mar 9, 2011 at 4:30 AM, nino martinez wael <
>> > nino.martinez.wael@gmail.com> wrote:
>> >
>> >> ok great.. I'll probably take at look at it monday then..
>> >>
>> >> 2011/3/8 Richard Nichols <rn...@visural.com>
>> >>
>> >> > Hi Nino,
>> >> >
>> >> > The version in the public respository 1.5 branch is still a direct
>> copy
>> >> of
>> >> > 1.4 - sorry I haven't commited the WIP 1.5 changes yet.
>> >> >
>> >> > I'll aim to get the WIP committed in this week.
>> >> >
>> >> > cheers,
>> >> > Richard.
>> >> >
>> >> > On Mon, Mar 7, 2011 at 6:47 PM, nino martinez wael <
>> >> > nino.martinez.wael@gmail.com> wrote:
>> >> >
>> >> > > Strange it compiles well, but does not work as wanted.. Any idea on
>> >> which
>> >> > > parts are causing the problems? On my dropdowns the dropdowns are
>> >> empty,
>> >> > > and in my textfields both the text and the span are added if in
>> view
>> >> > mode,
>> >> > > and if not 2 textfields are added.
>> >> > >
>> >> > > 2011/3/5 Richard Nichols <rn...@richardnichols.net>
>> >> > >
>> >> > > > I've created a 1.5 branch and it's in the works. 1.5 broke more
>> stuff
>> >> > > > than expected :)
>> >> > > >
>> >> > > > Hopefully I can have a beta 1.5 branch functional within a few
>> weeks
>> >> > > >
>> >> > > > Sent from my iPhone
>> >> > > >
>> >> > > > On 05/03/2011, at 6:15 AM, nino martinez wael
>> >> > > > <ni...@gmail.com> wrote:
>> >> > > >
>> >> > > > > So does has anybody run it on wicket 1.5, or is there something
>> in
>> >> > the
>> >> > > > works
>> >> > > > > for it?
>> >> > > > >
>> >> > > > > regards Nino
>> >> > > >
>> >> > > >
>> ---------------------------------------------------------------------
>> >> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> > > > For additional commands, e-mail: users-help@wicket.apache.org
>> >> > > >
>> >> > > >
>> >> > >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Richard Nichols
>> >> > http://www.richardnichols.net/ :: http://onmydoorstep.com.au/
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> > Richard Nichols
>> > http://www.richardnichols.net/ :: http://onmydoorstep.com.au/
>>
>
>

Re: visural-wicket running on wicket 1.5?

Posted by nino martinez wael <ni...@gmail.com>.
Ok I've given it a run.. And are having problems :(

It still does'nt seem like ViewOrEdit honors the fact that it is either
ViewOrEdit.
So it either looks like:
http://img826.imageshack.us/i/greenshot20110310111030.png/
Or
http://img689.imageshack.us/i/greenshot20110310111207.png/

If I try to run the examples I get and error:
http://img833.imageshack.us/i/greenshot20110310111126.png/


Also I had to add the servlet api inorder to run the ant build, as well as
putting the jar files besides the other wicket dependencies.

Index: branches/1.5/visural-wicket-examples/lib/nblibraries.properties
===================================================================
--- branches/1.5/visural-wicket-examples/lib/nblibraries.properties (revision
266)
+++ branches/1.5/visural-wicket-examples/lib/nblibraries.properties (working
copy)
@@ -20,6 +20,7 @@
 libs.visural-wicket.src=\
     ${base}/visural-wicket/visural-wicket-0.5-sources.jar
 libs.Wicket.classpath=\
+ ${base}/Wicket/servlet-api-2.5-20081211.jar;\
     ${base}/Wicket/slf4j-api-1.4.2.jar;\
     ${base}/Wicket/slf4j-jdk14-1.4.2.jar;\
     ${base}/Wicket/wicket-core-1.5-rc2.jar;\





2011/3/9 nino martinez wael <ni...@gmail.com>

> Thanks. I'll give feedback if needed
> On Mar 9, 2011 4:22 AM, "Richard Nichols" <rn...@visural.com> wrote:
> > I've committed what appears to be a mostly working visural-wicket with
> 1.5
> > (rc2) compatibility.
> >
> >
> http://code.google.com/p/visural-wicket/source/browse/#svn%2Fbranches%2F1.5
> >
> > If there are any issues found, please report them at
> > http://code.google.com/p/visural-wicket/
> >
> > cheers,
> > Richard.
> >
> > On Wed, Mar 9, 2011 at 4:30 AM, nino martinez wael <
> > nino.martinez.wael@gmail.com> wrote:
> >
> >> ok great.. I'll probably take at look at it monday then..
> >>
> >> 2011/3/8 Richard Nichols <rn...@visural.com>
> >>
> >> > Hi Nino,
> >> >
> >> > The version in the public respository 1.5 branch is still a direct
> copy
> >> of
> >> > 1.4 - sorry I haven't commited the WIP 1.5 changes yet.
> >> >
> >> > I'll aim to get the WIP committed in this week.
> >> >
> >> > cheers,
> >> > Richard.
> >> >
> >> > On Mon, Mar 7, 2011 at 6:47 PM, nino martinez wael <
> >> > nino.martinez.wael@gmail.com> wrote:
> >> >
> >> > > Strange it compiles well, but does not work as wanted.. Any idea on
> >> which
> >> > > parts are causing the problems? On my dropdowns the dropdowns are
> >> empty,
> >> > > and in my textfields both the text and the span are added if in view
> >> > mode,
> >> > > and if not 2 textfields are added.
> >> > >
> >> > > 2011/3/5 Richard Nichols <rn...@richardnichols.net>
> >> > >
> >> > > > I've created a 1.5 branch and it's in the works. 1.5 broke more
> stuff
> >> > > > than expected :)
> >> > > >
> >> > > > Hopefully I can have a beta 1.5 branch functional within a few
> weeks
> >> > > >
> >> > > > Sent from my iPhone
> >> > > >
> >> > > > On 05/03/2011, at 6:15 AM, nino martinez wael
> >> > > > <ni...@gmail.com> wrote:
> >> > > >
> >> > > > > So does has anybody run it on wicket 1.5, or is there something
> in
> >> > the
> >> > > > works
> >> > > > > for it?
> >> > > > >
> >> > > > > regards Nino
> >> > > >
> >> > > >
> ---------------------------------------------------------------------
> >> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> > > > For additional commands, e-mail: users-help@wicket.apache.org
> >> > > >
> >> > > >
> >> > >
> >> >
> >> >
> >> >
> >> > --
> >> > Richard Nichols
> >> > http://www.richardnichols.net/ :: http://onmydoorstep.com.au/
> >> >
> >>
> >
> >
> >
> > --
> > Richard Nichols
> > http://www.richardnichols.net/ :: http://onmydoorstep.com.au/
>

Re: visural-wicket running on wicket 1.5?

Posted by nino martinez wael <ni...@gmail.com>.
Thanks. I'll give feedback if needed
On Mar 9, 2011 4:22 AM, "Richard Nichols" <rn...@visural.com> wrote:
> I've committed what appears to be a mostly working visural-wicket with 1.5
> (rc2) compatibility.
>
>
http://code.google.com/p/visural-wicket/source/browse/#svn%2Fbranches%2F1.5
>
> If there are any issues found, please report them at
> http://code.google.com/p/visural-wicket/
>
> cheers,
> Richard.
>
> On Wed, Mar 9, 2011 at 4:30 AM, nino martinez wael <
> nino.martinez.wael@gmail.com> wrote:
>
>> ok great.. I'll probably take at look at it monday then..
>>
>> 2011/3/8 Richard Nichols <rn...@visural.com>
>>
>> > Hi Nino,
>> >
>> > The version in the public respository 1.5 branch is still a direct copy
>> of
>> > 1.4 - sorry I haven't commited the WIP 1.5 changes yet.
>> >
>> > I'll aim to get the WIP committed in this week.
>> >
>> > cheers,
>> > Richard.
>> >
>> > On Mon, Mar 7, 2011 at 6:47 PM, nino martinez wael <
>> > nino.martinez.wael@gmail.com> wrote:
>> >
>> > > Strange it compiles well, but does not work as wanted.. Any idea on
>> which
>> > > parts are causing the problems? On my dropdowns the dropdowns are
>> empty,
>> > > and in my textfields both the text and the span are added if in view
>> > mode,
>> > > and if not 2 textfields are added.
>> > >
>> > > 2011/3/5 Richard Nichols <rn...@richardnichols.net>
>> > >
>> > > > I've created a 1.5 branch and it's in the works. 1.5 broke more
stuff
>> > > > than expected :)
>> > > >
>> > > > Hopefully I can have a beta 1.5 branch functional within a few
weeks
>> > > >
>> > > > Sent from my iPhone
>> > > >
>> > > > On 05/03/2011, at 6:15 AM, nino martinez wael
>> > > > <ni...@gmail.com> wrote:
>> > > >
>> > > > > So does has anybody run it on wicket 1.5, or is there something
in
>> > the
>> > > > works
>> > > > > for it?
>> > > > >
>> > > > > regards Nino
>> > > >
>> > > >
---------------------------------------------------------------------
>> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > > > For additional commands, e-mail: users-help@wicket.apache.org
>> > > >
>> > > >
>> > >
>> >
>> >
>> >
>> > --
>> > Richard Nichols
>> > http://www.richardnichols.net/ :: http://onmydoorstep.com.au/
>> >
>>
>
>
>
> --
> Richard Nichols
> http://www.richardnichols.net/ :: http://onmydoorstep.com.au/

Re: visural-wicket running on wicket 1.5?

Posted by Richard Nichols <rn...@visural.com>.
I've committed what appears to be a mostly working visural-wicket with 1.5
(rc2) compatibility.

http://code.google.com/p/visural-wicket/source/browse/#svn%2Fbranches%2F1.5

If there are any issues found, please report them at
http://code.google.com/p/visural-wicket/

cheers,
Richard.

On Wed, Mar 9, 2011 at 4:30 AM, nino martinez wael <
nino.martinez.wael@gmail.com> wrote:

> ok great.. I'll probably take at look at it monday then..
>
> 2011/3/8 Richard Nichols <rn...@visural.com>
>
> > Hi Nino,
> >
> > The version in the public respository 1.5 branch is still a direct copy
> of
> > 1.4 - sorry I haven't commited the WIP 1.5 changes yet.
> >
> > I'll aim to get the WIP committed in this week.
> >
> > cheers,
> > Richard.
> >
> > On Mon, Mar 7, 2011 at 6:47 PM, nino martinez wael <
> > nino.martinez.wael@gmail.com> wrote:
> >
> > > Strange it compiles well, but does not work as wanted.. Any idea on
> which
> > > parts are causing the problems?  On my dropdowns the dropdowns are
> empty,
> > > and in my textfields both the text and the span are added if in view
> > mode,
> > > and if not 2 textfields are added.
> > >
> > > 2011/3/5 Richard Nichols <rn...@richardnichols.net>
> > >
> > > > I've created a 1.5 branch and it's in the works. 1.5 broke more stuff
> > > > than expected :)
> > > >
> > > > Hopefully I can have a beta 1.5 branch functional within a few weeks
> > > >
> > > > Sent from my iPhone
> > > >
> > > > On 05/03/2011, at 6:15 AM, nino martinez wael
> > > > <ni...@gmail.com> wrote:
> > > >
> > > > > So does has anybody run it on wicket 1.5, or is there something in
> > the
> > > > works
> > > > > for it?
> > > > >
> > > > > regards Nino
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > > For additional commands, e-mail: users-help@wicket.apache.org
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > Richard Nichols
> > http://www.richardnichols.net/ :: http://onmydoorstep.com.au/
> >
>



-- 
Richard Nichols
http://www.richardnichols.net/ :: http://onmydoorstep.com.au/

Re: visural-wicket running on wicket 1.5?

Posted by nino martinez wael <ni...@gmail.com>.
ok great.. I'll probably take at look at it monday then..

2011/3/8 Richard Nichols <rn...@visural.com>

> Hi Nino,
>
> The version in the public respository 1.5 branch is still a direct copy of
> 1.4 - sorry I haven't commited the WIP 1.5 changes yet.
>
> I'll aim to get the WIP committed in this week.
>
> cheers,
> Richard.
>
> On Mon, Mar 7, 2011 at 6:47 PM, nino martinez wael <
> nino.martinez.wael@gmail.com> wrote:
>
> > Strange it compiles well, but does not work as wanted.. Any idea on which
> > parts are causing the problems?  On my dropdowns the dropdowns are empty,
> > and in my textfields both the text and the span are added if in view
> mode,
> > and if not 2 textfields are added.
> >
> > 2011/3/5 Richard Nichols <rn...@richardnichols.net>
> >
> > > I've created a 1.5 branch and it's in the works. 1.5 broke more stuff
> > > than expected :)
> > >
> > > Hopefully I can have a beta 1.5 branch functional within a few weeks
> > >
> > > Sent from my iPhone
> > >
> > > On 05/03/2011, at 6:15 AM, nino martinez wael
> > > <ni...@gmail.com> wrote:
> > >
> > > > So does has anybody run it on wicket 1.5, or is there something in
> the
> > > works
> > > > for it?
> > > >
> > > > regards Nino
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
>
>
>
> --
> Richard Nichols
> http://www.richardnichols.net/ :: http://onmydoorstep.com.au/
>

Re: visural-wicket running on wicket 1.5?

Posted by Richard Nichols <rn...@visural.com>.
Hi Nino,

The version in the public respository 1.5 branch is still a direct copy of
1.4 - sorry I haven't commited the WIP 1.5 changes yet.

I'll aim to get the WIP committed in this week.

cheers,
Richard.

On Mon, Mar 7, 2011 at 6:47 PM, nino martinez wael <
nino.martinez.wael@gmail.com> wrote:

> Strange it compiles well, but does not work as wanted.. Any idea on which
> parts are causing the problems?  On my dropdowns the dropdowns are empty,
> and in my textfields both the text and the span are added if in view mode,
> and if not 2 textfields are added.
>
> 2011/3/5 Richard Nichols <rn...@richardnichols.net>
>
> > I've created a 1.5 branch and it's in the works. 1.5 broke more stuff
> > than expected :)
> >
> > Hopefully I can have a beta 1.5 branch functional within a few weeks
> >
> > Sent from my iPhone
> >
> > On 05/03/2011, at 6:15 AM, nino martinez wael
> > <ni...@gmail.com> wrote:
> >
> > > So does has anybody run it on wicket 1.5, or is there something in the
> > works
> > > for it?
> > >
> > > regards Nino
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>



-- 
Richard Nichols
http://www.richardnichols.net/ :: http://onmydoorstep.com.au/

Re: visural-wicket running on wicket 1.5?

Posted by nino martinez wael <ni...@gmail.com>.
Strange it compiles well, but does not work as wanted.. Any idea on which
parts are causing the problems?  On my dropdowns the dropdowns are empty,
and in my textfields both the text and the span are added if in view mode,
and if not 2 textfields are added.

2011/3/5 Richard Nichols <rn...@richardnichols.net>

> I've created a 1.5 branch and it's in the works. 1.5 broke more stuff
> than expected :)
>
> Hopefully I can have a beta 1.5 branch functional within a few weeks
>
> Sent from my iPhone
>
> On 05/03/2011, at 6:15 AM, nino martinez wael
> <ni...@gmail.com> wrote:
>
> > So does has anybody run it on wicket 1.5, or is there something in the
> works
> > for it?
> >
> > regards Nino
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: visural-wicket running on wicket 1.5?

Posted by Richard Nichols <rn...@richardnichols.net>.
I've created a 1.5 branch and it's in the works. 1.5 broke more stuff
than expected :)

Hopefully I can have a beta 1.5 branch functional within a few weeks

Sent from my iPhone

On 05/03/2011, at 6:15 AM, nino martinez wael
<ni...@gmail.com> wrote:

> So does has anybody run it on wicket 1.5, or is there something in the works
> for it?
>
> regards Nino

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


Re: visural-wicket running on wicket 1.5?

Posted by nino martinez wael <ni...@gmail.com>.
Hmm looking at trunk it does not seem so.. I'll port the vieworedit
component to wicket 1.5..

2011/3/4 nino martinez wael <ni...@gmail.com>

> So does has anybody run it on wicket 1.5, or is there something in the
> works for it?
>
> regards Nino
>