I want to set the hover property to a button through the CSS but I think Servoy does not implement this functionality.
I am implementing the correct hover property but it does not work.
After following your code, this is what I am doing?
function onShowForm(){
plugins.WebClientUtils.addCssReference('http://localhost:8080/ron.css');
plugins.WebClientUtils.setExtraCssClass(elements.submit,'ron.css');
}
Am I doing it right? ron.css is my css file. I dont know whether I am giving the proper parameters.
I run the code but there is no error.
Look at the difference between your code and Nirav’s code. You are not defining or referencing the css style correctly.
“on the start up of the solution”…select the activated module in Servoy developer and look at the properties view. A number of solution specific events there (startup, shutdown, etc).
Please have a look on the snapshot that is attached below:
When I see the properties view, there is no mention of solution specific events such as startup or shut down.
However, I have seen startup and shut down when I go to the preferences section under the window tab.
I just do not feel like leaving this at this point because it is very important for me to show this to my project leader.
Corresponds to this location: C:/servoy/application_server/server/webapps/ROOT/servoy-webclient/nav-hover.css. You don’t have to define the complete url (‘http://localhost:8080…’).
If you put this in nav-hover.css file:
.main-tab:hover {color: red;}
You don’t see the element in red color when you pass the mouse over it. This is because if the element (or label/file/button…) has a default color, it overrides the color you set in the file. You have to code like this:
.main-tab:hover {color: red !important;}
You have to add !important at the end (but before the ;)
Regards,
maria.kyselova:
Are there ways to display a label as a hyperlink in smart client?
Not by default. Smoke and mirrors to get the browser behavior – you have to use two elements: your text label and then an image placed on top of the text label. The image object has an underline one pixel wide and however tall you want the rollover to be as the rollover image media property (don’t need the regular imageMedia property). Stretch image object to size and place on top of the text object. Then attach whatever methods to the image object instead of the text object.
maria.kyselova:
Are there ways to display a label as a hyperlink in smart client?
Not by default. Smoke and mirrors to get the browser behavior – you have to use two elements: your text label and then an image placed on top of the text label. The image object has an underline one pixel wide and however tall you want the rollover to be as the rollover image media property (don’t need the regular imageMedia property). Stretch image object to size and place on top of the text object. Then attach whatever methods to the image object instead of the text object.
The way to show a label as hyperlink is just setting the text of the label to a bit of HTML that contains a hyperlink, like:
<html><a href="#">test</a></html>
You assign your action method to the onAction of the label and uncheck the showClick checkbox.
You won’t get the behavior that David refers to where the underline is hidden when you don’t hover over the link, but from a UX point of view it is debatable if you want that behavior: Links should look like links, so always underlined
pbakker:
The way to show a label as hyperlink is just setting the text of the label to a bit of HTML that contains a hyperlink, like:
<html><a href="#">test</a></html>
You assign your action method to the onAction of the label and uncheck the showClick checkbox.
You won’t get the behavior that David refers to where the underline is hidden when you don’t hover over the link, but from a UX point of view it is debatable if you want that behavior: Links should look like links, so always underlined
pbakker:
The way to show a label as hyperlink is just setting the text of the label to a bit of HTML that contains a hyperlink, like:
<html><a href="#">test</a></html>
You assign your action method to the onAction of the label and uncheck the showClick checkbox.
You won’t get the behavior that David refers to where the underline is hidden when you don’t hover over the link, but from a UX point of view it is debatable if you want that behavior: Links should look like links, so always underlined
Paul
Paul, the hyperlink implemented in the way you suggested is the standard bright blue colour.
Can I apply a different colour to it?
Doesn’t fit in my theme otherwise.
Also, I’ve tried a few options but my i18n’ed label won’t translate properly if I put it inside html tags?
pbakker:
The way to show a label as hyperlink is just setting the text of the label to a bit of HTML that contains a hyperlink, like:
<html><a href="#">test</a></html>
You assign your action method to the onAction of the label and uncheck the showClick checkbox.
You won’t get the behavior that David refers to where the underline is hidden when you don’t hover over the link, but from a UX point of view it is debatable if you want that behavior: Links should look like links, so always underlined
Paul
Paul, i18n doesn’t seem to work on the label in this solution.