OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | exoplatform List | April 2008 Index

<--  Date Index  --> <--  Thread Index  -->

[exoplatform] Button on form don t work


Hi,

I had to perform a simple form to send a mail. I put my form in a popup.

When I clic on the little sendMailIcon on the right of the sreen, my popup rended well. But when I click on my button, no action.

Note the link of my send button : _javascript_:eXo.webui.UIForm.submitEvent('199082237#UISendMailPopupContent','Send','&objectId=')
If anybody can help me.


My classes :

My groovy template :

<div id="<%=uicomponent.getId();%>">
    <%=uicomponent.getUserName()%>
</div>
<% String fieldName; %>
<div class="UIForm $uicomponent.id">
  <%uiform.begin()%>
  <div class="HorizontalLayout">
    <div class="FormContainer">
      <table class="UIFormGrid">
          <%
            for(field in uicomponent.getChildren()) {
          %>
              <tr>
                  <%fieldName = uicomponent.getLabel(field.getName());%>
                  <%//TODO: Tung.Pham modified
                      //if(!fieldName.equals(uicomponent.getId())) {
                      if(fieldName != null && fieldName.length() > 0 && !fieldName.equals(uicomponent.getId())) {
                  %>                       
                    <td class="FieldLabel">
                    <%if(fieldName != null && fieldName.length() > 0) {%>
                      <%=uicomponent.getLabel(field.getName()) %>
                    <%}%>
                  </td>
                    <td class="FieldComponent"><% uicomponent.renderField(field) %></td>
                  <%} else {%>
                    <td class="FieldComponent" colspan="2"><% uicomponent.renderField(field) %></td>
                  <%}%>
                </tr>
          <%
             
            }
          %>
      </table>
    </div>
  </div>
  <div class="UIAction">
                  <table class="ActionContainer" align="center">
                      <tr>
                              <td align="center">
                          <%for(action in uicomponent.getActions()) {
                                  String actionLabel = _ctx.appRes(uicomponent.getName() + ".action." + action);
                                  String link = uicomponent.event(action,"") ;
                            %>
                                    <a href="" class="ActionButton LightBlueStyle">
                                      <div class="ButtonLeft">
                                          <div class="ButtonRight">
                                            <div class="ButtonMiddle">
                                           $actionLabel
                                            </div>
                                        </div>
                                        </div>
                                    </a>
                        <%}%>
                       </td>
                  </tr>
              </table>
             </div>
  <%uiform.end()%>
</div>


my class popup :
With correct import

@ComponentConfig(
    lifecycle = UIFormLifecycle.class,
    template = "app:/groovy/listMembers/portlet/UISendMailPopupContent.gtmpl",
    events = {
    @EventConfig(listeners = UISendMailPopupContent.ResetActionListener.class),
    @EventConfig(listeners = UISendMailPopupContent.SendActionListener.class)
    }
     
)
public class UISendMailPopupContent extends UIForm {
 
  private String userName;
 
  public UISendMailPopupContent() throws Exception{

    addUIFormInput(new UIFormStringInput("mailTo", "mailTo", null).setEditable(false));
    addUIFormInput(new UIFormStringInput("mailFrom", "mailFrom", null).setEditable(false));
    addUIFormInput(new UIFormStringInput("subject", "subject", null).setEditable(true));
    addUIFormInput(new UIFormTextAreaInput("corps", "corps", null));

    setActions(new String[]{"Send","Reset"}) ;
  }
 
  public String getUserName() {
    return userName;
  }

  public void setUserName(String userName) {
    this.userName = userName;
  }
 
  static public class SendActionListener extends EventListener<UISendMailPopupContent> {
    public void execute(Event<UISendMailPopupContent> event) throws Exception {
      System.out.println("Send");
     
    }
    }
 
  static public class ResetActionListener extends EventListener<UISendMailPopupContent> {
    public void execute(Event<UISendMailPopupContent> event) throws Exception {
      System.out.println("Reset");
     
      //UISendMailPopupContent uiForm = event.getSource();
      //uiForm.reset()
     
    }
    }


}

sendMail



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.