Hi,
I just ran into a problem generating a confirmation for a delete request.
I'm using an AjaxCallListener to build the confirmation message:

public class AjaxConfimListener extends AjaxCallListener {
        private static final long serialVersionUID = 1L;
        private final LinkIcon icon; 

        public AjaxConfimListener(final LinkIcon linkIcon) {
                super();
                this.icon = linkIcon;
        }
        
        @Override
        public CharSequence getPrecondition(
                        Component component) {
                return "if (confirm (\"" 
                        + new
StringResourceModel("confirm"+icon.name()+"."+component.getPage().getClass().getSimpleName(),
                                        component.getPage(),
                                        
component.getParent().getDefaultModel()).getString()
                        + "\")) { return true;} else { return false;}";
        }


The problem rises with the StringResourceModel. The message is composed with
information of the item to delete:

confirmDELETE.Detail='${name}' wirklich löschen?
  
The getter getName() of the component returns a string like "Buster "The
But" Baggin" with double quotes inside. I suppose that while rendering the
String I will need something like "Buster "The But" Baggin" as a
result.

Is there any help inside Wicket to render the string like this?

Thanks a lot, Peter

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/StringResourceModel-tp4664706.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

Reply via email to