The event handler method is in a class called CellHTSUpload.java and the
actionlink in the corresponding CellHTSUpload.tml.

CellHTSUpload.java looks like this:

public class CellHTSUpload {

    private UploadedFile descript;
    private UploadedFile topTable;

    @Persist
    private Experiment experiment;

    @Persist
    private Boolean saveSucceed = false;

    @Persist
    private Boolean tableParsed = false;

    @Inject
    private ExperimentDAO experimentDAO;

    ... (Getters and Setters)

    public void onSubmitFromDescription(){
        experimentDAO.saveExperiment(experiment);
        setSaveSucceed(true);
    }

    @OnEvent(value = "reset")
    public Object reset(){
        tableParsed = false;
        saveSucceed = false;
        return null;
    }

    public void onSubmitFromScreenUpload() {
        ...
    }
}


The CellHTSUpload.tml looks like this:

<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
    <t:if test="saveSucceed">
        <h3>Screen submitted successfully.</h3>
        <t:parameter name="else">
            <t:if test="tableParsed">
                <t:beaneditform object="experiment" t:id="description"
t:submitLabel="Save">
                     <t:parameter name="assaydesc">
                         <t:label for="assaydesc"/>
                         <t:textarea t:id="assaydesc"
t:value="experiment.assaydesc" cols="30" rows="5"/>
                      </t:parameter>
                 </t:beaneditform>
                <t:parameter name="else">
                    <table>
                        <t:form t:id="screenUpload">
                            <tr>
                                <td>
                                    <t:label
t:for="descript">Description</t:label>
                                </td>
                                <td>
                                    <input t:type="upload" t:id="descript"
validate="required"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <t:label
t:for="topTable">topTable</t:label>
                                </td>
                                <td>
                                    <input t:type="upload" t:id="topTable"
validate="required"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="submit" value="Upload"/>
                                </td>
                            </tr>
                        </t:form>
                    </table>
                </t:parameter>
            </t:if>
        </t:parameter>
    </t:if>
    <br/>
    [<t:actionlink id="reset">Reset</t:actionlink>]
</div>

Basically the component is working well except that I cannot reset the
component. 

Thanks for the help.





Howard Lewis Ship wrote:
> 
> Where is your event handler method?  If the <t:actionlink> is inside
> component Foo's template (Foo.tml), then the method goes inside
> Foo.java.
> 
> On Mon, Oct 13, 2008 at 9:22 AM, moritzgilsdorf
> <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> I'm feeling like posting a very trivial problem but unfortunately I can't
>> find my mistake.
>>
>> I have a actionlink in a component to reset some persisted booleans. The
>> actionlink looks like this:
>>
>> <t:actionlink id="reset">Reset</t:actionlink>
>>
>> And the triggered method like this:
>>
>>    @OnEvent(component = "reset")
>>    public Object reset(){
>>        tableParsed = false;
>>        saveSucceed = false;
>>        return null;
>>    }
>>
>> But the booleans are not resetted. It only works when I remove the
>> ("component="reset") or rename reset() to onAction(). But then I also
>> reset
>> the variables on form submits.
>>
>> What am I doing wrong?
>>
>> Thanks.
>>
>> --
>> View this message in context:
>> http://n2.nabble.com/ActionLink-in-component-tp1329406p1329406.html
>> Sent from the Tapestry Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/ActionLink-in-component-tp1329406p1331850.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


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

Reply via email to