@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render( OnLoadHeaderItem.forScript( String.format( "addTextAreaMapper('%s', '%s');", this.container.getMarkupId(), this.textarea.getMarkupId()))); }
// Events // @Override protected void onInitialize() { super.onInitialize(); this.datePicker = this.newDatePicker("datepicker", this.getModel(), this.datePattern); this.timePicker = this.newTimePicker("timepicker", this.getModel(), this.timePattern); this.add(this.datePicker); this.add(this.timePicker); }
// Events // @Override protected void onInitialize() { super.onInitialize(); this.add( this.newInputFragment( "model")); // cannot be in ctor as the model may not have been initialized before. this.add( JQueryWidget.newWidgetBehavior( this, this.label)); // cannot be in ctor as the markupId may be set manually afterward }
@Override protected void onBeforeRender() { date = (Date) getModelObject(); if (date != null) { Calendar calendar = Calendar.getInstance(getLocale()); calendar.setTime(date); hours = calendar.get(Calendar.HOUR_OF_DAY); minutes = calendar.get(Calendar.MINUTE); } dateField.setRequired(isRequired()); super.onBeforeRender(); }
@Override protected void onModelChanged() { super.onModelChanged(); this.textarea.setModelObject(this.getDefaultModelObjectAsString()); }
// Events // @Override protected void onInitialize() { super.onInitialize(); this.add(JQueryWidget.newWidgetBehavior(this, this.container)); }