[Wicket-user] [Question] render(final MarkupStream markupStream)

2007-06-13 Thread Alex Objelean

I have a question about the render method. Why, before rendering, instead of
checking isVisibleInHierarchy(),  isVisible() is called? 
public final void render(final MarkupStream markupStream)
{
setMarkupStream(markupStream);
setFlag(FLAG_IS_RENDERED_ONCE, true);

// Determine if component is visible using it's authorization 
status
// and the isVisible property.
if (isRenderAllowed()  isVisible()) //why not 
isVisibleInHierarchy() ?? 
{
   //etc...
}
//more code.
 }

I am asking because I suspect a bug with the following StackTrace: 

Caused by: java.lang.NullPointerException
at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
at wicket.markup.html.list.ListView.onRender(ListView.java:637)

I happens when an AjaxTabbedPanel is updated via ajax. The tabbedPanel
contains a holder Panel with a ListView child component. The visibility of
the holder Panel is decided dynamicaly by overriding isVisible method. 

Maybe later I will try to isolate this situation and to make it more clear.
Still, I would like to know if you've encountered something like this.

Thank you!
-- 
View this message in context: 
http://www.nabble.com/-Question--render%28final-MarkupStream-markupStream%29-tf3914413.html#a11098575
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Question] render(final MarkupStream markupStream)

2007-06-13 Thread Al Maw
Hmmm,

This bug looks suspiciously like another onAttach/onBeforeRender issue. 
Matej seems good at debugging those, care to comment? :-)

Al

Alex Objelean wrote:
 I have a question about the render method. Why, before rendering, instead of
 checking isVisibleInHierarchy(),  isVisible() is called? 
   public final void render(final MarkupStream markupStream)
   {
   setMarkupStream(markupStream);
   setFlag(FLAG_IS_RENDERED_ONCE, true);
 
   // Determine if component is visible using it's authorization 
 status
   // and the isVisible property.
   if (isRenderAllowed()  isVisible()) //why not 
 isVisibleInHierarchy() ?? 
   {
//etc...
 }
 //more code.
  }
 
 I am asking because I suspect a bug with the following StackTrace: 
 
 Caused by: java.lang.NullPointerException
   at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
   at wicket.markup.html.list.ListView.onRender(ListView.java:637)
 
 I happens when an AjaxTabbedPanel is updated via ajax. The tabbedPanel
 contains a holder Panel with a ListView child component. The visibility of
 the holder Panel is decided dynamicaly by overriding isVisible method. 
 
 Maybe later I will try to isolate this situation and to make it more clear.
 Still, I would like to know if you've encountered something like this.
 
 Thank you!


-- 
Alastair Maw
Wicket-biased blog at http://herebebeasties.com

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Question] render(final MarkupStream markupStream)

2007-06-13 Thread Johan Compagner
isVisibleInHierarchy doesn't make to much sense because it has to be
visible already because the parent is already rendering and passing
its render to the childs.  So the parent is already checked for
visiblility.
what you seem to have is more another bug that something
is not created or tried to rendered that is already removed by another
request

On 6/13/07, Alex Objelean [EMAIL PROTECTED] wrote:

 I have a question about the render method. Why, before rendering, instead of
 checking isVisibleInHierarchy(),  isVisible() is called?
   public final void render(final MarkupStream markupStream)
   {
   setMarkupStream(markupStream);
   setFlag(FLAG_IS_RENDERED_ONCE, true);

   // Determine if component is visible using it's authorization 
 status
   // and the isVisible property.
   if (isRenderAllowed()  isVisible()) //why not 
 isVisibleInHierarchy() ??
   {
//etc...
 }
 //more code.
  }

 I am asking because I suspect a bug with the following StackTrace:

 Caused by: java.lang.NullPointerException
   at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
   at wicket.markup.html.list.ListView.onRender(ListView.java:637)

 I happens when an AjaxTabbedPanel is updated via ajax. The tabbedPanel
 contains a holder Panel with a ListView child component. The visibility of
 the holder Panel is decided dynamicaly by overriding isVisible method.

 Maybe later I will try to isolate this situation and to make it more clear.
 Still, I would like to know if you've encountered something like this.

 Thank you!
 --
 View this message in context:
 http://www.nabble.com/-Question--render%28final-MarkupStream-markupStream%29-tf3914413.html#a11098575
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Question] render(final MarkupStream markupStream)

2007-06-13 Thread Alex Objelean

I found a workaround for this issue, so instead of overriding isVisible() of
the bulkContainer WebMarkupContainer, I add an AttributeModifier which makes
the container display:none.. 

private WebMarkupContainer getBulkContainer() {
if (bulkContainer == null) {
  bulkContainer = new WebMarkupContainer(bulkContainer);
  bulkContainer.add(new SimpleAttributeModifier(class, invisible) {
public boolean isEnabled() {
  return getMode().isEdit();
}
  });
  //add to bulkContainer a form which contains a ListView.
}
return bulkContainer;
  }

I do not like this solution, because anyone having firebug can hack the
application + more markup than needed is generated...



Johan Compagner wrote:
 
 isVisibleInHierarchy doesn't make to much sense because it has to be
 visible already because the parent is already rendering and passing
 its render to the childs.  So the parent is already checked for
 visiblility.
what you seem to have is more another bug that something
 is not created or tried to rendered that is already removed by another
 request
 
 On 6/13/07, Alex Objelean [EMAIL PROTECTED] wrote:

 I have a question about the render method. Why, before rendering, instead
 of
 checking isVisibleInHierarchy(),  isVisible() is called?
  public final void render(final MarkupStream markupStream)
  {
  setMarkupStream(markupStream);
  setFlag(FLAG_IS_RENDERED_ONCE, true);

  // Determine if component is visible using it's authorization 
 status
  // and the isVisible property.
  if (isRenderAllowed()  isVisible()) //why not 
 isVisibleInHierarchy()
 ??
  {
//etc...
 }
 //more code.
  }

 I am asking because I suspect a bug with the following StackTrace:

 Caused by: java.lang.NullPointerException
  at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
  at wicket.markup.html.list.ListView.onRender(ListView.java:637)

 I happens when an AjaxTabbedPanel is updated via ajax. The tabbedPanel
 contains a holder Panel with a ListView child component. The visibility
 of
 the holder Panel is decided dynamicaly by overriding isVisible method.

 Maybe later I will try to isolate this situation and to make it more
 clear.
 Still, I would like to know if you've encountered something like this.

 Thank you!
 --
 View this message in context:
 http://www.nabble.com/-Question--render%28final-MarkupStream-markupStream%29-tf3914413.html#a11098575
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/-Question--render%28final-MarkupStream-markupStream%29-tf3914413.html#a11099854
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Question] render(final MarkupStream markupStream)

2007-06-13 Thread Johan Compagner
we also have a. setting where we do output some markup with
display:none when it is not visible, setOutputMarkupIdX() (i
forgot the exact name)

On 6/13/07, Alex Objelean [EMAIL PROTECTED] wrote:

 I found a workaround for this issue, so instead of overriding isVisible() of
 the bulkContainer WebMarkupContainer, I add an AttributeModifier which makes
 the container display:none..

 private WebMarkupContainer getBulkContainer() {
 if (bulkContainer == null) {
   bulkContainer = new WebMarkupContainer(bulkContainer);
   bulkContainer.add(new SimpleAttributeModifier(class, invisible) {
 public boolean isEnabled() {
   return getMode().isEdit();
 }
   });
   //add to bulkContainer a form which contains a ListView.
 }
 return bulkContainer;
   }

 I do not like this solution, because anyone having firebug can hack the
 application + more markup than needed is generated...



 Johan Compagner wrote:
 
  isVisibleInHierarchy doesn't make to much sense because it has to be
  visible already because the parent is already rendering and passing
  its render to the childs.  So the parent is already checked for
  visiblility.
what you seem to have is more another bug that something
  is not created or tried to rendered that is already removed by another
  request
 
  On 6/13/07, Alex Objelean [EMAIL PROTECTED] wrote:
 
  I have a question about the render method. Why, before rendering, instead
  of
  checking isVisibleInHierarchy(),  isVisible() is called?
 public final void render(final MarkupStream markupStream)
 {
 setMarkupStream(markupStream);
 setFlag(FLAG_IS_RENDERED_ONCE, true);
 
 // Determine if component is visible using it's authorization 
  status
 // and the isVisible property.
 if (isRenderAllowed()  isVisible()) //why not 
  isVisibleInHierarchy()
  ??
 {
 //etc...
  }
  //more code.
   }
 
  I am asking because I suspect a bug with the following StackTrace:
 
  Caused by: java.lang.NullPointerException
 at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
 at wicket.markup.html.list.ListView.onRender(ListView.java:637)
 
  I happens when an AjaxTabbedPanel is updated via ajax. The tabbedPanel
  contains a holder Panel with a ListView child component. The visibility
  of
  the holder Panel is decided dynamicaly by overriding isVisible method.
 
  Maybe later I will try to isolate this situation and to make it more
  clear.
  Still, I would like to know if you've encountered something like this.
 
  Thank you!
  --
  View this message in context:
 
 http://www.nabble.com/-Question--render%28final-MarkupStream-markupStream%29-tf3914413.html#a11098575
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

 --
 View this message in context:
 http://www.nabble.com/-Question--render%28final-MarkupStream-markupStream%29-tf3914413.html#a11099854
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Question] render(final MarkupStream markupStream)

2007-06-13 Thread Timo Rantalaiho
On Wed, 13 Jun 2007, Alex Objelean wrote:
 I found a workaround for this issue, so instead of overriding isVisible() of
 the bulkContainer WebMarkupContainer, I add an AttributeModifier which makes
 the container display:none.. 

I'm not sure if I got it correctly, but you're not trying to
repaint an invisible container via ajax, right? To make that
work you need to update the parent of the conditionally-
visible component.

Another thing that we have noticed is that sometimes calling
setVisible() in onBeforeRender() works better than overriding
isVisble() directly. Make sure you call super.onBeforeRender()
in the overriding implementation.

- Timo

-- 
Timo Rantalaiho   
Reaktor Innovations OyURL: http://www.ri.fi/ 

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user