You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ernesto Reinaldo Barreiro <re...@gmail.com> on 2011/01/11 13:05:44 UTC

check for component visibility on BehaviorRequestTarget introduced on 1.4.14

Hi All,

On [1] we are providing an integration with jqgrid that uses the trick
of having and "invisible" panel that is used to stream back data to
the data grid. We needed this to be a panel in order to allow wicket
components to be used for grid cells. This little trick was working
fine till wicket 1.4.13 but on wicket 1.4.14 the following check was
added to the processEvents method

if (!component.isVisibleInHierarchy() ||
			(!(behaviorListener instanceof IIgnoreDisabledComponentBehavior) &&
!component.isEnabledInHierarchy()))
		{
			// ignore this request
			logger.warn("component not enabled or visible; ignoring call.
Component: {}", component);
			if (requestCycle.getRequest() instanceof WebRequest &&
				((WebRequest)requestCycle.getRequest()).isAjax())
			{
				throw new AbortException();
			}
			return;
		}

So, the trick we used to stream data back is no longer working (as a
user just discovered a few minutes ago, see [2]). Of course, I
could/will try to find other ways to do it... But I would like to ask
why this check was introduced? As this might break existing
applications...

Regards,

Ernesto

1-http://code.google.com/p/wiquery-plugins/
2-http://code.google.com/p/wiquery-plugins/issues/detail?id=19

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


Re: check for component visibility on BehaviorRequestTarget introduced on 1.4.14

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Martin,

I was trying to avoid rendering the same data twice: that's why I was
making the panel that generates grid's contents "invisible". One easy
solution could be make it "server" side visible but client side
invisible (e.g. display: none).

Thank for your answer.

Ernesto

On Tue, Jan 11, 2011 at 2:02 PM, Martin Grigorov <mg...@apache.org> wrote:
> I think for this particular case you may use zero size <div> which is
> positioned out of the visible viewport.
> So it is still visible in Wicket world but not visible for the user.
>
> On Tue, Jan 11, 2011 at 1:39 PM, Pedro Santos <pe...@gmail.com> wrote:
>
>> Hi Ernesto, the main concern is security, it is natural to expect that
>> actions coded in behaviours will not get invoked when its components are
>> disabled. Actually we treated this unexpected disabled behavior call as a
>> bug since we discovered it[1].
>>
>> On a side note, in Wicket 1.4 the Behavior needs to implement the
>> IIgnoreDisabledComponentBehavi
>> or interface in order work on disabled components, and in 1.5 return true
>> on
>> method: Behavior#canCallListenerInterface
>>
>> 1 - https://issues.apache.org/jira/browse/WICKET-3098
>>
>>
>> On Tue, Jan 11, 2011 at 10:05 AM, Ernesto Reinaldo Barreiro <
>> reiern70@gmail.com> wrote:
>>
>> > Hi All,
>> >
>> > On [1] we are providing an integration with jqgrid that uses the trick
>> > of having and "invisible" panel that is used to stream back data to
>> > the data grid. We needed this to be a panel in order to allow wicket
>> > components to be used for grid cells. This little trick was working
>> > fine till wicket 1.4.13 but on wicket 1.4.14 the following check was
>> > added to the processEvents method
>> >
>> > if (!component.isVisibleInHierarchy() ||
>> >                        (!(behaviorListener instanceof
>> > IIgnoreDisabledComponentBehavior) &&
>> > !component.isEnabledInHierarchy()))
>> >                {
>> >                        // ignore this request
>> >                        logger.warn("component not enabled or visible;
>> > ignoring call.
>> > Component: {}", component);
>> >                        if (requestCycle.getRequest() instanceof
>> WebRequest
>> > &&
>> >
>> >  ((WebRequest)requestCycle.getRequest()).isAjax())
>> >                        {
>> >                                throw new AbortException();
>> >                        }
>> >                        return;
>> >                }
>> >
>> > So, the trick we used to stream data back is no longer working (as a
>> > user just discovered a few minutes ago, see [2]). Of course, I
>> > could/will try to find other ways to do it... But I would like to ask
>> > why this check was introduced? As this might break existing
>> > applications...
>> >
>> > Regards,
>> >
>> > Ernesto
>> >
>> > 1-http://code.google.com/p/wiquery-plugins/
>> > 2-http://code.google.com/p/wiquery-plugins/issues/detail?id=19
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>>
>> --
>> Pedro Henrique Oliveira dos Santos
>>
>

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


Re: check for component visibility on BehaviorRequestTarget introduced on 1.4.14

Posted by Martin Grigorov <mg...@apache.org>.
I think for this particular case you may use zero size <div> which is
positioned out of the visible viewport.
So it is still visible in Wicket world but not visible for the user.

On Tue, Jan 11, 2011 at 1:39 PM, Pedro Santos <pe...@gmail.com> wrote:

> Hi Ernesto, the main concern is security, it is natural to expect that
> actions coded in behaviours will not get invoked when its components are
> disabled. Actually we treated this unexpected disabled behavior call as a
> bug since we discovered it[1].
>
> On a side note, in Wicket 1.4 the Behavior needs to implement the
> IIgnoreDisabledComponentBehavi
> or interface in order work on disabled components, and in 1.5 return true
> on
> method: Behavior#canCallListenerInterface
>
> 1 - https://issues.apache.org/jira/browse/WICKET-3098
>
>
> On Tue, Jan 11, 2011 at 10:05 AM, Ernesto Reinaldo Barreiro <
> reiern70@gmail.com> wrote:
>
> > Hi All,
> >
> > On [1] we are providing an integration with jqgrid that uses the trick
> > of having and "invisible" panel that is used to stream back data to
> > the data grid. We needed this to be a panel in order to allow wicket
> > components to be used for grid cells. This little trick was working
> > fine till wicket 1.4.13 but on wicket 1.4.14 the following check was
> > added to the processEvents method
> >
> > if (!component.isVisibleInHierarchy() ||
> >                        (!(behaviorListener instanceof
> > IIgnoreDisabledComponentBehavior) &&
> > !component.isEnabledInHierarchy()))
> >                {
> >                        // ignore this request
> >                        logger.warn("component not enabled or visible;
> > ignoring call.
> > Component: {}", component);
> >                        if (requestCycle.getRequest() instanceof
> WebRequest
> > &&
> >
> >  ((WebRequest)requestCycle.getRequest()).isAjax())
> >                        {
> >                                throw new AbortException();
> >                        }
> >                        return;
> >                }
> >
> > So, the trick we used to stream data back is no longer working (as a
> > user just discovered a few minutes ago, see [2]). Of course, I
> > could/will try to find other ways to do it... But I would like to ask
> > why this check was introduced? As this might break existing
> > applications...
> >
> > Regards,
> >
> > Ernesto
> >
> > 1-http://code.google.com/p/wiquery-plugins/
> > 2-http://code.google.com/p/wiquery-plugins/issues/detail?id=19
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
> --
> Pedro Henrique Oliveira dos Santos
>

Re: check for component visibility on BehaviorRequestTarget introduced on 1.4.14

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Pedro,

Thanks for you answer! Yes I saw IIgnoreDisabledComponentBehavior but
using it introduces a dependency on version > 1.4.14 which might force
users to up-grade wicket version if they want to use trunk. Maybe, I
will go for attaching the behavior to a visible component... Thanks
again.

Regards,

Ernesto

On Tue, Jan 11, 2011 at 1:39 PM, Pedro Santos <pe...@gmail.com> wrote:
> Hi Ernesto, the main concern is security, it is natural to expect that
> actions coded in behaviours will not get invoked when its components are
> disabled. Actually we treated this unexpected disabled behavior call as a
> bug since we discovered it[1].
>
> On a side note, in Wicket 1.4 the Behavior needs to implement the
> IIgnoreDisabledComponentBehavi
> or interface in order work on disabled components, and in 1.5 return true on
> method: Behavior#canCallListenerInterface
>
> 1 - https://issues.apache.org/jira/browse/WICKET-3098
>
>
> On Tue, Jan 11, 2011 at 10:05 AM, Ernesto Reinaldo Barreiro <
> reiern70@gmail.com> wrote:
>
>> Hi All,
>>
>> On [1] we are providing an integration with jqgrid that uses the trick
>> of having and "invisible" panel that is used to stream back data to
>> the data grid. We needed this to be a panel in order to allow wicket
>> components to be used for grid cells. This little trick was working
>> fine till wicket 1.4.13 but on wicket 1.4.14 the following check was
>> added to the processEvents method
>>
>> if (!component.isVisibleInHierarchy() ||
>>                        (!(behaviorListener instanceof
>> IIgnoreDisabledComponentBehavior) &&
>> !component.isEnabledInHierarchy()))
>>                {
>>                        // ignore this request
>>                        logger.warn("component not enabled or visible;
>> ignoring call.
>> Component: {}", component);
>>                        if (requestCycle.getRequest() instanceof WebRequest
>> &&
>>
>>  ((WebRequest)requestCycle.getRequest()).isAjax())
>>                        {
>>                                throw new AbortException();
>>                        }
>>                        return;
>>                }
>>
>> So, the trick we used to stream data back is no longer working (as a
>> user just discovered a few minutes ago, see [2]). Of course, I
>> could/will try to find other ways to do it... But I would like to ask
>> why this check was introduced? As this might break existing
>> applications...
>>
>> Regards,
>>
>> Ernesto
>>
>> 1-http://code.google.com/p/wiquery-plugins/
>> 2-http://code.google.com/p/wiquery-plugins/issues/detail?id=19
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>

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


Re: check for component visibility on BehaviorRequestTarget introduced on 1.4.14

Posted by Pedro Santos <pe...@gmail.com>.
Hi Ernesto, the main concern is security, it is natural to expect that
actions coded in behaviours will not get invoked when its components are
disabled. Actually we treated this unexpected disabled behavior call as a
bug since we discovered it[1].

On a side note, in Wicket 1.4 the Behavior needs to implement the
IIgnoreDisabledComponentBehavi
or interface in order work on disabled components, and in 1.5 return true on
method: Behavior#canCallListenerInterface

1 - https://issues.apache.org/jira/browse/WICKET-3098


On Tue, Jan 11, 2011 at 10:05 AM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:

> Hi All,
>
> On [1] we are providing an integration with jqgrid that uses the trick
> of having and "invisible" panel that is used to stream back data to
> the data grid. We needed this to be a panel in order to allow wicket
> components to be used for grid cells. This little trick was working
> fine till wicket 1.4.13 but on wicket 1.4.14 the following check was
> added to the processEvents method
>
> if (!component.isVisibleInHierarchy() ||
>                        (!(behaviorListener instanceof
> IIgnoreDisabledComponentBehavior) &&
> !component.isEnabledInHierarchy()))
>                {
>                        // ignore this request
>                        logger.warn("component not enabled or visible;
> ignoring call.
> Component: {}", component);
>                        if (requestCycle.getRequest() instanceof WebRequest
> &&
>
>  ((WebRequest)requestCycle.getRequest()).isAjax())
>                        {
>                                throw new AbortException();
>                        }
>                        return;
>                }
>
> So, the trick we used to stream data back is no longer working (as a
> user just discovered a few minutes ago, see [2]). Of course, I
> could/will try to find other ways to do it... But I would like to ask
> why this check was introduced? As this might break existing
> applications...
>
> Regards,
>
> Ernesto
>
> 1-http://code.google.com/p/wiquery-plugins/
> 2-http://code.google.com/p/wiquery-plugins/issues/detail?id=19
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos