[Control Wishlist] LinkButton.

20 messages Options
Embed this post
Permalink
Demetrios Kyriakis

[Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
Hi,

I wish there were a LinkButton control in Click, i.e. a button(not a styled link) that points to link(URL) (full link with support for parameters - maybe PageLink) directly, without a roundtrip to the server like the ActionButton + setRedirect() trick.

Also it should "live" outside a Form and should not interfere with existing forms in the Page.

Thank you,

Demetrios.
Demetrios Kyriakis

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
Demetrios Kyriakis wrote:
I wish there were a LinkButton control in Click, i.e. a button(not a styled link) that points to link(URL) (full link with support for parameters - maybe PageLink) directly, without a roundtrip to the server like the ActionButton + setRedirect() trick.

Also it should "live" outside a Form and should not interfere with existing forms in the Page.
Any idea how to implement such a control?

Thank you,

Demetrios.
Ozakca, Muzaffer

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
I think you can do that by extending Control and overriding the toString() method to return something like:

<a href="search.htm" title="Search">
     <span class="menuButton">Search</span>
</a>

In your CSS, define menuButton to draw a border around itself and do other fancy buttonish styling. That will create a faux button easily. You can make CSS specific to this button deployable automatically. You will also need to parameterize the link and the label. I think the other method will be using CSS and javascript instead.

Muzaffer

> -----Original Message-----
> From: [hidden email] [mailto:click-user-
> [hidden email]] On Behalf Of Demetrios Kyriakis
> Sent: Wednesday, June 04, 2008 2:48 PM
> To: [hidden email]
> Subject: Re: [Click-user] [Control Wishlist] LinkButton.
>
>
>
> Demetrios Kyriakis wrote:
> >
> > I wish there were a LinkButton control in Click, i.e. a button(not a
> > styled link) that points to link(URL) (full link with support for
> > parameters - maybe PageLink) directly, without a roundtrip to the server
> > like the ActionButton + setRedirect() trick.
> >
> > Also it should "live" outside a Form and should not interfere with
> > existing forms in the Page.
> >
> Any idea how to implement such a control?
>
> Thank you,
>
> Demetrios.
> --
> View this message in context: http://www.nabble.com/-Control-Wishlist--
> LinkButton.-tp17274531p17653557.html
> Sent from the click-user mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Click-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/click-user
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user
Demetrios Kyriakis

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
Ozakca, Muzaffer wrote:
In your CSS, define menuButton to draw a border around itself and do other fancy buttonish styling. That will create a faux button easily. You can make CSS specific to this button deployable automatically. You will also need to parameterize the link and the label. I think the other method will be using CSS and javascript instead.
Sorry but this is exactly what I did *not* asked in the parrent message:
-------
"a button(not a styled link) that points to link(URL) (full link with support for parameters -
maybe PageLink) directly, without a roundtrip to the server like the
ActionButton + setRedirect() trick"
-------

Any ideas how to make it work with a button? It is very important that the parameters work (automatic parameters like jSessionID, or TableControl parameters should work too) .

Thank you,

Demetrios.
Malcolm Edgar-2

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
Hi

Below is a LinkButton we have used, note you will need to style it to your own needs.

regards Malcolm Edgar

        LinkButton viewSubmissionButton = new LinkButton("ViewSubmission");
        viewSubmissionButton.setTarget("_blank");
        viewSubmissionButton.setHref(href);
        viewSubmissionButton.setTitle("View Form Submission");
        viewSubmissionButton.setAttribute("class", "linkButton");
        form.add(viewSubmissionButton);

-----------------------------------------------------------

a.linkButton,a.linkButton:visited {
    background: #D4D0C8;
    border-top: 1px solid #efefef;
    border-left: 1px solid #efefef;
    border-right: 1px solid #717171;
    border-bottom: 1px solid #717171;
    color: black;
    font-weight: normal;
    padding: 1px 6px;
    text-decoration: none;
}

-----------------------------------------------------------

public class LinkButton extends Button {

    private static final long serialVersionUID = 1L;

    private String href;
    private String target;

    // ----------------------------------------------------------- Constructor

    public LinkButton(String name) {
        super(name);
        setStyle("color", "black");
        setStyle("font-weight", "normal");
        setStyle("text-decoration", "none");
    }

    public LinkButton(String name, String label) {
        super(name, label);
        setStyle("color", "black");
        setStyle("font-weight", "normal");
        setStyle("text-decoration", "none");
    }

    public LinkButton() {
        setStyle("color", "black");
        setStyle("font-weight", "normal");
        setStyle("text-decoration", "none");
    }

    // --------------------------------------------------------- Public Methods

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    /**
     * @see net.sf.click.Control#render(HtmlStringBuffer)
     */
    public void render(HtmlStringBuffer buffer) {
        String href = getHref();
       
        if (StringUtils.isBlank(href)) {
            throw new IllegalStateException("href is not defined.");
        }
       
        if (href.startsWith("/")) {
            href = getContext().getRequest().getContextPath() + href;
        }
       
        buffer.elementStart("a");
        buffer.appendAttribute("target", getTarget());
        buffer.appendAttribute("title", getTitle());
        buffer.appendAttribute("href", href);
       
        appendAttributes(buffer);
       
        buffer.closeTag();
        buffer.append(getLabel());
        buffer.elementEnd("a");
    }
}


On Thu, Jun 5, 2008 at 7:07 AM, Demetrios Kyriakis <[hidden email]> wrote:


Ozakca, Muzaffer wrote:
>
> In your CSS, define menuButton to draw a border around itself and do other
> fancy buttonish styling. That will create a faux button easily. You can
> make CSS specific to this button deployable automatically. You will also
> need to parameterize the link and the label. I think the other method will
> be using CSS and javascript instead.
>
Sorry but this is exactly what I did *not* asked in the parrent message:
-------
"a button(not a styled link) that points to link(URL) (full link with
support for parameters -
maybe PageLink) directly, without a roundtrip to the server like the
ActionButton + setRedirect() trick"
-------

Any ideas how to make it work with a button? It is very important that the
parameters work (automatic parameters like jSessionID, or TableControl
parameters should work too) .

Thank you,

Demetrios.
--
View this message in context: http://www.nabble.com/-Control-Wishlist--LinkButton.-tp17274531p17656648.html
Sent from the click-user mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user
Bob Schellink-2

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
In reply to this post by Demetrios Kyriakis
Demetrios Kyriakis wrote:

> "a button(not a styled link) that points to link(URL) (full link with
> support for parameters -
> maybe PageLink) directly, without a roundtrip to the server like the
> ActionButton + setRedirect() trick"

So its not a <a> but a <button>? And it lives outside a <form> tag?
You will have to use javascript or ajax to submit to the server. Is
this what you want?


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user
Demetrios Kyriakis

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
Demetrios Kyriakis

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
In reply to this post by Malcolm Edgar-2
Malcolm Edgar-2 wrote:
Below is a LinkButton we have used, note you will need to style it to your
own needs.

        LinkButton viewSubmissionButton = new LinkButton("ViewSubmission");
        viewSubmissionButton.setTarget("_blank");
        viewSubmissionButton.setHref(href);
        viewSubmissionButton.setTitle("View Form Submission");
        viewSubmissionButton.setAttribute("class", "linkButton");
        form.add(viewSubmissionButton);
The example is nice, and I think it should be included in click-examples too.
However this is *not* what I requested in the parent posts :), because your approach has several disadvantages:

- It's an 'a' HTML tag, so crawlers will follow it (as well as google toolbar an the like for protected applications). Many crawlers also don't respect the "no follow" directives :).

- "button" tags have "native" look and feel (different on each platform and even for the same platform is OS theme dependent). To simulate this with CSS on an 'a' tag is very hard and allot of work - also the CSS is not aware about the specific active OS theme, so one could say that it's almost impossible.


So the only way to make something look and behave like the other buttons in the page is to really use a 'button' HTML tag. This is why I posted my "wish" on this list.
(Partially the existing "ActionButton" does the job, but it requires an extra server roundtrip, and also setRedirect() does not support request paramters or AbstractLinks in signature)

Thank you,

Demetrios.
Bob Schellink-2

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
Hi Demetrios,

I don't think what you want is possible with HTML. Or rather it is
possible but with restrictions.

A <button> cannot submit to the server on its own. It must be inside a
Form. So when you create your control (lets call it a PageButton) you
must place it inside its very own Form.

So you could let the PageButton create its own Form and set the Form
action to the Page to submit to.

public MyPage extends PAge {
   public MyPage() {
     PageButton button = new PageButton(ThatPage.class);
     button.setParameter("key1", "value1");
     button.setParameter("key2", "value2");
     addControl(button);
   }
}

If you were to print the button out it should be something like:

<form action="someContext/that.htm?key1=value1&key2=value2">
   <button type="submit"/>
</form>

The button should create its own Form and set the Form action to its
parameters and href.


The only alternative I know of is Javascript+Ajax.

kind regards

bob

Demetrios Kyriakis wrote:

>
> Malcolm Edgar-2 wrote:
>> Below is a LinkButton we have used, note you will need to style it to your
>> own needs.
>>
>>         LinkButton viewSubmissionButton = new
>> LinkButton("ViewSubmission");
>>         viewSubmissionButton.setTarget("_blank");
>>         viewSubmissionButton.setHref(href);
>>         viewSubmissionButton.setTitle("View Form Submission");
>>         viewSubmissionButton.setAttribute("class", "linkButton");
>>         form.add(viewSubmissionButton);
>>
> The example is nice, and I think it should be included in click-examples
> too.
> However this is *not* what I requested in the parent posts :), because your
> approach has several disadvantages:
>
> - It's an 'a' HTML tag, so crawlers will follow it (as well as google
> toolbar an the like for protected applications). Many crawlers also don't
> respect the "no follow" directives :).
>
> - "button" tags have "native" look and feel (different on each platform and
> even for the same platform is OS theme dependent). To simulate this with CSS
> on an 'a' tag is very hard and allot of work - also the CSS is not aware
> about the specific active OS theme, so one could say that it's almost
> impossible.
>
>
> So the only way to make something look and behave like the other buttons in
> the page is to really use a 'button' HTML tag. This is why I posted my
> "wish" on this list.
> (Partially the existing "ActionButton" does the job, but it requires an
> extra server roundtrip, and also setRedirect() does not support request
> paramters or AbstractLinks in signature)
>
> Thank you,
>
> Demetrios.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user
Demetrios Kyriakis

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
sabob wrote:
I don't think what you want is possible with HTML. Or rather it is
possible but with restrictions.

A <button> cannot submit to the server on its own. It must be inside a
Form. So when you create your control (lets call it a PageButton) you
must place it inside its very own Form.
But how comes that the actual ActionButton:
http://click.sourceforge.net/docs/click-api/net/sf/click/control/ActionButton.html
can exist outside a Form?
From that javadoc:
-----
"Please Note do not add ActionButton instances to the Form object, as the GET request it generates will never be processed by the Form, and in turn the Form will not invoke the ActionButton's onProcess() method"
-----

Thank you,

Demetrios.
Bob Schellink-2

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
Hi Demetrios,

It uses javascript :)

<input type="button"
onclick="javascript:document.location.href='/click-examples/control/action-demo.htm?actionButton=button';"/>

regards

bob

Demetrios Kyriakis wrote:

>
> sabob wrote:
>> I don't think what you want is possible with HTML. Or rather it is
>> possible but with restrictions.
>>
>> A <button> cannot submit to the server on its own. It must be inside a
>> Form. So when you create your control (lets call it a PageButton) you
>> must place it inside its very own Form.
>>
> But how comes that the actual ActionButton:
> http://click.sourceforge.net/docs/click-api/net/sf/click/control/ActionButton.html
> can exist outside a Form?
>>From that javadoc:
> -----
> "Please Note do not add ActionButton instances to the Form object, as the
> GET request it generates will never be processed by the Form, and in turn
> the Form will not invoke the ActionButton's onProcess() method"
> -----
>
> Thank you,
>
> Demetrios.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user
Ahmed Mohombe

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
In reply to this post by Demetrios Kyriakis
>> I don't think what you want is possible with HTML. Or rather it is
>> possible but with restrictions.
>>
>> A <button> cannot submit to the server on its own. It must be inside a
>> Form. So when you create your control (lets call it a PageButton) you
>> must place it inside its very own Form.
>>
> But how comes that the actual ActionButton:
> http://click.sourceforge.net/docs/click-api/net/sf/click/control/ActionButton.html
> can exist outside a Form?
>>From that javadoc:
> -----
> "Please Note do not add ActionButton instances to the Form object, as the
> GET request it generates will never be processed by the Form, and in turn
> the Form will not invoke the ActionButton's onProcess() method"
> -----

Hi Demetrios,

Below is a simple implementation of a PageLinkButton (I guess this is what you want to have).

If the other developers agree, I'll check it in.

PageLinkButton.java:
-----------------------------------
package net.sf.click.extras.control;

import net.sf.click.control.PageLink;
import net.sf.click.util.HtmlStringBuffer;

/**
  * PageLink rendered as push button.
  *
  */
public class PageLinkButton extends PageLink {
     public PageLinkButton(String name) {
         super(name);
     }

     public PageLinkButton(String name, Class targetPage) {
         super(name, targetPage);
     }

     public PageLinkButton(String name, String label, Class targetPage) {
         super(name, label, targetPage);
     }

     public PageLinkButton(Class targetPage) {
         super(targetPage);
     }

     public PageLinkButton() {
     }

     /**
      * Return a HTML rendered Button string. Note the button label is rendered
      * as the HTML "value" attribute.
      *
      * @see Object#toString()
      *
      * @return a HTML rendered Button string
      */
     public String toString() {
         HtmlStringBuffer buffer = new HtmlStringBuffer(40);

         buffer.elementStart("input");

         buffer.appendAttribute("type", "button");
         buffer.appendAttribute("name", getName());
         buffer.appendAttribute("id", getId());
         buffer.appendAttribute("value", getLabel());
         buffer.appendAttribute("title", getTitle());
         if (getTabIndex() > 0) {
             buffer.appendAttribute("tabindex", getTabIndex());
         }

         String onClickAction = " onclick=\"" + getOnClick() + "\"";
         buffer.append(onClickAction);

         appendAttributes(buffer);

         if (isDisabled()) {
             buffer.appendAttributeDisabled();
         }

         buffer.elementEnd();

         return buffer.toString();
     }
     /**
      * Return the Button anchor <a> tag href attribute value.
      *
      * @return the Button anchor <a> tag HTML href attribute value
      */
     public String getOnClick() {
         return "javascript:document.location.href='"
                + getHref()
                + "';";
     }
}
--------------------------------------

Ahmed.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user
Demetrios Kyriakis

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
Ahmed Mohombe wrote:
>> I don't think what you want is possible with HTML. Or rather it is
>> possible but with restrictions.
>>
>> A <button> cannot submit to the server on its own. It must be inside a
>> Form. So when you create your control (lets call it a PageButton) you
>> must place it inside its very own Form.
>>
> But how comes that the actual ActionButton:
> http://click.sourceforge.net/docs/click-api/net/sf/click/control/ActionButton.html
> can exist outside a Form?
>>From that javadoc:
> -----
> "Please Note do not add ActionButton instances to the Form object, as the
> GET request it generates will never be processed by the Form, and in turn
> the Form will not invoke the ActionButton's onProcess() method"
> -----
Below is a simple implementation of a PageLinkButton (I guess this is what you want to have).
Thank you very much :). This is exactly what I need :).
I tested it with click 1.4.2 only and it works.

Ahmed Mohombe wrote:
If the other developers agree, I'll check it in.
Please include it in Click if it's possible. It would be practical in many application because ActionButton is just not the right control for many cases.

What is the standard procedure to get the agreement(to include such a control) of the other developers at Click project?

Thank you,

Demetrios.
Malcolm Edgar-2

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
Hi Demetrios,

Please raise a JIRA feature request.

www.avoka.com/jira/

regards Malcolm Edgar

On Tue, Jun 10, 2008 at 10:22 PM, Demetrios Kyriakis
<[hidden email]> wrote:

>
>
> Ahmed Mohombe wrote:
>>
>>>> I don't think what you want is possible with HTML. Or rather it is
>>>> possible but with restrictions.
>>>>
>>>> A <button> cannot submit to the server on its own. It must be inside a
>>>> Form. So when you create your control (lets call it a PageButton) you
>>>> must place it inside its very own Form.
>>>>
>>> But how comes that the actual ActionButton:
>>> http://click.sourceforge.net/docs/click-api/net/sf/click/control/ActionButton.html
>>> can exist outside a Form?
>>>>From that javadoc:
>>> -----
>>> "Please Note do not add ActionButton instances to the Form object, as the
>>> GET request it generates will never be processed by the Form, and in turn
>>> the Form will not invoke the ActionButton's onProcess() method"
>>> -----
>> Below is a simple implementation of a PageLinkButton (I guess this is what
>> you want to have).
>>
> Thank you very much :). This is exactly what I need :).
> I tested it with click 1.4.2 only and it works.
>
>
> Ahmed Mohombe wrote:
>>
>> If the other developers agree, I'll check it in.
>>
> Please include it in Click if it's possible. It would be practical in many
> application because ActionButton is just not the right control for many
> cases.
>
> What is the standard procedure to get the agreement(to include such a
> control) of the other developers at Click project?
>
> Thank you,
>
> Demetrios.
> --
> View this message in context: http://www.nabble.com/-Control-Wishlist--LinkButton.-tp17274531p17754074.html
> Sent from the click-user mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Click-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/click-user
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user
Demetrios Kyriakis

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
Malcolm Edgar-2 wrote:
Hi Demetrios,

Please raise a JIRA feature request.

www.avoka.com/jira/
Done.
It is the issue CLK-392:
http://www.avoka.com/jira/browse/CLK-392

I hope it can be included soon.

Thank you,

Demetrios.
Bob Schellink-2

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
In reply to this post by Ahmed Mohombe
Hi Ahmed,

Looks very good. Perhaps we should call it PageButton (we already have
PageLink) which is analogous to ActionLink and ActionButton.

kind regards

bob

Ahmed Mohombe wrote:

>>> I don't think what you want is possible with HTML. Or rather it is
>>> possible but with restrictions.
>>>
>>> A <button> cannot submit to the server on its own. It must be inside a
>>> Form. So when you create your control (lets call it a PageButton) you
>>> must place it inside its very own Form.
>>>
>> But how comes that the actual ActionButton:
>> http://click.sourceforge.net/docs/click-api/net/sf/click/control/ActionButton.html
>> can exist outside a Form?
>> >From that javadoc:
>> -----
>> "Please Note do not add ActionButton instances to the Form object, as the
>> GET request it generates will never be processed by the Form, and in turn
>> the Form will not invoke the ActionButton's onProcess() method"
>> -----
>
> Hi Demetrios,
>
> Below is a simple implementation of a PageLinkButton (I guess this is what you want to have).
>
> If the other developers agree, I'll check it in.
>
> PageLinkButton.java:
> -----------------------------------
> package net.sf.click.extras.control;
>
> import net.sf.click.control.PageLink;
> import net.sf.click.util.HtmlStringBuffer;
>
> /**
>   * PageLink rendered as push button.
>   *
>   */
> public class PageLinkButton extends PageLink {
>      public PageLinkButton(String name) {
>          super(name);
>      }
>
>      public PageLinkButton(String name, Class targetPage) {
>          super(name, targetPage);
>      }
>
>      public PageLinkButton(String name, String label, Class targetPage) {
>          super(name, label, targetPage);
>      }
>
>      public PageLinkButton(Class targetPage) {
>          super(targetPage);
>      }
>
>      public PageLinkButton() {
>      }
>
>      /**
>       * Return a HTML rendered Button string. Note the button label is rendered
>       * as the HTML "value" attribute.
>       *
>       * @see Object#toString()
>       *
>       * @return a HTML rendered Button string
>       */
>      public String toString() {
>          HtmlStringBuffer buffer = new HtmlStringBuffer(40);
>
>          buffer.elementStart("input");
>
>          buffer.appendAttribute("type", "button");
>          buffer.appendAttribute("name", getName());
>          buffer.appendAttribute("id", getId());
>          buffer.appendAttribute("value", getLabel());
>          buffer.appendAttribute("title", getTitle());
>          if (getTabIndex() > 0) {
>              buffer.appendAttribute("tabindex", getTabIndex());
>          }
>
>          String onClickAction = " onclick=\"" + getOnClick() + "\"";
>          buffer.append(onClickAction);
>
>          appendAttributes(buffer);
>
>          if (isDisabled()) {
>              buffer.appendAttributeDisabled();
>          }
>
>          buffer.elementEnd();
>
>          return buffer.toString();
>      }
>      /**
>       * Return the Button anchor <a> tag href attribute value.
>       *
>       * @return the Button anchor <a> tag HTML href attribute value
>       */
>      public String getOnClick() {
>          return "javascript:document.location.href='"
>                 + getHref()
>                 + "';";
>      }
> }
> --------------------------------------
>
> Ahmed.
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user
Ahmed Mohombe

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
> Looks very good. Perhaps we should call it PageButton (we already have
> PageLink) which is analogous to ActionLink and ActionButton.
Another possibility would be not to make a new control, but to just add
a new attribute to PageLink (in order to reduce the too high fragmetation of
components with similar features - in this case PageButton has almost 100% the same signature
with PageLink).
e.g. attribute - displayType="link" (default, with rendering as it is now) and displayType="button"
this new button rendering.

What do you think?

Ahmed.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user
Bob Schellink-2

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
Hi Ahmed,

Ahmed Mohombe wrote:
> Another possibility would be not to make a new control, but to just add
> a new attribute to PageLink (in order to reduce the too high fragmetation of
> components with similar features - in this case PageButton has almost 100% the same signature
> with PageLink).
> e.g. attribute - displayType="link" (default, with rendering as it is now) and displayType="button"
> this new button rendering.

Good catch, the fragmentation is something to be careful of. We also
have PageSubmit in extras.

My only concern is if the two controls (PageLink and PageButton)
evolve differently. As features are added to link they might not fit a
button and vice versa. Also the documentation for PageLink becomes
blurred as we have to explain that PageLink can be rendered as a
button too.

> What do you think?

Hmm I would prefer keeping it as PageButton in the extras package for now.

kind regards

bob

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user
Malcolm Edgar-2

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
+1 on making it a separate button. I presume we would be putting this
in extras.controls.

regards Malcolm Edgar

On Wed, Jun 11, 2008 at 5:06 AM, bob <[hidden email]> wrote:

> Hi Ahmed,
>
> Ahmed Mohombe wrote:
>> Another possibility would be not to make a new control, but to just add
>> a new attribute to PageLink (in order to reduce the too high fragmetation of
>> components with similar features - in this case PageButton has almost 100% the same signature
>> with PageLink).
>> e.g. attribute - displayType="link" (default, with rendering as it is now) and displayType="button"
>> this new button rendering.
>
> Good catch, the fragmentation is something to be careful of. We also
> have PageSubmit in extras.
>
> My only concern is if the two controls (PageLink and PageButton)
> evolve differently. As features are added to link they might not fit a
> button and vice versa. Also the documentation for PageLink becomes
> blurred as we have to explain that PageLink can be rendered as a
> button too.
>
>> What do you think?
>
> Hmm I would prefer keeping it as PageButton in the extras package for now.
>
> kind regards
>
> bob
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Click-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/click-user
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user
Ahmed Mohombe

Re: [Control Wishlist] LinkButton.

Reply Threaded More More options
Print post
Permalink
> +1 on making it a separate button. I presume we would be putting this
> in extras.controls.
Done.

It's in SVN now, and of course it's in "extras.controls"

The example usage is however in: Controls/Link Controls Demo Page , since
this is the closest example page: it behaves more like a link, and it's not an "action" control to
put it in the Action Controls Demo page.

Ahmed.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Click-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/click-user