PerShing2014 / jmesa

Automatically exported from code.google.com/p/jmesa
0 stars 0 forks source link

Javascript API has no knowledge of table's context path #231

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have the following scenario...

* Page URL has one context path (in this case,
http://myserver.net/myportal/etc.../)

 * JMesa table resides in an application under another context path (i.e.,
http://myserver.net/myapp)

The application with the table is included in the page via cross-context
dispatching, so the browser only sees the page URL.  This causes the
following POST in submitWsColumn to fail:

$.post('jmesa.wrk?', eval('(' + data + ')'), function(data) {});

My fix for this was to make HtmlSnippetsImpl extend from
AbstractContextSupport so that it has access to the WebContext.  Then, if
the web context is set on the snippets, the following line is output from
initJavaScriptLimit:

jQuery.jmesa.setContextPath('myTableId','/myapp')

I made modifications to jquery.jmesa.js to support setContextPath() and
getContextPath() on a per-table basis.  Finally, if the context path has
indeed been set via initJavaScriptLimit(), that value is prepended in
submitWsColumn.  Otherwise the old behavior is used.

These changes should be 100% backwards compatible.  Please let me know if
this is a good solution, or if I should try something else.  Patch is attached.

Original issue reported on code.google.com by bgo...@e1b.org on 19 Nov 2009 at 7:28

Attachments:

GoogleCodeExporter commented 8 years ago
of course, my last patch had a couple of bugs in the javascript file.  Here's a
better one.

Original comment by bgo...@e1b.org on 19 Nov 2009 at 8:36

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you! I did not notice that you posted the patch here...I will get this 
in. I
will also do a release fairly soon. There is a language patch that was sent to 
me
that I want to release as well.

Original comment by jeff.johnston.mn@gmail.com on 28 Nov 2009 at 1:32

GoogleCodeExporter commented 8 years ago
Have the patch applied now.

Original comment by jeff.johnston.mn@gmail.com on 28 Nov 2009 at 2:03

GoogleCodeExporter commented 8 years ago

Original comment by jeff.johnston.mn@gmail.com on 9 Mar 2011 at 8:17