How to get the content of textarea in a vm page

xuhai zhao August 29, 2012

<webwork1 key="select-action" name="Select Project" class="java.lang.Object">

<actions>

<action name="com.atlassian.cpji.action.SelectTargetProjectAction" alias="SelectTargetProjectAction">

<view name="success">/templates/selectproject.vm</view>

<view name="error">/templates/error.vm</view>

</action>

</actions>

</webwork1>

just like this, how could the SelectTargetProjectAction get the content of the a textarea in selectproject.vm.

It seems that the value attribute is not work, using the "value" can only get part of the content.

1 answer

1 accepted

0 votes
Answer accepted
Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 29, 2012

eh? it doesnt, and you cant, but I think I know where you're going

1) it doesnt: The Action is passed in as a reference TO the velocity template when the Webwork? processor hands off for rendering. The Action does not 'get' the rendered velocity output at any time.

2) it cant: The rendering is piped to the web browser. The client then enters text into a text area at which point the Action is definitely out of the picture.

3) What I think you want to do is inject content into the velocity template FROM the action? this is done with something like:

<textarea id="expectedValue-content" cols="80" rows="30" name="expectedValue" value="$action.getContent()">$!action.getContent()</textarea>

xuhai zhao August 29, 2012

I want the user to input sth. into the textarea, and then the Action get the content and process it just as processing a string, is it possible?

The content of "<input type="text" ...>" can be got, but the textarea seems a little different.

Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 29, 2012

I see, that wasnt clear, sorry haven't played with the dynamic editing stuff yet, so can't comment.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events