How to add line breaks in the summary text of Wizard properties file
Hi, I am using wicket Wizard extension to create a create metaprofile wizard. I am having trouble incorporating line breaks in the summary text of the properties file. As you can see below, the summary text for the steps are long, and I intended to break into several lines, but does not seem to work: NewMetaProfileWizard.properties: otstep2.summary=Based on the OT node you selected ('$\{otNodeName\}'), you must further define the following properties that are available on the node: (1) a free directory number range, (2) a site linking the OT node to an OXE node, (3) an OT user template For (1)-(6), you will be prompted with a list of options available for that property. The options for (1)-(3) are also configurable on the node, please consult the user guide to configure those options on the OT node and perform a sync operation for the node before proceeding with the metaprofile creation. otstep3.title=Define OT Properties (Step 3) otstep3.summary=Last step in creating an OT metaprofile: please define the following properties: (1) an OXE user profile available on the OXE node linked via site, and optionally, (2) a SIP domain name, (3) a voice mail server (4) a voice mail profile nameFor (1), if you want an OXE user profile that is not in the list, you can configure a user profile on the OXE node linked by the site. A sync operation for the node should be performed before proceeding with the metaprofile creation. Any ideas or suggestions would be appreciated!! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: How to add line breaks in the summary text of Wizard properties file
You can have HTML in your language pack and then call Componenet.setEscapeModelString(false) to have it rendered. http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/Compone nt.html#setEscapeModelStrings(boolean) You can also add an attribute modifier to your panel to wrap it at a given size or you could extending that panel and replacing the label with your own implementation if you want to further customize it. Anyhow, you can download the Wicket Free Guide book from: http://wicket.apache.org/learn/books/freeguide.html Read over chapter 12 "Internationalization with Wicket" to get up to speed with the basic features. ~ Thank you, Paul Bors -Original Message- From: shimin_q [mailto:smq...@hotmail.com] Sent: Wednesday, July 31, 2013 3:20 PM To: users@wicket.apache.org Subject: How to add line breaks in the summary text of Wizard properties file Hi, I am using wicket Wizard extension to create a create metaprofile wizard. I am having trouble incorporating line breaks in the summary text of the properties file. As you can see below, the summary text for the steps are long, and I intended to break into several lines, but does not seem to work: NewMetaProfileWizard.properties: otstep2.summary=Based on the OT node you selected ('$\{otNodeName\}'), you must further define the following properties that are available on the node: (1) a free directory number range, (2) a site linking the OT node to an OXE node, (3) an OT user template For (1)-(6), you will be prompted with a list of options available for that property. The options for (1)-(3) are also configurable on the node, please consult the user guide to configure those options on the OT node and perform a sync operation for the node before proceeding with the metaprofile creation. otstep3.title=Define OT Properties (Step 3) otstep3.summary=Last step in creating an OT metaprofile: please define the following properties: (1) an OXE user profile available on the OXE node linked via site, and optionally, (2) a SIP domain name, (3) a voice mail server (4) a voice mail profile nameFor (1), if you want an OXE user profile that is not in the list, you can configure a user profile on the OXE node linked by the site. A sync operation for the node should be performed before proceeding with the metaprofile creation. Any ideas or suggestions would be appreciated!! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-sum mary-text-of-Wizard-properties-file-tp4660589.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to add line breaks in the summary text of Wizard properties file
Hi, you're probably extending WizardStep? Override #getHeader() returning a custom header similar to WizardStep$Header but using a MultiLineLabel for the summary. Then you can use new lines in your properties. Sven On 07/31/2013 09:20 PM, shimin_q wrote: Hi, I am using wicket Wizard extension to create a create metaprofile wizard. I am having trouble incorporating line breaks in the summary text of the properties file. As you can see below, the summary text for the steps are long, and I intended to break into several lines, but does not seem to work: NewMetaProfileWizard.properties: otstep2.summary=Based on the OT node you selected ('$\{otNodeName\}'), you must further define the following properties that are available on the node: (1) a free directory number range, (2) a site linking the OT node to an OXE node, (3) an OT user template For (1)-(6), you will be prompted with a list of options available for that property. The options for (1)-(3) are also configurable on the node, please consult the user guide to configure those options on the OT node and perform a sync operation for the node before proceeding with the metaprofile creation. otstep3.title=Define OT Properties (Step 3) otstep3.summary=Last step in creating an OT metaprofile: please define the following properties: (1) an OXE user profile available on the OXE node linked via site, and optionally, (2) a SIP domain name, (3) a voice mail server (4) a voice mail profile nameFor (1), if you want an OXE user profile that is not in the list, you can configure a user profile on the OXE node linked by the site. A sync operation for the node should be performed before proceeding with the metaprofile creation. Any ideas or suggestions would be appreciated!! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to add line breaks in the summary text of Wizard properties file
Thanks for the suggestion! Yes, I am extending WizardStep. Here is what I did to my code following your suggestion (the Header class is a final class, so I had to create a new MultiLineHeader class extends Panel directly to add new MultiLineLabel instead of the default new Label line in Header class. But I am getting error: 2013-07-31 16:35:45,813 [5245418@qtp-15847288-0] ERROR org.apache.wicket.DefaultExceptionMapper - Unexpected error occurred org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup file associated. MultiLineHeader: [MultiLineHeader [Component id = header]] at org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.getMarkup(AssociatedMarkupSourcingStrategy.java:97) at org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:447) Here is the code I put in: private final class OXEDetailsStep extends WizardStep implements ICondition { private static final long serialVersionUID = 1L; /** * Construct. */ public OXEDetailsStep() { ... } public Component getHeader(final String id, final Component parent, final IWizard wizard) { return new MultiLineHeader(id, wizard); } private final class MultiLineHeader extends Panel { private static final long serialVersionUID = 1L; /** * Construct. * * @param id *The component id * @param wizard *The containing wizard */ public MultiLineHeader(final String id, final IWizard wizard) { super(id); setDefaultModel(new CompoundPropertyModel(wizard)); add(new MultiLineLabel("title", new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public String getObject() { return getTitle(); } })); add(new MultiLineLabel("summary", new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public String getObject() { return getSummary(); } })); } } } Any ideas about the error? Thanks so much for your help! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589p4660595.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to add line breaks in the summary text of Wizard properties file
MultiLineHeader is a panel, so it needs its own markup file. Did you create MultiLineHeader.html? Sven On 07/31/2013 10:43 PM, shimin_q wrote: Thanks for the suggestion! Yes, I am extending WizardStep. Here is what I did to my code following your suggestion (the Header class is a final class, so I had to create a new MultiLineHeader class extends Panel directly to add new MultiLineLabel instead of the default new Label line in Header class. But I am getting error: 2013-07-31 16:35:45,813 [5245418@qtp-15847288-0] ERROR org.apache.wicket.DefaultExceptionMapper - Unexpected error occurred org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup file associated. MultiLineHeader: [MultiLineHeader [Component id = header]] at org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.getMarkup(AssociatedMarkupSourcingStrategy.java:97) at org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:447) Here is the code I put in: private final class OXEDetailsStep extends WizardStep implements ICondition { private static final long serialVersionUID = 1L; /** * Construct. */ public OXEDetailsStep() { ... } public Component getHeader(final String id, final Component parent, final IWizard wizard) { return new MultiLineHeader(id, wizard); } private final class MultiLineHeader extends Panel { private static final long serialVersionUID = 1L; /** * Construct. * * @param id *The component id * @param wizard *The containing wizard */ public MultiLineHeader(final String id, final IWizard wizard) { super(id); setDefaultModel(new CompoundPropertyModel(wizard)); add(new MultiLineLabel("title", new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public String getObject() { return getTitle(); } })); add(new MultiLineLabel("summary", new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public String getObject() { return getSummary(); } })); } } } Any ideas about the error? Thanks so much for your help! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589p4660595.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: How to add line breaks in the summary text of Wizard properties file
w EditGroupMembersPanel("editGroupMembers", form)); } } ... } EditUserGroupPage.html http://wicket.apache.org";> [Edit Group] [[Wizard will be placed here]] EditUserGroupPage#SetUsersStep.html http://wicket.apache.org";> [Users Palette] ~ Thank you, Paul Bors -Original Message- From: shimin_q [mailto:smq...@hotmail.com] Sent: Wednesday, July 31, 2013 4:43 PM To: users@wicket.apache.org Subject: Re: How to add line breaks in the summary text of Wizard properties file Thanks for the suggestion! Yes, I am extending WizardStep. Here is what I did to my code following your suggestion (the Header class is a final class, so I had to create a new MultiLineHeader class extends Panel directly to add new MultiLineLabel instead of the default new Label line in Header class. But I am getting error: 2013-07-31 16:35:45,813 [5245418@qtp-15847288-0] ERROR org.apache.wicket.DefaultExceptionMapper - Unexpected error occurred org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup file associated. MultiLineHeader: [MultiLineHeader [Component id = header]] at org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.getMark up(AssociatedMarkupSourcingStrategy.java:97) at org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:447) Here is the code I put in: private final class OXEDetailsStep extends WizardStep implements ICondition { private static final long serialVersionUID = 1L; /** * Construct. */ public OXEDetailsStep() { ... } public Component getHeader(final String id, final Component parent, final IWizard wizard) { return new MultiLineHeader(id, wizard); } private final class MultiLineHeader extends Panel { private static final long serialVersionUID = 1L; /** * Construct. * * @param id *The component id * @param wizard *The containing wizard */ public MultiLineHeader(final String id, final IWizard wizard) { super(id); setDefaultModel(new CompoundPropertyModel(wizard)); add(new MultiLineLabel("title", new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public String getObject() { return getTitle(); } })); add(new MultiLineLabel("summary", new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public String getObject() { return getSummary(); } })); } } } Any ideas about the error? Thanks so much for your help! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-sum mary-text-of-Wizard-properties-file-tp4660589p4660595.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: How to add line breaks in the summary text of Wizard properties file
So in your case I would just change my CSS and add a wicketExtensionsWizardHeader with the width you want :) ~ Thank you, Paul Bors -Original Message- From: Paul Bors [mailto:p...@bors.ws] Sent: Wednesday, July 31, 2013 6:34 PM To: users@wicket.apache.org Subject: RE: How to add line breaks in the summary text of Wizard properties file The way I styled the wizard to fit my look-n-feel is by extending Wizard and creating MyOwnWizard and then overriding whatever I wanted to change in the Java code (such as the type of form to create) and also in the HTML. You can do this with any Component but keep in mind the more you customize them the more work you'd have to do once you update your dependencies. public class MyWizard extends Wizard { private static final long serialVersionUID = 1L; public MyWizard(String id) { super(id, false); } public MyWizard(String id, IWizardModel wizardModel) { super(id, wizardModel, false); } @Override public MyForm getForm() { return (MyForm)super.getForm(); } @Override protected MyForm newForm(final String id) { MyForm form = new MyForm(id, true); form.setAuditUserInputOnFormSubmit(false); return form; } @Override protected FeedbackPanel newFeedbackPanel(String id) { FeedbackPanel feedbackPanel = new FeedbackPanel(id, new ContainerFeedbackMessageFilter(this)); feedbackPanel.setVisible(false); return feedbackPanel; } @Override protected Component newButtonBar(String id) { return new MyWizardButtonBar(id, this, finishOnAnyStep()); } /** * On each step activation through the wizard, collect the user input and the original default * values on the next step. * * @see {@link Wizard#onActiveStepChanged(IWizardStep)} */ @Override public void onActiveStepChanged(final IWizardStep newStep) { getForm().collectAfterFormInputComponents(); super.onActiveStepChanged(newStep); } /** * Collect from components input for audit of changes since the form submit is not always fired for * the Finish button. This happens when you directly edit a step and the finish is enabled on every step. */ @Override public void onFinish() { if(finishOnAnyStep()) { getForm().collectAfterFormInputComponents(); } } /** * Override if you'd like the Finish button to be enabled on any step of the wizard. * @return false by default representing that the Finish is only enabled at the last step. * true otherwise and the Finish button will always be enabled. */ protected boolean finishOnAnyStep() { return false; } } And in the HTML: http://wicket.apache.org";> [[Overview]] [[Header]] [[View]] [[Feeback]] [[Buttons]] This is a simple example of how I use a wizard step to add a panel: public class EditUserGroupPage extends Page { private static final long serialVersionUID = 1L; @SpringBean private UserGroupServiceuserGroupService; @SpringBean private UserService userService; public static enum WizStep { /** Step 1 of 4 */ GROUP_DETAILS(1), /** Step 2 of 4 */ SET_PERMISSIONS(2), /** Step 3 of 4 */ SET_USERS(3), /** Step 4 of 4 */ VIEW_GROUP(4); private int stepNum; WizStep(int stepNum) { this.stepNum = stepNum; } public int getNum() { return this.stepNum; } } private CompoundPropertyModel userGroupModel; public EditUserGroupPage() { this(ManageUserGroupsPage.class, new UserGroup(), WizStep.GROUP_DETAILS); } public EditUserGroupPage(Class backPage, UserGroup editGroup, WizStep wizardStartStep) { for(Permission permission : editGroup.getPermissions()) { permission.setSelected(Boolean.TRUE); } this.backPage = backPage; this.userGroupModel = new CompoundPropertyModel(editGroup); ResourceModel pageTitleModel = new ResourceModel( (editGroup.getId() == null) ? "new.group" : getPageClass().getName() + ResourceKeyHelper.PAGETITLE ); add(new Label
Re: How to add line breaks in the summary text of Wizard properties file
That was it! How did I not think of this? :-) Thanks Sven! The only issue, as I found out quickly, is that I have to introduce the MultiLineHeader inner class in many of my classes that extend WizardStep. And since wicket id does not support different namespaces, I will have to use different wicket ids for the MultiLineLabels for each class. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589p4660625.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: How to add line breaks in the summary text of Wizard properties file
Thanks Paul! For now, creating a MultiLineHeader class to replace Header class, as Sven suggested, did the trick. But I will keep your point in mind for any future customization of the default Wizard. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589p4660626.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: How to add line breaks in the summary text of Wizard properties file
In Wicket 5 it was as easy as using tags inside summary String. In Wicket 6 this simple way does not work anymore. Why? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589p4664234.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to add line breaks in the summary text of Wizard properties file
See https://issues.apache.org/jira/browse/WICKET-4219 Sven On 02/06/2014 12:51 PM, dpmihai wrote: In Wicket 5 it was as easy as using tags inside summary String. In Wicket 6 this simple way does not work anymore. Why? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589p4664234.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to add line breaks in the summary text of Wizard properties file
Thanks. I did the following: @Override public Component getHeader(final String id, final Component parent, final IWizard wizard) { Component c = super.getHeader(id, parent, wizard); c.get("summary").setEscapeModelStrings(false); return c; } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-add-line-breaks-in-the-summary-text-of-Wizard-properties-file-tp4660589p4664241.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