• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SubmitButton Component
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SubmitButton Component


  • Subject: Re: SubmitButton Component
  • From: David Neumann <email@hidden>
  • Date: Tue, 11 Mar 2003 19:57:14 -0600

I think you are going to have to use a custom WOForm that is implemented as a Component to get this to work. See WXForm in the WOComponentElements framework source in the JavaWebObjects Examples.

BTW: this I think this might be a better implementation of your button:



// .html file:
<WEBOBJECT NAME=SubmitButton></WEBOBJECT>



// .wod file:
SubmitButton: WOGenericElement {
    elementName = "input";
    type = "submit";
    value = ^value;
    invokeAction = ^action;
    name = context.elementID;
}



// .java
public class SubmitButton extends WOComponent {

    public SubmitButton( WOContext aContext )  {
        super( aContext );
    }

    public boolean synchronizesVariablesWithBindings() {
        return false;
    }
}



Take a look at the other WOComponents in WOComponentElements, it might be the ideal starting point to creating your own library of custom elements (e.g. for different presentation dialects like WAP, XHTML, XSL:FO, etc...

d




On Tuesday, March 11, 2003, at 04:26 PM, Benjamin Miller wrote:

I'm trying to implement a XHTML submit button to be used inside a
WOForm with multiple submit buttons. So far I think I have tried most
methods unsuccessfully. I currently have a WOComponent with a single
binding to an action in the parent component.

public class ImageSubmit extends WOComponent {

     public String action;

     public ImageSubmit(WOContext context) {
         super(context);
     }

public void appendToResponse(WOResponse response, WOContext
context) {
response.appendContentString("<input type=\"submit\" name=\"");
response.appendContentString(context.elementID());
response.appendContentString("\" />");
}


     public WOComponent invokeAction() {
         NSLog.out.appendln("invokeAction in component");
         return
(WOComponent)performParentAction((String)valueForBinding("action"));
     }

}

invokeAction() doesn't appear to be called, although the method in the
parent component executes four times in one response loop. Any ideas
where I am going wrong? The WOForm does not have an action binding and
multiple submit is true. Whilst experimenting earlier I found that I
appeared to have problems with the elementID generated. What does
WebObjects do if it can't find the component with the elementID that
submitted the form?

Is this the best way to handle generation of small chunks of HTML like
this or are WODynamicElements in some way 'better' ? I did read
somewhere in the Apple docs that there was little difference between
components and dynamic elements since version 4 or so.

Obviously working through all the above, I haven't found a nice
framework full of XHTML elements and components so I guess one doesn't
exist.

Benjamin Miller


-- Happy 21st birthday to Watershed.... We need your thoughts, memories and experiences of Watershed  past, present and future  to help celebrate Watersheds 21st birthday. FFI go to http://www.watershed.co.uk/development . Send in your contributions by email to: email@hidden

+44 (0)117 927 6444 t / +44 (0)117 921 3958 f /
http://www.watershed.co.uk
Watershed Media Centre, 1 Canon's Road, Harbourside, Bristol, BS1 5TX
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: SubmitButton Component
      • From: Benjamin Miller <email@hidden>
References: 
 >SubmitButton Component (From: Benjamin Miller <email@hidden>)

  • Prev by Date: Re: Now that MacOS X Java 1.4.1 is out...
  • Next by Date: DB error
  • Previous by thread: SubmitButton Component
  • Next by thread: Re: SubmitButton Component
  • Index(es):
    • Date
    • Thread