Re: modal CloseButtonCallback returning old value
If you have a quickstart someone could take a look at it. Maurice On Mon, Jul 7, 2008 at 9:43 PM, taygolf <[EMAIL PROTECTED]> wrote: > > Still having this issue. Can anyone tell me what it might be. I think it is a > cache issue but I am really not sure > > Thanks > > T > > > taygolf wrote: >> >> hey guys. I have a problem that is stumping me. I have 2 textfields one >> called type and one called subtype. They both have modal windows that are >> opened to show the list of values that can be selected for them. Of course >> I have it setup where the user can not select a subtype before they select >> a type and the list of values for subtype changes depending on what >> subtype is selected. >> >> Now if I user selects a type and subtype and then decideds to change the >> type I am setting the subtype to blank. This all works fine. Now when the >> user decides to select a new subtype they are presented with the correct >> list to choose from. If instead of selecting a value and clicking submit >> the user for some strange reason decides to click the X button to close >> the modal window the old value that was whipped out and replaced with >> blank when the user choose a new type returns to the blank! I can not >> allow this to happen even though it will probably not happen often in the >> real world. >> >> My quick fix is to set onCloseButtonClicked to return false. This forces >> the user to pick a value but I would rather figure out what is allowing it >> to put in the old value. I am guessing that it is coming from cache some >> how but I am not sure. >> >> Any suggestions? >> >> Thanks >> >> T >> > > -- > View this message in context: > http://www.nabble.com/modal-CloseButtonCallback-returning-old-value-tp18198443p18325030.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]
FeedbackPanel.anyErrorMessage() Strange Behavior
Hi, My intention was to use the same feedback panel to show both info and error messages. What I did was if there there is a mistake e.g. blank textfield, feedback panel will display and error and expects the user to fix his mistake and submit again. If the form is filled in accordingly, an info message will inform him that his information is captured. The problem I faced was, I used FeedbackPanel.anyErrorMessage() to check if any error was attached to the panel otherwise show an acceptance message using FeedbackPanel.info(...). However, the info message is not shown. If I didn't invoke FeedbackPanel.anyErrorMessage() and use a boolean flag to track errors, the info message will show. ... if (messageModel.getObject() == null || messageModel.getObject().toString().length() == 0) { error("Message must not be empty."); } if (feedback.anyErrorMessage()) { return; } // will not show in feedback panel when there is no error info("Your message is " + messageModel.getObject()); ... I have also included full codes to demonstrate what I mean. TQ http://www.nabble.com/file/p18332776/TestFeedbackPanelPage.java TestFeedbackPanelPage.java http://www.nabble.com/file/p18332776/TestFeedbackPanelPage.html TestFeedbackPanelPage.html -- View this message in context: http://www.nabble.com/FeedbackPanel.anyErrorMessage%28%29-Strange-Behavior-tp18332776p18332776.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: Automatic redirection to Expiry Page once the session timeout is reached - Possible options
On Mon, 07 Jul 2008, mfs wrote: > The problem is that since my application pages has various ajax-components > in it and not every request results in the whole page being rendered, i am > not sure which component to attach this ajaxTimerBehavior with, such that > the AjaxTimerBehavior's timer is updated accordingly with every ajax-request > (as well). Maybe you can create your custom RequestCycle and do something like this @Override public void detach() { try { AjaxRequestTarget target = AjaxRequestTarget.get(); target.addComponent(Mysession.get().getSessionExpiryComponent()); } finally { super.detach(); } } I'm not sure if it would work, but in general RequestCycle can be used for making hooks in every request processing. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations Oyhttp://www.ri.fi/ > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Getting Attributes from a Servlet using Wicket
try request.getParameter(String)::String getAttribute (if I remember correctly) is an attribute of the session... if you want a parameter passed in via a GET or PORT then you need to use the parameter accessors. Also, I think there is a simpler method of getting access to the Wicket session. Search the forum for my name (about 2 months ago, I don't have it handy), although if Igor reads this he can fill in the details. - Brill Pappin On 7-Jul-08, at 7:19 PM, Giuliano Caliari wrote: Hello, I have a flash application that makes a request to my server through a servlet. I have managed to get the servlet in the wicket context and access the wicket session in the servlet, but I can't get the parameters of the request. Any clues of what I am doing wrong? Thank you Giuliano Here's my servlet: public class StwCommandRequest extends HttpServlet { @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletOutputStream out = response.getOutputStream(); Object command2 = request.getAttribute("command"); Object command = AbismoWicketWebSession.get().getRequestAttribute(request, "command"); //Do Stuff StwController.processRequest(command, AbismoWicketWebSession.get().getAbismoUser()); out.print("result=1&msg=Looking"); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doPost(request, response); } } My Session: public class AbismoWicketWebSession extends WebSession { private AbismoUser abismoUser; public AbismoWicketWebSession(Request request) { super(request); } public AbismoUser getAbismoUser() { return abismoUser; } public static AbismoWicketWebSession get() { return (AbismoWicketWebSession) Session.get(); } public Object getRequestAttribute(HttpServletRequest request, String attributeName){ //return getSessionStore().getAttribute(new ServletWebRequest(request), attributeName); return this.getAttribute(attributeName); } } and My web.xml http://java.sun.com/xml/ns/javaee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; version="2.5"> Abismo Server AbismoServlets class>org.apache.wicket.protocol.http.servlet.WicketSessionFilterfilter-class> filterName AbismoServer AbismoServer org.apache.wicket.protocol.http.WicketFilterfilter-class> applicationFactoryClassName value>org.apache.wicket.spring.SpringWebApplicationFactoryvalue> AbismoServer /* AbismoServlets /stw/* contextConfigLocation /WEB-INF/applicationContext.xml org.springframework.web.context.request.RequestContextListener org.springframework.web.context.ContextLoaderListener StwCommandsRequest StwCommandRequest StwCommandRequest StwCommandRequest /stw/* - 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]
Re: Automatic redirection to Expiry Page once the session timeout is reached - Possible options
Another point worth mentioning in the solution i discussed in my earlier post is that i would want the ajax timer-based event (with the help of ajaxTimerbehavior) to be invoked ONLY when the session-timeout period has reached, as otherwise the ajax-event would unnecessarily result in the extension of the session-timeout period of the app, without any user event, something i certainly don't want. It is the above reason, why i mentioned in my earlier post, that i would want to update the timer period on every ajax request, as otherwise the ajax-event would be invoked based on the time-set on AjaxTimerBehavior component when the page was first rendered AND not based on the actual session-timeout period, which would have changed, had there been any ajax-based communication after the page was first rendered. Hope it make sense.. Thanks mfs wrote: > > Guys, > > I wanted to add this feature in my application, where once the > session-timeout period is reached, the user is automatically redirected to > the session-expiry page, like the way you might have seen in various > banking sites. > > In order to achieve the above the first component which came to my mind > was AbstractAjaxTimerBehavior, on which i set the to event-invocation-time > to => "session-timeout_period + 1 mill-sec (or 1 sec)", where when the > ajax-event is invoked (once the timeout is reached), the wicket framework > would automatically redirect the user to the session-expiry page. > > The problem is that since my application pages has various ajax-components > in it and not every request results in the whole page being rendered, i am > not sure which component to attach this ajaxTimerBehavior with, such that > the AjaxTimerBehavior's timer is updated accordingly with every > ajax-request (as well). > > Can anyone suggest as to what would be the right way to go with this, or > an alternate solution to the above requirement.. > > Thanks in advance and Regards, > > Farhan. > -- View this message in context: http://www.nabble.com/Automatic-redirection-to-Expiry-Page-once-the-session-timeout-is-reached---Possible-options-tp18326963p18328921.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]
Getting Attributes from a Servlet using Wicket
Hello, I have a flash application that makes a request to my server through a servlet. I have managed to get the servlet in the wicket context and access the wicket session in the servlet, but I can't get the parameters of the request. Any clues of what I am doing wrong? Thank you Giuliano Here's my servlet: public class StwCommandRequest extends HttpServlet { @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletOutputStream out = response.getOutputStream(); Object command2 = request.getAttribute("command"); Object command = AbismoWicketWebSession.get().getRequestAttribute(request, "command"); //Do Stuff StwController.processRequest(command, AbismoWicketWebSession.get().getAbismoUser()); out.print("result=1&msg=Looking"); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.doPost(request, response); } } My Session: public class AbismoWicketWebSession extends WebSession { private AbismoUser abismoUser; public AbismoWicketWebSession(Request request) { super(request); } public AbismoUser getAbismoUser() { return abismoUser; } public static AbismoWicketWebSession get() { return (AbismoWicketWebSession) Session.get(); } public Object getRequestAttribute(HttpServletRequest request, String attributeName){ //return getSessionStore().getAttribute(new ServletWebRequest(request), attributeName); return this.getAttribute(attributeName); } } and My web.xml http://java.sun.com/xml/ns/javaee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; version="2.5"> Abismo Server AbismoServlets org.apache.wicket.protocol.http.servlet.WicketSessionFilter filterName AbismoServer AbismoServer org.apache.wicket.protocol.http.WicketFilter applicationFactoryClassName org.apache.wicket.spring.SpringWebApplicationFactory AbismoServer /* AbismoServlets /stw/* contextConfigLocation /WEB-INF/applicationContext.xml org.springframework.web.context.request.RequestContextListener org.springframework.web.context.ContextLoaderListener StwCommandsRequest StwCommandRequest StwCommandRequest StwCommandRequest /stw/* - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Checkbox tree component
I am sure there are a couple of ways to do this. First thing that comes to mind is to override the Panel2.isVisible() method and return true if there are any nodes selected in CBTree1. for instance: Panel checkBoxPanel2 = new Panel( "checkBoxPanel2" ) { public boolean isVisible() { return /** cbTree1 Selection State **/; } }; To determine the cbTree1 Selection State, either you iterator through the entire tree to determine if a node is selected via the TreeState or capture the number of nodes selected/deselected via TreeStateListener. By overridding isVisible(), no matter if you are refreshing the entire page or via Ajax, the checkBoxPanel2 visibility would be handled correctly. Hope that helps. - Doug -- View this message in context: http://www.nabble.com/Checkbox-tree-component-tp13433102p18327178.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]
Automatic redirection to Expiry Page once the session timeout is reached - Possible options
Guys, I wanted to add this feature in my application, where once the session-timeout period is reached, the user is automatically redirected to the session-expiry page, like the way you might have seen in various banking sites. In order to achieve the above the first component which came to my mind was AbstractAjaxTimerBehavior, on which i set the to event-invocation-time to => "session-timeout_period + 1 mill-sec (or 1 sec)", where when the ajax-event is invoked (once the timeout is reached), the wicket framework would automatically redirect the user to the session-expiry page. The problem is that since my application pages has various ajax-components in it and not every request results in the whole page being rendered, i am not sure which component to attach this ajaxTimerBehavior with, such that the AjaxTimerBehavior's timer is updated accordingly with every ajax-request (as well). Can anyone suggest as to what would be the right way to go with this, or an alternate solution to the above requirement.. Thanks in advance and Regards, Farhan. -- View this message in context: http://www.nabble.com/Automatic-redirection-to-Expiry-Page-once-the-session-timeout-is-reached---Possible-options-tp18326963p18326963.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: Checkbox tree component
Hey Doug, I was able to get the check boxes to work. Thanks for your help on that. However there is another problem that I am not able to get to work. I have created another panel with a checkbox tree in it and i want that panel to show only when I check one of the child nodes in my main checkbox tree. i.e. I have Panel1 and Panel2 for a page both having a checkbox tree component in them say checkboxtree1 and checkboxtree2 respectively. I want the Panel2 to show up (along with the tree) only when a node of the checkboxtree1 is selected. I tried to add the panel dynamically in the onNodeCheckUpdated() method of the main panel but it doesn't work like that. Any ideas about how i can get this to work. Regards, vishy_sb Doug Leeper wrote: > > If the tree is pre-loaded, it is easier. When the checkbox is selected, > iterate through the children nodes and set its state to selected. > > The dynamically loaded is alot trickier...as you would have to load the > tree from the selected node and then iterate and set the children notes to > selected. > > Are you sure you want to select the children nodes or is it the parent > nodes you want to select? > -- View this message in context: http://www.nabble.com/Checkbox-tree-component-tp13433102p18326913.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: modal CloseButtonCallback returning old value
Still having this issue. Can anyone tell me what it might be. I think it is a cache issue but I am really not sure Thanks T taygolf wrote: > > hey guys. I have a problem that is stumping me. I have 2 textfields one > called type and one called subtype. They both have modal windows that are > opened to show the list of values that can be selected for them. Of course > I have it setup where the user can not select a subtype before they select > a type and the list of values for subtype changes depending on what > subtype is selected. > > Now if I user selects a type and subtype and then decideds to change the > type I am setting the subtype to blank. This all works fine. Now when the > user decides to select a new subtype they are presented with the correct > list to choose from. If instead of selecting a value and clicking submit > the user for some strange reason decides to click the X button to close > the modal window the old value that was whipped out and replaced with > blank when the user choose a new type returns to the blank! I can not > allow this to happen even though it will probably not happen often in the > real world. > > My quick fix is to set onCloseButtonClicked to return false. This forces > the user to pick a value but I would rather figure out what is allowing it > to put in the old value. I am guessing that it is coming from cache some > how but I am not sure. > > Any suggestions? > > Thanks > > T > -- View this message in context: http://www.nabble.com/modal-CloseButtonCallback-returning-old-value-tp18198443p18325030.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: @SpringBean instead @Resource
Thank you for answer. 2008/7/7, Igor Vaynberg <[EMAIL PROTECTED]>: > > because when we created @SpringBean there was no standard @Resource. > also, afaik, @Resource is part of jdk6 while Wicket requires 1.4/5. > > perhaps when we require jdk6 we can use @Resource > > -igor > > > On Mon, Jul 7, 2008 at 11:32 AM, Dima Rzhevskiy <[EMAIL PROTECTED]> > wrote: > > Why wicket framework used it's own annotation @SpringBean instead > standard > > annotation @Resource? > > (I want configure other web framework to use anotation for bean > injecting) > > > > Dmitry. > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
RE: wicketstuff yui context menu clashes with YUI menu
Although this seems strange sense the Yui libary I am using is 2.4.1 and the wicketStuff yui looks like it is also 2.4.1. Is it because some javascript files are added twice? > -Original Message- > From: Karen Schaper [mailto:[EMAIL PROTECTED] > Sent: Monday, July 07, 2008 12:48 PM > To: users@wicket.apache.org > Subject: RE: wicketstuff yui context menu clashes with YUI menu > > > Hi, > > I looked at this further and the problem seems to be because the YUI menu > was not being created with the wicketstuff YUI classes but directory using > the YUI javascript library with javascript files being added into the html > clashing with the javascript files that are being added by using the > YuiContextMenu. > > I changed the menu to be created using the java classes and now > there is not > a problem. The Yui menu is not clashing with my context menu below. > > Thanks > Karen > > > Karen, > > > > I am the original author of the menu2 package. > > > > What I believe is happening (as I haven't looked at this in > > awhile) is that > > YUI menu that is created originally is losing the 'reference' > of the item > > that had the context menu associated with it. This happens > > because you are > > using Ajax to refresh data view and not the menu too. > > > > I believe to fix you will need to add the menu component that > contains the > > YuiContextMenuBehavior to the AjaxTarget. > > > > If this doesn't work, please post some example code or send me a > > quick start > > to reproduce so I can take a look. > > > > - Doug > > -- > > View this message in context: > > http://www.nabble.com/wicketstuff-yui-context-menu-clashes-with-YU > > I-menu-tp18305922p18320478.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] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: @SpringBean instead @Resource
because when we created @SpringBean there was no standard @Resource. also, afaik, @Resource is part of jdk6 while Wicket requires 1.4/5. perhaps when we require jdk6 we can use @Resource -igor On Mon, Jul 7, 2008 at 11:32 AM, Dima Rzhevskiy <[EMAIL PROTECTED]> wrote: > Why wicket framework used it's own annotation @SpringBean instead standard > annotation @Resource? > (I want configure other web framework to use anotation for bean injecting) > > Dmitry. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
@SpringBean instead @Resource
Why wicket framework used it's own annotation @SpringBean instead standard annotation @Resource? (I want configure other web framework to use anotation for bean injecting) Dmitry.
Getting the full client location on a file upload
This is my first post, so please bear with me, if I haven't done this correctly (and please correct me). When I am uploading a file in a form, I want to save the full client path of the file, but I am not sure how to access that information. My code looks like this: final FileUpload upload = fileUploadField.getFileUpload(); if (upload != null){ .. // Save to new file File newFile = new File() newFile.createNewFile(); upload.writeTo(newFile); //Want to get the full path here, e.g. c:\clientComputer\myFolder\myFile.txt String fullPath = ? } catch (Exception e){ //yatta yatta yatta } } Thx, Joe Celano
Re: Possible AbstractAjaxBehavior Bug
i dont think the behavior has been designed with the adding/removing in mind. feel free to open a jira issue for it. i think a much easier way to do this is to always add it and override isenabled() -igor On Mon, Jul 7, 2008 at 10:35 AM, Hoover, William <[EMAIL PROTECTED]> wrote: > I am using a behavior that is dynamically added/removed from a TextField > based upon another components state (in order to avoid extra round trips > to the server): > > final AjaxFormComponentUpdatingBehavior afcub = ... > final TextField textField = new TextField("some-id", new Model()){ >protected final void onBeforeRender() { >boolean hasBehavior = false; >for (final IBehavior b : (List) > component.getBehaviors()) { >if (b.equals(behavior)) { >hasBehavior = true; >break; >} >} >// is add flag is captured by another components > conditions to avoid server round-trips >if (isAddFlag && !hasBehavior) { >add(afcub); >} else if(!isAddFlag && hasBehavior) { >remove(afcub); >} >super.onBeforeRender(); >} > } > > Using the code above I get an IllegalStateException when the > AjaxFormComponentUpdatingBehavior is added, then removed, and added > again (all based on user interaction of course). In AbstractAjaxBehavoir > there is a method that does a (component != null) check... shouldn't > that check be (component != null && !(component.equals(hostComponent))) > to avoid this type of scenario? > >public final void bind(final Component hostComponent) >{ >if (hostComponent == null) >{ >throw new IllegalArgumentException("Argument > hostComponent must be not null"); >} > >if (component != null) >{ >throw new IllegalStateException("this kind of > handler cannot be attached to " + >"multiple components; it is already > attached to component " + component + >", but component " + hostComponent + " > wants to be attached too"); > >} > >component = hostComponent; > >// call the callback >onBind(); >} > > > - > 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]
Possible AbstractAjaxBehavior Bug
I am using a behavior that is dynamically added/removed from a TextField based upon another components state (in order to avoid extra round trips to the server): final AjaxFormComponentUpdatingBehavior afcub = ... final TextField textField = new TextField("some-id", new Model()){ protected final void onBeforeRender() { boolean hasBehavior = false; for (final IBehavior b : (List) component.getBehaviors()) { if (b.equals(behavior)) { hasBehavior = true; break; } } // is add flag is captured by another components conditions to avoid server round-trips if (isAddFlag && !hasBehavior) { add(afcub); } else if(!isAddFlag && hasBehavior) { remove(afcub); } super.onBeforeRender(); } } Using the code above I get an IllegalStateException when the AjaxFormComponentUpdatingBehavior is added, then removed, and added again (all based on user interaction of course). In AbstractAjaxBehavoir there is a method that does a (component != null) check... shouldn't that check be (component != null && !(component.equals(hostComponent))) to avoid this type of scenario? public final void bind(final Component hostComponent) { if (hostComponent == null) { throw new IllegalArgumentException("Argument hostComponent must be not null"); } if (component != null) { throw new IllegalStateException("this kind of handler cannot be attached to " + "multiple components; it is already attached to component " + component + ", but component " + hostComponent + " wants to be attached too"); } component = hostComponent; // call the callback onBind(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: wicketstuff yui context menu clashes with YUI menu
Hi, I looked at this further and the problem seems to be because the YUI menu was not being created with the wicketstuff YUI classes but directory using the YUI javascript library with javascript files being added into the html clashing with the javascript files that are being added by using the YuiContextMenu. I changed the menu to be created using the java classes and now there is not a problem. The Yui menu is not clashing with my context menu below. Thanks Karen Karen, > > I am the original author of the menu2 package. > > What I believe is happening (as I haven't looked at this in > awhile) is that > YUI menu that is created originally is losing the 'reference' of the item > that had the context menu associated with it. This happens > because you are > using Ajax to refresh data view and not the menu too. > > I believe to fix you will need to add the menu component that contains the > YuiContextMenuBehavior to the AjaxTarget. > > If this doesn't work, please post some example code or send me a > quick start > to reproduce so I can take a look. > > - Doug > -- > View this message in context: > http://www.nabble.com/wicketstuff-yui-context-menu-clashes-with-YU > I-menu-tp18305922p18320478.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]
Reading files
I have a third party package that requires a java.io.Reader (or descendent) as an input. I need to provide a Reader for a file locate in either WEB-INF (or possibly package sourced). This file is a CSV list of items that is used to initialize a database table. I just need to iterate over it and send it off to my DAO. I've looked at a couple of options, but it seems like I'm traversing an inordinately large number of classes just to get hold of some type of Reader. Any suggestions on a wicket friendly, yet straightforward way to handle this type of activity? -David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicketstuff yui context menu clashes with YUI menu
Karen, I am the original author of the menu2 package. What I believe is happening (as I haven't looked at this in awhile) is that YUI menu that is created originally is losing the 'reference' of the item that had the context menu associated with it. This happens because you are using Ajax to refresh data view and not the menu too. I believe to fix you will need to add the menu component that contains the YuiContextMenuBehavior to the AjaxTarget. If this doesn't work, please post some example code or send me a quick start to reproduce so I can take a look. - Doug -- View this message in context: http://www.nabble.com/wicketstuff-yui-context-menu-clashes-with-YUI-menu-tp18305922p18320478.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 to get the data altered by the user in html page in a list view
a) you should be using models to bind data instead of directly iterating over listview's listitems b) when using listview in a form you should call setreuseitems(true) on it. -igor On Mon, Jul 7, 2008 at 3:17 AM, Deepak_G <[EMAIL PROTECTED]> wrote: > > Hello, > > I am rendering a list view having multiple rows using wicket. In form > submit(), I could retrive the data in below mentioned code but i am not sure > whether it is right way of getting the changed data from the list view . > Below is my code snippet attached. Please review the code and let me know > the best practice. > > // LiConfig is application pojo > private Form form; > private ListView li_config_settings_row; > private List li_config_settings;// applicaton pojo list > li_config_settings_row = new ListView("settingRow", li_config_settings) { >protected void populateItem(ListItem item) { >final LiConfig p = (LiConfig) > item.getModelObject(); >item.setModel(new CompoundPropertyModel(p)); > //Some code to add > components like Hidden fields, Text fields, Labels etc. >} >}; >form.add(li_config_settings_row); > > form = new Form("sectionPanelForm"){ >protected void onSubmit() { > ArrayList liConfigs = new > ArrayList(); >Iterator iterator = > li_config_settings_row.iterator(); >while (iterator.hasNext()) { >ListItem listItem = > iterator.next(); >LiConfig l = new LiConfig(); >Iterator > childIterator = listItem..iterator(); >boolean changed = false; >while > (childIterator.hasNext()) { >Component c = > childIterator.next(); >if > (c.getId().equalsIgnoreCase("isChanged")) { >if > HiddenField) c).getConvertedInput() > > .toString()).equalsIgnoreCase("1")) { > > changed = true; >} > >} >if > (c.getId().equalsIgnoreCase("id")) { >l.setId(new > Integer(((HiddenField) c) > > .getConvertedInput().toString())); >} >if > (c.getId().equalsIgnoreCase("fieldValue")) { >l > > .setFieldValue(((TextField) c) > > .getConvertedInput() != null ? ((TextField) c) > > .getConvertedInput().toString() > > : ""); >} > >} >if (changed) { >liConfigs.add(l); >} >} > >if (liConfigs.size() != 0) { >ArrayList > updatedList = new ArrayList(); >String changedValue; >for (LiConfig li : liConfigs) { >changedValue = > li.getFieldValue(); >li = > ConfigWizardhelper.getLiConfig(li.getId()); > > li.setFieldValue(changedValue); >updatedList.add(li); > >} > > ConfigWizardhelper.insertORUpdateLiConfigs(updatedList); >
How to get the data altered by the user in html page in a list view
Hello, I am rendering a list view having multiple rows using wicket. In form submit(), I could retrive the data in below mentioned code but i am not sure whether it is right way of getting the changed data from the list view . Below is my code snippet attached. Please review the code and let me know the best practice. // LiConfig is application pojo private Form form; private ListView li_config_settings_row; private List li_config_settings;// applicaton pojo list li_config_settings_row = new ListView("settingRow", li_config_settings) { protected void populateItem(ListItem item) { final LiConfig p = (LiConfig) item.getModelObject(); item.setModel(new CompoundPropertyModel(p)); //Some code to add components like Hidden fields, Text fields, Labels etc. } }; form.add(li_config_settings_row); form = new Form("sectionPanelForm"){ protected void onSubmit() { ArrayList liConfigs = new ArrayList(); Iterator iterator = li_config_settings_row.iterator(); while (iterator.hasNext()) { ListItem listItem = iterator.next(); LiConfig l = new LiConfig(); Iterator childIterator = listItem..iterator(); boolean changed = false; while (childIterator.hasNext()) { Component c = childIterator.next(); if (c.getId().equalsIgnoreCase("isChanged")) { if HiddenField) c).getConvertedInput() .toString()).equalsIgnoreCase("1")) { changed = true; } } if (c.getId().equalsIgnoreCase("id")) { l.setId(new Integer(((HiddenField) c) .getConvertedInput().toString())); } if (c.getId().equalsIgnoreCase("fieldValue")) { l .setFieldValue(((TextField) c) .getConvertedInput() != null ? ((TextField) c) .getConvertedInput().toString() : ""); } } if (changed) { liConfigs.add(l); } } if (liConfigs.size() != 0) { ArrayList updatedList = new ArrayList(); String changedValue; for (LiConfig li : liConfigs) { changedValue = li.getFieldValue(); li = ConfigWizardhelper.getLiConfig(li.getId()); li.setFieldValue(changedValue); updatedList.add(li); } ConfigWizardhelper.insertORUpdateLiConfigs(updatedList); } HashMap param = new HashMap(); param.put("id", id); ConfigWizardPage.index = getIndex(); setResponsePage(ConfigWizardPage.class); } }; -- V
Re: No effect of code until restarting netbeans.
Ahh, ok thanks for the feedback.. Witold Czaplewski wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks a lot, didn't know it. Btw, Java 6 produces a small warning: Please use CMSClassUnloadingEnabled in place of CMSPermGenSweepingEnabled in the future Witold Am Mon, 07 Jul 2008 09:06:53 +0200 schrieb Nino Saturnino Martinez Vazquez Wael <[EMAIL PROTECTED]>: And even better enable permgen garbage collection, so the problem never will happen... -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled Witold Czaplewski wrote: Am Sat, 5 Jul 2008 18:40:24 +0100 schrieb "Ayodeji Aladejebi" <[EMAIL PROTECTED]>: Only that after a while, tomcat will give you perm-gen error which will force you to terminate the tomcat instance using Task Manager manually before netbeans can continue managing tomcat You can set the MaxPermSize e.g. to 512m (Tools --> Servers --> Platform --> VM Options: -XX:MaxPermSize=512m). At least it seems to work here. :) Witold - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - -- Mit freundlichen Grüßen Witold Czaplewski Projektmanagement Softwareentwicklung CTS GmbH creative technology solutions Otto-Hahn-Str. 7 D - 50997 Köln Fon: +49 (0)2236 - 96926-3 Fax: +49 (0)2236 - 96926-1 http://www.cts-media.eu http://www.cts-hosting.eu UST-Id. DE218137586 HRB 36066 | Registergericht Köln Geschäftsführer: Stefan Godulla http://www.xing.com/profile/Witold_Czaplewski Kennen Sie schon den serverseitigen Spamschutz von cts media? Erhalten Sie bis zu über 90% weniger Spam und sparen Sie wertvolle Zeit. Keine Konfiguration, kein Aufwand für Sie – einfach ungestört arbeiten. Für Preise, Buchung, Rückfragen oder weitere Informationen erreichen Sie uns jederzeit unter [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkhx3NkACgkQ4gvv3qOY2pi++ACeOx6zxm4jusjHcDFzUmuJbfnB W8UAnjwM9FKWFI8R63qPkljXgdUZ8sMz =k0Xx -END PGP SIGNATURE- -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No effect of code until restarting netbeans.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks a lot, didn't know it. Btw, Java 6 produces a small warning: Please use CMSClassUnloadingEnabled in place of CMSPermGenSweepingEnabled in the future Witold Am Mon, 07 Jul 2008 09:06:53 +0200 schrieb Nino Saturnino Martinez Vazquez Wael <[EMAIL PROTECTED]>: > And even better enable permgen garbage collection, so the problem > never will happen... > > -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled > -XX:+CMSClassUnloadingEnabled > > Witold Czaplewski wrote: > > Am Sat, 5 Jul 2008 18:40:24 +0100 > > schrieb "Ayodeji Aladejebi" <[EMAIL PROTECTED]>: > > > > > >> Only that after a while, tomcat will give you perm-gen error which > >> will force you to terminate the tomcat instance using Task Manager > >> manually before netbeans can continue managing tomcat > >> > > > > You can set the MaxPermSize e.g. to 512m > > (Tools --> Servers --> Platform --> VM Options: > > -XX:MaxPermSize=512m). At least it seems to work here. :) > > > > Witold > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - -- Mit freundlichen Grüßen Witold Czaplewski Projektmanagement Softwareentwicklung CTS GmbH creative technology solutions Otto-Hahn-Str. 7 D - 50997 Köln Fon: +49 (0)2236 - 96926-3 Fax: +49 (0)2236 - 96926-1 http://www.cts-media.eu http://www.cts-hosting.eu UST-Id. DE218137586 HRB 36066 | Registergericht Köln Geschäftsführer: Stefan Godulla http://www.xing.com/profile/Witold_Czaplewski Kennen Sie schon den serverseitigen Spamschutz von cts media? Erhalten Sie bis zu über 90% weniger Spam und sparen Sie wertvolle Zeit. Keine Konfiguration, kein Aufwand für Sie – einfach ungestört arbeiten. Für Preise, Buchung, Rückfragen oder weitere Informationen erreichen Sie uns jederzeit unter [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkhx3NkACgkQ4gvv3qOY2pi++ACeOx6zxm4jusjHcDFzUmuJbfnB W8UAnjwM9FKWFI8R63qPkljXgdUZ8sMz =k0Xx -END PGP SIGNATURE-
Re: PropertyModel implementing IComponentInheritedModel
On Mon, Jul 7, 2008 at 10:17 AM, Johan Compagner <[EMAIL PROTECTED]> wrote: > CompoundPropertyModel cpm = new CompoundPropertyModel(); > Form form = new Form("form", cpm) > form.add(new TextField("name", cpm.bind("firstName")); Perfect! Had overlooked that. Thanks, Thomas > On Mon, Jul 7, 2008 at 8:59 AM, Maurice Marrink <[EMAIL PROTECTED]> wrote: > >> Have you seen BoundCompoundPropertyModel? >> >> It sounds like you are looking for that behavior. >> >> Maurice >> >> On Sun, Jul 6, 2008 at 9:42 AM, Thomas Kappler <[EMAIL PROTECTED]> >> wrote: >> > Thanks, Johan. Perhaps I wasn't clear enough about the motivation. >> > >> > On Sun, Jul 6, 2008 at 6:51 AM, Johan Compagner <[EMAIL PROTECTED]> >> wrote: >> >> Why should the propertymodel be an inherited? >> > >> > Well, to have model sharing. So why not just use a CPM? Because it has >> > another difference to PM: you don't give the property expression >> > explicitly, but the component name is used. When you don't want that >> > (keep your HTML independent of your Java), or can't do that (reusable >> > panels), you can't use CPM. >> > >> > So, what I'd like is a CompoundPropertyModel(Object, String) that >> > works like in PM: "Construct with a wrapped (IModel) or unwrapped >> > (non-IModel) object and a property expression that works on the given >> > model.". >> > >> > I feel like I'm missing something basic here, sorry - perhaps you can >> > enlighten me why this wouldn't make sense. >> > >> > Cheers, >> > Thomas >> > >> > - >> > 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] >> >> > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: generics
thats just a listener interface for example PropertyChangeListener (but you can make it more specific interface) Just make a base model that has add/removePropertyChangeListener and let your components listen to that johan On Mon, Jul 7, 2008 at 8:28 AM, Matthijs Wensveen <[EMAIL PROTECTED]> wrote: > Timo Rantalaiho wrote: > >> On Fri, 04 Jul 2008, Matthijs Wensveen wrote: >> >> >>> How do you cope with deeply nested model properties? For example: >>> >>> public class PersonViewer extends Component { >>> .. >>> } >>> >>> some other component does: >>> person.getOrders().get(0).setAmount(0); // first order for free (as in >>> beer) >>> >>> >> >> I have no idea of Johan's project, but normally you just edit an object in >> one place at a time, and PersonViewer would be a read-only component with a >> model that always pulls the freshest version of the person it is displaying >> from the database. >> >> Best wishes, >> Timo >> >> >> > The thing is that when using Ajax you have to specifically add PersonViewer > to the AjaxRequestTarget when 'some other component' modifies the Person > object. The problem is that 'some other component' might not even know about > or have access to PersonViewer (maybe it's a 3rd-party component). > OnModelChanged does not work in this case, because there is no call to > setModelObject, just to some setter of the Person object. > > While Ajax does very nice things to the GUI, it kinda messes up the > model-driven (as in wicket model) approach to gui development. That is why I > was thinking about some aspect-oriented solution to let components know > about model updates, even when they keep a reference to the same object. > > Matthijs > > -- > Matthijs Wensveen > Func. Internet Integration > W http://www.func.nl > T +31 20 423 > F +31 20 4223500 > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: PropertyModel implementing IComponentInheritedModel
Bounded is deprecated look at CompoundPropertyModel.bind(String) so CompoundPropertyModel cpm = new CompoundPropertyModel(); Form form = new Form("form", cpm) form.add(new TextField("name", cpm.bind("firstName")); johan On Mon, Jul 7, 2008 at 8:59 AM, Maurice Marrink <[EMAIL PROTECTED]> wrote: > Have you seen BoundCompoundPropertyModel? > > It sounds like you are looking for that behavior. > > Maurice > > On Sun, Jul 6, 2008 at 9:42 AM, Thomas Kappler <[EMAIL PROTECTED]> > wrote: > > Thanks, Johan. Perhaps I wasn't clear enough about the motivation. > > > > On Sun, Jul 6, 2008 at 6:51 AM, Johan Compagner <[EMAIL PROTECTED]> > wrote: > >> Why should the propertymodel be an inherited? > > > > Well, to have model sharing. So why not just use a CPM? Because it has > > another difference to PM: you don't give the property expression > > explicitly, but the component name is used. When you don't want that > > (keep your HTML independent of your Java), or can't do that (reusable > > panels), you can't use CPM. > > > > So, what I'd like is a CompoundPropertyModel(Object, String) that > > works like in PM: "Construct with a wrapped (IModel) or unwrapped > > (non-IModel) object and a property expression that works on the given > > model.". > > > > I feel like I'm missing something basic here, sorry - perhaps you can > > enlighten me why this wouldn't make sense. > > > > Cheers, > > Thomas > > > > - > > 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] > >
Re: No effect of code until restarting netbeans.
And even better enable permgen garbage collection, so the problem never will happen... -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled Witold Czaplewski wrote: Am Sat, 5 Jul 2008 18:40:24 +0100 schrieb "Ayodeji Aladejebi" <[EMAIL PROTECTED]>: Only that after a while, tomcat will give you perm-gen error which will force you to terminate the tomcat instance using Task Manager manually before netbeans can continue managing tomcat You can set the MaxPermSize e.g. to 512m (Tools --> Servers --> Platform --> VM Options: -XX:MaxPermSize=512m). At least it seems to work here. :) Witold - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]