Re: styling thead in DataTable
Martin, Yes...you would have to set a wicket:id for the thead to add attributes dynamically. This is easily done by setting markup to a subclass of datatable, and using the same structure used in the wicket-extensions jar. Cheers, Christian On 3/11/08, Eyal Golan [EMAIL PROTECTED] wrote: Thanks Christian, As Igor suggested, I did use a CSS (at the beginning I didn't find the style attribute I needed). I'll keep in mind the onComponentTag() as well. As I mentioned before, my problem was solved, but when I have time, I'll try to find the thead of a DataTable issue. Thanks guys On Tue, Mar 11, 2008 at 3:45 AM, Christian Alejandro Marquez Grabia [EMAIL PROTECTED] wrote: You can change tag attributes by overriding the onComponentTag() method, at least that is what I do when modifying any class or other attribute. (you should get the attribute from the tag parameter, and then set it there as well) I'm not sure where you should add that for the thead builder, but if you find it, then you'll get it done. You may also use IBehaviours, like SimpleAttributeModifier. Or as Igor well said, use your own markup (you could see the default markup inside the jar, and simply add the attribute you want) Rgds, Christian On 3/10/08, Igor Vaynberg [EMAIL PROTECTED] wrote: there shouldnt be anything you cannot do through css that you can do through adding things to markup that said you can always subclass datatable and provide your own markup -igor On Mon, Mar 10, 2008 at 3:31 PM, Eyal Golan [EMAIL PROTECTED] wrote: well, I can and this is what I actually did. I found out that I can use in style, the attribute: *text-align* that has solved me the problem. But my (more general) question is: what if there is an attribute that can't be set in style? as what I understand, it can't be set in a CSS (if I'm mistaken, please tell me how it's done). How can I add attributes to thead of a DataTable? Hope I'm clear enough. Eyal On Mon, Mar 10, 2008 at 7:17 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: can you not use css? -igor On Mon, Mar 10, 2008 at 6:17 AM, Eyal Golan [EMAIL PROTECTED] wrote: Hey all, I am having an issue that seems to be simple, but still, no success. I have a normal DataTable. I add to it the toptoolbars manually: HeadersToolbar thead = new HeadersToolbar(entityDataTable, entitiesProvider); entityDataTable.addTopToolbar(thead); This is how it looks in the HTML: table wicket:id=entitiesList class=browserTable This is how (part of) the generated HTML looks like: table class=browserTable wicket:id=entitiesList thead tr class=headers th wicket:id=header class=wicket_orderUpwicket:border _moz-userdefined=a wicket:id=orderByLink class= href=?wicket:interface=:4:tabs:browserTabbedPanel:panel:entitiesList:topToolbars:2:toolbar:headers:1:header:orderByLink::ILinkListener::wicket:body _moz-userdefined=span wicket:id=labelPerson ID/span/wicket:body/a/wicket:border /th I want a simple thing: I want to align the header labels to the left. The problem(s): - style doesn't have an attribute of align. Only vertical-align. - I tried to add to the HeadersToolbar an AttributeModifier: thead.add(new AttributeModifier(align, true, new Model(left))); Nothing seems working. I am using Firebug and the label thead keeps with no attribute. Can anyone help? Thank a lot -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/
Re: styling thead in DataTable
You can change tag attributes by overriding the onComponentTag() method, at least that is what I do when modifying any class or other attribute. (you should get the attribute from the tag parameter, and then set it there as well) I'm not sure where you should add that for the thead builder, but if you find it, then you'll get it done. You may also use IBehaviours, like SimpleAttributeModifier. Or as Igor well said, use your own markup (you could see the default markup inside the jar, and simply add the attribute you want) Rgds, Christian On 3/10/08, Igor Vaynberg [EMAIL PROTECTED] wrote: there shouldnt be anything you cannot do through css that you can do through adding things to markup that said you can always subclass datatable and provide your own markup -igor On Mon, Mar 10, 2008 at 3:31 PM, Eyal Golan [EMAIL PROTECTED] wrote: well, I can and this is what I actually did. I found out that I can use in style, the attribute: *text-align* that has solved me the problem. But my (more general) question is: what if there is an attribute that can't be set in style? as what I understand, it can't be set in a CSS (if I'm mistaken, please tell me how it's done). How can I add attributes to thead of a DataTable? Hope I'm clear enough. Eyal On Mon, Mar 10, 2008 at 7:17 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: can you not use css? -igor On Mon, Mar 10, 2008 at 6:17 AM, Eyal Golan [EMAIL PROTECTED] wrote: Hey all, I am having an issue that seems to be simple, but still, no success. I have a normal DataTable. I add to it the toptoolbars manually: HeadersToolbar thead = new HeadersToolbar(entityDataTable, entitiesProvider); entityDataTable.addTopToolbar(thead); This is how it looks in the HTML: table wicket:id=entitiesList class=browserTable This is how (part of) the generated HTML looks like: table class=browserTable wicket:id=entitiesList thead tr class=headers th wicket:id=header class=wicket_orderUpwicket:border _moz-userdefined=a wicket:id=orderByLink class= href=?wicket:interface=:4:tabs:browserTabbedPanel:panel:entitiesList:topToolbars:2:toolbar:headers:1:header:orderByLink::ILinkListener::wicket:body _moz-userdefined=span wicket:id=labelPerson ID/span/wicket:body/a/wicket:border /th I want a simple thing: I want to align the header labels to the left. The problem(s): - style doesn't have an attribute of align. Only vertical-align. - I tried to add to the HeadersToolbar an AttributeModifier: thead.add(new AttributeModifier(align, true, new Model(left))); Nothing seems working. I am using Firebug and the label thead keeps with no attribute. Can anyone help? Thank a lot -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Adding onClick event to form fields
Yes...and the right way to do it is not using ajaxlink, but using AjaxFormComponentUpdatingBehaviour(onclick) I tried this on FF, and the mouse events are accepted in text fields...according to the page, accepted in all tags except: base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, title You should check the page http://www.w3schools.com/html/tryit.asp?filename=tryhtml_input and try things on the go Rgds, Christian On 2/20/08, Nick Heudecker [EMAIL PROTECTED] wrote: I think just onfocus, onblur and possibly onchange. On Wed, Feb 20, 2008 at 5:14 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: input type=textfield doesnt have an onclick event afaik... -igor On Tue, Feb 19, 2008 at 6:28 PM, givp [EMAIL PROTECTED] wrote: Hi, Sorry for the newbie query. I currently have a form text field and I want to also be able to click on the field and do other stuff. I'm doing this right now but it's obviously not working. Can anyone point me to the right direction? // Form statusForm = new Form(statusForm); statusText = new TextField(statusText, new Model()); // make clicking on the text field do something statusText.add(new AjaxLink(this.getId()) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { // do something here! } }); statusForm.add(statusText); add(statusForm); // Thanks G -- View this message in context: http://www.nabble.com/Adding-onClick-event-to-form-fields-tp15580983p15580983.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nick Heudecker Professional Wicket Training Consulting http://www.systemmobile.com Eventful - Intelligent Event Management http://www.eventfulhq.com
Re: Settings focus to window opened by javascript appended to AjaxLink
You should try without the alertit removes the focus when you click the 'Ok' button. Instead you should try something like: onfocus= this.value = 'focused'; Another method that can be used is select() instead of focus() Rgds, Christian On 2/20/08, jeredm [EMAIL PROTECTED] wrote: I am having a similar problem in IE, but it does not happen in Firefox. I am popping up a modal dialog and want to set focus on the first text box in the modal when it is opened (id=focusMe). Here is some code that has been trimmed for simplicity: HTML: input id=focusMe type=text onfocus=alert('I have focus'); onblur=alert('I lost focus'); / JAVA: public void onClick(AjaxRequestTarget target){ modal.setContent(newPanel); modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback(){ public void onClose(AjaxRequestTarget target){ } }); modal.show(target); target.appendJavascript(document.getElementById('focusMe').focus()); } I added an alert to the text box that tells me when it has focus and when it is lost. I found that I see the focus message, but I do not see the cursor bar in the text box and nothing shows when I type. Additionally, I do not see the blur message. When I click in the text box after closing the focus alert there is no new alert. This would indicate that IE thinks that the text box still has focus. When I click out of the text box and then back into it the alerts and cursor both work as expected. I ran this test in IE6 and IE7 with the same results. Note that you will want to remove the onblur event for testing in Firefox as the alert itself will cause the text box to lose focus. -- View this message in context: http://www.nabble.com/Settings-focus-to-window-opened-by-javascript-appended-to-AjaxLink-tp15336895p15602292.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: No feedback message in Modal window with AjaxSubmitLink
Have you added the feedback panel to the target when detecting an error? (see method onError(AjaxRequestTarget, Form)) In there you should do target.addComponent(feedbackPanel); (since it is an ajax submit link) Hope it helps, Chris On 12/28/07, Javed [EMAIL PROTECTED] wrote: Hi all, I am facing a very tedious but may be a common problem. I am using ModalWindow (with page ) in which I have one text box and one radio group and a AjaxSubmitLink. I have text box as RequiredTextField and radio group is set Required true. I have added feed back panel and also called this method setOutPutMarkupId(true); But if I submit this page (i.e.Form) as blank it doesnt show any error message (feed back message) for both required fields. Where as I have few other custom validation in onSubmit(AjaxRequestTarget, Form) of AjaxSubmitLink which are get called when I submit page with proper data in fields. Can anybody tell me why it is not showing Wicket-validation error messages? Am I missing something? Thanks in Advance. :) ~Javed -- View this message in context: http://www.nabble.com/No-feedback-message-in-Modal-window-with-AjaxSubmitLink-tp14527519p14527519.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: How can i present a busy component
Yes...that is another way (I forgot about it) I remember I used it oncebut changed it to my previous proposal (request to change the way it was shown), it was simple to use. Rgds, Chris On 12/27/07, Michael Sparer [EMAIL PROTECTED] wrote: what about using a IndicatingAjaxLink or IndicatingAjaxButton or a custom implemenation using a WicketAjaxIndicatorAppender (I think it's called like that)? Newgro wrote: Hi *, i have a page with some panels. On one panel there is a button. If this is clicked a long running task is executed. The problem is that the cursor is still a pointer and the browser seems to do nothing. This happens until the long running task is ended. Then the panel components will be refreshed. I would like at least to bring the little clock icon to my pointer. But how should i do that? Another much better solution would be if i could overlay the panel with a grey fog. I experimented already with this but couldn't find a usable solution. Maybe someone can give me a hint where i can start to search. Thanks Per - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/How-can-i-present-a-busy-component-tp14462974p14515327.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: How can i present a busy component
It looks fine for meI never used that code to change the cursormaybe you should try something else to check if it works...I called my function to hide / show a span, and it works for me (remember, I used 1.2.6), instead of changing cursor style. I really don't know what else to say, since as I can see, it should get the job done. Rgds, Chris On 12/22/07, Per Newgro [EMAIL PROTECTED] wrote: Hi Christian Alejandro Marquez Grabia this looked promising but it's not working here. Am i missing something? I use wicket 1.3-rc1 and added my link this way add(new AjaxLink(aFogLink) { protected IAjaxCallDecorator getAjaxCallDecorator() { return new IAjaxCallDecorator() { public CharSequence decorateOnFailureScript(CharSequence pScript) { return document.body.style.cursor = 'auto';; } public CharSequence decorateOnSuccessScript(CharSequence pScript) { return document.body.style.cursor = 'auto';; } public CharSequence decorateScript(CharSequence pScript) { return pScript + document.body.style.cursor = 'wait';; } }; } public void onClick(AjaxRequestTarget pTarget) { new Thread() { public void run() { synchronized (this) { try { System.out.println(Start); wait(12000); System.out.println(Stop); } catch (InterruptedException e) { e.printStackTrace(); } } } }.start(); } }); } Cheers Per - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question regarding navigation with the browser's back button
Well...after trying on different things, what I did was override the onAttach method, and there I regenerate the tree. Don't know if this is the better way, but it's working so far. Thanks for your help, Chris On Nov 5, 2007 4:35 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: maybe your tree model caches more then it should, not sure. if you want regen the page then its url has to be bookmarkable, but the tree doesnt work with that really without some extra work... -igor On 11/5/07, Christian Alejandro Marquez Grabia [EMAIL PROTECTED] wrote: Thanks Igor. Indeed, the browser now reloads the page, but the Internal Error occurs now, instead of watching the cached page. It seems that the Java page is somewhere cached, and the tree is attempted to be reloaded, and since some of the methods use the objects in the tree, it brings up the internal error. Is there anyway to make the Java web page to be regenerated, instead of using the previous one? So that the tree is re-drawn without the item. ( in the address bar the url ends with :4::. after deleting it becomes :5::, but when I press the back button, the :4:: appears, and so does the internal error. any ideas on how to make it re-draw the tree, using real data? Chris On 11/5/07, Igor Vaynberg [EMAIL PROTECTED] wrote: override webpage#setheaders() and instead of no-cache set a no-store header. that should force the browser to reload the page on backbutton... -igor On 11/5/07, Christian Alejandro Marquez Grabia [EMAIL PROTECTED] wrote: I am using Wicket version 1.2.6 I have been looking for this or related issues in the list, but couldn't find any to solve my problem. I have a page that show a Tree with many items. These items can be deleted using a link. When the item is deleted the page is reloaded using SetResponsePage(). Then if I click the browser's back button, I go to the previous page in which this item was not deleted, causing an inconsistence between the tree and the real thing, that will eventually cause an internal error leading the user to the internal error page. Is there a way to tell wicket that if the back button is pressed, to reload the page fully, i.e. rebuild it, not using cache? Thanks in advanced, Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question regarding navigation with the browser's back button
I am using Wicket version 1.2.6 I have been looking for this or related issues in the list, but couldn't find any to solve my problem. I have a page that show a Tree with many items. These items can be deleted using a link. When the item is deleted the page is reloaded using SetResponsePage(). Then if I click the browser's back button, I go to the previous page in which this item was not deleted, causing an inconsistence between the tree and the real thing, that will eventually cause an internal error leading the user to the internal error page. Is there a way to tell wicket that if the back button is pressed, to reload the page fully, i.e. rebuild it, not using cache? Thanks in advanced, Chris
Re: Question regarding navigation with the browser's back button
Thanks Igor. Indeed, the browser now reloads the page, but the Internal Error occurs now, instead of watching the cached page. It seems that the Java page is somewhere cached, and the tree is attempted to be reloaded, and since some of the methods use the objects in the tree, it brings up the internal error. Is there anyway to make the Java web page to be regenerated, instead of using the previous one? So that the tree is re-drawn without the item. ( in the address bar the url ends with :4::. after deleting it becomes :5::, but when I press the back button, the :4:: appears, and so does the internal error. any ideas on how to make it re-draw the tree, using real data? Chris On 11/5/07, Igor Vaynberg [EMAIL PROTECTED] wrote: override webpage#setheaders() and instead of no-cache set a no-store header. that should force the browser to reload the page on backbutton... -igor On 11/5/07, Christian Alejandro Marquez Grabia [EMAIL PROTECTED] wrote: I am using Wicket version 1.2.6 I have been looking for this or related issues in the list, but couldn't find any to solve my problem. I have a page that show a Tree with many items. These items can be deleted using a link. When the item is deleted the page is reloaded using SetResponsePage(). Then if I click the browser's back button, I go to the previous page in which this item was not deleted, causing an inconsistence between the tree and the real thing, that will eventually cause an internal error leading the user to the internal error page. Is there a way to tell wicket that if the back button is pressed, to reload the page fully, i.e. rebuild it, not using cache? Thanks in advanced, Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prompting a User to Save When Leaving a Page
I have a problem while doing this... I am using Wicket 1.2.6 and when I attempt to leave the page after modifying the form, the alert pops up, but if I select Cancel, in order to remain in the page, everything that had Ajax stops working, without any visible errors. Any ideas? Did anyone had the same problem? This also happened to me without using the behaviour On 10/2/07, JulianS [EMAIL PROTECTED] wrote: Thanks, this is a great tip. swaroop belur wrote: Have a look at this blog http://www.jroller.com/karthikg/entry/modelling_client_side_form_modifications#comments Basically state of the form onload is compared to that of beforeonunload. Just understand the concept and modify accordingly. Here the author tries to add a behavior to form's page in bind method of behavior. Not sure- but the page may be null at this point if form is not yet attched to page. Just modify accd. -swaroop - Julian http://javathoughts.capesugarbird.com/ My blog about Wicket and other Java stuff -- View this message in context: http://www.nabble.com/Prompting-a-User-to-Save-When-Leaving-a-Page-tf4549589.html#a13001983 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: Problem with form default button in IE
After working some time on this, I got to fix the problem. Thanks anyway =), Christian On 10/8/07, Christian Alejandro Marquez Grabia [EMAIL PROTECTED] wrote: Hi all, and thanks in advanced for your attention. I'm having some problems with the default button in a form that is not working in IE. Here is the situation: I have a collapsible border that contains the form. When clicked, the form is toggled and when the page loads, this border is set default to collapsed. The main problem is that when I load the page this way, the default action is ignored: when pressing enter in any field, nothing happens. However, if I click the button with the mouse, the page is refreshed with the results ( is a filtering form, showing beneath a table with results ) and the form remains open. Now, if I input something in the form and press enter, it works. However, if on the page constructor I set the border to remain open as default, the form behaves correctly without having to click the button first. My guess is that when the page is loaded, with the form inside a div that has style=display: none; all actions on the form will be ignored. When the border is clicked, and the content is shown, IE doesn't realize about this and then the default actions are still ignored by the browser. This works perfect in Firefox. Any ideas? I am using Wicket 1.2.6 Thanks, Christian
Problem with form default button in IE
Hi all, and thanks in advanced for your attention. I'm having some problems with the default button in a form that is not working in IE. Here is the situation: I have a collapsible border that contains the form. When clicked, the form is toggled and when the page loads, this border is set default to collapsed. The main problem is that when I load the page this way, the default action is ignored: when pressing enter in any field, nothing happens. However, if I click the button with the mouse, the page is refreshed with the results ( is a filtering form, showing beneath a table with results ) and the form remains open. Now, if I input something in the form and press enter, it works. However, if on the page constructor I set the border to remain open as default, the form behaves correctly without having to click the button first. My guess is that when the page is loaded, with the form inside a div that has style=display: none; all actions on the form will be ignored. When the border is clicked, and the content is shown, IE doesn't realize about this and then the default actions are still ignored by the browser. This works perfect in Firefox. Any ideas? I am using Wicket 1.2.6 Thanks, Christian