xPages question - div vs panel

Hello,

If I put a panel control on my xpages it will become a “div” in the webpage if I add a style to it.

If I instead put a xp:div control on my xpages I get the same thing but this div also give me javascript events like onClick.

please explain the difference

thanks

Thomas Adrian

http://www.notessidan.se

Subject: Didn’t know xp:div worked…

  • Traditionally the question has been to use xp:panel or just div, no xp: anything. They are the same on the client side. The difference is the server-side automagic works with a xp:panel and not with a div, so if you want to do something like partial refresh a div, then the xp:panel flavor simplifies that considerably. If you don’t need to use server-side automagic, the xp:-ness introduces a performance penalty that may be avoided by using a non-decorated HTML element.- The obvious answer for xp:div is it’s the same; since it’s an xp: thing the server-side automagic can work with it. Why it’s got onClick is a bit of a mystery.

Hope this helps…

Subject: Div control

@DavidI have a “Div” control in my “Container Controls”

  • Thomas

Subject: I don’t…

  • I have a panel who annoyingly non-removable pop-up comment says it generates a div, but no control anywhere that explicitly labels itself “Div”.- If I type in xp:div it does just as you say; when selected it has a list of events, and Properties calls itself “paragraph”. I can only conclude this is valid, and the heinously useless “documentation” simply doesn’t cover it.

Good luck…

Subject: I agree…

…a mystery it is

/Thomas