Re: Navigation and Adding Panels dynamically.
Martin, I could not find any help using this extension. May be I missed something somewhere. Let's look at a peice of code of what I am trying to do: private void setScreen(String screen) { try { Panel myPanel; myPanel = (Panel) Class.forName(com.mycompany.components.+screen).newInstance(); screenPanel.replaceWith(myPanel); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } } So assuming I need to display a screen called EditUserScreen, I need to load myPanel = (Panel) Class.forName(com.mycompany.components.EditUserScreen).newInstance(); With the above code everything works fine. But Nothing is replaced. I mean it executes with with no error, but the new panel is not shown. One more thing to mention, if I add additional components in the EditUserScreen Panel class, without adding them in the html, I see NO error generated ! Is't correct to conclude that the html template for EditUserScreen is never parsed, and instead the Panle.java is used ? Shouldn't the old panel should be removed in this case, at least? On Fri Mar 25,2011 03:06 pm, Mansour Al Akeel wrote: Thank you Martin, I had a quick look at extension. I will try a small application with it soon. However my requirement are a bit more complex, as I need to load Panels by string. So let's say I have a String called EditUserScreen, then I need to dynamically load this panel. I am not sure yet if the wizard extension can do this, but will try it anyway. If you know something else that can work for these requirements please advice me. On Fri Mar 25,2011 12:37 pm, Martin Grigorov wrote: See Wizard component in wicket-extensions. You'll need custom logic to check whether the previous/next wizard step should be shown to the current user depending on its privileges. On Fri, Mar 25, 2011 at 1:57 AM, Mansour Al Akeel mansour.alak...@gmail.com wrote: I do have the need to implement different screens. Each screen is a Panel that will be displayed when requested from the screens menu. The screen menu should display the items depending on the functionality the user has access to. Can some one point me to an article or a tutorial with similar requirements ? I trully appreciate any help. - 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 http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Navigation and Adding Panels dynamically.
Foo.class.newInstance() will use zero arg constructor which is not possible because panel has no zero arg. constructor so basically you got the exception at that line itself :) just pass the panel id in screen method and one enum which helps you in identifying the panel type you want to create and then create a panel instance in a normal way etc. what you want to do.. On Sun, Mar 27, 2011 at 12:56 PM, Mansour Al Akeel mansour.alak...@gmail.com wrote: Martin, I could not find any help using this extension. May be I missed something somewhere. Let's look at a peice of code of what I am trying to do: private void setScreen(String screen) { try { Panel myPanel; myPanel = (Panel) Class.forName(com.mycompany.components.+screen).newInstance(); screenPanel.replaceWith(myPanel); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } } So assuming I need to display a screen called EditUserScreen, I need to load myPanel = (Panel) Class.forName(com.mycompany.components.EditUserScreen).newInstance(); With the above code everything works fine. But Nothing is replaced. I mean it executes with with no error, but the new panel is not shown. One more thing to mention, if I add additional components in the EditUserScreen Panel class, without adding them in the html, I see NO error generated ! Is't correct to conclude that the html template for EditUserScreen is never parsed, and instead the Panle.java is used ? Shouldn't the old panel should be removed in this case, at least? On Fri Mar 25,2011 03:06 pm, Mansour Al Akeel wrote: Thank you Martin, I had a quick look at extension. I will try a small application with it soon. However my requirement are a bit more complex, as I need to load Panels by string. So let's say I have a String called EditUserScreen, then I need to dynamically load this panel. I am not sure yet if the wizard extension can do this, but will try it anyway. If you know something else that can work for these requirements please advice me. On Fri Mar 25,2011 12:37 pm, Martin Grigorov wrote: See Wizard component in wicket-extensions. You'll need custom logic to check whether the previous/next wizard step should be shown to the current user depending on its privileges. On Fri, Mar 25, 2011 at 1:57 AM, Mansour Al Akeel mansour.alak...@gmail.com wrote: I do have the need to implement different screens. Each screen is a Panel that will be displayed when requested from the screens menu. The screen menu should display the items depending on the functionality the user has access to. Can some one point me to an article or a tutorial with similar requirements ? I trully appreciate any help. - 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 http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- thank you, regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Navigation and Adding Panels dynamically.
Vineet, thank you for replying. I don't think this is the issue, because the panels I am creating, have their Id's set directly in the constructor. For example, public EditUserScreen(){ super(workScreen); setOutputMarkupPlaceholderTag(true); setOutputMarkupId(true); } And basically they all have the same Id. However, I don't think this has anything to do with creation of the Panels anymore. I have just tried something like: EditUserScreen screen = new EditUserScreen(); currentPanel.replaceWith(screen); currentPanel = screen; Still nothing changed. So it doesn't look to me like the wat I am creating the panel is the problem. I think there is issues with the way I am using replaceWith method. Any ideas ? On Sun Mar 27,2011 01:50 pm, vineet semwal wrote: Foo.class.newInstance() will use zero arg constructor which is not possible because panel has no zero arg. constructor so basically you got the exception at that line itself :) just pass the panel id in screen method and one enum which helps you in identifying the panel type you want to create and then create a panel instance in a normal way etc. what you want to do.. On Sun, Mar 27, 2011 at 12:56 PM, Mansour Al Akeel mansour.alak...@gmail.com wrote: Martin, I could not find any help using this extension. May be I missed something somewhere. Let's look at a peice of code of what I am trying to do: ? ?private void setScreen(String screen) { ? ? ? ? ? ?try { ? ? ? ? ? ? ? ? ? ?Panel myPanel; ? ? ? ? ? ? ? ? ? ?myPanel = (Panel) Class.forName(com.mycompany.components.+screen).newInstance(); ? ? ? ? ? ? ? ? ? ?screenPanel.replaceWith(myPanel); ? ? ? ? ? ?} catch (InstantiationException e) { ? ? ? ? ? ? ? ? ? ?e.printStackTrace(); ? ? ? ? ? ?} catch (IllegalAccessException e) { ? ? ? ? ? ? ? ? ? ?e.printStackTrace(); ? ? ? ? ? ?} catch (ClassNotFoundException e) { ? ? ? ? ? ? ? ? ? ?e.printStackTrace(); ? ? ? ? ? ?} ? ?} So assuming I need to display a screen called EditUserScreen, I need to load ? ?myPanel = (Panel) Class.forName(com.mycompany.components.EditUserScreen).newInstance(); With the above code everything works fine. But Nothing is replaced. I mean it executes with with no error, but the new panel is not shown. One more thing to mention, if I add additional components in the EditUserScreen Panel class, without adding them in the html, I see NO error generated ! Is't correct to conclude that the html template for EditUserScreen is never parsed, and instead the Panle.java is used ? Shouldn't the old panel should be removed in this case, at least? On Fri Mar 25,2011 03:06 pm, Mansour Al Akeel wrote: Thank you Martin, I had a quick look at extension. I will try a small application with it soon. However my requirement are a bit more complex, as I need to load Panels by string. So let's say I have a String called EditUserScreen, then I need to dynamically load this panel. I am not sure yet if the wizard extension can do this, but will try it anyway. If you know something else that can work for these requirements please advice me. On Fri Mar 25,2011 12:37 pm, Martin Grigorov wrote: See Wizard component in wicket-extensions. You'll need custom logic to check whether the previous/next wizard step should be shown to the current user depending on its privileges. On Fri, Mar 25, 2011 at 1:57 AM, Mansour Al Akeel mansour.alak...@gmail.com wrote: I do have the need to implement different screens. Each screen is a Panel that will be displayed when requested from the screens menu. The screen menu should display the items depending on the functionality the user has access to. Can some one point me to an article or a tutorial with similar requirements ? I trully appreciate any help. - 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 http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- thank you, regards, Vineet Semwal - 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: Navigation and Adding Panels dynamically.
sorry i wrongly assumed you might not have defined zero arg constructor.. you dont need setOutputMarkupId(true) as you are already using setOutputMarkupPlaceholderTag(true) and yes you are using replacewith correctly ,i dont think there is any problem in this code.. On Sun, Mar 27, 2011 at 2:08 PM, Mansour Al Akeel mansour.alak...@gmail.com wrote: Vineet, thank you for replying. I don't think this is the issue, because the panels I am creating, have their Id's set directly in the constructor. For example, public EditUserScreen(){ super(workScreen); setOutputMarkupPlaceholderTag(true); setOutputMarkupId(true); } And basically they all have the same Id. However, I don't think this has anything to do with creation of the Panels anymore. I have just tried something like: EditUserScreen screen = new EditUserScreen(); currentPanel.replaceWith(screen); currentPanel = screen; Still nothing changed. So it doesn't look to me like the wat I am creating the panel is the problem. I think there is issues with the way I am using replaceWith method. Any ideas ? On Sun Mar 27,2011 01:50 pm, vineet semwal wrote: Foo.class.newInstance() will use zero arg constructor which is not possible because panel has no zero arg. constructor so basically you got the exception at that line itself :) just pass the panel id in screen method and one enum which helps you in identifying the panel type you want to create and then create a panel instance in a normal way etc. what you want to do.. On Sun, Mar 27, 2011 at 12:56 PM, Mansour Al Akeel mansour.alak...@gmail.com wrote: Martin, I could not find any help using this extension. May be I missed something somewhere. Let's look at a peice of code of what I am trying to do: ? ?private void setScreen(String screen) { ? ? ? ? ? ?try { ? ? ? ? ? ? ? ? ? ?Panel myPanel; ? ? ? ? ? ? ? ? ? ?myPanel = (Panel) Class.forName(com.mycompany.components.+screen).newInstance(); ? ? ? ? ? ? ? ? ? ?screenPanel.replaceWith(myPanel); ? ? ? ? ? ?} catch (InstantiationException e) { ? ? ? ? ? ? ? ? ? ?e.printStackTrace(); ? ? ? ? ? ?} catch (IllegalAccessException e) { ? ? ? ? ? ? ? ? ? ?e.printStackTrace(); ? ? ? ? ? ?} catch (ClassNotFoundException e) { ? ? ? ? ? ? ? ? ? ?e.printStackTrace(); ? ? ? ? ? ?} ? ?} So assuming I need to display a screen called EditUserScreen, I need to load ? ?myPanel = (Panel) Class.forName(com.mycompany.components.EditUserScreen).newInstance(); With the above code everything works fine. But Nothing is replaced. I mean it executes with with no error, but the new panel is not shown. One more thing to mention, if I add additional components in the EditUserScreen Panel class, without adding them in the html, I see NO error generated ! Is't correct to conclude that the html template for EditUserScreen is never parsed, and instead the Panle.java is used ? Shouldn't the old panel should be removed in this case, at least? On Fri Mar 25,2011 03:06 pm, Mansour Al Akeel wrote: Thank you Martin, I had a quick look at extension. I will try a small application with it soon. However my requirement are a bit more complex, as I need to load Panels by string. So let's say I have a String called EditUserScreen, then I need to dynamically load this panel. I am not sure yet if the wizard extension can do this, but will try it anyway. If you know something else that can work for these requirements please advice me. On Fri Mar 25,2011 12:37 pm, Martin Grigorov wrote: See Wizard component in wicket-extensions. You'll need custom logic to check whether the previous/next wizard step should be shown to the current user depending on its privileges. On Fri, Mar 25, 2011 at 1:57 AM, Mansour Al Akeel mansour.alak...@gmail.com wrote: I do have the need to implement different screens. Each screen is a Panel that will be displayed when requested from the screens menu. The screen menu should display the items depending on the functionality the user has access to. Can some one point me to an article or a tutorial with similar requirements ? I trully appreciate any help. - 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 http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- thank you, regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For
Re: Navigation and Adding Panels dynamically.
Hello Vineet, I resolved the issue. I didn't add the panel to the Ajax request target. So ajaxRequestTarget.add(currentPanel); solved the issue. Thank you. On Sun Mar 27,2011 02:50 pm, vineet semwal wrote: sorry i wrongly assumed you might not have defined zero arg constructor.. you dont need setOutputMarkupId(true) as you are already using setOutputMarkupPlaceholderTag(true) and yes you are using replacewith correctly ,i dont think there is any problem in this code.. On Sun, Mar 27, 2011 at 2:08 PM, Mansour Al Akeel mansour.alak...@gmail.com wrote: Vineet, thank you for replying. I don't think this is the issue, because the panels I am creating, have their Id's set directly in the constructor. For example, public EditUserScreen(){ ? ?super(workScreen); ? ?setOutputMarkupPlaceholderTag(true); ? ?setOutputMarkupId(true); } And basically they all have the same Id. However, I don't think this has anything to do with creation of the Panels anymore. I have just tried something like: EditUserScreen screen = new EditUserScreen(); currentPanel.replaceWith(screen); currentPanel = screen; Still nothing changed. So it doesn't look to me like the wat I am creating the panel is the problem. I think there is issues with the way I am using replaceWith method. Any ideas ? On Sun Mar 27,2011 01:50 pm, vineet semwal wrote: Foo.class.newInstance() will use zero arg constructor which is not possible because panel has no zero arg. constructor so basically you got the exception at that line itself ?:) just pass the panel id in screen method and one enum which helps you in identifying the panel type you want to create and then create a panel instance in a normal way etc. what you want to do.. On Sun, Mar 27, 2011 at 12:56 PM, Mansour Al Akeel mansour.alak...@gmail.com wrote: Martin, I could not find any help using this extension. May be I missed something somewhere. Let's look at a peice of code of what I am trying to do: ? ?private void setScreen(String screen) { ? ? ? ? ? ?try { ? ? ? ? ? ? ? ? ? ?Panel myPanel; ? ? ? ? ? ? ? ? ? ?myPanel = (Panel) Class.forName(com.mycompany.components.+screen).newInstance(); ? ? ? ? ? ? ? ? ? ?screenPanel.replaceWith(myPanel); ? ? ? ? ? ?} catch (InstantiationException e) { ? ? ? ? ? ? ? ? ? ?e.printStackTrace(); ? ? ? ? ? ?} catch (IllegalAccessException e) { ? ? ? ? ? ? ? ? ? ?e.printStackTrace(); ? ? ? ? ? ?} catch (ClassNotFoundException e) { ? ? ? ? ? ? ? ? ? ?e.printStackTrace(); ? ? ? ? ? ?} ? ?} So assuming I need to display a screen called EditUserScreen, I need to load ? ?myPanel = (Panel) Class.forName(com.mycompany.components.EditUserScreen).newInstance(); With the above code everything works fine. But Nothing is replaced. I mean it executes with with no error, but the new panel is not shown. One more thing to mention, if I add additional components in the EditUserScreen Panel class, without adding them in the html, I see NO error generated ! Is't correct to conclude that the html template for EditUserScreen is never parsed, and instead the Panle.java is used ? Shouldn't the old panel should be removed in this case, at least? On Fri Mar 25,2011 03:06 pm, Mansour Al Akeel wrote: Thank you Martin, I had a quick look at extension. I will try a small application with it soon. However my requirement are a bit more complex, as I need to load Panels by string. So let's say I have a String called EditUserScreen, then I need to dynamically load this panel. I am not sure yet if the wizard extension can do this, but will try it anyway. If you know something else that can work for these requirements please advice me. On Fri Mar 25,2011 12:37 pm, Martin Grigorov wrote: See Wizard component in wicket-extensions. You'll need custom logic to check whether the previous/next wizard step should be shown to the current user depending on its privileges. On Fri, Mar 25, 2011 at 1:57 AM, Mansour Al Akeel mansour.alak...@gmail.com wrote: I do have the need to implement different screens. Each screen is a Panel that will be displayed when requested from the screens menu. The screen menu should display the items depending on the functionality the user has access to. Can some one point me to an article or a tutorial with similar requirements ? I trully appreciate any help. - 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 http://jweekend.com/
Re: Navigation and Adding Panels dynamically.
See Wizard component in wicket-extensions. You'll need custom logic to check whether the previous/next wizard step should be shown to the current user depending on its privileges. On Fri, Mar 25, 2011 at 1:57 AM, Mansour Al Akeel mansour.alak...@gmail.com wrote: I do have the need to implement different screens. Each screen is a Panel that will be displayed when requested from the screens menu. The screen menu should display the items depending on the functionality the user has access to. Can some one point me to an article or a tutorial with similar requirements ? I trully appreciate any help. - 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 http://jweekend.com/
Re: Navigation and Adding Panels dynamically.
Thank you Martin, I had a quick look at extension. I will try a small application with it soon. However my requirement are a bit more complex, as I need to load Panels by string. So let's say I have a String called EditUserScreen, then I need to dynamically load this panel. I am not sure yet if the wizard extension can do this, but will try it anyway. If you know something else that can work for these requirements please advice me. On Fri Mar 25,2011 12:37 pm, Martin Grigorov wrote: See Wizard component in wicket-extensions. You'll need custom logic to check whether the previous/next wizard step should be shown to the current user depending on its privileges. On Fri, Mar 25, 2011 at 1:57 AM, Mansour Al Akeel mansour.alak...@gmail.com wrote: I do have the need to implement different screens. Each screen is a Panel that will be displayed when requested from the screens menu. The screen menu should display the items depending on the functionality the user has access to. Can some one point me to an article or a tutorial with similar requirements ? I trully appreciate any help. - 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 http://jweekend.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org