Reputation: 955
Im trying to figure out how to create a wicket component wicket could represent a div that is then used by the Bootstrap-wyiswyg javascript. Once the page is submitted i want to be able to get the content of the div and have that represented on the server, in a IModel<String>
.
The part im struggling with is getting the content from the div to the server-side. For instance if i used a textarea i would just have my component extends TextArea
and that would do all of this for me. So really what im asking is whether there is a wicket component that i can add as a <div wicket:id="mycomponent"></div>
but onsubmit populate the component's Model with the content of the div from the client-side. Or do I have to write all this code myself?
Upvotes: 1
Views: 608
Reputation: 6029
You can try adding a normal "wicket" textarea to your form (with display: none
) and add a jQuery handler for the form's submit event that will do something like:
$('your-text-area-selector').html($('your-wysiwyg-div-selector').html());
Upvotes: 1