Re: WebMarkupContainer as string for use in jqgrid cell

2010-06-03 Thread Sam Zilverberg
Sweet.
I looked at the changes made and now I understand what you meant by
virtual repeater.

Anyway I've decided to use a custom implementation of wicket's DataTable for
now and if
a demand for more fancy grids will be made I'l probably come back to
wijqgrid or try out inmethod grid.

Thanks
-Sam

On Wed, Jun 2, 2010 at 9:31 AM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Hi Sam,

 Yesterday I commited some changes to [1] that add the possibility to
 render Wicket cells as components. You can find an example on [2].
 There are some limitations to the kind of cells you can show (they
 cannot add JavaScript to the page) but at least you can add cells
 containing links and so on.

 Best,

 Ernesto

 References,

 1-http://code.google.com/p/wiquery-plugins/
 2-
 http://code.google.com/p/wiquery-plugins/source/browse/trunk/wiquery-plugins/example-war/src/main/java/com/wiquery/plugins/demo/NewGridPanel.java



 On Tue, May 25, 2010 at 4:04 PM, Sam Zilverberg samzilverb...@gmail.com
 wrote:
  I thought of contributing some of the changes after a while but then I
  realized they were too
  project specific and not abstract enough so no one else would be able to
 use
  em.
  Example: I created a JQGridDataProvider that the grid uses but the
 provider
  is tightly tied to hibernate
  and some other stuff i'm using in the project.
 
  I took a look at AjaxRequestTarget and its inner classes to check how
 wicket
  renders components on ajax requests.
  These components always have parent pages and the rendering process looks
  something like this:
  page.startComponentRender(comp) - comp.renderComponenet() -
  page.endComponentRender(comp)
  then the response from request cycle is set to be the ajax response so
 the
  html is directed to it.
 
  I don't see anyway I can mimic this kind of behavior and render wicket
  components without them having
  some parent page.
 
  I havn't seen jweekend's implementation in a long time because they added
  password protection to labs.jweekend.com/public.
  But what I remember is that they had wicket component as a jqgrid
 subgrid.
  If this is the case they probably just rendered a wicket page into the
  subgrid, which is a little easier...
 
  On Tue, May 25, 2010 at 2:31 PM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
  Hi Sam,
 
   I'm using a flavor of wijqgrid. I took wijqgrid as a base code and
 made
   major modifications to almost everything.
  
 
  It is a pity some of those modifications never made it back into the
  original:-(. But I'm still glad to hear the code was useful to you: at
  least as a starting point.
 
  What I would do in order to render arbitrary Wicket components is try
  to implement some kind of virtual repeater that is not rendered with
  normal page rendering  and that is used to render grid data (I had the
  idea of looking into the logic that render components via AJAX and see
  how to do something similar for grid data). These virtual components
  will be attached to the grid so that they exist on the server side and
  could handle events and so on. These are only ideas and haven't tried
  to implement them: but I know it is possible because jWeekends
  implementation already supports that.
 
  Best,
 
  Ernesto
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

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




Re: WebMarkupContainer as string for use in jqgrid cell

2010-06-02 Thread Ernesto Reinaldo Barreiro
Hi Sam,

Yesterday I commited some changes to [1] that add the possibility to
render Wicket cells as components. You can find an example on [2].
There are some limitations to the kind of cells you can show (they
cannot add JavaScript to the page) but at least you can add cells
containing links and so on.

Best,

Ernesto

References,

1-http://code.google.com/p/wiquery-plugins/
2-http://code.google.com/p/wiquery-plugins/source/browse/trunk/wiquery-plugins/example-war/src/main/java/com/wiquery/plugins/demo/NewGridPanel.java



On Tue, May 25, 2010 at 4:04 PM, Sam Zilverberg samzilverb...@gmail.com wrote:
 I thought of contributing some of the changes after a while but then I
 realized they were too
 project specific and not abstract enough so no one else would be able to use
 em.
 Example: I created a JQGridDataProvider that the grid uses but the provider
 is tightly tied to hibernate
 and some other stuff i'm using in the project.

 I took a look at AjaxRequestTarget and its inner classes to check how wicket
 renders components on ajax requests.
 These components always have parent pages and the rendering process looks
 something like this:
 page.startComponentRender(comp) - comp.renderComponenet() -
 page.endComponentRender(comp)
 then the response from request cycle is set to be the ajax response so the
 html is directed to it.

 I don't see anyway I can mimic this kind of behavior and render wicket
 components without them having
 some parent page.

 I havn't seen jweekend's implementation in a long time because they added
 password protection to labs.jweekend.com/public.
 But what I remember is that they had wicket component as a jqgrid subgrid.
 If this is the case they probably just rendered a wicket page into the
 subgrid, which is a little easier...

 On Tue, May 25, 2010 at 2:31 PM, Ernesto Reinaldo Barreiro 
 reier...@gmail.com wrote:

 Hi Sam,

  I'm using a flavor of wijqgrid. I took wijqgrid as a base code and made
  major modifications to almost everything.
 

 It is a pity some of those modifications never made it back into the
 original:-(. But I'm still glad to hear the code was useful to you: at
 least as a starting point.

 What I would do in order to render arbitrary Wicket components is try
 to implement some kind of virtual repeater that is not rendered with
 normal page rendering  and that is used to render grid data (I had the
 idea of looking into the logic that render components via AJAX and see
 how to do something similar for grid data). These virtual components
 will be attached to the grid so that they exist on the server side and
 could handle events and so on. These are only ideas and haven't tried
 to implement them: but I know it is possible because jWeekends
 implementation already supports that.

 Best,

 Ernesto

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




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



Re: WebMarkupContainer as string for use in jqgrid cell

2010-05-31 Thread Ernesto Reinaldo Barreiro
Hi Sam,

 I took a look at AjaxRequestTarget and its inner classes to check how wicket
 renders components on ajax requests.
 These components always have parent pages and the rendering process looks
 something like this:
 page.startComponentRender(comp) - comp.renderComponenet() -
 page.endComponentRender(comp)
 then the response from request cycle is set to be the ajax response so the
 html is directed to it.


I just gave it a try during weekend and I have managed to render
arbitrary Wicket components as cells of the grid (so, you could use
a panel with link and so on as you needed). My current solution is
still a bit hacky and I would like clean it up before making it
public. I write arbitrary because there will be some limitations
on the cell contents, e.g. they will not work if they contribute
JavaScript code to page, but that could be considered as a minor
limitation. I used the idea I mentioned before...

Best,

Ernesto

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



WebMarkupContainer as string for use in jqgrid cell

2010-05-25 Thread Sam Zilverberg
Hi all,

I'm using a integration of jqgrid with wicket.
jqgrid renders its cells from json data that is retrieved from the server.
I've got this behavior and other operations of jqgrid(search/edit) working
for some time now.

I want to have one of the columns hold a link to some info page.
For example: a user name column that links to the user's info page.
(Note: I don't want the info page to be bookmarkable/mountable. So for this
page I'm using a constructor that gets a user model and not page params.)

I need the the json data that the server returns to hold a markup of a link
that points to this info page.

How can I turn a Wicket WebMarkupContainer (panel/link/etc...) to string
representation so I can put it into the json data?
I tried rendering the panel/link, but it won't work because their not added
to a page...
Any idea how to get this working?

I searched the mail archives for a solution, but could only find how to turn
wicket pages to an html string.


Re: WebMarkupContainer as string for use in jqgrid cell

2010-05-25 Thread Ernesto Reinaldo Barreiro
Hi Sam,

 I'm using a flavor of wijqgrid. I took wijqgrid as a base code and made
 major modifications to almost everything.


It is a pity some of those modifications never made it back into the
original:-(. But I'm still glad to hear the code was useful to you: at
least as a starting point.

What I would do in order to render arbitrary Wicket components is try
to implement some kind of virtual repeater that is not rendered with
normal page rendering  and that is used to render grid data (I had the
idea of looking into the logic that render components via AJAX and see
how to do something similar for grid data). These virtual components
will be attached to the grid so that they exist on the server side and
could handle events and so on. These are only ideas and haven't tried
to implement them: but I know it is possible because jWeekends
implementation already supports that.

Best,

Ernesto

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



Re: WebMarkupContainer as string for use in jqgrid cell

2010-05-25 Thread Sam Zilverberg
I thought of contributing some of the changes after a while but then I
realized they were too
project specific and not abstract enough so no one else would be able to use
em.
Example: I created a JQGridDataProvider that the grid uses but the provider
is tightly tied to hibernate
and some other stuff i'm using in the project.

I took a look at AjaxRequestTarget and its inner classes to check how wicket
renders components on ajax requests.
These components always have parent pages and the rendering process looks
something like this:
page.startComponentRender(comp) - comp.renderComponenet() -
page.endComponentRender(comp)
then the response from request cycle is set to be the ajax response so the
html is directed to it.

I don't see anyway I can mimic this kind of behavior and render wicket
components without them having
some parent page.

I havn't seen jweekend's implementation in a long time because they added
password protection to labs.jweekend.com/public.
But what I remember is that they had wicket component as a jqgrid subgrid.
If this is the case they probably just rendered a wicket page into the
subgrid, which is a little easier...

On Tue, May 25, 2010 at 2:31 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Hi Sam,

  I'm using a flavor of wijqgrid. I took wijqgrid as a base code and made
  major modifications to almost everything.
 

 It is a pity some of those modifications never made it back into the
 original:-(. But I'm still glad to hear the code was useful to you: at
 least as a starting point.

 What I would do in order to render arbitrary Wicket components is try
 to implement some kind of virtual repeater that is not rendered with
 normal page rendering  and that is used to render grid data (I had the
 idea of looking into the logic that render components via AJAX and see
 how to do something similar for grid data). These virtual components
 will be attached to the grid so that they exist on the server side and
 could handle events and so on. These are only ideas and haven't tried
 to implement them: but I know it is possible because jWeekends
 implementation already supports that.

 Best,

 Ernesto

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