Re: PageRenderSupport problem (Body component is in template)
Thanks you peter !!! finally we solved the problem just using hidden values to retrieve again from the DB the correct object ... also need to do lot of tricks ("non tapestry") to get also validation working inside the dojo dialog. Anyway this is working now. sincerely, robert On 11/9/06, Peter Beshai <[EMAIL PROTECTED]> wrote: I had the issue with the submit button not doing anything until I included it in the dialog box's body, but I didn't experience any other issues. There is a Dialog component in the latest 4.1.1 snapshot... maybe you should try that (if you're not using it already). Sorry, that's as much as I can say! -- Peter Beshai - Using Tapestry 4.1.1 Pure Mathematics Student University of Waterloo >From: "Roberto Ramírez Vique" <[EMAIL PROTECTED]> >Reply-To: "Tapestry users" >To: "Tapestry users" >Subject: Re: PageRenderSupport problem (Body component is in template) >Date: Thu, 9 Nov 2006 16:45:53 +0100 > >Yes, yes ... for sure... that was an error ... > >Then you have no idea :( > >Have you had this problem with your component ? > >thanks you in advance, > robert > >On 11/9/06, Peter Beshai <[EMAIL PROTECTED]> wrote: >> >>Hi, >> >>Unless you just made a typo in the email, your loop is defined as : >> >> >>Should probably be: >> >> >>Other than that, I have no ideas. Good luck! >> >> >>-- >>Peter Beshai - Using Tapestry 4.1.1 >> >>Pure Mathematics Student >>University of Waterloo >> >> >> >> >> >> >From: "Roberto Ramírez Vique" <[EMAIL PROTECTED]> >> >Reply-To: "Tapestry users" >> >To: "Tapestry users" >> >Subject: Re: PageRenderSupport problem (Body component is in template) >> >Date: Thu, 9 Nov 2006 12:03:57 +0100 >> > >> >Hello Peter and everybody ! >> > >> >I'm using tapestry 4.0, jdk 1.5 and tomcat 5.5. >> > >> >I'm doing more or less the same as all of you, but I have a question. >> > >> >My dojo dialogs are though to be places where the user can write >> >information >> >and send it back to the server: like a way to have forms that sends >> >information to the server. My problem now is that all these dojo dialogs >> >needs a form in the same div because otherwise the submit buttons in the >> >dojo doesn't do anything. I understand that these dojo dialogs are >> >rewritten >> >in any other place (in the DOM structure) and that's the problem why the >> >submit button doesn't work. >> >Well I have some of these popups working for list of elements, which are >> >modified with a dojo dialog. When I tried to save the current element >>(I'm >> >using a tag-selected of a submit button, as explained down) I always get >> >the >> >last element as the modified one... Any of you have had this problem >>with >> >multiple forms ? Because is a problem of having multiple forms in a >>page, >> >because just with one form it works (but i can't have just one form due >>the >> >dojo dialog). >> > >> > >> >The way I tried to select the current element is very simple (and works >> >with >> >a single form in a page, but not with a multiple form in a page): >> >HTML >> > >> > >> > >> > >> > >> > >> > >> > >> > >> >PAGE >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> >In the java code I get the "selectedElement" always as the last element >> >from >> >the elementList but always with the correct values. >> > >> >Any explanation, help, idea or something will be really appreciated, >> > robert >> > >> > >> > >> >On 10/18/06, Peter Beshai <[EMAIL PROTECTED]> wrote: >> >> >> >>Great that fixed it up :-) >> >> >> >>You said you had wrapped the Dialog component just yesterday, but I >>don't >> >>see it in the tapestry-framework trunk. Is there somewhere I can go and >> >>see >> >>how you implemented it? >> >> >> >>Oh
Re: PageRenderSupport problem (Body component is in template)
I had the issue with the submit button not doing anything until I included it in the dialog box's body, but I didn't experience any other issues. There is a Dialog component in the latest 4.1.1 snapshot... maybe you should try that (if you're not using it already). Sorry, that's as much as I can say! -- Peter Beshai - Using Tapestry 4.1.1 Pure Mathematics Student University of Waterloo From: "Roberto Ramírez Vique" <[EMAIL PROTECTED]> Reply-To: "Tapestry users" To: "Tapestry users" Subject: Re: PageRenderSupport problem (Body component is in template) Date: Thu, 9 Nov 2006 16:45:53 +0100 Yes, yes ... for sure... that was an error ... Then you have no idea :( Have you had this problem with your component ? thanks you in advance, robert On 11/9/06, Peter Beshai <[EMAIL PROTECTED]> wrote: Hi, Unless you just made a typo in the email, your loop is defined as : Should probably be: Other than that, I have no ideas. Good luck! -- Peter Beshai - Using Tapestry 4.1.1 Pure Mathematics Student University of Waterloo >From: "Roberto Ramírez Vique" <[EMAIL PROTECTED]> >Reply-To: "Tapestry users" >To: "Tapestry users" >Subject: Re: PageRenderSupport problem (Body component is in template) >Date: Thu, 9 Nov 2006 12:03:57 +0100 > >Hello Peter and everybody ! > >I'm using tapestry 4.0, jdk 1.5 and tomcat 5.5. > >I'm doing more or less the same as all of you, but I have a question. > >My dojo dialogs are though to be places where the user can write >information >and send it back to the server: like a way to have forms that sends >information to the server. My problem now is that all these dojo dialogs >needs a form in the same div because otherwise the submit buttons in the >dojo doesn't do anything. I understand that these dojo dialogs are >rewritten >in any other place (in the DOM structure) and that's the problem why the >submit button doesn't work. >Well I have some of these popups working for list of elements, which are >modified with a dojo dialog. When I tried to save the current element (I'm >using a tag-selected of a submit button, as explained down) I always get >the >last element as the modified one... Any of you have had this problem with >multiple forms ? Because is a problem of having multiple forms in a page, >because just with one form it works (but i can't have just one form due the >dojo dialog). > > >The way I tried to select the current element is very simple (and works >with >a single form in a page, but not with a multiple form in a page): >HTML > > > > > > > > > >PAGE > > > > > > > > > > > > > > > > > > > >In the java code I get the "selectedElement" always as the last element >from >the elementList but always with the correct values. > >Any explanation, help, idea or something will be really appreciated, > robert > > > >On 10/18/06, Peter Beshai <[EMAIL PROTECTED]> wrote: >> >>Great that fixed it up :-) >> >>You said you had wrapped the Dialog component just yesterday, but I don't >>see it in the tapestry-framework trunk. Is there somewhere I can go and >>see >>how you implemented it? >> >>Oh I have another question... I had to put the .jwc and .script file in >>the >>WEB-INF directory. It seems more standard to keep them in the same >>location >>as the .java file. Do I need to configure something to be able to store >>everything in one place? >> >>Anyway, here's the code I used, any suggestions are welcome! >> >>Dialog.java:: >>import java.util.HashMap; >>import java.util.Map; >> >>import org.apache.tapestry.AbstractComponent; >>import org.apache.tapestry.IComponent; >>import org.apache.tapestry.IMarkupWriter; >>import org.apache.tapestry.IRequestCycle; >>import org.apache.tapestry.IScript; >>import org.apache.tapestry.PageRenderSupport; >>import org.apache.tapestry.TapestryUtils; >>import org.apache.tapestry.dojo.DojoUtils; >>import org.apache.tapestry.dojo.IWidget; >>import org.apache.tapestry.json.JSONObject; >> >>public abstract class Dialog extends AbstractComponent implements IWidget >>{ >> /** id. */ >> public abstract String getIdParameter(); >> >> /** component that handles closing the dialog */ >> public abstract IComponent getCloser(); >> >> /** component that handles showing the dialog */ >> public abstract IC
Re: PageRenderSupport problem (Body component is in template)
Yes, yes ... for sure... that was an error ... Then you have no idea :( Have you had this problem with your component ? thanks you in advance, robert On 11/9/06, Peter Beshai <[EMAIL PROTECTED]> wrote: Hi, Unless you just made a typo in the email, your loop is defined as : Should probably be: Other than that, I have no ideas. Good luck! -- Peter Beshai - Using Tapestry 4.1.1 Pure Mathematics Student University of Waterloo >From: "Roberto Ramírez Vique" <[EMAIL PROTECTED]> >Reply-To: "Tapestry users" >To: "Tapestry users" >Subject: Re: PageRenderSupport problem (Body component is in template) >Date: Thu, 9 Nov 2006 12:03:57 +0100 > >Hello Peter and everybody ! > >I'm using tapestry 4.0, jdk 1.5 and tomcat 5.5. > >I'm doing more or less the same as all of you, but I have a question. > >My dojo dialogs are though to be places where the user can write >information >and send it back to the server: like a way to have forms that sends >information to the server. My problem now is that all these dojo dialogs >needs a form in the same div because otherwise the submit buttons in the >dojo doesn't do anything. I understand that these dojo dialogs are >rewritten >in any other place (in the DOM structure) and that's the problem why the >submit button doesn't work. >Well I have some of these popups working for list of elements, which are >modified with a dojo dialog. When I tried to save the current element (I'm >using a tag-selected of a submit button, as explained down) I always get >the >last element as the modified one... Any of you have had this problem with >multiple forms ? Because is a problem of having multiple forms in a page, >because just with one form it works (but i can't have just one form due the >dojo dialog). > > >The way I tried to select the current element is very simple (and works >with >a single form in a page, but not with a multiple form in a page): >HTML > > > > > > > > > >PAGE > > > > > > > > > > > > > > > > > > > >In the java code I get the "selectedElement" always as the last element >from >the elementList but always with the correct values. > >Any explanation, help, idea or something will be really appreciated, > robert > > > >On 10/18/06, Peter Beshai <[EMAIL PROTECTED]> wrote: >> >>Great that fixed it up :-) >> >>You said you had wrapped the Dialog component just yesterday, but I don't >>see it in the tapestry-framework trunk. Is there somewhere I can go and >>see >>how you implemented it? >> >>Oh I have another question... I had to put the .jwc and .script file in >>the >>WEB-INF directory. It seems more standard to keep them in the same >>location >>as the .java file. Do I need to configure something to be able to store >>everything in one place? >> >>Anyway, here's the code I used, any suggestions are welcome! >> >>Dialog.java:: >>import java.util.HashMap; >>import java.util.Map; >> >>import org.apache.tapestry.AbstractComponent; >>import org.apache.tapestry.IComponent; >>import org.apache.tapestry.IMarkupWriter; >>import org.apache.tapestry.IRequestCycle; >>import org.apache.tapestry.IScript; >>import org.apache.tapestry.PageRenderSupport; >>import org.apache.tapestry.TapestryUtils; >>import org.apache.tapestry.dojo.DojoUtils; >>import org.apache.tapestry.dojo.IWidget; >>import org.apache.tapestry.json.JSONObject; >> >>public abstract class Dialog extends AbstractComponent implements IWidget >>{ >> /** id. */ >> public abstract String getIdParameter(); >> >> /** component that handles closing the dialog */ >> public abstract IComponent getCloser(); >> >> /** component that handles showing the dialog */ >> public abstract IComponent getShower(); >> >> /** bgColor */ >> public abstract String getBgColor(); >> >> /** bgOpacity */ >> public abstract Double getBgOpacity(); >> >> /** toggle */ >> public abstract String getToggle(); >> >> /** toggleDuration */ >> public abstract Integer getToggleDuration(); >> >> /** Injected script. */ >> public abstract IScript getScript(); >> >> public void renderWidget(IMarkupWriter writer, IRequestCycle cycle) >> { >> renderComponent(writer, cycle); >> } >> >>
Re: PageRenderSupport problem (Body component is in template)
Hi, Unless you just made a typo in the email, your loop is defined as : Should probably be: Other than that, I have no ideas. Good luck! -- Peter Beshai - Using Tapestry 4.1.1 Pure Mathematics Student University of Waterloo From: "Roberto Ramírez Vique" <[EMAIL PROTECTED]> Reply-To: "Tapestry users" To: "Tapestry users" Subject: Re: PageRenderSupport problem (Body component is in template) Date: Thu, 9 Nov 2006 12:03:57 +0100 Hello Peter and everybody ! I'm using tapestry 4.0, jdk 1.5 and tomcat 5.5. I'm doing more or less the same as all of you, but I have a question. My dojo dialogs are though to be places where the user can write information and send it back to the server: like a way to have forms that sends information to the server. My problem now is that all these dojo dialogs needs a form in the same div because otherwise the submit buttons in the dojo doesn't do anything. I understand that these dojo dialogs are rewritten in any other place (in the DOM structure) and that's the problem why the submit button doesn't work. Well I have some of these popups working for list of elements, which are modified with a dojo dialog. When I tried to save the current element (I'm using a tag-selected of a submit button, as explained down) I always get the last element as the modified one... Any of you have had this problem with multiple forms ? Because is a problem of having multiple forms in a page, because just with one form it works (but i can't have just one form due the dojo dialog). The way I tried to select the current element is very simple (and works with a single form in a page, but not with a multiple form in a page): HTML PAGE In the java code I get the "selectedElement" always as the last element from the elementList but always with the correct values. Any explanation, help, idea or something will be really appreciated, robert On 10/18/06, Peter Beshai <[EMAIL PROTECTED]> wrote: Great that fixed it up :-) You said you had wrapped the Dialog component just yesterday, but I don't see it in the tapestry-framework trunk. Is there somewhere I can go and see how you implemented it? Oh I have another question... I had to put the .jwc and .script file in the WEB-INF directory. It seems more standard to keep them in the same location as the .java file. Do I need to configure something to be able to store everything in one place? Anyway, here's the code I used, any suggestions are welcome! Dialog.java:: import java.util.HashMap; import java.util.Map; import org.apache.tapestry.AbstractComponent; import org.apache.tapestry.IComponent; import org.apache.tapestry.IMarkupWriter; import org.apache.tapestry.IRequestCycle; import org.apache.tapestry.IScript; import org.apache.tapestry.PageRenderSupport; import org.apache.tapestry.TapestryUtils; import org.apache.tapestry.dojo.DojoUtils; import org.apache.tapestry.dojo.IWidget; import org.apache.tapestry.json.JSONObject; public abstract class Dialog extends AbstractComponent implements IWidget { /** id. */ public abstract String getIdParameter(); /** component that handles closing the dialog */ public abstract IComponent getCloser(); /** component that handles showing the dialog */ public abstract IComponent getShower(); /** bgColor */ public abstract String getBgColor(); /** bgOpacity */ public abstract Double getBgOpacity(); /** toggle */ public abstract String getToggle(); /** toggleDuration */ public abstract Integer getToggleDuration(); /** Injected script. */ public abstract IScript getScript(); public void renderWidget(IMarkupWriter writer, IRequestCycle cycle) { renderComponent(writer, cycle); } @SuppressWarnings("unchecked") protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { if(cycle.isRewinding()) { renderBody(writer, cycle); return; } // configure the node writer.begin("div"); writer.attribute("id", getIdParameter()); renderInformalParameters(writer, cycle); renderBody(writer, cycle); writer.end(); // configure the widget JSONObject obj = DojoUtils.parseJSONParameter(this, "options"); obj.put("widgetId", getId()); obj.put("toggle", getToggle()); obj.put("toggleDuration", getToggleDuration()); obj.put("bgColor", getBgColor()); obj.put("bgOpacity", getBgOpacity()); // setup script includes Map scriptParms = new HashMap(); scriptParms.put("id", getIdParameter()); scriptParms.put("props", obj.toString()
Re: PageRenderSupport problem (Body component is in template)
quot; required="yes" /> <input-symbol key="closer" required="yes" /> <input-symbol key="shower" required="yes" /> <body> <unique> dojo.require("dojo.widget.Dialog"); dojo.require("tapestry.widget.Widget"); </unique> </body> <initialization> tapestry.widget.synchronizeWidgetState("${id}", "dialog", ${props}); dojo.widget.byId("${id}").setCloseControl(dojo.byId("${closer}")); dojo.widget.byId("${id}").setShowControl(dojo.byId("${shower}")); </initialization> Dialog.jwc:: http://tapestry.apache.org/dtd/Tapestry_4_0.dtd";> Creates a dojo dialog widget Peter Beshai >From: "Jesse Kuhnert" <[EMAIL PROTECTED]> >Reply-To: "Tapestry users" >To: "Tapestry users" >Subject: Re: PageRenderSupport problem (Body component is in template) >Date: Wed, 18 Oct 2006 12:31:25 -0400 > >Without the benefit of knowing what your component code is doing I am going >to guess that you are attempting to render your dialog component during a >Form "rewind" cycle. > >The best thing to do in your case is check for cycle.isRewinding() and skip >over all blocks except for renderBody() . > >On 10/18/06, Peter Beshai <[EMAIL PROTECTED]> wrote: >> >>Sorry if this idea seems silly, but this is the first custom >>component/dojo >>widget wrapper I have made, so it basically just does the same thing as >>calling dojo.widget.byId("yourDlgId").show(). >> >>My dialog takes a 'shower' and a 'closer' (IComponents) as required >>parameters -- I wasn't sure the best way to do this... but I thought it >>would allow more flexibility by doing it this way. >> >>My script looks like this: (Dialog.script) >> >> >>> "-//Apache Software Foundation//Tapestry Script Specification 3.0 //EN" >> "http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd";> >> >><input-symbol key="id" required="yes" /> >><input-symbol key="props" required="yes" /> >><input-symbol key="closer" required="yes" /> >><input-symbol key="shower" required="yes" /> >> <body> >> <unique> >> dojo.require("dojo.widget.Dialog"); >> dojo.require("tapestry.widget.Widget"); >> </unique> >> </body> >> <initialization> >> tapestry.widget.synchronizeWidgetState("${id}", "dialog", >>${props}); >> >>dojo.widget.byId("${id}").setCloseControl(dojo.byId("${closer}")); >> dojo.widget.byId("${id}").setShowControl(dojo.byId ("${shower}")); >> </initialization> >> >> >>So when I click on my shower (my form submit button) it pops up the dialog >>that has the closer (cancel button) and then instantaneously throws the >>exception. >> >>It took me a lot longer than 10 minutes to make this (a couple of hours!!) >>but after it was done it all seems very simple. I just couldn't find any >>documentation anywhere about it, so I just read through some source and >>tried putting things together. >> >>When you say "I'm assuming it's not just a simple >>dojo.widget.byId("yourDlgId").show()" are you implying that if it is just >>doing that, I ought to just use dojo directly in my template? >> >>Thanks, >>Peter Beshai >> >> >> >From: "Jesse Kuhnert" <[EMAIL PROTECTED]> >> >Reply-To: "Tapestry users" >> >To: "Tapestry users" >> >Subject: Re: PageRenderSupport problem (Body component is in template) >> >Date: Tue, 17 Oct 2006 22:54:39 -0400 >> > >> >So what does it do after loading up? I'm assuming it's not just a simple >> >dojo.widget.byId("yourDlgId").show() ? >> > >> >I created the same component in 4.1.1 yesterday btw. (Took me all of ten >> >minutes!, of course that is expected..) >> > >> >On 10/17/06, Peter Beshai <[EMAIL PROTECTED]> wrote: >> >> >> >>Hi, >> >> >> >>I have created a wrapper for the dojo component Dialog and it works >>fine >> >>(in >> >>general!), but I have a problem w
Re: PageRenderSupport problem (Body component is in template)
No kidding? Huh! I was just wondering about that.. How convenient! You need a red cape, Jesse.. Something to better iconify your contributions :-) Thanks in advance, Josh On 10/17/06, Jesse Kuhnert <[EMAIL PROTECTED]> wrote: So what does it do after loading up? I'm assuming it's not just a simple dojo.widget.byId("yourDlgId").show() ? I created the same component in 4.1.1 yesterday btw. (Took me all of ten minutes!, of course that is expected..) On 10/17/06, Peter Beshai <[EMAIL PROTECTED]> wrote: > > Hi, > > I have created a wrapper for the dojo component Dialog and it works fine > (in > general!), but I have a problem when I use it with my form. I want to have > the dialog appear when I submit the form (ie, the form submit button is > the > show controller) and the dialog will basically have a cancel button (close > controller and Submit component with type cancel). > > The dialog loads fine, but soon after loading it throws an exception: > Component FileUpload/uploadingDialog requires rendering support, but no > PageRenderSupport object has been stored into the request cycle. This > object > is typically provided by a Body component. You should add a Body component > to your template. > > I do have a body component defined : . > > Any ideas how to fix this problem? > > FYI in my Dialog.java file I have in the renderComponent function: > PageRenderSupport pageRenderSupport = > TapestryUtils.getPageRenderSupport(cycle, this); > getScript().execute(this, cycle, pageRenderSupport, scriptParms); > > > Peter Beshai > > _ > Essayez la nouvelle génération de recherche avec Live Search. > http://www.live.com/?mkt=fr-ca > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
Re: PageRenderSupport problem (Body component is in template)
Great that fixed it up :-) You said you had wrapped the Dialog component just yesterday, but I don't see it in the tapestry-framework trunk. Is there somewhere I can go and see how you implemented it? Oh I have another question... I had to put the .jwc and .script file in the WEB-INF directory. It seems more standard to keep them in the same location as the .java file. Do I need to configure something to be able to store everything in one place? Anyway, here's the code I used, any suggestions are welcome! Dialog.java:: import java.util.HashMap; import java.util.Map; import org.apache.tapestry.AbstractComponent; import org.apache.tapestry.IComponent; import org.apache.tapestry.IMarkupWriter; import org.apache.tapestry.IRequestCycle; import org.apache.tapestry.IScript; import org.apache.tapestry.PageRenderSupport; import org.apache.tapestry.TapestryUtils; import org.apache.tapestry.dojo.DojoUtils; import org.apache.tapestry.dojo.IWidget; import org.apache.tapestry.json.JSONObject; public abstract class Dialog extends AbstractComponent implements IWidget { /** id. */ public abstract String getIdParameter(); /** component that handles closing the dialog */ public abstract IComponent getCloser(); /** component that handles showing the dialog */ public abstract IComponent getShower(); /** bgColor */ public abstract String getBgColor(); /** bgOpacity */ public abstract Double getBgOpacity(); /** toggle */ public abstract String getToggle(); /** toggleDuration */ public abstract Integer getToggleDuration(); /** Injected script. */ public abstract IScript getScript(); public void renderWidget(IMarkupWriter writer, IRequestCycle cycle) { renderComponent(writer, cycle); } @SuppressWarnings("unchecked") protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { if(cycle.isRewinding()) { renderBody(writer, cycle); return; } // configure the node writer.begin("div"); writer.attribute("id", getIdParameter()); renderInformalParameters(writer, cycle); renderBody(writer, cycle); writer.end(); // configure the widget JSONObject obj = DojoUtils.parseJSONParameter(this, "options"); obj.put("widgetId", getId()); obj.put("toggle", getToggle()); obj.put("toggleDuration", getToggleDuration()); obj.put("bgColor", getBgColor()); obj.put("bgOpacity", getBgOpacity()); // setup script includes Map scriptParms = new HashMap(); scriptParms.put("id", getIdParameter()); scriptParms.put("props", obj.toString()); scriptParms.put("closer", getCloser().getId()); scriptParms.put("shower", getShower().getId()); PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this); getScript().execute(this, cycle, pageRenderSupport, scriptParms); } } Dialog.script:: http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd";> <input-symbol key="id" required="yes" /> <input-symbol key="props" required="yes" /> <input-symbol key="closer" required="yes" /> <input-symbol key="shower" required="yes" /> <body> <unique> dojo.require("dojo.widget.Dialog"); dojo.require("tapestry.widget.Widget"); </unique> </body> <initialization> tapestry.widget.synchronizeWidgetState("${id}", "dialog", ${props}); dojo.widget.byId("${id}").setCloseControl(dojo.byId("${closer}")); dojo.widget.byId("${id}").setShowControl(dojo.byId("${shower}")); </initialization> Dialog.jwc:: http://tapestry.apache.org/dtd/Tapestry_4_0.dtd";> Creates a dojo dialog widget Peter Beshai From: "Jesse Kuhnert" <[EMAIL PROTECTED]> Reply-To: "Tapestry users" To: "Tapestry users" Subject: Re: PageRenderSupport problem (Body component is in template) Date: Wed, 18 Oct 2006 12:31:25 -0400 Without the benefit of knowing what your component code is doing I am going to guess that you are attempting to render your dialog component during a Form "rewind" cycle. The best thing to do in your case is check for cycle.isRewinding() and skip over all blocks except for renderBody() . On 10/18/06, Peter Beshai <[EMAIL PROTECTED]> wrote: Sorry if this idea seems silly, but this is the first custom component/dojo widget wrapper I have made, so it basically just does the same thing as calling dojo.widget.byId("yourDlgId").show(). My dialog takes a
Re: PageRenderSupport problem (Body component is in template)
Without the benefit of knowing what your component code is doing I am going to guess that you are attempting to render your dialog component during a Form "rewind" cycle. The best thing to do in your case is check for cycle.isRewinding() and skip over all blocks except for renderBody() . On 10/18/06, Peter Beshai <[EMAIL PROTECTED]> wrote: Sorry if this idea seems silly, but this is the first custom component/dojo widget wrapper I have made, so it basically just does the same thing as calling dojo.widget.byId("yourDlgId").show(). My dialog takes a 'shower' and a 'closer' (IComponents) as required parameters -- I wasn't sure the best way to do this... but I thought it would allow more flexibility by doing it this way. My script looks like this: (Dialog.script) http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd";> <input-symbol key="id" required="yes" /> <input-symbol key="props" required="yes" /> <input-symbol key="closer" required="yes" /> <input-symbol key="shower" required="yes" /> <body> <unique> dojo.require("dojo.widget.Dialog"); dojo.require("tapestry.widget.Widget"); </unique> </body> <initialization> tapestry.widget.synchronizeWidgetState("${id}", "dialog", ${props}); dojo.widget.byId("${id}").setCloseControl(dojo.byId("${closer}")); dojo.widget.byId("${id}").setShowControl(dojo.byId("${shower}")); </initialization> So when I click on my shower (my form submit button) it pops up the dialog that has the closer (cancel button) and then instantaneously throws the exception. It took me a lot longer than 10 minutes to make this (a couple of hours!!) but after it was done it all seems very simple. I just couldn't find any documentation anywhere about it, so I just read through some source and tried putting things together. When you say "I'm assuming it's not just a simple dojo.widget.byId("yourDlgId").show()" are you implying that if it is just doing that, I ought to just use dojo directly in my template? Thanks, Peter Beshai >From: "Jesse Kuhnert" <[EMAIL PROTECTED]> >Reply-To: "Tapestry users" >To: "Tapestry users" >Subject: Re: PageRenderSupport problem (Body component is in template) >Date: Tue, 17 Oct 2006 22:54:39 -0400 > >So what does it do after loading up? I'm assuming it's not just a simple >dojo.widget.byId("yourDlgId").show() ? > >I created the same component in 4.1.1 yesterday btw. (Took me all of ten >minutes!, of course that is expected..) > >On 10/17/06, Peter Beshai <[EMAIL PROTECTED]> wrote: >> >>Hi, >> >>I have created a wrapper for the dojo component Dialog and it works fine >>(in >>general!), but I have a problem when I use it with my form. I want to have >>the dialog appear when I submit the form (ie, the form submit button is >>the >>show controller) and the dialog will basically have a cancel button (close >>controller and Submit component with type cancel). >> >>The dialog loads fine, but soon after loading it throws an exception: >>Component FileUpload/uploadingDialog requires rendering support, but no >>PageRenderSupport object has been stored into the request cycle. This >>object >>is typically provided by a Body component. You should add a Body component >>to your template. >> >>I do have a body component defined : . >> >>Any ideas how to fix this problem? >> >>FYI in my Dialog.java file I have in the renderComponent function: >>PageRenderSupport pageRenderSupport = >>TapestryUtils.getPageRenderSupport(cycle, this); >>getScript().execute(this, cycle, pageRenderSupport, scriptParms); >> >> >>Peter Beshai >> >>_ >>Essayez la nouvelle génération de recherche avec Live Search. >>http://www.live.com/?mkt=fr-ca >> >> >>- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > >-- >Jesse Kuhnert >Tapestry/Dojo/(and a dash of TestNG), team member/developer > >Open source based consulting work centered around >dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com _ Découvrez Live Search de votre PC ou de votre appareil mobile dès aujourd'hui. http://www.live.com/?mkt=fr-ca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
Re: PageRenderSupport problem (Body component is in template)
Sorry if this idea seems silly, but this is the first custom component/dojo widget wrapper I have made, so it basically just does the same thing as calling dojo.widget.byId("yourDlgId").show(). My dialog takes a 'shower' and a 'closer' (IComponents) as required parameters -- I wasn't sure the best way to do this... but I thought it would allow more flexibility by doing it this way. My script looks like this: (Dialog.script) http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd";> <input-symbol key="id" required="yes" /> <input-symbol key="props" required="yes" /> <input-symbol key="closer" required="yes" /> <input-symbol key="shower" required="yes" /> <body> <unique> dojo.require("dojo.widget.Dialog"); dojo.require("tapestry.widget.Widget"); </unique> </body> <initialization> tapestry.widget.synchronizeWidgetState("${id}", "dialog", ${props}); dojo.widget.byId("${id}").setCloseControl(dojo.byId("${closer}")); dojo.widget.byId("${id}").setShowControl(dojo.byId("${shower}")); </initialization> So when I click on my shower (my form submit button) it pops up the dialog that has the closer (cancel button) and then instantaneously throws the exception. It took me a lot longer than 10 minutes to make this (a couple of hours!!) but after it was done it all seems very simple. I just couldn't find any documentation anywhere about it, so I just read through some source and tried putting things together. When you say "I'm assuming it's not just a simple dojo.widget.byId("yourDlgId").show()" are you implying that if it is just doing that, I ought to just use dojo directly in my template? Thanks, Peter Beshai From: "Jesse Kuhnert" <[EMAIL PROTECTED]> Reply-To: "Tapestry users" To: "Tapestry users" Subject: Re: PageRenderSupport problem (Body component is in template) Date: Tue, 17 Oct 2006 22:54:39 -0400 So what does it do after loading up? I'm assuming it's not just a simple dojo.widget.byId("yourDlgId").show() ? I created the same component in 4.1.1 yesterday btw. (Took me all of ten minutes!, of course that is expected..) On 10/17/06, Peter Beshai <[EMAIL PROTECTED]> wrote: Hi, I have created a wrapper for the dojo component Dialog and it works fine (in general!), but I have a problem when I use it with my form. I want to have the dialog appear when I submit the form (ie, the form submit button is the show controller) and the dialog will basically have a cancel button (close controller and Submit component with type cancel). The dialog loads fine, but soon after loading it throws an exception: Component FileUpload/uploadingDialog requires rendering support, but no PageRenderSupport object has been stored into the request cycle. This object is typically provided by a Body component. You should add a Body component to your template. I do have a body component defined : . Any ideas how to fix this problem? FYI in my Dialog.java file I have in the renderComponent function: PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this); getScript().execute(this, cycle, pageRenderSupport, scriptParms); Peter Beshai _ Essayez la nouvelle génération de recherche avec Live Search. http://www.live.com/?mkt=fr-ca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com _ Découvrez Live Search de votre PC ou de votre appareil mobile dès aujourdhui. http://www.live.com/?mkt=fr-ca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageRenderSupport problem (Body component is in template)
So what does it do after loading up? I'm assuming it's not just a simple dojo.widget.byId("yourDlgId").show() ? I created the same component in 4.1.1 yesterday btw. (Took me all of ten minutes!, of course that is expected..) On 10/17/06, Peter Beshai <[EMAIL PROTECTED]> wrote: Hi, I have created a wrapper for the dojo component Dialog and it works fine (in general!), but I have a problem when I use it with my form. I want to have the dialog appear when I submit the form (ie, the form submit button is the show controller) and the dialog will basically have a cancel button (close controller and Submit component with type cancel). The dialog loads fine, but soon after loading it throws an exception: Component FileUpload/uploadingDialog requires rendering support, but no PageRenderSupport object has been stored into the request cycle. This object is typically provided by a Body component. You should add a Body component to your template. I do have a body component defined : . Any ideas how to fix this problem? FYI in my Dialog.java file I have in the renderComponent function: PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this); getScript().execute(this, cycle, pageRenderSupport, scriptParms); Peter Beshai _ Essayez la nouvelle génération de recherche avec Live Search. http://www.live.com/?mkt=fr-ca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
PageRenderSupport problem (Body component is in template)
Hi, I have created a wrapper for the dojo component Dialog and it works fine (in general!), but I have a problem when I use it with my form. I want to have the dialog appear when I submit the form (ie, the form submit button is the show controller) and the dialog will basically have a cancel button (close controller and Submit component with type cancel). The dialog loads fine, but soon after loading it throws an exception: Component FileUpload/uploadingDialog requires rendering support, but no PageRenderSupport object has been stored into the request cycle. This object is typically provided by a Body component. You should add a Body component to your template. I do have a body component defined : . Any ideas how to fix this problem? FYI in my Dialog.java file I have in the renderComponent function: PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this); getScript().execute(this, cycle, pageRenderSupport, scriptParms); Peter Beshai _ Essayez la nouvelle génération de recherche avec Live Search. http://www.live.com/?mkt=fr-ca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]