My experiences with Brix 6.0-SNAPSHOT

110 views
Skip to first unread message

D S

unread,
Jul 7, 2012, 7:48:12 AM7/7/12
to brix-cms...@googlegroups.com
Hello guys,

I am also working on migrate my application on Brix 6.0-SNAPSHOT and only two problems what I see are:

1) AjaxFormChoiceComponentUpdatingBehavior not working - I already created Wicket Jira issue (WICKET-4643)

2) Because of JS preventDefault I can't click on inmethod grid row which contains some link (<a href="...">something</a>). You can try it in brix admin page. I think it is caused by this code (wicket-ajax-jquery.js - line 582):

if (!attrs.ad && attrs.event) {
   attrs.event.preventDefault();
}

My workaround is adding this code:

ajaxCallListener.onAfter("attrs.ad = true;");

to the com.inmethod.grid.common.AbstractGrid on line 841:

            @Override
            protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
                super.updateAjaxAttributes(attributes);

                CharSequence columnParameter = "return {'column': Wicket.$(attrs.c).imxtClickedColumn}";
                attributes.getDynamicExtraParameters().add(columnParameter);

                CharSequence precondition = "return InMethod.XTable.canSelectRow(attrs.event);";
                AjaxCallListener ajaxCallListener = new AjaxCallListener();
                ajaxCallListener.onPrecondition(precondition);
                ajaxCallListener.onAfter("attrs.ad = true;");                               // THIS IS MY ADDED CODE
                attributes.getAjaxCallListeners().add(ajaxCallListener);
            }


Could you guys look at it?

Thank you very much!


Dan Simko


P.S. I will commit some changes to the brix-hierarchical-node-plugin and others plugins.

Martin Grigorov

unread,
Jul 9, 2012, 9:32:11 AM7/9/12
to brix-cms...@googlegroups.com
Hi,

On Sat, Jul 7, 2012 at 2:48 PM, D S <wick...@gmail.com> wrote:
> Hello guys,
>
> I am also working on migrate my application on Brix 6.0-SNAPSHOT and only
> two problems what I see are:
>
> 1) AjaxFormChoiceComponentUpdatingBehavior not working - I already created
> Wicket Jira issue (WICKET-4643)

Fixed.

>
> 2) Because of JS preventDefault I can't click on inmethod grid row which
> contains some link (<a href="...">something</a>). You can try it in brix
> admin page. I think it is caused by this code (wicket-ajax-jquery.js - line
> 582):

The preventDefault is there to stop the execution of the normal link's
behavior - the follow of the 'href' url.
Is this an Ajax link or a normal link ?
For Ajax the prevent default should be 'true'

>
> if (!attrs.ad && attrs.event) {
> attrs.event.preventDefault();
> }
>
> My workaround is adding this code:
>
> ajaxCallListener.onAfter("attrs.ad = true;");
>
> to the com.inmethod.grid.common.AbstractGrid on line 841:
>
> @Override
> protected void updateAjaxAttributes(AjaxRequestAttributes
> attributes) {
> super.updateAjaxAttributes(attributes);
>
> CharSequence columnParameter = "return {'column':
> Wicket.$(attrs.c).imxtClickedColumn}";
> attributes.getDynamicExtraParameters().add(columnParameter);
>
> CharSequence precondition = "return
> InMethod.XTable.canSelectRow(attrs.event);";
> AjaxCallListener ajaxCallListener = new AjaxCallListener();
> ajaxCallListener.onPrecondition(precondition);
> ajaxCallListener.onAfter("attrs.ad = true;");
> // THIS IS MY ADDED CODE
> attributes.getAjaxCallListeners().add(ajaxCallListener);
> }
>
>
> Could you guys look at it?
>
> Thank you very much!
>
>
> Dan Simko
>
>
> P.S. I will commit some changes to the brix-hierarchical-node-plugin and
> others plugins.
>
> --
> You received this message because you are subscribed to the Google Groups
> "brix-cms-discuss" group.
> To post to this group, send email to brix-cms...@googlegroups.com.
> To unsubscribe from this group, send email to
> brix-cms-discu...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/brix-cms-discuss?hl=en.

D S

unread,
Jul 9, 2012, 10:59:25 AM7/9/12
to brix-cms...@googlegroups.com
Hi Martin,

On Mon, Jul 9, 2012 at 3:32 PM, Martin Grigorov <martin....@gmail.com> wrote:
Hi,

On Sat, Jul 7, 2012 at 2:48 PM, D S <wick...@gmail.com> wrote:
> Hello guys,
>
> I am also working on migrate my application on Brix 6.0-SNAPSHOT and only
> two problems what I see are:
>
> 1) AjaxFormChoiceComponentUpdatingBehavior not working - I already created
> Wicket Jira issue (WICKET-4643)

Fixed.

great, thanks!

>
> 2) Because of JS preventDefault I can't click on inmethod grid row which
> contains some link (<a href="...">something</a>). You can try it in brix
> admin page. I think it is caused by this code (wicket-ajax-jquery.js - line
> 582):

The preventDefault is there to stop the execution of the normal link's
behavior - the follow of the 'href' url.
Is this an Ajax link or a normal link ?
For Ajax the prevent default should be 'true'

 
It is normal link but ajax behavior is added to the whole row. Before wicket 6 normal (non ajax) link in inmethod grid column was working. So I think we should fix it nevertheless I do not know if my fix is usable.
 

Martin Grigorov

unread,
Jul 9, 2012, 11:03:59 AM7/9/12
to brix-cms...@googlegroups.com
If you need to allow the default behavior of the link then you better
override ajax behavior's #updateAjaxAttributes() and call
attributes.setPreventDefault(false);

D S

unread,
Jul 13, 2012, 5:24:17 AM7/13/12
to brix-cms...@googlegroups.com
Thank you Martin.

Although I didn't find method

attributes.setPreventDefault(false);

I used

attributes.setAllowDefault(true);

And it works great. I created pull request https://github.com/wicketstuff/core/pull/139


Dan

Martin Grigorov

unread,
Jul 13, 2012, 7:49:59 AM7/13/12
to brix-cms...@googlegroups.com
Perfect!
Merged!
Reply all
Reply to author
Forward
0 new messages