Re: dynamic DataTable
Someone in another forum advised me this: *** Maybe in latest Wicket something changed but in 1.4.16 you can't change Columns in DataTable. So it's immutable in some sense. But you may replace whole DataTable component instead when your sql statement changes: form.add(new Button(sqlSubmit) { void onSubmit() { String sql = ...; form.replace(createDataTable(myDataTable, sql)); } }) form.add(createDataTable(myDataTable, null)); Where createDataTable() creates DataTable using provided id and sql string. Also there is a convenient method Component.replaceWith(). Maybe it'll fit better to your coding style. *** I think this is what I need, but I dont know how to do. Can someone please help me to create below method? *createDataTable(wicketId, SQL)* Thanks, On 21 July 2011 21:05, Andrew Fielden andrew.fiel...@power-oasis.comwrote: I see your problem Davut, but I really don't think Wicket can solve it in the way you want it to. As Martin said, you need an entity to populate the models used by the various Wicket components. Could you somehow parse the SQL statement to extract the table name, and find its meta data? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/dynamic-DataTable-tp3683514p3684513.html Sent from the Users forum 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: Issues with HeaderResponseContainerFilteringHeaderResponse
Hi, It is not documented by wicket:head contributes before #renderHead(). This may change in the future so don't rely on it. Better take a look at http://wicketstuff.org/wicket/resourceaggregation application. There you can see how resources are scored. This way you can setup org.apache.wicket.resource.filtering.HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter which renders your specific contribution after all other. To render CSS text use org.apache.wicket.markup.html.IHeaderResponse.renderCSS(CharSequence css, String id). Use the id in the filter to recognize it. On Fri, Jul 22, 2011 at 1:00 AM, Loren Cole loren.c...@gmail.com wrote: Under normal circumstances I would, but I don't have my css in a file. It gets pulled from a database and stashed in the session. All the header contributer classes and resource references assume there's a file somewhere with this info. But in my case there is not. And, even id I did stuff this data into a file it still wouldn't fix my problem, because the customer defined css needs to override everything else with the same css selector. If another component added a header contributor afterwards that would not be the case. - Loren On Tue, Jul 19, 2011 at 11:35 PM, Jeremy Thomerson jer...@wickettraining.com wrote: To start, don't use a Label to contribute css. Use a header contributor. That's what they're made for. On 2011 7 19 13:22, Loren Cole loren.c...@gmail.com wrote: We're making our application skinable, but I'm having some trouble getting user specified css into the right place in the header. We're working in a distributed environment, so instead of saving their css in the file system we're putting it in our database, and in order to get the cascade to work properly we need to add this css after all the others. Here's how I'm adding it: StandardPage.java onInitialize() //Add any override style Tenant tenant = MyWebSession.get().getTenant(); Css css = cssRepository.GetStyleByTenant(tenant); if(tenant.getBranding() css != null) { add(new Label(style, css.getStyle())); } } StandardPage.html wicket:head style type=text/css wicket:id=style/style /wicket:head - So the issue is that thet style tag comes before all my header contributions. I've tried specifying a header response decorator like so: Application.java public static final String HEADER_FILTER_NAME = myHeaderBucket; init() { super.init(); setHeaderResponseDecorator(new IHeaderResponseDecorator() { HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter[] filters = {new CssAcceptingHeaderResponseFilter(HEADER_FILTER_NAME)}; @Override public IHeaderResponse decorate(IHeaderResponse response) { return new HeaderResponseContainerFilteringHeaderResponse(response, HEADER_FILTER_NAME, filters); } }); } StandardPage.html wicket:head div wicket:id=myHeaderBucket/div style type=text/css wicket:id=style/style /wicket:head -- Unfortunately I'm getting this exception when I instantiate a page: 12:28:04,097 INFO [STDOUT] 2011-07-19 12:28:04.096 [http-127.0.0.1-8080-1] [127.0.0.1] [T:2] [U:3 - joe_sharp] [com.transverse.bleep.wicket.desktop.DesktopPage] ERROR org.apache.wicket.RequestCycle 1529 - Exception in rendering component: [MarkupContainer [Component id = headerBucket]] org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = headerBucket]] at org.apache.wicket.Component.renderComponent(Component.java:2729) ~[wicket-1.4.17.jar:1.4.17] at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1539) ~[wicket-1.4.17.jar:1.4.17] at org.apache.wicket.Component.render(Component.java:2521) ~[wicket-1.4.17.jar:1.4.17] ... Caused by: java.lang.RuntimeException: there was an error processing the header response - you tried to render a bucket of response from HeaderResponseContainerFilteringHeaderResponse, but it had not yet run and been closed. this should occur when the header container that is standard in wicket renders, so perhaps you have done something to keep that from rendering? at org.apache.wicket.resource.filtering.HeaderResponseFilteredResponseContainer.onComponentTagBody(HeaderResponseFilteredResponseContainer.java:67) ~[wicket-1.4.17.jar:1.4.17] at org.apache.wicket.Component.renderComponent(Component.java:2690) ~[wicket-1.4.17.jar:1.4.17] ... 81 common frames omitted Any ideas on what I'm doing wrong? Is there an easier approach I can take? Thanks, Loren -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DateTimeField and setOutputMarkupId()
I don't see any problem. Put a break point in AjaxRequestTarget.addComponent() and see what is registered. If you see component with id hours then investigate the stacktrace. As last resort you can create a quickstart with plain Wicket components and if it still fails with this error send it to us in a ticket. On Thu, Jul 21, 2011 at 11:49 PM, Julian Sinai jsi...@gmail.com wrote: Hi Martin Thanks for looking at this. It's a bit complicated because we've built a form framework around Wicket, but here goes: In the page: HtFormPanel.DateFormField startField = new HtFormPanel.DateFormField(startField, new StringResourceModel(start, this, null), new PropertyModelDate(this, start), false); Where the constructor for HtFormPanel.DateFormField is: public DateFormField(String uniqueId, IModelString label, IModel m, boolean bShowTime) { // The DateTimeField is contained within the DateFormField super(uniqueId, FieldType.DATETEXTFIELD.toString(), (bShowTime ? new DateTimeField(FIELD_ID) : new DateField(FIELD_ID)), label, m); } Next, in the page: startField.setFieldOutputMarkupId(true); // The radio button that does the ajax update: final HtFormPanel.RadioFormFieldReportAction actionField = new HtFormPanel.RadioFormFieldReportAction( actionField,new ResourceModel(actionField),actionTypes,new LocalizedChoiceRendererReportAction(this), new PropertyModelReportAction(this,action)); Finally, the update code that causes the problem: actionField.getFormComponent().add( new HtAjaxFormChoiceComponentUpdatingBehavior() { private static final long serialVersionUID = 8574977146235850631L; protected void onUpdate(AjaxRequestTarget target) { if (getAction() != null getAction().equals(ReportAction.VIEW)) { startField.setRequired(false); } else { startField.setRequired(true); } // We update the startField and the DateTimeField inside it. target.addComponent(startField); target.addComponent(startField.getComponent()); } }); Julian On Thu, Jul 21, 2011 at 12:30 PM, Martin Grigorov mgrigo...@apache.org wrote: Show some code. On Thu, Jul 21, 2011 at 10:09 PM, Julian Sinai jsi...@gmail.com wrote: Nothing is adding it, we add the DateTimeField itself to the target. Julian On Thu, Jul 21, 2011 at 12:08 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: what is adding that to the target? -igor On Thu, Jul 21, 2011 at 12:07 PM, Julian Sinai jsi...@gmail.com wrote: It is the hours component of the DateTimeField. From DateTimeField.html: input type=text wicket:id=hours size=2 /nbsp;: Julian On Thu, Jul 21, 2011 at 11:24 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: what is hours ? -igor On Thu, Jul 21, 2011 at 11:17 AM, Julian Sinai jsi...@gmail.com wrote: Igor, We do update the DateTimeField itself, and this is what we see: SEVERE: cannot update component that does not have setOutputMarkupId property set to true. Component: [MarkupContainer [Component id = hours]] java.lang.IllegalArgumentException: cannot update component that does not have setOutputMarkupId property set to true. Component: [MarkupContainer [Component id = hours]] at org.apache.wicket.ajax.AjaxRequestTarget.addComponent(AjaxRequestTarget.java:346) Julian On Thu, Jul 21, 2011 at 11:02 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: cant update the DateTimeField itself? -igor On Thu, Jul 21, 2011 at 10:57 AM, Julian Sinai jsi...@gmail.com wrote: We have a need to update a DateTimeField via Ajax, but its fields are private, and they don't have setOutputMarkupId() set on them. The result is an exception upon Ajax update. Is there any solution other than cloning and owning DateTimeField? We are using Wicket 1.4.17 (and we can't upgrade to 1.5 just yet). Any help is appreciated. Julian -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: PageMap in 1.5
On Fri, Jul 22, 2011 at 6:31 AM, Donohoe Digital d...@donohoe.info wrote: I'm porting this sample scala/wicket application from Wicket 1.4 to 1.5. I've almost completely got it figured out except for this bit of code from a class that extends RequestCycle (it does some basic EntityManager/Transaction stuff): override def onEndRequest = { super.onEndRequest() if (em != null) { if (em.getTransaction().isActive()) em.getTransaction().commit() em.close() } // TODO: in 1.5 page maps no longer in use - not sure why they'd want to do this to begin with... // TODO: ahhh, maybe to prevent hitting 'back button'? //if (_endConversation) getRequest().getPage().getPageMap().remove() } The line I have commented out at the end is what I can't find an equivalent for in Wicket 1.5. Whether or not this is the proper way to do database stuff is really not important to me - please don't let that distract from the question. For those that are curious, the _endConversation flag is set in the body of a form's onSubmit() method, after data is written to the database. What I'm really interested in is a) Why would someone want to remove the page map from the session in Wicket 1.4? like above Is my comment correct that it prevents hitting the back button and re-submitting a form? no idea b) What is the Wicket 1.5 way of handling a situation like this? I looked at some other related posts on these forums, but haven't found a good description yet. c) In general, how does page caching work in Wicket 1.5? There isn't much on the migrating wiki page... The migration page has a note at the top mentioning other wiki pages for 1.5. There is a page for cache http headers and page storages. You need the second one. Thanks, -Doug -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PageMap-in-1-5-tp3685858p3685858.html Sent from the Users forum 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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Display pdf in frame issues
Hi, I wrote that page long time ago... I'm not aware of the issue you mention:-( If you find a solution, can you, please, update that page? So that other users can benefit from your experience. Regards, Ernesto On Wed, Jul 20, 2011 at 6:27 PM, Rahvin stephenfsm...@hotmail.com wrote: Hello, Not sure if this a wicket specific problem but the example i used to do this I got from here: https://cwiki.apache.org/WICKET/displaying-content-eg-pdf-excel-word-in-an-iframe.html https://cwiki.apache.org/WICKET/displaying-content-eg-pdf-excel-word-in-an-iframe.html The example works great, except for with IE8. To my component I have added the line: add(new StringHeaderContributor(meta http-equiv=\X-UA-Compatible\ content=\IE=EmulateIE7\/)); I have checked the source of the rendered page and found: head meta Script .. meta http-equiv=X-UA-Compatible content=IE=EmulateIE7/ /head The issue I get in IE8 is that the iFrame is a dark grey and entire page goes all wonky (for lack of a better term) Has anyone had/solved this? Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Display-pdf-in-frame-issues-tp3681441p3681441.html Sent from the Users forum 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxEventBehavior(onchange) and AjaxFormComponentUpdatingBehavior(onchange) on same DropDownChoice
Hi guys, I'm very new to Wicket, and I came across this: What I want to do: - I have a DropDownChoice component and I'd like to update it's model when it changes through AJAX. Also, I want to refresh (repaint, reload) this dropdown's parent when a value is changed, also though AJAX. My approach: - Adding an AjaxEventBehavior(onchange) AND an AjaxFormComponentUpdatingBehavior(onchange). Here's the code: dropDownChoice.add(new AjaxEventBehavior(onchange) { protected void onEvent(AjaxRequestTarget target) { LOG.debug(DroDownChoice's parent + IntegrityLevelDropDownPanel.this.getParent().getParent().getParent()); target.addComponent(IntegrityLevelDropDownPanel.this.getParent().getParent().getParent()); } }); dropDownChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) { @Override protected void onUpdate(AjaxRequestTarget target) { LOG.debug(New updated value: + this.getComponent().getDefaultModelObjectAsString()); target.addComponent(this.getComponent()); } }); The Problem: - Unfortunately both onchange events don't work together. Depending on the order of my code, the AjaxFormComponentUpdatingBehavior or the AjaxEventBehavior are executed, but not both. I've changed one of them to happen onblur and then they're both executed, but this is not a solution to my issue. Does anybody have any tips for this? I've been searching for a while but couldn't find anything that solves this. Thank you in advance, -- Rodrigo H M Bezerra - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEventBehavior(onchange) and AjaxFormComponentUpdatingBehavior(onchange) on same DropDownChoice
Why not put everything in the AjaxFormComponentUpdatingBehavior? As in: dropDownChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) { @Override protected void onUpdate(AjaxRequestTarget target) { LOG.debug(New updated value: + this.getComponent().getDefaultModelObjectAsString()); target.addComponent(this.getComponent()); * //This code was in the AjaxEventBehavior before LOG.debug(DroDownChoice's parent + IntegrityLevelDropDownPanel.* *this.getParent().getParent().**getParent()); target.addComponent(* *IntegrityLevelDropDownPanel.** this.getParent().getParent().**getParent());* } }); On Fri, Jul 22, 2011 at 6:32 AM, Rodrigo Heffner rodrigo.heff...@gmail.comwrote: Hi guys, I'm very new to Wicket, and I came across this: What I want to do: - I have a DropDownChoice component and I'd like to update it's model when it changes through AJAX. Also, I want to refresh (repaint, reload) this dropdown's parent when a value is changed, also though AJAX. My approach: - Adding an AjaxEventBehavior(onchange) AND an AjaxFormComponentUpdatingBehavior(onchange). Here's the code: dropDownChoice.add(new AjaxEventBehavior(onchange) { protected void onEvent(AjaxRequestTarget target) { LOG.debug(DroDownChoice's parent + IntegrityLevelDropDownPanel.this.getParent().getParent().getParent()); target.addComponent(IntegrityLevelDropDownPanel.this.getParent().getParent().getParent()); } }); dropDownChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) { @Override protected void onUpdate(AjaxRequestTarget target) { LOG.debug(New updated value: + this.getComponent().getDefaultModelObjectAsString()); target.addComponent(this.getComponent()); } }); The Problem: - Unfortunately both onchange events don't work together. Depending on the order of my code, the AjaxFormComponentUpdatingBehavior or the AjaxEventBehavior are executed, but not both. I've changed one of them to happen onblur and then they're both executed, but this is not a solution to my issue. Does anybody have any tips for this? I've been searching for a while but couldn't find anything that solves this. Thank you in advance, -- Rodrigo H M Bezerra - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxEventBehavior(onchange) and AjaxFormComponentUpdatingBehavior(onchange) on same DropDownChoice
Hi Clint, Thank you very much for your (quick) response. I had the (maybe incorrect) idea that AjaxEventBehavior's target.addComponent(aComponent) would only make aComponent refresh itself through AJAX (and not store new changed values on it's model). I also thought that the AjaxFormComponentUpdatingBehavior's target.addComponent(aComponent) would make the opposite: save aComponent's model without a form submission (thorugh AJAX) but without refreshing anything. I'll apply your changes and check if, onchange, new values are stored in the dropdown's model and it's parent is refreshed to show the changes. Thanks On Fri, Jul 22, 2011 at 12:39 PM, Clint Checketts checke...@gmail.com wrote: Why not put everything in the AjaxFormComponentUpdatingBehavior? As in: dropDownChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) { @Override protected void onUpdate(AjaxRequestTarget target) { LOG.debug(New updated value: + this.getComponent().getDefaultModelObjectAsString()); target.addComponent(this.getComponent()); * //This code was in the AjaxEventBehavior before LOG.debug(DroDownChoice's parent + IntegrityLevelDropDownPanel.* *this.getParent().getParent().**getParent()); target.addComponent(* *IntegrityLevelDropDownPanel.** this.getParent().getParent().**getParent());* } }); On Fri, Jul 22, 2011 at 6:32 AM, Rodrigo Heffner rodrigo.heff...@gmail.comwrote: Hi guys, I'm very new to Wicket, and I came across this: What I want to do: - I have a DropDownChoice component and I'd like to update it's model when it changes through AJAX. Also, I want to refresh (repaint, reload) this dropdown's parent when a value is changed, also though AJAX. My approach: - Adding an AjaxEventBehavior(onchange) AND an AjaxFormComponentUpdatingBehavior(onchange). Here's the code: dropDownChoice.add(new AjaxEventBehavior(onchange) { protected void onEvent(AjaxRequestTarget target) { LOG.debug(DroDownChoice's parent + IntegrityLevelDropDownPanel.this.getParent().getParent().getParent()); target.addComponent(IntegrityLevelDropDownPanel.this.getParent().getParent().getParent()); } }); dropDownChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) { @Override protected void onUpdate(AjaxRequestTarget target) { LOG.debug(New updated value: + this.getComponent().getDefaultModelObjectAsString()); target.addComponent(this.getComponent()); } }); The Problem: - Unfortunately both onchange events don't work together. Depending on the order of my code, the AjaxFormComponentUpdatingBehavior or the AjaxEventBehavior are executed, but not both. I've changed one of them to happen onblur and then they're both executed, but this is not a solution to my issue. Does anybody have any tips for this? I've been searching for a while but couldn't find anything that solves this. Thank you in advance, -- Rodrigo H M Bezerra - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Rodrigo H M Bezerra - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
changing the background color of link on performing onclick event
Hi, I'm using wicket 1.4 and my site contains one Template which header,footer,hor.menu and it is common to all the pages now, my req is onclicking the hor menu item, i want to show the active link with some background.. I tried with a:active but it is not working as it is a common template to all the pages..Can any one help in doing this?..here is my Hor menu -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/changing-the-background-color-of-link-on-performing-onclick-event-tp3686180p3686180.html Sent from the Users forum 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: AjaxEventBehavior(onchange) and AjaxFormComponentUpdatingBehavior(onchange) on same DropDownChoice
So far it seems to work. Thank you Clint On Fri, Jul 22, 2011 at 12:55 PM, Rodrigo Heffner rodrigo.heff...@gmail.com wrote: Hi Clint, Thank you very much for your (quick) response. I had the (maybe incorrect) idea that AjaxEventBehavior's target.addComponent(aComponent) would only make aComponent refresh itself through AJAX (and not store new changed values on it's model). I also thought that the AjaxFormComponentUpdatingBehavior's target.addComponent(aComponent) would make the opposite: save aComponent's model without a form submission (thorugh AJAX) but without refreshing anything. I'll apply your changes and check if, onchange, new values are stored in the dropdown's model and it's parent is refreshed to show the changes. Thanks On Fri, Jul 22, 2011 at 12:39 PM, Clint Checketts checke...@gmail.com wrote: Why not put everything in the AjaxFormComponentUpdatingBehavior? As in: dropDownChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) { @Override protected void onUpdate(AjaxRequestTarget target) { LOG.debug(New updated value: + this.getComponent().getDefaultModelObjectAsString()); target.addComponent(this.getComponent()); * //This code was in the AjaxEventBehavior before LOG.debug(DroDownChoice's parent + IntegrityLevelDropDownPanel.* *this.getParent().getParent().**getParent()); target.addComponent(* *IntegrityLevelDropDownPanel.** this.getParent().getParent().**getParent());* } }); On Fri, Jul 22, 2011 at 6:32 AM, Rodrigo Heffner rodrigo.heff...@gmail.comwrote: Hi guys, I'm very new to Wicket, and I came across this: What I want to do: - I have a DropDownChoice component and I'd like to update it's model when it changes through AJAX. Also, I want to refresh (repaint, reload) this dropdown's parent when a value is changed, also though AJAX. My approach: - Adding an AjaxEventBehavior(onchange) AND an AjaxFormComponentUpdatingBehavior(onchange). Here's the code: dropDownChoice.add(new AjaxEventBehavior(onchange) { protected void onEvent(AjaxRequestTarget target) { LOG.debug(DroDownChoice's parent + IntegrityLevelDropDownPanel.this.getParent().getParent().getParent()); target.addComponent(IntegrityLevelDropDownPanel.this.getParent().getParent().getParent()); } }); dropDownChoice.add(new AjaxFormComponentUpdatingBehavior(onchange) { @Override protected void onUpdate(AjaxRequestTarget target) { LOG.debug(New updated value: + this.getComponent().getDefaultModelObjectAsString()); target.addComponent(this.getComponent()); } }); The Problem: - Unfortunately both onchange events don't work together. Depending on the order of my code, the AjaxFormComponentUpdatingBehavior or the AjaxEventBehavior are executed, but not both. I've changed one of them to happen onblur and then they're both executed, but this is not a solution to my issue. Does anybody have any tips for this? I've been searching for a while but couldn't find anything that solves this. Thank you in advance, -- Rodrigo H M Bezerra - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Rodrigo H M Bezerra -- Rodrigo H M Bezerra - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Display pdf in frame issues
Sorry, I should have done that... In our testing it looks like it is an issue with adobe reader version 10.0. It is fixed in 10.1 ( a few versions between the 2 dont work either), it has worked with all other version of reader that we tried. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Display-pdf-in-frame-issues-tp3681441p3686671.html Sent from the Users forum 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: PageMap in 1.5
Let me simplify my original question. If in the past I could do this: getRequest().getPage().getPageMap().remove() a) What was the practical purpose of removing page maps from sessions (i.e., this API existed for a purpose - what was it)? b) What do I do in 1.5 to accomplish the same thing now that PageMaps are gone? I suspect this has something to do with back button support and page history. This wiki page (https://cwiki.apache.org/WICKET/caching-in-wicket-15.html) discusses caching, true. I guess what I'm looking for is a discussion of PageManager (the replacement for PageMaps). How does this work in 1.5? -Doug -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PageMap-in-1-5-tp3685858p3686882.html Sent from the Users forum 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: dynamic DataTable
Hi, Here is the outline of a possible implementation : Execute SQL String Create a ListIColumnSQLResultRow for each SQL result column: add a column to the list that displays one column of a SQLResultRow Create a very simple ISortableDataProvider that returns the SQL result from above (make it more complex to implement sorting) Create a DataTable using the column list and the data provider On 22/07/2011 2:05 AM, davut uysal wrote: Someone in another forum advised me this: *** Maybe in latest Wicket something changed but in 1.4.16 you can't change Columns in DataTable. So it's immutable in some sense. But you may replace whole DataTable component instead when your sql statement changes: form.add(new Button(sqlSubmit) { void onSubmit() { String sql = ...; form.replace(createDataTable(myDataTable, sql)); } }) form.add(createDataTable(myDataTable, null)); Where createDataTable() creates DataTable using provided id and sql string. Also there is a convenient method Component.replaceWith(). Maybe it'll fit better to your coding style. *** I think this is what I need, but I dont know how to do. Can someone please help me to create below method? *createDataTable(wicketId, SQL)* Thanks, On 21 July 2011 21:05, Andrew Fieldenandrew.fiel...@power-oasis.comwrote: I see your problem Davut, but I really don't think Wicket can solve it in the way you want it to. As Martin said, you need anentity to populate the models used by the various Wicket components. Could you somehow parse the SQL statement to extract the table name, and find its meta data? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/dynamic-DataTable-tp3683514p3684513.html Sent from the Users forum 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: PageMap in 1.5
On Thu, Jul 21, 2011 at 8:31 PM, Donohoe Digital d...@donohoe.info wrote: I'm porting this sample scala/wicket application from Wicket 1.4 to 1.5. I've almost completely got it figured out except for this bit of code from a class that extends RequestCycle (it does some basic EntityManager/Transaction stuff): override def onEndRequest = { super.onEndRequest() if (em != null) { if (em.getTransaction().isActive()) em.getTransaction().commit() em.close() } // TODO: in 1.5 page maps no longer in use - not sure why they'd want to do this to begin with... // TODO: ahhh, maybe to prevent hitting 'back button'? //if (_endConversation) getRequest().getPage().getPageMap().remove() } The line I have commented out at the end is what I can't find an equivalent for in Wicket 1.5. Whether or not this is the proper way to do database stuff is really not important to me - please don't let that distract from the question. For those that are curious, the _endConversation flag is set in the body of a form's onSubmit() method, after data is written to the database. What I'm really interested in is a) Why would someone want to remove the page map from the session in Wicket 1.4? like above Is my comment correct that it prevents hitting the back button and re-submitting a form? i can only guess and say that all pages in the pagemap are part of the conversation and once the conversation is over/discarded the pagemap is removed so pages in that pagemap/conversation are no longer accessible. if the user tries to click back to a page and click any link on it they will get the page expired exception. b) What is the Wicket 1.5 way of handling a situation like this? I looked at some other related posts on these forums, but haven't found a good description yet. dont think we have a replacement for this, actually. what we would need is ipagemanager#removePage(int id). that will only handle removing a single page though. if you have more pages that are part of a conversation you will have to track them all so the last page of the conversation knows all other pages that paricipated. this should be easy since somehow you must already be propagating the conversation somehow. then when conversation is over the code can access the list, from pages metadata?, and remove all pages. feel free to add an rfe for the remove() method. c) In general, how does page caching work in Wicket 1.5? There isn't much on the migrating wiki page... martin has already answered that in another email... -igor Thanks, -Doug -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PageMap-in-1-5-tp3685858p3685858.html Sent from the Users forum 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DateTimeField and setOutputMarkupId()
Martin, thanks for your help. Igor's hint helped me. After some investigation I realized that I have a visitor in my button's submit handler that visits all form components and adds them to the ajax target. That meant it was visiting the inner fields of the DateTimeField, also, which was not necessary. I fixed it by ignoring form fields in the visitor that don't have outputMarkupId set. Julian On Thu, Jul 21, 2011 at 11:32 PM, Martin Grigorov mgrigo...@apache.orgwrote: I don't see any problem. Put a break point in AjaxRequestTarget.addComponent() and see what is registered. If you see component with id hours then investigate the stacktrace. As last resort you can create a quickstart with plain Wicket components and if it still fails with this error send it to us in a ticket. On Thu, Jul 21, 2011 at 11:49 PM, Julian Sinai jsi...@gmail.com wrote: Hi Martin Thanks for looking at this. It's a bit complicated because we've built a form framework around Wicket, but here goes: In the page: HtFormPanel.DateFormField startField = new HtFormPanel.DateFormField(startField, new StringResourceModel(start, this, null), new PropertyModelDate(this, start), false); Where the constructor for HtFormPanel.DateFormField is: public DateFormField(String uniqueId, IModelString label, IModel m, boolean bShowTime) { // The DateTimeField is contained within the DateFormField super(uniqueId, FieldType.DATETEXTFIELD.toString(), (bShowTime ? new DateTimeField(FIELD_ID) : new DateField(FIELD_ID)), label, m); } Next, in the page: startField.setFieldOutputMarkupId(true); // The radio button that does the ajax update: final HtFormPanel.RadioFormFieldReportAction actionField = new HtFormPanel.RadioFormFieldReportAction( actionField,new ResourceModel(actionField),actionTypes,new LocalizedChoiceRendererReportAction(this), new PropertyModelReportAction(this,action)); Finally, the update code that causes the problem: actionField.getFormComponent().add( new HtAjaxFormChoiceComponentUpdatingBehavior() { private static final long serialVersionUID = 8574977146235850631L; protected void onUpdate(AjaxRequestTarget target) { if (getAction() != null getAction().equals(ReportAction.VIEW)) { startField.setRequired(false); } else { startField.setRequired(true); } // We update the startField and the DateTimeField inside it. target.addComponent(startField); target.addComponent(startField.getComponent()); } }); Julian On Thu, Jul 21, 2011 at 12:30 PM, Martin Grigorov mgrigo...@apache.org wrote: Show some code. On Thu, Jul 21, 2011 at 10:09 PM, Julian Sinai jsi...@gmail.com wrote: Nothing is adding it, we add the DateTimeField itself to the target. Julian On Thu, Jul 21, 2011 at 12:08 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote: what is adding that to the target? -igor On Thu, Jul 21, 2011 at 12:07 PM, Julian Sinai jsi...@gmail.com wrote: It is the hours component of the DateTimeField. From DateTimeField.html: input type=text wicket:id=hours size=2 /nbsp;: Julian On Thu, Jul 21, 2011 at 11:24 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: what is hours ? -igor On Thu, Jul 21, 2011 at 11:17 AM, Julian Sinai jsi...@gmail.com wrote: Igor, We do update the DateTimeField itself, and this is what we see: SEVERE: cannot update component that does not have setOutputMarkupId property set to true. Component: [MarkupContainer [Component id = hours]] java.lang.IllegalArgumentException: cannot update component that does not have setOutputMarkupId property set to true. Component: [MarkupContainer [Component id = hours]] at org.apache.wicket.ajax.AjaxRequestTarget.addComponent(AjaxRequestTarget.java:346) Julian On Thu, Jul 21, 2011 at 11:02 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: cant update the DateTimeField itself? -igor On Thu, Jul 21, 2011 at 10:57 AM, Julian Sinai jsi...@gmail.com wrote: We have a need to update a DateTimeField via Ajax, but its fields are private, and they don't have setOutputMarkupId() set on them. The result is an exception upon Ajax update. Is there any solution other than cloning and owning DateTimeField? We are using Wicket 1.4.17 (and we can't upgrade to 1.5 just yet). Any help is appreciated. Julian -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com
Getting Post DATA
I am very new user of wicket, so please be gentle with me if this is obvious question or RTFM. I tried searching for docs but no luck. Using Wicket 1.5. I have bunch of pages mounted using mountPage(url, page class). This works fine and pages do get parameters so long as the request is GET. If you do post on the same url, pages don't see the same parameters. I tried searching google for the solution and came across one solution at http://apache-wicket.1842946.n4.nabble.com/Manually-handle-post-data-td1853028.html However seems like I can not resolve QueryStringUrlCodingStrategy class in wicket 1.5. Tried looking for replacement calls, but no luck so far. These are services and there is no UI for this. A script will typically post the data to the service. Regards, Niranjan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket documentation suggestion
Not sure if this is the right forum to post, but I presume many decision makers are lurking here. When googling for class documentation, google typically shows multiple results. I have caught myself looking at wrong version of docs many times. This is especially useful if there methods that are deprecated or we have new way of doing things in better way. From this perspective, I like what Microsoft does. They tell you that you are looking at documentation of version X and have a link to jump to other versions if required. Example at http://msdn.microsoft.com/en-us/library/system.data.dataset.aspx I know for API docs, we can see 1.4 or other versions in url bar, but I think this might be really useful to have a link to jump to other versions. Any Thoughts? Niranjan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Select Component with Blank Choice at the Top
I am using the Select component to represent the HTML OptionGroup with Options. The Select must have a blank choice displayed at the top. With DropDowns, I would have been able to do setNullValid, but Select doesn't have this method. Any ideas? Thanks a lot. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Select-Component-with-Blank-Choice-at-the-Top-tp3687589p3687589.html Sent from the Users forum 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
Avoid doing lot of Ajax request
I have alot of onmouseover ajax request in one panel. How to avoid queuing all request when mouse move is too fast and ideally only do the last ? I tried with a thread but i'm out of the context : no application is defined Thank you -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Avoid-doing-lot-of-Ajax-request-tp3687472p3687472.html Sent from the Users forum 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: Avoid doing lot of Ajax request
You can throttle events. See setThrottleDelay() on your behavior. On Fri, Jul 22, 2011 at 1:31 PM, coincoinfou olivierandr...@gmail.comwrote: I have alot of onmouseover ajax request in one panel. How to avoid queuing all request when mouse move is too fast and ideally only do the last ? I tried with a thread but i'm out of the context : no application is defined Thank you -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Avoid-doing-lot-of-Ajax-request-tp3687472p3687472.html Sent from the Users forum 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: Re-Captcha with WiQuery ButtonBehavior causes Channel busy - postponing
I didn't get any feedback on this and was thinking about posting this on WiQuery forum but it didn't look very active. Does anybody have any thoughts on why we are getting Channel busy - postponing message? Thanks On Tue, Jul 19, 2011 at 3:42 PM, Alec Swan alecs...@gmail.com wrote: Hello, We have a re-captcha button which refreshes captcha password image. It works fine until we add WiQuery ButtonBehavior to the button. With this behavior the captcha image is no longer refreshed and Wicked Ajax Debugger displays INFO: Channel busy - postponing. The following is a code snippet which describes the problem. Uncommenting add(new ButtonBehavior()) breaks re-captcha functionality. Please help, Thanks new AjaxLink(reCaptcha) { @Override public void onClick(AjaxRequestTarget target) { password = newPassword(); CaptchaImageResource captchaImageResource = new CaptchaImageResource(password); NonCachingImage imgCaptcha = new NonCachingImage(captchaImage, captchaImageResource); imgCaptcha.setOutputMarkupId(true); SignUpForm.this.addOrReplace(imgCaptcha); if (target != null) { target.addComponent(imgCaptcha); } } }//.add(new ButtonBehavior()) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Issues with HeaderResponseContainerFilteringHeaderResponse
I had a similar case where I wanted to contribute header sections that are written with renderString() last. I was not able to figure out all that resource aggregation and bucketing stuff, so I wrote something simpler. I would appreciate if somebody could review and comment on this: setHeaderResponseDecorator(new IHeaderResponseDecorator() { @Override public IHeaderResponse decorate(IHeaderResponse response) { return new DecoratingHeaderResponse(response) { private CharSequence stringToRender; @Override public void renderString(CharSequence string) { stringToRender = stringToRender == null ? string : stringToRender.toString() + string; } @Override public void close() { renderStringIfNeeded(); super.close(); } private void renderStringIfNeeded() { if (stringToRender != null !wasRendered(stringToRender)) { super.renderString(stringToRender); markRendered(stringToRender); } } }; } }); On Fri, Jul 22, 2011 at 12:28 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi, It is not documented by wicket:head contributes before #renderHead(). This may change in the future so don't rely on it. Better take a look at http://wicketstuff.org/wicket/resourceaggregation application. There you can see how resources are scored. This way you can setup org.apache.wicket.resource.filtering.HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter which renders your specific contribution after all other. To render CSS text use org.apache.wicket.markup.html.IHeaderResponse.renderCSS(CharSequence css, String id). Use the id in the filter to recognize it. On Fri, Jul 22, 2011 at 1:00 AM, Loren Cole loren.c...@gmail.com wrote: Under normal circumstances I would, but I don't have my css in a file. It gets pulled from a database and stashed in the session. All the header contributer classes and resource references assume there's a file somewhere with this info. But in my case there is not. And, even id I did stuff this data into a file it still wouldn't fix my problem, because the customer defined css needs to override everything else with the same css selector. If another component added a header contributor afterwards that would not be the case. - Loren On Tue, Jul 19, 2011 at 11:35 PM, Jeremy Thomerson jer...@wickettraining.com wrote: To start, don't use a Label to contribute css. Use a header contributor. That's what they're made for. On 2011 7 19 13:22, Loren Cole loren.c...@gmail.com wrote: We're making our application skinable, but I'm having some trouble getting user specified css into the right place in the header. We're working in a distributed environment, so instead of saving their css in the file system we're putting it in our database, and in order to get the cascade to work properly we need to add this css after all the others. Here's how I'm adding it: StandardPage.java onInitialize() //Add any override style Tenant tenant = MyWebSession.get().getTenant(); Css css = cssRepository.GetStyleByTenant(tenant); if(tenant.getBranding() css != null) { add(new Label(style, css.getStyle())); } } StandardPage.html wicket:head style type=text/css wicket:id=style/style /wicket:head - So the issue is that thet style tag comes before all my header contributions. I've tried specifying a header response decorator like so: Application.java public static final String HEADER_FILTER_NAME = myHeaderBucket; init() { super.init(); setHeaderResponseDecorator(new IHeaderResponseDecorator() { HeaderResponseContainerFilteringHeaderResponse.IHeaderResponseFilter[] filters = {new CssAcceptingHeaderResponseFilter(HEADER_FILTER_NAME)}; @Override public IHeaderResponse decorate(IHeaderResponse response) { return new HeaderResponseContainerFilteringHeaderResponse(response, HEADER_FILTER_NAME, filters); } }); } StandardPage.html wicket:head div wicket:id=myHeaderBucket/div style type=text/css wicket:id=style/style /wicket:head -- Unfortunately I'm getting this exception when I instantiate a page: 12:28:04,097 INFO [STDOUT] 2011-07-19 12:28:04.096 [http-127.0.0.1-8080-1] [127.0.0.1] [T:2] [U:3 - joe_sharp] [com.transverse.bleep.wicket.desktop.DesktopPage] ERROR org.apache.wicket.RequestCycle 1529 - Exception in rendering component: [MarkupContainer [Component id = headerBucket]] org.apache.wicket.WicketRuntimeException: Exception in rendering component:
Re: Re-Captcha with WiQuery ButtonBehavior causes Channel busy - postponing
Alec, Have you checked that no JavaScript errors are being encountered on the client? We're not using WiQuery, but we encountered your channel busy symptom dealing with https://issues.apache.org/jira/browse/WICKET-3820. The client-side AJAX processing was choking before the channel was marked available. Dan On Fri, Jul 22, 2011 at 4:04 PM, Alec Swan alecs...@gmail.com wrote: I didn't get any feedback on this and was thinking about posting this on WiQuery forum but it didn't look very active. Does anybody have any thoughts on why we are getting Channel busy - postponing message? Thanks On Tue, Jul 19, 2011 at 3:42 PM, Alec Swan alecs...@gmail.com wrote: Hello, We have a re-captcha button which refreshes captcha password image. It works fine until we add WiQuery ButtonBehavior to the button. With this behavior the captcha image is no longer refreshed and Wicked Ajax Debugger displays INFO: Channel busy - postponing. The following is a code snippet which describes the problem. Uncommenting add(new ButtonBehavior()) breaks re-captcha functionality. Please help, Thanks new AjaxLink(reCaptcha) { @Override public void onClick(AjaxRequestTarget target) { password = newPassword(); CaptchaImageResource captchaImageResource = new CaptchaImageResource(password); NonCachingImage imgCaptcha = new NonCachingImage(captchaImage, captchaImageResource); imgCaptcha.setOutputMarkupId(true); SignUpForm.this.addOrReplace(imgCaptcha); if (target != null) { target.addComponent(imgCaptcha); } } }//.add(new ButtonBehavior()) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Handling futures
Hello, I can't find the correct way to handle java.util.concurrent.Future instances returned from asynchronous methods in Wicket. This interface does not extend Serializable so its instances can't be stored in components or pages. So what do you do with them? Do you store them in a map in the application and keep a handle (e.g. an int) in the Wicket component? I saw code on a github repository that implemented an ajax timer behavior that keeps a reference to a Future in a transient field to update a status. However, I can't understand how that would work. Wouldn't the transient field be nulled out if the behavior is serialized with the page and then deserialized? Essentially, my question is: what is the standard way to handle Futures in Wicket that run longer than the page rendering? (like processing an order or sending emails) I hope I'm not missing something obvious, but that might be the case... Regards, Bertrand - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org