Simone Gianni wrote:
Hi Berin,

Berin Loritsch wrote:

I've got the CForm displaying the information in the database--even
though the <fd:booleanfield/> doesn't display checked if Tag.isHotTopic
is true.

I know it seems strange, but try to convert it/add a getter getHotTopic.
I couldn't determine why, but sometimes JXPath does not read from "is"
getters.
:/  Not JavaBean compliant?  Ok, I'll try that.

When I click the submit button for the form, I get an exception in the
part where CForms is supposed to save back to the object:

Factory
[EMAIL PROTECTED]

could not create an object for path: /terms

Is there a setTerms? is getTerms a collection or what? It would be
useful if you could post the binding file and at least the interfaces of
your business objects.

There is.

CountryHotTopics
--------------------
List<Term> getTerms(); // Term == Tag for this discussion
setTerms(List<Term>);
List<Term> getHotTopics();

The terms (tags) is a collection.

Attached is my Model and Binding.

--
*Berin Loritsch*
Owner   

*Work:* 571-215-7708
        *Email:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
*IM:* [EMAIL PROTECTED] (MSN)
*http://www.linkedin.com/in/bloritsch
*
* *             *D-Haven* <http://d-haven.org>
20044 Great Falls Forest Dr.
<http://maps.google.com/maps?q=20044+Great+Falls+Forest+Dr.%2CGreat+Falls%2CVA+22066%2CUSA&hl=en> Great Falls, VA 22066
USA

See who we know in common <http://www.linkedin.com/e/wwk/5678360/> Want a signature like this? <http://www.linkedin.com/e/sig/5678360/>

<?xml version="1.0" encoding="UTF-8"?>
<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"; path="/">
  <fb:repeater id="terms" parent-path="." row-path="terms">
      <fb:value id="id" path="termId"/>
	  <fb:value id="term-name" path="term"/>
	  <fb:value id="isHotTopic" path="isPostHT"/>
	  <fb:value id="displayName" path="fullDesc"/>
  </fb:repeater>
  <fb:repeater id="hotTopics" parent-path="." row-path="hotTopics">
      <fb:value id="id" path="termId"/>
	  <fb:value id="displayName" path="fullDesc"/>
  </fb:repeater>
</fb:context>
<?xml version="1.0" encoding="UTF-8"?>
<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"; xmlns:i18n="http://apache.org/cocoon/i18n/2.1";>
  <fd:widgets>
  <fd:repeater id="terms">
	<fd:label>Terms Used</fd:label>
  	<fd:hint>This is a list of all terms used in your country.  They can be promoted to become hot topics</fd:hint>
  	<fd:help>...</fd:help>
	<fd:widgets>
	  <fd:output id="id" state="invisible">
            <fd:datatype base="string"/>
	  </fd:output>
  	  <fd:output id="term-name">
  	    <fd:label>Term</fd:label>
  	    <fd:datatype base="string"/>
  	  </fd:output>
  	  <fd:booleanfield id="isHotTopic">
  	    <fd:label>HT?</fd:label>
  	    <fd:hint>Make this term a hot topic?</fd:hint>
  	    <fd:on-value-changed>
  	      <fd:javascript>
  	        var longdesc = this.lookupWidget("../displayName");

  	        if (longdesc.value == "")
  	        {
  	            longdesc.value = this.lookupWidget("../term-name").value;
  	        }

            longdesc.state = (this.value) ? 
                org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE :
                org.apache.cocoon.forms.formmodel.WidgetState.OUTPUT;
  	      </fd:javascript>
  	    </fd:on-value-changed>
  	  </fd:booleanfield>
  	  <fd:field id="displayName" state="output">
  	    <fd:datatype base="string"/>
  	  </fd:field>
	</fd:widgets>
  </fd:repeater>
  <fd:repeater id="hotTopics">
	<fd:label>Hot Topics</fd:label>
  	<fd:hint>This is a list of all hot topics used in your country.  They can be promoted to become hot topics</fd:hint>
  	<fd:help>...</fd:help>
	<fd:widgets>
	  <fd:output id="id" state="invisible">
            <fd:datatype base="string"/>
	  </fd:output>
  	  <fd:output id="displayName">
  	    <fd:datatype base="string"/>
  	  </fd:output>
	</fd:widgets>
  </fd:repeater>
  <fd:submit id="done">
    <fd:label>Done</fd:label>
  </fd:submit>
  </fd:widgets>
</fd:form>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to