Home
TeamSite
How to set string datum value using java?
Ritzzz
I need to set the string datum value on selection of an option in select datum.
I have used generator for select datum to dynamically populate it's options.
Please let me if anyone has worked on such requirement.
Find more posts tagged with
Comments
Rick Poulin
Are you setting a default value for a datum that is meant to be editable by users? If so, I think you're out of luck; the "component specification" can't do that. You'll have to rethink your design.
If you're just looking to set a String based on the selected option, for exposure only to XSL/Java, then just skip trying to write to a Datum at all, and make your code do a switch/lookup based on the value of the dropdown.
Ritzzz
I want to show some text (readonly) to user on selection of select datum options in the component only.
To populate select datum I am using below code
Document doc = Dom4jUtils.newDocument();
org.dom4j.Element optionsBase = doc.addElement("Options");
GeneratorUtils.addOption(optionsBase,label, value);
I want to know can we similary populate string datum. If yes then how?
Rick Poulin
There is no supported way to do this. You'll either have to capture your content in a DCR, or hack something.