Re: custom resolving of relative paths in head section of panel
Ernesto Reinaldo Barreiro wrote: This solution will work for sure... and additionally you could have the markup of MyPanel . So that you cant test it offline and have it working when used dynamically. Thank you, but in my case, the javascript files are not globally available, i need to service them via a mounted target url coding strategy. Ittay Ernesto On Wed, Oct 7, 2009 at 1:26 PM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: You could do public class MyPanel extends Panel { public static ResourceReference CSS = new ResourceReference(MyPanel.class, "mycss.css"); public MyPanel(String id) { add(CSSPackageResource.getHeaderContribution(CSS )); } } Similar for JavaScript with JavascriptPackageResource instead of CSSPackageResource Best, Ernesto On Wed, Oct 7, 2009 at 1:21 PM, Ittay Dror wrote: In the panel's html i have something like: This works well when the html is viewed as standalone. but in the context of the application i need the tag to be rendered as: Ittay Ernesto Reinaldo Barreiro wrote: Not quite following you... What do you mean? Something like: a.myClass { background: url('${myURL}'); } and get ${myURL} replaced? Best, Ernesto On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror wrote: Hi, Is there a way in which I can convert javascript/css relative references in a of a panel and add a prefix to them? Regards, Ittay - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Tikal <http://www.tikalk.com> Tikal Project <http://tikal.sourceforge.net> - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Tikal <http://www.tikalk.com> Tikal Project <http://tikal.sourceforge.net> - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: custom resolving of relative paths in head section of panel
Pedro Santos wrote: Hi Ittay, you can use wicket:link tag to resolve that path dynamically too. that way you keep the reference valid whe html is viewed as standalone, and in the context of the application Thank you, I tried this and the result is: http://localhost:8080/alm/js/application.js</a>>" type="text/javascript"> Ittay On Wed, Oct 7, 2009 at 8:26 AM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: You could do public class MyPanel extends Panel { public static ResourceReference CSS = new ResourceReference(MyPanel.class, "mycss.css"); public MyPanel(String id) { add(CSSPackageResource.getHeaderContribution(CSS )); } } Similar for JavaScript with JavascriptPackageResource instead of CSSPackageResource Best, Ernesto On Wed, Oct 7, 2009 at 1:21 PM, Ittay Dror wrote: In the panel's html i have something like: This works well when the html is viewed as standalone. but in the context of the application i need the tag to be rendered as: Ittay Ernesto Reinaldo Barreiro wrote: Not quite following you... What do you mean? Something like: a.myClass { background: url('${myURL}'); } and get ${myURL} replaced? Best, Ernesto On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror wrote: Hi, Is there a way in which I can convert javascript/css relative references in a of a panel and add a prefix to them? Regards, Ittay - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Tikal <http://www.tikalk.com> Tikal Project <http://tikal.sourceforge.net> - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Tikal <http://www.tikalk.com> Tikal Project <http://tikal.sourceforge.net> - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: custom resolving of relative paths in head section of panel
In the panel's html i have something like: This works well when the html is viewed as standalone. but in the context of the application i need the tag to be rendered as: Ittay Ernesto Reinaldo Barreiro wrote: Not quite following you... What do you mean? Something like: a.myClass { background: url('${myURL}'); } and get ${myURL} replaced? Best, Ernesto On Wed, Oct 7, 2009 at 12:55 PM, Ittay Dror wrote: Hi, Is there a way in which I can convert javascript/css relative references in a of a panel and add a prefix to them? Regards, Ittay - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Tikal <http://www.tikalk.com> Tikal Project <http://tikal.sourceforge.net> - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
custom resolving of relative paths in head section of panel
Hi, Is there a way in which I can convert javascript/css relative references in a of a panel and add a prefix to them? Regards, Ittay - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: InlineFrame: IPageLink object looses reference to page after deserialiations
Ittay Dror wrote: > > Hi, > > I'm trying to use the InlineFrame component. I create an IPageLink > object to it. The object holds a reference to a page. > > By placing breakpoints, I can see that the IPageLink object is created > once. > > InlineFrame#onLinkClicked is called twice. On the first time, the page > reference is fine. The second time the IPageLink is of a different > object and the page reference it is null. My guess is that the second > time is after deserialization of the page. But why is the reference null? > > I'm working in an osgi environment with pax-wicket. > on further investigation, i see the issue is that although the page is saved to the page map (by touching it), it is not found after, (the pagemap is the same object in both requests and the session exists) thanks, ittay > > Thank you, > Ittay > > -- > -- > Ittay > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/InlineFrame%3A-IPageLink-object-looses-reference-to-page-after-deserialiations-tp21661515p22777118.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Embedding html from an external application
mfs wrote: > > Eric, > > Thanks for the follow-up. > > Actually i just came across the > http://wicket.sourceforge.net/apidocs/wicket/markup/html/include/Include.html > Include component in Wicket which i believe does the same as you > suggested to implement...i.e. opens up a new http-connection to the > server/url from where the contents are to be embedded...Isn't it ? > > Secondly since this would mean a separate request would be opened for > contents to be included, and hence wouldn't be carrying the request > parameters, cookies etc. Which i would have to figure out a way to > pass-on/embed manually. > Include uses a URL connection to get the data. You might want to try and writing a similar component that uses the httpclient library. Or cast the connection from URL#openConnection to HttpConnection and use the methods there for adding headers. I think the only major challenge will be if the old application is using cookies since you'd need to manage them yourself. Ittay > > > Farhan. > > > > quote author="Erik van Oosten"> > Farhan, > > You can not mix and match content from different servlet contexts within > the same server. The only way is to request content from another server > and indeed, this is what the c:import tag does. Wicket has no equivalent > component but you could write one without too much problems. > > Something like: > > public class HttpImport extends WebMarkupContainer { > > private String url; > > public HttpImport(String id, String url) { > super(id); > this.url = url; > } > > @Override > protected void onComponentTagBody(MarkupStream markupStream, > ComponentTag openTag) { > replaceComponentTagBody(markupStream, openTag, getContent(url)); > } > > private String getContent(String url) { > ... code to get data from url ... > } > } > > I'll leave the code in getContent as an exercise :) > The component above behaves like a Label, it will replace the content of > the HTML element it is attached to. > > Regards, > Erik. > > > > > mfs wrote: >> I have had a look at the blog >> http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/ >> http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/ >> which pretty much is based on the same idea, but the only hitch is that >> it >> is assuming the external/non-wicket page (i.e. jsp) to be contained in >> the >> same context/app as wicket. I am looking for a way to include the dynamic >> contents from a different context/application, since >> RequestDispatcher.include doesn't allow the same. A functionality similar >> to >> the c:import tag library that is.. >> >> > > > -- > Erik van Oosten > http://www.day-to-day-stuff.blogspot.com/ > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/Embedding-html-from-an-external-application-tp21593700p21671932.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
page services
Hi, What is the proper way to model a registry of services per page instance? What I mean is for a component to be able to locate a service that is registered with the current page and that affects the GUI. An example of such a service exists today: the feedback panel. Session.get().getFeedbackMessages returns the service that components can use to add feedback messages. What I'm is for a way to model a similar service. Is Session#getMetaData the way to do it? Thanks, Ittay -- -- Ittay - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: InlineFrame: IPageLink object looses reference to page after deserialiations
After some debugging, the reason is that Page#writeReplace replaces the page with a PageHolder regardless of whether the page is marked as non-stateless (I call setStatelessHint(false) in the ctor). Isn't this a bug? Ittay Ittay Dror wrote: > > Hi, > > I'm trying to use the InlineFrame component. I create an IPageLink > object to it. The object holds a reference to a page. > > By placing breakpoints, I can see that the IPageLink object is created > once. > > InlineFrame#onLinkClicked is called twice. On the first time, the page > reference is fine. The second time the IPageLink is of a different > object and the page reference it is null. My guess is that the second > time is after deserialization of the page. But why is the reference null? > > I'm working in an osgi environment with pax-wicket. > > Thank you, > Ittay > > -- > -- > Ittay > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/InlineFrame%3A-IPageLink-object-looses-reference-to-page-after-deserialiations-tp21661515p21662059.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
InlineFrame: IPageLink object looses reference to page after deserialiations
Hi, I'm trying to use the InlineFrame component. I create an IPageLink object to it. The object holds a reference to a page. By placing breakpoints, I can see that the IPageLink object is created once. InlineFrame#onLinkClicked is called twice. On the first time, the page reference is fine. The second time the IPageLink is of a different object and the page reference it is null. My guess is that the second time is after deserialization of the page. But why is the reference null? I'm working in an osgi environment with pax-wicket. Thank you, Ittay -- -- Ittay - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: about IBehavior#beforeRender
igor.vaynb...@gmail.com wrote: Behaviors are not meant for adding components, only to modifying the ones they are attached to. What is your usecase. well, if there's no problem to move it before the call to #markRendering, then it would be able to add components, right? why not allow this? ittay -igor On 1/24/09, Ittay Dror wrote: Hi, In Component#render, the call to #notifyBehaviorsComponentBeforeRender is done after #markRendering is called. This means a behavior cannot add components to the component. Can the call be moved to before #markRendering is called? Thanks, Ittay -- -- Ittay - 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 -- -- Ittay
about IBehavior#beforeRender
Hi, In Component#render, the call to #notifyBehaviorsComponentBeforeRender is done after #markRendering is called. This means a behavior cannot add components to the component. Can the call be moved to before #markRendering is called? Thanks, Ittay -- -- Ittay - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: generate javascript file together with html page
Martijn Dashorst wrote: > > I'm sure I don't understand your question, but in a futile attempt to > answer it anyway: > thanks for the effort ;) my point is that the javascript file is also generated. e.g., the code in it creates javascript objects that are attached to the html elements in the containing page. of course, i can attach behaviors to those components that will render the javascript inline the page, but it seems to me this will be harder to read (if the javascript objects interact with each other) and so maintain. > > > > > > > > > > > > Martijn > > On Mon, Oct 27, 2008 at 4:03 PM, Ittay Dror <[EMAIL PROTECTED]> wrote: >> >> >> >> Michael Sparer wrote: >>> >>> take a look at headercontributors e.g. >>> http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/ >>> >> >> This will only generate the reference to the javascript in the html page. >> However, now when the browser tries to request this javascript file, I >> want >> the request to go to the same Page object that created the html, so that >> it >> renders the javascript file. >> >> Assume FooPage.java. A request FooPage.html creates a call to FooPage. It >> then contributes FooPage.js to the header and then I want a request to >> FooPage.js to go back to FooPage so it creates the javascript file by >> using >> the same hierarchy of components. >> >> Ittay >> >> >> >> >> >>> regards, >>> Michael >>> >>> >>> Ittay Dror wrote: >>>> >>>> Hi, >>>> >>>> I'd like to create a page with lots of javascript code. For reasons of >>>> maintenance, I'd like the Page object to generate the html with >>>> reference >>>> to a javascript file with the same name and .js extension so when the >>>> browser tries to load this file the same Page object then renders (by >>>> using behaviors) the javascript content. (by saying 'object renders' I >>>> mean the normal wicket style rendering of delegating to the contained >>>> component hierarchies). >>>> >>>> Any pointers would be appreciated. >>>> >>>> Ittay >>>> >>> >>> >> >> -- >> View this message in context: >> http://www.nabble.com/generate-javascript-file-together-with-html-page-tp20188258p20189490.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > > -- > Become a Wicket expert, learn from the best: http://wicketinaction.com > Apache Wicket 1.3.4 is released > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/generate-javascript-file-together-with-html-page-tp20188258p20192198.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: generate javascript file together with html page
Erik van Oosten wrote: > > Sound like what you need is a DynamicWebResource. > yes, sound like this can do it. but can i start a rendering cycle here so that i get the bytes required at the end? > > Regards, > Erik. > > Ittay Dror wrote: >> >> Michael Sparer wrote: >> >>> take a look at headercontributors e.g. >>> http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/ >>> >>> >> >> This will only generate the reference to the javascript in the html page. >> However, now when the browser tries to request this javascript file, I >> want >> the request to go to the same Page object that created the html, so that >> it >> renders the javascript file. >> >> Assume FooPage.java. A request FooPage.html creates a call to FooPage. It >> then contributes FooPage.js to the header and then I want a request to >> FooPage.js to go back to FooPage so it creates the javascript file by >> using >> the same hierarchy of components. >> >> Ittay >> > > > -- > Erik van Oosten > http://www.day-to-day-stuff.blogspot.com/ > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/generate-javascript-file-together-with-html-page-tp20188258p20191181.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: generate javascript file together with html page
Michael Sparer wrote: > > take a look at headercontributors e.g. > http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/ > This will only generate the reference to the javascript in the html page. However, now when the browser tries to request this javascript file, I want the request to go to the same Page object that created the html, so that it renders the javascript file. Assume FooPage.java. A request FooPage.html creates a call to FooPage. It then contributes FooPage.js to the header and then I want a request to FooPage.js to go back to FooPage so it creates the javascript file by using the same hierarchy of components. Ittay > regards, > Michael > > > Ittay Dror wrote: >> >> Hi, >> >> I'd like to create a page with lots of javascript code. For reasons of >> maintenance, I'd like the Page object to generate the html with reference >> to a javascript file with the same name and .js extension so when the >> browser tries to load this file the same Page object then renders (by >> using behaviors) the javascript content. (by saying 'object renders' I >> mean the normal wicket style rendering of delegating to the contained >> component hierarchies). >> >> Any pointers would be appreciated. >> >> Ittay >> > > -- View this message in context: http://www.nabble.com/generate-javascript-file-together-with-html-page-tp20188258p20189490.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
generate javascript file together with html page
Hi, I'd like to create a page with lots of javascript code. For reasons of maintenance, I'd like the Page object to generate the html with reference to a javascript file with the same name and .js extension so when the browser tries to load this file the same Page object then renders (by using behaviors) the javascript content. (by saying 'object renders' I mean the normal wicket style rendering of delegating to the contained component hierarchies). Any pointers would be appreciated. Ittay -- View this message in context: http://www.nabble.com/generate-javascript-file-together-with-html-page-tp20188258p20188258.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]