July 2007


It has always bedeviled me how to submit an ATG form using a text link. I have asked many people about this but no one seems to know. Finally with the help of ATG support I figured it out.

Below is a simple example of how to do it. The trick is the hidden submit input which triggers ATG to call the handleSubmit method of the form handler.

<%@ taglib uri="/dspTaglib" prefix="dsp"%>

<dsp:page>

<script>
  function submit(form) {
    form.submit();
  }
</script>

<dsp:form action="<%=request.getRequestURI()%>" method="post" name="testForm">

  Foo: <dsp:input type="text" bean="TestFormHandler.foo"/>

  <p><a href="javascript:submit(document.testForm)" mce_href="javascript:submit(document.testForm)">Submit</a>

  <dsp:input type="hidden" bean="TestFormHandler.submit" value="Submit"/>

</dsp:form>

</dsp:page>

Perforce has great tech notes and one of them is Perforce Reverting Submitted Changelists.

Here is how one rolls back to version N-1 .

> p4 sync …@N-1

> p4 add deleted_file
> p4 edit foo bar baz

> p4 sync …@N

> p4 resolve -ay

> p4 sync …

> p4 resolve

> p4 delete added_file

> p4 submit …

You can also do a simple rollback of a file like in this example.

> p4 sync foo#7

> p4 edit foo

> p4 sync …

> p4 resolve -ay

> p4 submit …