IHeaderContributor problem - How to render the page css after all css styles from components
Hi all, I have created some custom components which implement the IHeaderContributor interface in order to obtain their custom css when rendered. I want to give user the opportunity to override these classes without making them create specific new trees in their page's basic css. To be more specific, I have created a custom textfield which renders an Error class in its tag when not valid. I have also created a css file which is being rendered in order to define the Error class displaying the textfield with red borders [the component implements the IHeaderContributor]. I want to give user the opportunity to define a new Error class in his page's css in order to override this. The problem is that the page's css is being rendered before the components css reference thus doesn't override it. Do you have any hint on how to proceed? Best regards, Poko
Re: IHeaderContributor problem - How to render the page css after all css styles from components
Thank you, I had no idea about the important attribute. I just thought that it would make more sense if the page's css was rendered after all components contributions. Regards, Poko On Wed, Mar 2, 2011 at 2:44 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Can't you just use !important at page CSS definition to override what the component defines as default? Ernesto On Wed, Mar 2, 2011 at 1:24 PM, Poko Booth poko.bo...@gmail.com wrote: Hi all, I have created some custom components which implement the IHeaderContributor interface in order to obtain their custom css when rendered. I want to give user the opportunity to override these classes without making them create specific new trees in their page's basic css. To be more specific, I have created a custom textfield which renders an Error class in its tag when not valid. I have also created a css file which is being rendered in order to define the Error class displaying the textfield with red borders [the component implements the IHeaderContributor]. I want to give user the opportunity to define a new Error class in his page's css in order to override this. The problem is that the page's css is being rendered before the components css reference thus doesn't override it. Do you have any hint on how to proceed? Best regards, Poko - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Ajax and ModalWindow Strange behaviour
Hi all, here's the case: I have an object, let's say a, which has a member b which has two members: owner and driver of same type. In a page I have a checkbox which when being pressed, sets driver = owner and the opposite and I have the components bellow: TextFieldString ownerName with PropertyModel(a,b.owner.firstname); TextFieldString driverName with PropertyModel(a,b.driver.firstname); When the checkbox is pressed [true] the driverName component is disabled. The checkbox has an ajax event behavior to do the job/rerendering of the appropriate components. So far so good. I have a modal window in the page at another point and after I open/close it [without messing with the b object at all] the checkbox's behiavior becomes weird. When the driverName is rerendered, it has no value. The driverName was one of 20 components that need to be rerendered. Before openening the modal window everything works fine, after I close it the inputs are being drawn with empty strings instead of the real values. *If I call driverName.modelChanged() in the checkbox's ajax event behavior then everything goes as expected. Why is that?* Any ideas? Thanx, Poko
Re: Ajax and ModalWindow Strange behaviour
Nope...Just tried that, same result. I can't understand why components.modalChanged() fixes this problematic behavior... Why is the modal window messing with the parent page's components model??? Thanx for the answer though, you were too fast, thought it would be it :) On Fri, Dec 3, 2010 at 3:58 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Maybe this: http://www.mail-archive.com/users@wicket.apache.org/msg35946.html ** Martin 2010/12/3 Poko Booth poko.bo...@gmail.com: Hi all, here's the case: I have an object, let's say a, which has a member b which has two members: owner and driver of same type. In a page I have a checkbox which when being pressed, sets driver = owner and the opposite and I have the components bellow: TextFieldString ownerName with PropertyModel(a,b.owner.firstname); TextFieldString driverName with PropertyModel(a,b.driver.firstname); When the checkbox is pressed [true] the driverName component is disabled. The checkbox has an ajax event behavior to do the job/rerendering of the appropriate components. So far so good. I have a modal window in the page at another point and after I open/close it [without messing with the b object at all] the checkbox's behiavior becomes weird. When the driverName is rerendered, it has no value. The driverName was one of 20 components that need to be rerendered. Before openening the modal window everything works fine, after I close it the inputs are being drawn with empty strings instead of the real values. *If I call driverName.modelChanged() in the checkbox's ajax event behavior then everything goes as expected. Why is that?* Any ideas? Thanx, Poko - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ajax and ModalWindow Strange behaviour
Hmmm.. Turns out it's not the modal window the one causing the problem. The modal was activated by an ajaxsubmitlink and the page form had required components thus errors took place. I changed those links to ajaxlinks and the problem now appears only after the user submits the page form with required errors. Is this the normal behavior? On Fri, Dec 3, 2010 at 4:12 PM, Poko Booth poko.bo...@gmail.com wrote: Nope...Just tried that, same result. I can't understand why components.modalChanged() fixes this problematic behavior... Why is the modal window messing with the parent page's components model??? Thanx for the answer though, you were too fast, thought it would be it :) On Fri, Dec 3, 2010 at 3:58 PM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: Maybe this: http://www.mail-archive.com/users@wicket.apache.org/msg35946.html ** Martin 2010/12/3 Poko Booth poko.bo...@gmail.com: Hi all, here's the case: I have an object, let's say a, which has a member b which has two members: owner and driver of same type. In a page I have a checkbox which when being pressed, sets driver = owner and the opposite and I have the components bellow: TextFieldString ownerName with PropertyModel(a,b.owner.firstname); TextFieldString driverName with PropertyModel(a,b.driver.firstname); When the checkbox is pressed [true] the driverName component is disabled. The checkbox has an ajax event behavior to do the job/rerendering of the appropriate components. So far so good. I have a modal window in the page at another point and after I open/close it [without messing with the b object at all] the checkbox's behiavior becomes weird. When the driverName is rerendered, it has no value. The driverName was one of 20 components that need to be rerendered. Before openening the modal window everything works fine, after I close it the inputs are being drawn with empty strings instead of the real values. *If I call driverName.modelChanged() in the checkbox's ajax event behavior then everything goes as expected. Why is that?* Any ideas? Thanx, Poko - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: onSubmit not getting invoked using AjaxButton
Add a feedback and rerender it on the onError method to see the specific error. Regards, Poko On Nov 29, 2010, at 10:29, hemilshah hemil.s...@consult.nordea.com wrote: Hi, I have a panel with 2 dropdown choice component and an AjaxButton. One dropdownchoice has a AjaxFormUpdatingComponent behaviour added and this is working fine. But on clicking, its not invoking onSubmit button. It seems that there is a validation failure as Wicket invokes onError method when my set defaultFormProcessing to true. But i could not figure out why it is happening. On making the flag to false Wicket invokes onSubmit method but my functionality is not working. I want to know the possible reasons for not getting onSubmit to be invoked and also for validation failure. Thanks. Regards, Hemil -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onSubmit-not-getting-invoked-using-AjaxButton-tp3063201p3063201.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
Same panel, different ids and models, used more than once in the same page: panel's component...has the same wicket:id as another component already added at the same level
Hi all, I'm probably doing something wrong here: I have a long data entry page in which at some point user has to enter address information 2-3 times [for different objects]. I created a panel with 4 fields [city/postal code/street/number]. The panel takes an IModelAddress in its constructor and the textfields are declared with PropertyModels to this one. So, I add two panels to the page's form, with different ids and different models and I get the: The component [MarkupContainer [Component id = street]] has the same wicket:id as another component already added at the same level. Any ideas? Thanx, Poko
Re: Same panel, different ids and models, used more than once in the same page: panel's component...has the same wicket:id as another component already added at the same level
Sorry, don't bother. My bad. I don't even dare to try to explain what was wrong, you will block me :) On Fri, Nov 26, 2010 at 1:21 PM, Martin Grigorov mgrigo...@apache.orgwrote: show the code On Fri, Nov 26, 2010 at 12:17 PM, Poko Booth poko.bo...@gmail.com wrote: Hi all, I'm probably doing something wrong here: I have a long data entry page in which at some point user has to enter address information 2-3 times [for different objects]. I created a panel with 4 fields [city/postal code/street/number]. The panel takes an IModelAddress in its constructor and the textfields are declared with PropertyModels to this one. So, I add two panels to the page's form, with different ids and different models and I get the: The component [MarkupContainer [Component id = street]] has the same wicket:id as another component already added at the same level. Any ideas? Thanx, Poko
Invalid html rendered with DataTable [ex. empty tfoot element]
Hi all, If you use DataTables, when the bottomToolBars view has no items to render, the markup exported is invalid: table thead /thead tfoot /tfoot tbody ... ... /tbody /table I suppose the same happens with the thead. thead and tfoot tags can't be empty. I have overridden the class and manually added in the markup file tr style=display: none;td/td/tr in both thead and tfoot of the source file above the wicket:container ... tags. Works but you knowNot elegant. Enclosure containers should be used on the thead/tfoot tags defining their children as the top/bottom toolbar repeating views. Regards, Poko
Re: Invalid html rendered with DataTable [ex. empty tfoot element]
I'm using 1.4.12 Regards, Poko On Nov 25, 2010, at 9:28 PM, Igor Vaynberg wrote: mind specifying which wicket version you are using? -igor On Thu, Nov 25, 2010 at 5:17 AM, Poko Booth poko.bo...@gmail.com wrote: Hi all, If you use DataTables, when the bottomToolBars view has no items to render, the markup exported is invalid: table thead /thead tfoot /tfoot tbody ... ... /tbody /table I suppose the same happens with the thead. thead and tfoot tags can't be empty. I have overridden the class and manually added in the markup file tr style=display: none;td/td/tr in both thead and tfoot of the source file above the wicket:container ... tags. Works but you knowNot elegant. Enclosure containers should be used on the thead/tfoot tags defining their children as the top/bottom toolbar repeating views. Regards, Poko - 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: Execute JavaScript automatically when loading a Page through XHTTPRequest
Not sure about this but if you use jQuery, you could try adding a js in the head of the page which will have something like $(document).ready( function(){ //your javascript here } ); Regards, Poko On Nov 23, 2010, at 11:12, sonxurxo sonxu...@gmail.com wrote: Hi all, Is it possible to tell, from a Wicket Page, to execute some JavaScript automatically when a page loads through a JavaScript XHTTPRequest? I'm using AbstractBehavior with renderHead(), and it works when the Page is invoked from another Wicket component (through Link, etc), but not when I invoke the Page URL through Javascript, even when the HTML returned contains the script tags in the header, it does not execute it. Any ideas? TIA -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Execute-JavaScript-automatically-when-loading-a-Page-through-XHTTPRequest-tp3055042p3055042.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
Panel to be used as an abstract container
Hi all, my first mail here, glad to join your community! I want to do the following: Create a panel that will be rendered as a box with rounded corners. I dont want it to have it's inner components predefined in its class but dynamically adding them on each page the panel is present. I wish I could have its html file containg something like wicket:extend / and put there the markup defined when used in pages. Since I dont understand my own words so far, I'll give an example: CustomPanel.html ... div class=Foo [other ui stuff here] wicket:extend / /div ... APage.java ... CustomPanel pnl = new CustomPanel(pnl); pnl.add(new Label(test-lbl, Tadaaa)); add(pnl); ... APage.html ... span wicket:id=pnl span wicket:id=test-lbl /span ... I want the page rendered having the label inside the custom panel without having to implicitly create another panel extending the CustomPanel. So, if you understood this and have any ideas, let me know. Greetings from Greece, Poko - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Panel to be used as an abstract container
Just to see if we are on the same page: You mean that the CustomPanel.html will be like this: ... div class=RoundedStuff div wicket:id=contents / /div ... And in the APage.html: ... div wicket:id=pnl / wicket:fragment wicket:id=whatever ...PANEL CONTENTS HERE... /wicket:fragment ... and in APage.java: ... CustomPanel pnl = new CustomPanel(pnl); pnl.add(new Fragment(contents,whatever); ... Right? On Thu, Nov 11, 2010 at 11:12 AM, Martin Grigorov mgrigo...@apache.orgwrote: I think you need Fragment instead of Panel On Thu, Nov 11, 2010 at 9:47 AM, Poko Booth poko.bo...@gmail.com wrote: Hi all, my first mail here, glad to join your community! I want to do the following: Create a panel that will be rendered as a box with rounded corners. I dont want it to have it's inner components predefined in its class but dynamically adding them on each page the panel is present. I wish I could have its html file containg something like wicket:extend / and put there the markup defined when used in pages. Since I dont understand my own words so far, I'll give an example: CustomPanel.html ... div class=Foo [other ui stuff here] wicket:extend / /div ... APage.java ... CustomPanel pnl = new CustomPanel(pnl); pnl.add(new Label(test-lbl, Tadaaa)); add(pnl); ... APage.html ... span wicket:id=pnl span wicket:id=test-lbl /span ... I want the page rendered having the label inside the custom panel without having to implicitly create another panel extending the CustomPanel. So, if you understood this and have any ideas, let me know. Greetings from Greece, Poko - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Panel to be used as an abstract container
Exactly, thank you very much! I will try that in the afternoon. I had no idea about Fragments, never used them before. I want to use this panel only for ui purposes. I don't want to repeat rounded corners markup in each page or multiple times in the same page, better have it in one place. Thank you again On Thu, Nov 11, 2010 at 11:53 AM, Martin Grigorov mgrigo...@apache.orgwrote: Yes, the panel always contribute with its .html (always the same html). The Fragment is the dynamic content (so small that you don't to create Panel for it). This is what you want, right ? On Thu, Nov 11, 2010 at 10:35 AM, Poko Booth poko.bo...@gmail.com wrote: Just to see if we are on the same page: You mean that the CustomPanel.html will be like this: ... div class=RoundedStuff div wicket:id=contents / /div ... And in the APage.html: ... div wicket:id=pnl / wicket:fragment wicket:id=whatever ...PANEL CONTENTS HERE... /wicket:fragment ... and in APage.java: ... CustomPanel pnl = new CustomPanel(pnl); pnl.add(new Fragment(contents,whatever); ... Right? On Thu, Nov 11, 2010 at 11:12 AM, Martin Grigorov mgrigo...@apache.org wrote: I think you need Fragment instead of Panel On Thu, Nov 11, 2010 at 9:47 AM, Poko Booth poko.bo...@gmail.com wrote: Hi all, my first mail here, glad to join your community! I want to do the following: Create a panel that will be rendered as a box with rounded corners. I dont want it to have it's inner components predefined in its class but dynamically adding them on each page the panel is present. I wish I could have its html file containg something like wicket:extend / and put there the markup defined when used in pages. Since I dont understand my own words so far, I'll give an example: CustomPanel.html ... div class=Foo [other ui stuff here] wicket:extend / /div ... APage.java ... CustomPanel pnl = new CustomPanel(pnl); pnl.add(new Label(test-lbl, Tadaaa)); add(pnl); ... APage.html ... span wicket:id=pnl span wicket:id=test-lbl /span ... I want the page rendered having the label inside the custom panel without having to implicitly create another panel extending the CustomPanel. So, if you understood this and have any ideas, let me know. Greetings from Greece, Poko - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Panel to be used as an abstract container
Yes! Exactly, that's what I described in the previous mail. I hope panel will able to find the fragment declared to its parent. I'll let you know. On Thu, Nov 11, 2010 at 12:23 PM, Martin Grigorov mgrigo...@apache.orgwrote: If you have rounded corners at bottom of the panel then you'll need to add the Fragment *in* the Panel, but provide wicket:fragment in the Page (the fragment's markup provider) It is a bit tricky but I'm sure you'll manage it. On Thu, Nov 11, 2010 at 11:02 AM, Poko Booth poko.bo...@gmail.com wrote: Exactly, thank you very much! I will try that in the afternoon. I had no idea about Fragments, never used them before. I want to use this panel only for ui purposes. I don't want to repeat rounded corners markup in each page or multiple times in the same page, better have it in one place. Thank you again On Thu, Nov 11, 2010 at 11:53 AM, Martin Grigorov mgrigo...@apache.org wrote: Yes, the panel always contribute with its .html (always the same html). The Fragment is the dynamic content (so small that you don't to create Panel for it). This is what you want, right ? On Thu, Nov 11, 2010 at 10:35 AM, Poko Booth poko.bo...@gmail.com wrote: Just to see if we are on the same page: You mean that the CustomPanel.html will be like this: ... div class=RoundedStuff div wicket:id=contents / /div ... And in the APage.html: ... div wicket:id=pnl / wicket:fragment wicket:id=whatever ...PANEL CONTENTS HERE... /wicket:fragment ... and in APage.java: ... CustomPanel pnl = new CustomPanel(pnl); pnl.add(new Fragment(contents,whatever); ... Right? On Thu, Nov 11, 2010 at 11:12 AM, Martin Grigorov mgrigo...@apache.org wrote: I think you need Fragment instead of Panel On Thu, Nov 11, 2010 at 9:47 AM, Poko Booth poko.bo...@gmail.com wrote: Hi all, my first mail here, glad to join your community! I want to do the following: Create a panel that will be rendered as a box with rounded corners. I dont want it to have it's inner components predefined in its class but dynamically adding them on each page the panel is present. I wish I could have its html file containg something like wicket:extend / and put there the markup defined when used in pages. Since I dont understand my own words so far, I'll give an example: CustomPanel.html ... div class=Foo [other ui stuff here] wicket:extend / /div ... APage.java ... CustomPanel pnl = new CustomPanel(pnl); pnl.add(new Label(test-lbl, Tadaaa)); add(pnl); ... APage.html ... span wicket:id=pnl span wicket:id=test-lbl /span ... I want the page rendered having the label inside the custom panel without having to implicitly create another panel extending the CustomPanel. So, if you understood this and have any ideas, let me know. Greetings from Greece, Poko - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org