Hi Helma,
On 17 Dec 2004, at 13:02, [EMAIL PROTECTED] wrote:
Hi,I can go into more detail if necessary, but basically I just need to know:
1) how do I display a repeater widget as a "submit button"-type hyperlink?
<fi:styling type="link"/> ? Look at the sample trio: datasource-chooser,
dynamic repeater, task tree. At least one of them has a submit-button
displayed as a link.
tasktree has a link to add a row. But I want a link per row. My row repeater looks like this:
model:
<fd:repeater id="resultConcepts">
<fd:widgets>
<fd:output id="id">
<fd:datatype base="integer"/>
</fd:output>
<fd:output id="typeId">
<fd:datatype base="integer"/>
</fd:output>
<fd:output id="name">
<fd:datatype base="string"/>
</fd:output>
<fd:action id="addConcept" action-command="foo">
<fd:label>Add this concept</fd:label>
<fd:on-action>
<fd:javascript>
addConcept(event);
</fd:javascript>
</fd:on-action>
</fd:action>
</fd:widgets>
</fd:repeater>my template looks like this:
<ul>
<ft:repeater-widget id="resultConcepts">
<li>
<ft:widget id="name">
<fi:styling type="link"/> <!--
doesn't seem to work -->
</ft:widget>
<ft:widget id="addConcept">
<fi:styling type="link"/> <!--
doesn't seem to work -->
</ft:widget>
</li>
</ft:repeater-widget>
</ul>this produces: * Concept 1 [Add this concept] <- a button * Concept 2 [Add this concept] (etc.)
but I want:
* _Concept 1_ <- a hyperlink * _Concept 2_ (etc.)
2) how do I pick up which link was clicked, either in the flowscript or in the SearchBean when I execute form.save(searchBean)?
Hmm, when pressing "submit" the submit id is passed along I think. Isn't
this standard HTML form handling? Or do you mean something else?
I worked this one out. In the code above I now have an on-action declared for the action widget. The js code for this is:
function addConcept(event) {
var form = event.source.form; var row = form.getSubmitWidget().getParent();
var id = row.lookupWidget("id").value // is there a way to get this from form.binding or something?
var searchBean = form.getAttribute("searchBean"); searchBean.addConcept(id);
searchBean.doSearch(); // don't know why form.load doesn't work, so earlier in the js
// I have: form.setAttribute("theForm", form);
form.getAttribute("theForm").load(searchBean);
}Don't know if you also have an answer for the two questions posed in those comments?
Thanks for your help,
Jon
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
