Wicket- RequiredFieldValidator for AjaxEditableLabel

后端 未结 3 1273
孤独总比滥情好
孤独总比滥情好 2021-01-16 11:25

At first I want to say, although RequiredFieldValidator is used in .NET but I use this term for wicket as I want to mean a Label (color: red and text: *) which will be be di

3条回答
  •  别那么骄傲
    2021-01-16 11:41

    Try:

    Set the star label as hidden on init:

    star.setVisible(false);
    

    When the form is submitted, show star based on input (and add to AjaxRequestTarget):

    String input = (String) getModelObject(); // From your code
    star.setVisible("".equals(input));
    target.add(star); // Or is it addComponent()? Can't remember :-S
    

提交回复
热议问题