Commits

Yaw Anokwa committed 86c9b81

add <output> support in hints

  • Participants
  • Parent commits ce9934b

Comments (0)

Files changed (3)

File core/src/org/javarosa/core/model/QuestionDef.java

 	private String labelInnerText;
 	private String helpText;
 	private String textID; /* The id (ref) pointing to the localized values of (pic-URIs,audio-URIs,text) */
-
+	private String helpInnerText;
 
 
 
 		setLabelInnerText((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
 		setHelpText((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
 		setHelpTextID((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
+        setHelpInnerText((String)ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
 
 		setControlType(ExtUtil.readInt(dis));
 		choices = ExtUtil.nullIfEmpty((Vector)ExtUtil.read(dis, new ExtWrapList(SelectChoice.class), pf));
 		ExtUtil.write(dos, new ExtWrapNullable(getLabelInnerText()));
 		ExtUtil.write(dos, new ExtWrapNullable(getHelpText()));
 		ExtUtil.write(dos, new ExtWrapNullable(getHelpTextID()));
-				
+        ExtUtil.write(dos, new ExtWrapNullable(getHelpInnerText()));
+
 		ExtUtil.writeNumeric(dos, getControlType());
 		
 		ExtUtil.write(dos, new ExtWrapList(ExtUtil.emptyIfNull(choices)));
 		return labelInnerText;
 	}
 	
+    public void setHelpInnerText(String helpInnerText) {
+        this.helpInnerText = helpInnerText;
+    }
+
+    public String getHelpInnerText() {
+        return helpInnerText;
+    }
+	
 	public String getTextID() {
 		return textID;
 	}

File core/src/org/javarosa/form/api/FormEntryPrompt.java

 
 		String textID = ((QuestionDef)element).getHelpTextID();
 		String helpText = ((QuestionDef)element).getHelpText();
+		String helpInnerText = ((QuestionDef)element).getHelpInnerText();
+		
 		try{
 			if (textID != null) {
 				helpText=localizer().getLocalizedText(textID);
+			} else {
+			    helpText=substituteStringArgs(((QuestionDef)element).getHelpInnerText());
 			}
 		}catch(NoLocalizedTextException nlt){
 			//use fallback helptext

File core/src/org/javarosa/xform/parse/XFormParser.java

 		Vector usedAtts = new Vector();
 		usedAtts.addElement(REF_ATTR);
 		String hint = getXMLText(e, true);
+		String hintInnerText = getLabel(e);
 		String ref = e.getAttributeValue("", REF_ATTR);
 
 		if (ref != null) {
 				throw new RuntimeException("malformed ref [" + ref + "] for <hint>");
 			}
 		} else {
+		    q.setHelpInnerText(hintInnerText);
 			q.setHelpText(hint);
 		}