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
-------------------------------------------------------------------------
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