• 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: Creating Component with special behaviour
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating Component with special behaviour


  • Subject: Re: Creating Component with special behaviour
  • From: Samuel Pelletier <email@hidden>
  • Date: Fri, 17 Jul 2015 16:37:49 -0400

Hi,

I suggest using ERXWOTemplate. With these, you can create multiple content zone for a single component. The AjaxInPlace component uses these to define the edit and view templates. In you component, you can have the regular content and inside this content, you define a special zone like this:
<wo:ERXWOTemplate templateName = "bottomContent">
    The html to put in bottom
</wo:ERXWOTemplate>

In your Page container, you replace the WOComponentContent with this to skip the special template:
<wo:ERXWOComponentContent/>

And place this in the bottom of the page where the bottomContent template content should appear:
<wo:ERXWOComponentContent templateName = "bottomContent"/>

If you use it often, I suggest to create a ERXWOTemplate subcomponent like the AjaxInPlaceEditTemplate so you do not have to specify the template name in all places.

Samuel 

Le 2015-07-17 à 09:48, Daniele Corti <email@hidden> a écrit :

Hi list,

I need an advice about a thing that I would like to do:

I'm trying to create a component that works like a generic container, the difference is that it doesn't inject the inner HTML where the component is defined, but in the bottom of the page. I want to do this, because I would like to use in with the Bootstrap Modal Container.

Example:

<wo:form class="form-horizontal">
   .. other form fields...
<wo:MyModalContainer linkText = "Click Me" classLink="btn btn-default" id="MyModal">
    <wo:form>
        ... logic for another form...
    </wo:form>
</wo:MyModalContainer>
... other form fields...
</wo:form>

I would like the result:

<form action="" method="post">
     .. other form fields...
<a href="" class="btn bnt-default" data-toggle="modal" data-target="#MyModal">Click Me</a>
     .. other form fields...
</form>
... other page HTML...
<div class="modal fade" id="MyModal" tabindex="-1" role="dialog" >
  <div class="modal-dialog" role="document">
    <div class="modal-content">
       <from action="" method="post">
           ... logic for another form...
       </form>
    </div>
  </div>
</div>
</body>

That's the idea: the code contained in the container is appended to the bottom of the page (with the appropriate changes), but the form still work inside the component it is defined.
I need to do this, because, if i put the code where the component is defined, the second form is removed, changing the HTML DOM, and the fields in the second form inherit the class "form-horizontal" from the first form.

Is there a way to do this?

Thanks!
--
 
Daniele Corti
--
I DON'T DoubleClick
Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Creating Component with special behaviour (From: Daniele Corti <email@hidden>)

  • Prev by Date: Creating Component with special behaviour
  • Next by Date: postgresql eomodeler correctly "generate sql"
  • Previous by thread: Creating Component with special behaviour
  • Next by thread: postgresql eomodeler correctly "generate sql"
  • Index(es):
    • Date
    • Thread