Re: [Wicket-user] passing IModel around

2006-04-02 Thread karthik Guru
just curious

Blog blog = (Blog)blogModel.getObject(null);

didn't work for you?

On 4/3/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:
> Works great, thanks Eelco!
>
>
> On 4/2/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > Aaargh. Ok, final try:
> >
> > public HeaderPanel(String id, IModel blogModel) {
> >   super(id, blogModel);
> >   Blog blog = (Blog)getModelObject();
> >
> > or
> >
> > public HeaderPanel(String id, IModel blogModel) {
> >   super(id);
> >   setModel(blogModel);
> >   Blog blog = (Blog)getModelObject();
> >
> > Eelco
> >
> > On 4/2/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > > Oh, I didn't look at your example yet. Better is this:
> > >
> > > public HeaderPanel(String id, IModel blogModel)
> > > {
> > > super(id);
> > >
> > > Blog blog = (Blog)getModelObject();
> > >
> > > Eelco
> > >
> > >
> > > On 4/2/06, Eelco Hillenius < [EMAIL PROTECTED]> wrote:
> > > > Just pass in null. The component parameter is only used by
> > > > CompoundPropertyModel and friends, not by LoadableDetachableModel.
> > > >
> > > > Eelco
> > > >
> > > >
> > > > On 4/2/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:
> > > > > That won't work, since getObject takes a parameter of
> Componentwhat
> > > > > would I pass in?
> > > > >
> > > > >
> > > > > On 4/2/06, karthik Guru < [EMAIL PROTECTED]> wrote:
> > > > > > The model isn't of type Blog. The object stored within
> > > > > > LoadableDetachableModel is of type Blog.
> > > > > >
> > > > > > Blog blog = (Blog)blogModel.getObject( )
> > > > > >
> > > > > > should hopefully work.?
> > > > > >
> > > > > > On 4/2/06, Vincent Jenks <[EMAIL PROTECTED] > wrote:
> > > > > > > I'm just testing something out.  Since I use EJB3 and need lazy
> > > > > > > initialization I'm making an attempt to see if passing an object
> with a
> > > > > > > collection of lazily-loaded elements in an IModel, from
> page-to-page,
> > > > > will
> > > > > > > prevent a LazyInitializationException (Hibernate).
> > > > > > >
> > > > > > > I start here in the first page:
> > > > > > >
> > > > > > > public class ViewBlog extends WebPage
> > > > > > > {
> > > > > > > public ViewBlog()
> > > > > > > {
> > > > > > > //get Blog in detached model
> > > > > > > IModel blogModel = new LoadableDetachableModel()
> > > > > > > {
> > > > > > > protected Object load()
> > > > > > > {
> > > > > > > return BlogProxy.getDefault(); //via proxy
> > > > > > > }
> > > > > > > };
> > > > > > >
> > > > > > > //add panel components
> > > > > > > add(new HeaderPanel("headerPanel", blogModel));
> > > > > > > 
> > > > > > >
> > > > > > > ...and then in the HeaderPanel I do this:
> > > > > > >
> > > > > > > public class HeaderPanel extends Panel
> > > > > > > {
> > > > > > > public HeaderPanel(String id, IModel blogModel)
> > > > > > > {
> > > > > > > super(id);
> > > > > > >
> > > > > > >  Blog blog = (Blog)blogModel; //EXCEPTION HERE!
> > > > > > > ..
> > > > > > >
> > > > > > > I get this exception:
> > > > > > >
> > > > > > > java.lang.ClassCastException: com.myapp.ui.ViewBlog$1
> > > > > > > at com.myapp.ui.panel.HeaderPanel.(HeaderPanel.java
> :34)
> > > > > > > at com.myapp.ui.ViewBlog .(ViewBlog.java:53)
> > > > > > > at
> > > > > > >
> > > > >
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > > > > > > Method)
> > > > > > > at
> > > > > > >
> sun.reflect.NativeConstructorAccessorImpl.newInstance
> > > > > (NativeConstructorAccessorImpl.java
> > > > > > > :39)
> > > > > > > at
> > > > > > >
> > > > >
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> > > > > > > at
> > > > > > > java.lang.reflect.Constructor.newInstance
> > > > > (Constructor.java:494)
> > > > > > > at java.lang.Class.newInstance0 (Class.java:350)
> > > > > > > at java.lang.Class.newInstance(Class.java:303)
> > > > > > >
> > > > > > > How do I down-cast to Blog (entity bean) from the IModel param?
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > -- karthik --
> > > > > >
> > > > > >
> > > > > >
> ---
> > > > > > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > > > > language
> > > > > > that extends applications into web and mobile media. Attend the
> live
> > > > > webcast
> > > > > > and join the prime developer group breaking into this new coding
> > > > > territory!
> > > > > >
> > > > >
> http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> > > > > > ___
> > > > > > Wicket-user mailing list
> > > > > > Wicket-user@lists.sourceforge.net
> > > > > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> >
> > 

Re: [Wicket-user] passing IModel around

2006-04-02 Thread Dorel Vaida
I'm not really up to date with wicket but in old versions you would have 
done, I suppose it hasn't changed anyway.


blogModel.getModelObject().

Vincent Jenks wrote:

That won't work, since getObject takes a parameter of 
Componentwhat would I pass in?


On 4/2/06, *karthik Guru* < [EMAIL PROTECTED] 
> wrote:


The model isn't of type Blog. The object stored within
LoadableDetachableModel is of type Blog.

Blog blog = (Blog)blogModel.getObject( )

should hopefully work.?

On 4/2/06, Vincent Jenks <[EMAIL PROTECTED]
> wrote:
> I'm just testing something out.  Since I use EJB3 and need lazy
> initialization I'm making an attempt to see if passing an object
with a
> collection of lazily-loaded elements in an IModel, from
page-to-page, will
> prevent a LazyInitializationException (Hibernate).
>
> I start here in the first page:
>
> public class ViewBlog extends WebPage
> {
> public ViewBlog()
> {
> //get Blog in detached model
> IModel blogModel = new LoadableDetachableModel()
> {
> protected Object load()
> {
> return BlogProxy.getDefault(); //via proxy
> }
> };
>
> //add panel components
> add(new HeaderPanel("headerPanel", blogModel));
> 
>
> ...and then in the HeaderPanel I do this:
>
> public class HeaderPanel extends Panel
> {
> public HeaderPanel(String id, IModel blogModel)
> {
> super(id);
>
>  Blog blog = (Blog)blogModel; //EXCEPTION HERE!
> ..
>
> I get this exception:
>
> java.lang.ClassCastException: com.myapp.ui.ViewBlog$1
> at com.myapp.ui.panel.HeaderPanel.(HeaderPanel.java :34)
> at com.myapp.ui.ViewBlog.(ViewBlog.java:53)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java
> :39)
> at
>

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at
> java.lang.reflect.Constructor.newInstance (Constructor.java:494)
> at java.lang.Class.newInstance0 (Class.java:350)
> at java.lang.Class.newInstance(Class.java:303)
>
> How do I down-cast to Blog (entity bean) from the IModel param?
>


--
-- karthik --


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language
that extends applications into web and mobile media. Attend the
live webcast
and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642

___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user






---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] panels addition to panels

2006-04-02 Thread R.A

Hi.

I create 2 nested panel classes in a page.

public class TestPage extends WebPage {
...
private class Panel1 extends Panel {
public Panel1 {
...
add(new Panel2());
}

private class Panel2 extends Panel {
public Panel2 {
super("panel2");
}
}
}
}

And I create TestPage.html, TestPage$Panel1.html and
TestPage$Panel1$Panel2.html.
Access to the Panel1 is succeeded, but access to the Panel2 is failed.

The exception is,
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel2, page = , path =
panel2.TestPage$Panel1$Panel2]]

Is panels addition to panels wrong?

Thank you.
R.A
--
View this message in context: 
http://www.nabble.com/panels-addition-to-panels-t1384873.html#a3719620
Sent from the Wicket - User forum at Nabble.com.



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] PageLink called request two times

2006-04-02 Thread R.A

Hi Johan, 

Can I ask you a question on and on?
I downloaded wicket-1.2-beta3 today and I noticed WicketServlet#doGet's
change.
Using this new archives, WicketServlet#doGet is called two times again...
But this time, WebSphere and Tomcat is under the same conditions.
So. Is this correct?

I opened WicketExamples -> compref -> wicket.markup.html.link.PageLink -> go
to our private/ non bookmarkable page.
WebShere's output is here.
06/04/03 12:16:07:844 JST] 766c0cfe SystemOut O === doGet
[06/04/03 12:16:07:844 JST] 766c0cfe SystemOut O === sessionId:
y_BoFxSDfww7MCNTjwjWZ3L
[06/04/03 12:16:07:844 JST] 766c0cfe SystemOut O === queryString:
wicket:interface=:1:pageLink::ILinkListener
[06/04/03 12:16:07:844 JST] 766c0cfe SystemOut O === bufferedResponse:
null
[06/04/03 12:16:07:906 JST] 766c0cfe MarkupCache   I
wicket.markup.MarkupCache  Loading markup from
file:/D:/dev/wsappdev51/workspace/WicketExamples1.2-b3Web/WebContent/WEB-INF/classes/wicket/examples/compref/NonBookmarkablePage.html
[06/04/03 12:16:08:000 JST]  1e74cfe SystemOut O === doGet
[06/04/03 12:16:08:000 JST]  1e74cfe SystemOut O === sessionId:
y_BoFxSDfww7MCNTjwjWZ3L
[06/04/03 12:16:08:000 JST]  1e74cfe SystemOut O === queryString:
wicket:interface=:2::
[06/04/03 12:16:08:000 JST]  1e74cfe SystemOut O === bufferedResponse:
[EMAIL PROTECTED]

Tomcat's output is here.
=== doGet
=== sessionId: 7D282BAB9EC7D92772D7513C6309176E
=== queryString: wicket:interface=:4:pageLink::ILinkListener
=== bufferedResponse: null
INFO  - MarkupCache- Loading markup from
file:/C:/Program%20File
s/Apache%20Group/Tomcat%204.1/webapps/WicketExamples1.2-b3Web/WEB-INF/classes/wi
cket/examples/compref/NonBookmarkablePage.html
=== doGet
=== sessionId: 7D282BAB9EC7D92772D7513C6309176E
=== queryString: wicket:interface=:5::
=== bufferedResponse:
[EMAIL PROTECTED]

I set system out in WicketServlet#doGet as follows.
public final void doGet(final HttpServletRequest servletRequest,
final HttpServletResponse servletResponse) throws 
ServletException,
IOException
{
System.out.println("=== doGet");
long time = System.currentTimeMillis();

// First, set the webapplication for this thread
Application.set(webApplication);

// Try to see if there is a redirect stored
HttpSession httpSession = servletRequest.getSession(false);
if (httpSession != null
&& 
webApplication.getRequestCycleSettings().getRenderStrategy() ==
IRequestCycleSettings.REDIRECT_TO_BUFFER)
{
String sessionId = httpSession.getId();
String queryString = servletRequest.getQueryString();

System.out.println("=== sessionId: " + sessionId);
System.out.println("=== queryString: " + queryString);

if (queryString != null)
{
BufferedHttpServletResponse bufferedResponse =
webApplication.popBufferedResponse(
sessionId, queryString);

System.out.println("=== bufferedResponse: " + bufferedResponse);

if (bufferedResponse != null)
{

bufferedResponse.writeTo(servletResponse);
// redirect responses are ignored for 
the request logger...
return;
}
}
}

Thank you.
R.A
--
View this message in context: 
http://www.nabble.com/PageLink-called-request-two-times-t1205926.html#a3719486
Sent from the Wicket - User forum at Nabble.com.



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] AJAX and replacing components...

2006-04-02 Thread Igor Vaynberg
you didn tactually replace anything in the page hierarchy which is where you need to do it. the components you add to the target are only queued for rendering, nothing more.so what you need to do in the onclick is:
public void onClick(AjaxRequestTarget target) {System.out.println("Update Link Clicked");      Label label=new Label("updateText", new
Date().toString());   // do the actual replacement of the panel  getParent().replace(label);    // queue the new panel for ajax rendering    target.addComponent
(label);}};-IgorOn 4/2/06, Ramnivas Laddad <[EMAIL PROTECTED]> wrote:
I am trying to use AjaxLink to replace one component with another.However, it doesn't seem to work. In real project, I need to replace one
panel with completely different panel, hence merely modifying the modeland invoking addComponent() with the existing component won't be sufficient.Here is an illustrative example. I have been trying with beta2, but just
updated to beta3. It has somewhat different behavior, but still the sameoverall effect.Markup:Click here to update
textcurrentJava:public class AjaxUpdatedLabelHome extends WebPage {
public AjaxUpdatedLabelHome() {AjaxLink updateLink = new AjaxLink("updateLink") {@Overridepublic void onClick(AjaxRequestTarget target) {System.out.println
("Update Link Clicked");target.addComponent(new Label("updateText", newDate().toString()));}};add(updateLink);add(new Label("updateText", "Current time will be displayed here"));
}}I do see the "Update Link Clicked" message when I click on the link.However, I do not see the label being replaced. The Wicket Ajax Debugwindows shows that a runtime exception is thrown --
"java.lang.IllegalArgumentException: markupId cannot be empty" (the samebehavior as beta2).So I modified the code to explicitly provide the markup id:target.addComponent(new Label("updateText", new
Date().toString()), "updateText");I still do not see the label being replaced. The Wicket Ajax Debugwindow shows the following output: INFO: INFO: initiating ajax GET request with... INFO: url:
/quickstart/app?wicket:interface=:1:updateLink::IBehaviorListener&wicket:behaviorId=0 INFO: successHandler:function () {} INFO: failureHandler:function () {} INFO: received ajax response. 53 characters, envelope following...
 INFO: INFO: ERROR: malformed response envelope: could not find root element INFO: invoking failure handler...
ERROR: error while processing response: TypeError: root has noproperties.root has no properties INFO: invoking failure handler...What could be going wrong? Please help.-Ramnivas---
This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user



[Wicket-user] AJAX and replacing components...

2006-04-02 Thread Ramnivas Laddad
I am trying to use AjaxLink to replace one component with another. 
However, it doesn't seem to work. In real project, I need to replace one 
panel with completely different panel, hence merely modifying the model 
and invoking addComponent() with the existing component won't be sufficient.


Here is an illustrative example. I have been trying with beta2, but just 
updated to beta3. It has somewhat different behavior, but still the same 
overall effect.


Markup:

   
   
   Click here to update 
text

   current
   


Java:
public class AjaxUpdatedLabelHome extends WebPage {
   public AjaxUpdatedLabelHome() {
   AjaxLink updateLink = new AjaxLink("updateLink") {
   @Override
   public void onClick(AjaxRequestTarget target) {
   System.out.println("Update Link Clicked");
   target.addComponent(new Label("updateText", new 
Date().toString()));

   }};
   add(updateLink);
   add(new Label("updateText", "Current time will be displayed here"));
   }
}

I do see the "Update Link Clicked" message when I click on the link. 
However, I do not see the label being replaced. The Wicket Ajax Debug 
windows shows that a runtime exception is thrown -- 
"java.lang.IllegalArgumentException: markupId cannot be empty" (the same 
behavior as beta2).


So I modified the code to explicitly provide the markup id:
   target.addComponent(new Label("updateText", new 
Date().toString()), "updateText");


I still do not see the label being replaced. The Wicket Ajax Debug 
window shows the following output:

INFO:
INFO: initiating ajax GET request with...
INFO: url: 
/quickstart/app?wicket:interface=:1:updateLink::IBehaviorListener&wicket:behaviorId=0

INFO: successHandler:function () {
}
INFO: failureHandler:function () {
}
INFO: received ajax response. 53 characters, envelope following...
INFO:
INFO: 
ERROR: malformed response envelope: could not find root  
element

INFO: invoking failure handler...
ERROR: error while processing response: TypeError: root has no 
properties.root has no properties

INFO: invoking failure handler...

What could be going wrong? Please help.

-Ramnivas


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Wicket 1.2-beta3 is available

2006-04-02 Thread Martijn Dashorst
All,I have created and uploaded the third beta release of Wicket 1.2. We have solved quite some bugs, but there are some nasty one's still unsolved. This is why we chose to release another beta instead of moving into the end game of our 
1.2 release schedule. You can monitor the bug list at sourceforge (http://sourceforge.net/tracker/?group_id=119783&atid=684975) to see which are still open and which are solved.
The outstanding bugs shouldn't hurt development efforts, so if you are in the process of upgrading to Wicket 1.2, please continue to do so with this release (or bake your own from SVN trunk). This release is not considered stable enough to use in production.
Help us finalize this release by downloading and test driving this release. The more bugs you find now, the better the final release will be!You can download the release(s) of the different projects at the usual download location:
http://sourceforge.net/project/showfiles.php?group_id=119783This release contains the following projects: o wicket o wicket-extensions
 o wicket-spring o wicket-spring-annot o wicket-auth-roles o and all example projects for each release.Have fun!- the Wicket team-- Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!
-- http://wicketframework.org


Re: [Wicket-user] passing IModel around

2006-04-02 Thread Vincent Jenks
Works great, thanks Eelco!On 4/2/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
Aaargh. Ok, final try:public HeaderPanel(String id, IModel blogModel) {  super(id, blogModel);  Blog blog = (Blog)getModelObject();orpublic HeaderPanel(String id, IModel blogModel) {  super(id);
  setModel(blogModel);  Blog blog = (Blog)getModelObject();EelcoOn 4/2/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:> Oh, I didn't look at your example yet. Better is this:
>> public HeaderPanel(String id, IModel blogModel)> {> super(id);>> Blog blog = (Blog)getModelObject();>> Eelco>>> On 4/2/06, Eelco Hillenius <
[EMAIL PROTECTED]> wrote:> > Just pass in null. The component parameter is only used by> > CompoundPropertyModel and friends, not by LoadableDetachableModel.
> >> > Eelco> >> >> > On 4/2/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:> > > That won't work, since getObject takes a parameter of Componentwhat
> > > would I pass in?> > >> > >> > > On 4/2/06, karthik Guru < [EMAIL PROTECTED]> wrote:> > > > The model isn't of type Blog. The object stored within
> > > > LoadableDetachableModel is of type Blog.> > > >> > > > Blog blog = (Blog)blogModel.getObject( )> > > >> > > > should hopefully work.?
> > > >> > > > On 4/2/06, Vincent Jenks <[EMAIL PROTECTED] > wrote:> > > > > I'm just testing something out.  Since I use EJB3 and need lazy
> > > > > initialization I'm making an attempt to see if passing an object with a> > > > > collection of lazily-loaded elements in an IModel, from page-to-page,> > > will
> > > > > prevent a LazyInitializationException (Hibernate).> > > > >> > > > > I start here in the first page:> > > > >> > > > > public class ViewBlog extends WebPage
> > > > > {> > > > > public ViewBlog()> > > > > {> > > > > //get Blog in detached model> > > > > IModel blogModel = new LoadableDetachableModel()
> > > > > {> > > > > protected Object load()> > > > > {> > > > > return BlogProxy.getDefault(); //via proxy
> > > > > }> > > > > };> > > > >> > > > > //add panel components> > > > > add(new HeaderPanel("headerPanel", blogModel));
> > > > > > > > > >> > > > > ...and then in the HeaderPanel I do this:> > > > >> > > > > public class HeaderPanel extends Panel
> > > > > {> > > > > public HeaderPanel(String id, IModel blogModel)> > > > > {> > > > > super(id);> > > > >
> > > > >  Blog blog = (Blog)blogModel; //EXCEPTION HERE!> > > > > ..> > > > >> > > > > I get this exception:> > > > >
> > > > > java.lang.ClassCastException: com.myapp.ui.ViewBlog$1> > > > > at com.myapp.ui.panel.HeaderPanel.(HeaderPanel.java :34)> > > > > at com.myapp.ui.ViewBlog
.(ViewBlog.java:53)> > > > > at> > > > >> > > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native> > > > > Method)> > > > > at
> > > > > sun.reflect.NativeConstructorAccessorImpl.newInstance> > > (NativeConstructorAccessorImpl.java> > > > > :39)> > > > > at> > > > >
> > > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)> > > > > at> > > > > java.lang.reflect.Constructor.newInstance
> > > (Constructor.java:494)> > > > > at java.lang.Class.newInstance0 (Class.java:350)> > > > > at java.lang.Class.newInstance(Class.java:303)> > > > >
> > > > > How do I down-cast to Blog (entity bean) from the IModel param?> > > > >> > > >> > > >> > > > --> > > > -- karthik --
> > > >> > > >> > > > ---> > > > This SF.Net email is sponsored by xPML, a groundbreaking scripting> > > language
> > > > that extends applications into web and mobile media. Attend the live> > > webcast> > > > and join the prime developer group breaking into this new coding> > > territory!
> > > >> > > http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642> > > > ___
> > > > Wicket-user mailing list> > > > Wicket-user@lists.sourceforge.net> > > > 
https://lists.sourceforge.net/lists/listinfo/wicket-user> > > >> > >> > >> >>---This SF.Net
 email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user



Re: [Wicket-user] passing IModel around

2006-04-02 Thread Eelco Hillenius
Just pass in null. The component parameter is only used by
CompoundPropertyModel and friends, not by LoadableDetachableModel.

Eelco


On 4/2/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:
> That won't work, since getObject takes a parameter of Componentwhat
> would I pass in?
>
>
> On 4/2/06, karthik Guru < [EMAIL PROTECTED]> wrote:
> > The model isn't of type Blog. The object stored within
> > LoadableDetachableModel is of type Blog.
> >
> > Blog blog = (Blog)blogModel.getObject( )
> >
> > should hopefully work.?
> >
> > On 4/2/06, Vincent Jenks <[EMAIL PROTECTED] > wrote:
> > > I'm just testing something out.  Since I use EJB3 and need lazy
> > > initialization I'm making an attempt to see if passing an object with a
> > > collection of lazily-loaded elements in an IModel, from page-to-page,
> will
> > > prevent a LazyInitializationException (Hibernate).
> > >
> > > I start here in the first page:
> > >
> > > public class ViewBlog extends WebPage
> > > {
> > > public ViewBlog()
> > > {
> > > //get Blog in detached model
> > > IModel blogModel = new LoadableDetachableModel()
> > > {
> > > protected Object load()
> > > {
> > > return BlogProxy.getDefault(); //via proxy
> > > }
> > > };
> > >
> > > //add panel components
> > > add(new HeaderPanel("headerPanel", blogModel));
> > > 
> > >
> > > ...and then in the HeaderPanel I do this:
> > >
> > > public class HeaderPanel extends Panel
> > > {
> > > public HeaderPanel(String id, IModel blogModel)
> > > {
> > > super(id);
> > >
> > >  Blog blog = (Blog)blogModel; //EXCEPTION HERE!
> > > ..
> > >
> > > I get this exception:
> > >
> > > java.lang.ClassCastException: com.myapp.ui.ViewBlog$1
> > > at com.myapp.ui.panel.HeaderPanel.(HeaderPanel.java :34)
> > > at com.myapp.ui.ViewBlog.(ViewBlog.java:53)
> > > at
> > >
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > > Method)
> > > at
> > > sun.reflect.NativeConstructorAccessorImpl.newInstance
> (NativeConstructorAccessorImpl.java
> > > :39)
> > > at
> > >
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> > > at
> > > java.lang.reflect.Constructor.newInstance
> (Constructor.java:494)
> > > at java.lang.Class.newInstance0 (Class.java:350)
> > > at java.lang.Class.newInstance(Class.java:303)
> > >
> > > How do I down-cast to Blog (entity bean) from the IModel param?
> > >
> >
> >
> > --
> > -- karthik --
> >
> >
> > ---
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> > that extends applications into web and mobile media. Attend the live
> webcast
> > and join the prime developer group breaking into this new coding
> territory!
> >
> http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> > ___
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] passing IModel around

2006-04-02 Thread Eelco Hillenius
Oh, I didn't look at your example yet. Better is this:

public HeaderPanel(String id, IModel blogModel)
{
super(id);

Blog blog = (Blog)getModelObject();

Eelco


On 4/2/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> Just pass in null. The component parameter is only used by
> CompoundPropertyModel and friends, not by LoadableDetachableModel.
>
> Eelco
>
>
> On 4/2/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:
> > That won't work, since getObject takes a parameter of Componentwhat
> > would I pass in?
> >
> >
> > On 4/2/06, karthik Guru < [EMAIL PROTECTED]> wrote:
> > > The model isn't of type Blog. The object stored within
> > > LoadableDetachableModel is of type Blog.
> > >
> > > Blog blog = (Blog)blogModel.getObject( )
> > >
> > > should hopefully work.?
> > >
> > > On 4/2/06, Vincent Jenks <[EMAIL PROTECTED] > wrote:
> > > > I'm just testing something out.  Since I use EJB3 and need lazy
> > > > initialization I'm making an attempt to see if passing an object with a
> > > > collection of lazily-loaded elements in an IModel, from page-to-page,
> > will
> > > > prevent a LazyInitializationException (Hibernate).
> > > >
> > > > I start here in the first page:
> > > >
> > > > public class ViewBlog extends WebPage
> > > > {
> > > > public ViewBlog()
> > > > {
> > > > //get Blog in detached model
> > > > IModel blogModel = new LoadableDetachableModel()
> > > > {
> > > > protected Object load()
> > > > {
> > > > return BlogProxy.getDefault(); //via proxy
> > > > }
> > > > };
> > > >
> > > > //add panel components
> > > > add(new HeaderPanel("headerPanel", blogModel));
> > > > 
> > > >
> > > > ...and then in the HeaderPanel I do this:
> > > >
> > > > public class HeaderPanel extends Panel
> > > > {
> > > > public HeaderPanel(String id, IModel blogModel)
> > > > {
> > > > super(id);
> > > >
> > > >  Blog blog = (Blog)blogModel; //EXCEPTION HERE!
> > > > ..
> > > >
> > > > I get this exception:
> > > >
> > > > java.lang.ClassCastException: com.myapp.ui.ViewBlog$1
> > > > at com.myapp.ui.panel.HeaderPanel.(HeaderPanel.java :34)
> > > > at com.myapp.ui.ViewBlog.(ViewBlog.java:53)
> > > > at
> > > >
> > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > > > Method)
> > > > at
> > > > sun.reflect.NativeConstructorAccessorImpl.newInstance
> > (NativeConstructorAccessorImpl.java
> > > > :39)
> > > > at
> > > >
> > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> > > > at
> > > > java.lang.reflect.Constructor.newInstance
> > (Constructor.java:494)
> > > > at java.lang.Class.newInstance0 (Class.java:350)
> > > > at java.lang.Class.newInstance(Class.java:303)
> > > >
> > > > How do I down-cast to Blog (entity bean) from the IModel param?
> > > >
> > >
> > >
> > > --
> > > -- karthik --
> > >
> > >
> > > ---
> > > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > language
> > > that extends applications into web and mobile media. Attend the live
> > webcast
> > > and join the prime developer group breaking into this new coding
> > territory!
> > >
> > http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> > > ___
> > > Wicket-user mailing list
> > > Wicket-user@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> >
> >
>


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] passing IModel around

2006-04-02 Thread Eelco Hillenius
Aaargh. Ok, final try:

public HeaderPanel(String id, IModel blogModel) {
  super(id, blogModel);
  Blog blog = (Blog)getModelObject();

or

public HeaderPanel(String id, IModel blogModel) {
  super(id);
  setModel(blogModel);
  Blog blog = (Blog)getModelObject();

Eelco

On 4/2/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> Oh, I didn't look at your example yet. Better is this:
>
> public HeaderPanel(String id, IModel blogModel)
> {
> super(id);
>
> Blog blog = (Blog)getModelObject();
>
> Eelco
>
>
> On 4/2/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > Just pass in null. The component parameter is only used by
> > CompoundPropertyModel and friends, not by LoadableDetachableModel.
> >
> > Eelco
> >
> >
> > On 4/2/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:
> > > That won't work, since getObject takes a parameter of Componentwhat
> > > would I pass in?
> > >
> > >
> > > On 4/2/06, karthik Guru < [EMAIL PROTECTED]> wrote:
> > > > The model isn't of type Blog. The object stored within
> > > > LoadableDetachableModel is of type Blog.
> > > >
> > > > Blog blog = (Blog)blogModel.getObject( )
> > > >
> > > > should hopefully work.?
> > > >
> > > > On 4/2/06, Vincent Jenks <[EMAIL PROTECTED] > wrote:
> > > > > I'm just testing something out.  Since I use EJB3 and need lazy
> > > > > initialization I'm making an attempt to see if passing an object with 
> > > > > a
> > > > > collection of lazily-loaded elements in an IModel, from page-to-page,
> > > will
> > > > > prevent a LazyInitializationException (Hibernate).
> > > > >
> > > > > I start here in the first page:
> > > > >
> > > > > public class ViewBlog extends WebPage
> > > > > {
> > > > > public ViewBlog()
> > > > > {
> > > > > //get Blog in detached model
> > > > > IModel blogModel = new LoadableDetachableModel()
> > > > > {
> > > > > protected Object load()
> > > > > {
> > > > > return BlogProxy.getDefault(); //via proxy
> > > > > }
> > > > > };
> > > > >
> > > > > //add panel components
> > > > > add(new HeaderPanel("headerPanel", blogModel));
> > > > > 
> > > > >
> > > > > ...and then in the HeaderPanel I do this:
> > > > >
> > > > > public class HeaderPanel extends Panel
> > > > > {
> > > > > public HeaderPanel(String id, IModel blogModel)
> > > > > {
> > > > > super(id);
> > > > >
> > > > >  Blog blog = (Blog)blogModel; //EXCEPTION HERE!
> > > > > ..
> > > > >
> > > > > I get this exception:
> > > > >
> > > > > java.lang.ClassCastException: com.myapp.ui.ViewBlog$1
> > > > > at com.myapp.ui.panel.HeaderPanel.(HeaderPanel.java :34)
> > > > > at com.myapp.ui.ViewBlog.(ViewBlog.java:53)
> > > > > at
> > > > >
> > > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > > > > Method)
> > > > > at
> > > > > sun.reflect.NativeConstructorAccessorImpl.newInstance
> > > (NativeConstructorAccessorImpl.java
> > > > > :39)
> > > > > at
> > > > >
> > > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> > > > > at
> > > > > java.lang.reflect.Constructor.newInstance
> > > (Constructor.java:494)
> > > > > at java.lang.Class.newInstance0 (Class.java:350)
> > > > > at java.lang.Class.newInstance(Class.java:303)
> > > > >
> > > > > How do I down-cast to Blog (entity bean) from the IModel param?
> > > > >
> > > >
> > > >
> > > > --
> > > > -- karthik --
> > > >
> > > >
> > > > ---
> > > > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > > language
> > > > that extends applications into web and mobile media. Attend the live
> > > webcast
> > > > and join the prime developer group breaking into this new coding
> > > territory!
> > > >
> > > http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> > > > ___
> > > > Wicket-user mailing list
> > > > Wicket-user@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > >
> > >
> > >
> >
>


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] passing IModel around

2006-04-02 Thread Vincent Jenks
That won't work, since getObject takes a parameter of Componentwhat would I pass in?On 4/2/06, karthik Guru <
[EMAIL PROTECTED]> wrote:The model isn't of type Blog. The object stored within
LoadableDetachableModel is of type Blog.Blog blog = (Blog)blogModel.getObject( )should hopefully work.?On 4/2/06, Vincent Jenks <[EMAIL PROTECTED]
> wrote:> I'm just testing something out.  Since I use EJB3 and need lazy> initialization I'm making an attempt to see if passing an object with a> collection of lazily-loaded elements in an IModel, from page-to-page, will
> prevent a LazyInitializationException (Hibernate).>> I start here in the first page:>> public class ViewBlog extends WebPage> {> public ViewBlog()> {> //get Blog in detached model
> IModel blogModel = new LoadableDetachableModel()> {> protected Object load()> {> return BlogProxy.getDefault(); //via proxy> }
> };>> //add panel components> add(new HeaderPanel("headerPanel", blogModel));> >> ...and then in the HeaderPanel I do this:
>> public class HeaderPanel extends Panel> {> public HeaderPanel(String id, IModel blogModel)> {> super(id);>>  Blog blog = (Blog)blogModel; //EXCEPTION HERE!
> ..>> I get this exception:>> java.lang.ClassCastException: com.myapp.ui.ViewBlog$1> at com.myapp.ui.panel.HeaderPanel.(HeaderPanel.java :34)> at 
com.myapp.ui.ViewBlog.(ViewBlog.java:53)> at> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native> Method)> at> sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java> :39)> at> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)> at> java.lang.reflect.Constructor.newInstance
(Constructor.java:494)> at java.lang.Class.newInstance0 (Class.java:350)> at java.lang.Class.newInstance(Class.java:303)>> How do I down-cast to Blog (entity bean) from the IModel param?
>-- -- karthik -This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] passing IModel around

2006-04-02 Thread karthik Guru
The model isn't of type Blog. The object stored within
LoadableDetachableModel is of type Blog.

Blog blog = (Blog)blogModel.getObject( )

should hopefully work.?

On 4/2/06, Vincent Jenks <[EMAIL PROTECTED]> wrote:
> I'm just testing something out.  Since I use EJB3 and need lazy
> initialization I'm making an attempt to see if passing an object with a
> collection of lazily-loaded elements in an IModel, from page-to-page, will
> prevent a LazyInitializationException (Hibernate).
>
> I start here in the first page:
>
> public class ViewBlog extends WebPage
> {
> public ViewBlog()
> {
> //get Blog in detached model
> IModel blogModel = new LoadableDetachableModel()
> {
> protected Object load()
> {
> return BlogProxy.getDefault(); //via proxy
> }
> };
>
> //add panel components
> add(new HeaderPanel("headerPanel", blogModel));
> 
>
> ...and then in the HeaderPanel I do this:
>
> public class HeaderPanel extends Panel
> {
> public HeaderPanel(String id, IModel blogModel)
> {
> super(id);
>
>  Blog blog = (Blog)blogModel; //EXCEPTION HERE!
> ..
>
> I get this exception:
>
> java.lang.ClassCastException: com.myapp.ui.ViewBlog$1
> at com.myapp.ui.panel.HeaderPanel.(HeaderPanel.java :34)
> at com.myapp.ui.ViewBlog.(ViewBlog.java:53)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java
> :39)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at
> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at java.lang.Class.newInstance0 (Class.java:350)
> at java.lang.Class.newInstance(Class.java:303)
>
> How do I down-cast to Blog (entity bean) from the IModel param?
>


--
 -- karthik --


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] passing IModel around

2006-04-02 Thread Vincent Jenks
I'm just testing something out.  Since I use EJB3 and need lazy initialization I'm making an attempt to see if passing an object with a collection of lazily-loaded elements in an IModel, from page-to-page, will prevent a LazyInitializationException (Hibernate).
I start here in the first page:public class ViewBlog extends WebPage{        public ViewBlog()    {        //get Blog in detached model        IModel blogModel = new LoadableDetachableModel()
        {            protected Object load()            {                return BlogProxy.getDefault(); //via proxy            }        };                //add panel components        add(new HeaderPanel("headerPanel", blogModel));
...and then in the HeaderPanel I do this:public class HeaderPanel extends Panel{        public HeaderPanel(String id, IModel blogModel)    {        super(id);        
        Blog blog = (Blog)blogModel; //EXCEPTION HERE!..I get this exception:java.lang.ClassCastException: com.myapp.ui.ViewBlog$1    at com.myapp.ui.panel.HeaderPanel.(HeaderPanel.java
:34)    at com.myapp.ui.ViewBlog.(ViewBlog.java:53)    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java
:39)    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)    at java.lang.Class.newInstance0
(Class.java:350)    at java.lang.Class.newInstance(Class.java:303)How do I down-cast to Blog (entity bean) from the IModel param?


Re: [Wicket-user] Re: Wicket Include vs. RequestDispatcher.include

2006-04-02 Thread Nili Adoram
Our application is composed of wicket page and struts page (we wanted to 
avoid rewriting our huge application so we decided that only new pages 
are implemented as wicket pages).
In order to achieve a unique layout for all pages no matter if wicket or 
struts I used sitemesh servlet filter with url pattern "/*" which 
decorates all pages.

This is truly as simple as it sounds.

Nili

Eelco Hillenius wrote:

That's interesting. Do you include Wicket pages in you sitemesh definitions too?

Eelco

On 4/1/06, Nili Adoram <[EMAIL PROTECTED]> wrote:
  

After reconsidering I used Sitemesh which provides a better approach to
this issue.

However, this is a good opportunity to thank you Wicket team for
developing the most wonderful framework.
I voted for you!

Nili


Eelco Hillenius wrote:


To my knowledge, none of the core developers of Wicket uses the
Include component for their projects. What about this: if you and
anyone else that uses this functionality agree on what would be the
best implementation, I'd be happy to look at the patch and put it in
Wicket if we agree on it. That would work better than me developing it
and guessing what is right.

Ideally, it should work similar to sitemesh, but simpler, as we don't
need the composition (it would steer people the wrong direction for
how to do things with Wicket) and of course without a line of xml
configuration.

I'd like to keep it one component thought, so I wouldn't be in favor
of the LightInclude as mentioned the post before this. I'd rather have
some property for deciding how the include should work.

Related issues:
http://sourceforge.net/tracker/?group_id=119783&atid=684978&func=detail&aid=1243549
http://sourceforge.net/tracker/?group_id=119783&atid=684978&func=detail&aid=1285909

Eelco


On 3/30/06, Robert McClay <[EMAIL PROTECTED]> wrote:

  

I posted a very similar "component" to the group a while back -- search
for "Servlet forward to a JSP". It could be used as a starting point
for a "nice" component, as it definitely needs polishing.

On 2006-03-29 23:54:57 -0700, Nili Adoram <[EMAIL PROTECTED]> said:




How about extending Include as follows:
public class LightInclude extends Include {

public LightInclude(String id, String model, ServletRequest
request, ServletResponse response) {
   this.request = request;
   this.response = response;
}

protected String importUrl(String url) {
//create a buffer
Writer writer = new BufferedWriter(new CharArratWriter());
//create some mockup response
ServletResponse mockupResponse = new ServletResponse() {
   //implement all interface methods by delegating to the
original response except for this:
   public PrintWriter getWriter(){
  return new PrintWriter(writer);
   }
};
   //call RequestDispatcher with the mockup response
//this will write the response to our buffer
request.getrequestDispatcher(url).include(request, mockupResponse);
   //return the content of the buffer
return writer.toString();
}
}

I guess some additional polish is required..
Nili

Eelco Hillenius wrote:

  

That's what I did in the first version(s) of Include. There were
issues with it, which I unfortunately forgot. I never use this
component myself, but if you have good ideas in the form of patches,
I'd be happy to look at them.

Eelco

On 3/29/06, Nili Adoram <[EMAIL PROTECTED]> wrote:




Hi,
Is there an option to use utilize wicket Include without opening a new
connection?
I would like to include the contents of a URL like
RequestDispatcher.include() does, directly into a wicket component.
10x
Nili


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



  

---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user





---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
an

Re: [Wicket-user] Re: Wicket Include vs. RequestDispatcher.include

2006-04-02 Thread Eelco Hillenius
Thanks for voting. Don't forget to use it too! ;)

Eelco

On 4/1/06, Nili Adoram <[EMAIL PROTECTED]> wrote:
> After reconsidering I used Sitemesh which provides a better approach to
> this issue.
>
> However, this is a good opportunity to thank you Wicket team for
> developing the most wonderful framework.
> I voted for you!
>
> Nili
>
>
> Eelco Hillenius wrote:
> > To my knowledge, none of the core developers of Wicket uses the
> > Include component for their projects. What about this: if you and
> > anyone else that uses this functionality agree on what would be the
> > best implementation, I'd be happy to look at the patch and put it in
> > Wicket if we agree on it. That would work better than me developing it
> > and guessing what is right.
> >
> > Ideally, it should work similar to sitemesh, but simpler, as we don't
> > need the composition (it would steer people the wrong direction for
> > how to do things with Wicket) and of course without a line of xml
> > configuration.
> >
> > I'd like to keep it one component thought, so I wouldn't be in favor
> > of the LightInclude as mentioned the post before this. I'd rather have
> > some property for deciding how the include should work.
> >
> > Related issues:
> > http://sourceforge.net/tracker/?group_id=119783&atid=684978&func=detail&aid=1243549
> > http://sourceforge.net/tracker/?group_id=119783&atid=684978&func=detail&aid=1285909
> >
> > Eelco
> >
> >
> > On 3/30/06, Robert McClay <[EMAIL PROTECTED]> wrote:
> >
> >> I posted a very similar "component" to the group a while back -- search
> >> for "Servlet forward to a JSP". It could be used as a starting point
> >> for a "nice" component, as it definitely needs polishing.
> >>
> >> On 2006-03-29 23:54:57 -0700, Nili Adoram <[EMAIL PROTECTED]> said:
> >>
> >>
> >>> How about extending Include as follows:
> >>> public class LightInclude extends Include {
> >>>
> >>> public LightInclude(String id, String model, ServletRequest
> >>> request, ServletResponse response) {
> >>>this.request = request;
> >>>this.response = response;
> >>> }
> >>>
> >>> protected String importUrl(String url) {
> >>> //create a buffer
> >>> Writer writer = new BufferedWriter(new CharArratWriter());
> >>> //create some mockup response
> >>> ServletResponse mockupResponse = new ServletResponse() {
> >>>//implement all interface methods by delegating to the
> >>> original response except for this:
> >>>public PrintWriter getWriter(){
> >>>   return new PrintWriter(writer);
> >>>}
> >>> };
> >>>//call RequestDispatcher with the mockup response
> >>> //this will write the response to our buffer
> >>> request.getrequestDispatcher(url).include(request, 
> >>> mockupResponse);
> >>>//return the content of the buffer
> >>> return writer.toString();
> >>> }
> >>> }
> >>>
> >>> I guess some additional polish is required..
> >>> Nili
> >>>
> >>> Eelco Hillenius wrote:
> >>>
>  That's what I did in the first version(s) of Include. There were
>  issues with it, which I unfortunately forgot. I never use this
>  component myself, but if you have good ideas in the form of patches,
>  I'd be happy to look at them.
> 
>  Eelco
> 
>  On 3/29/06, Nili Adoram <[EMAIL PROTECTED]> wrote:
> 
> 
> > Hi,
> > Is there an option to use utilize wicket Include without opening a new
> > connection?
> > I would like to include the contents of a URL like
> > RequestDispatcher.include() does, directly into a wicket component.
> > 10x
> > Nili
> >
> >
> > ---
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting 
> > language
> > that extends applications into web and mobile media. Attend the live 
> > webcast
> > and join the prime developer group breaking into this new coding 
> > territory!
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> > ___
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
> >
>  ---
>  This SF.Net email is sponsored by xPML, a groundbreaking scripting 
>  language
>  that extends applications into web and mobile media. Attend the live 
>  webcast
>  and join the prime developer group breaking into this new coding 
>  territory!
>  http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
>  ___
>  Wicket-user mailing list
>  Wicket-user@lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 
> 
> >>> 

Re: [Wicket-user] Re: Wicket Include vs. RequestDispatcher.include

2006-04-02 Thread Eelco Hillenius
That's interesting. Do you include Wicket pages in you sitemesh definitions too?

Eelco

On 4/1/06, Nili Adoram <[EMAIL PROTECTED]> wrote:
> After reconsidering I used Sitemesh which provides a better approach to
> this issue.
>
> However, this is a good opportunity to thank you Wicket team for
> developing the most wonderful framework.
> I voted for you!
>
> Nili
>
>
> Eelco Hillenius wrote:
> > To my knowledge, none of the core developers of Wicket uses the
> > Include component for their projects. What about this: if you and
> > anyone else that uses this functionality agree on what would be the
> > best implementation, I'd be happy to look at the patch and put it in
> > Wicket if we agree on it. That would work better than me developing it
> > and guessing what is right.
> >
> > Ideally, it should work similar to sitemesh, but simpler, as we don't
> > need the composition (it would steer people the wrong direction for
> > how to do things with Wicket) and of course without a line of xml
> > configuration.
> >
> > I'd like to keep it one component thought, so I wouldn't be in favor
> > of the LightInclude as mentioned the post before this. I'd rather have
> > some property for deciding how the include should work.
> >
> > Related issues:
> > http://sourceforge.net/tracker/?group_id=119783&atid=684978&func=detail&aid=1243549
> > http://sourceforge.net/tracker/?group_id=119783&atid=684978&func=detail&aid=1285909
> >
> > Eelco
> >
> >
> > On 3/30/06, Robert McClay <[EMAIL PROTECTED]> wrote:
> >
> >> I posted a very similar "component" to the group a while back -- search
> >> for "Servlet forward to a JSP". It could be used as a starting point
> >> for a "nice" component, as it definitely needs polishing.
> >>
> >> On 2006-03-29 23:54:57 -0700, Nili Adoram <[EMAIL PROTECTED]> said:
> >>
> >>
> >>> How about extending Include as follows:
> >>> public class LightInclude extends Include {
> >>>
> >>> public LightInclude(String id, String model, ServletRequest
> >>> request, ServletResponse response) {
> >>>this.request = request;
> >>>this.response = response;
> >>> }
> >>>
> >>> protected String importUrl(String url) {
> >>> //create a buffer
> >>> Writer writer = new BufferedWriter(new CharArratWriter());
> >>> //create some mockup response
> >>> ServletResponse mockupResponse = new ServletResponse() {
> >>>//implement all interface methods by delegating to the
> >>> original response except for this:
> >>>public PrintWriter getWriter(){
> >>>   return new PrintWriter(writer);
> >>>}
> >>> };
> >>>//call RequestDispatcher with the mockup response
> >>> //this will write the response to our buffer
> >>> request.getrequestDispatcher(url).include(request, 
> >>> mockupResponse);
> >>>//return the content of the buffer
> >>> return writer.toString();
> >>> }
> >>> }
> >>>
> >>> I guess some additional polish is required..
> >>> Nili
> >>>
> >>> Eelco Hillenius wrote:
> >>>
>  That's what I did in the first version(s) of Include. There were
>  issues with it, which I unfortunately forgot. I never use this
>  component myself, but if you have good ideas in the form of patches,
>  I'd be happy to look at them.
> 
>  Eelco
> 
>  On 3/29/06, Nili Adoram <[EMAIL PROTECTED]> wrote:
> 
> 
> > Hi,
> > Is there an option to use utilize wicket Include without opening a new
> > connection?
> > I would like to include the contents of a URL like
> > RequestDispatcher.include() does, directly into a wicket component.
> > 10x
> > Nili
> >
> >
> > ---
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting 
> > language
> > that extends applications into web and mobile media. Attend the live 
> > webcast
> > and join the prime developer group breaking into this new coding 
> > territory!
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> > ___
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
> >
>  ---
>  This SF.Net email is sponsored by xPML, a groundbreaking scripting 
>  language
>  that extends applications into web and mobile media. Attend the live 
>  webcast
>  and join the prime developer group breaking into this new coding 
>  territory!
>  http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
>  ___
>  Wicket-user mailing list
>  Wicket-user@lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 
> 
> >