I would like to change the background color of a place bar button when the button is clicked. How can I do this? I have considered using Dojo or JavaScript but I don't see how I can get an "id" for the place bar button.
"Another solution like Steve Zavocki in green." This Code is not Using jQuery so you dont have to integrate jQuery.js in your application you can do this using native javascript and dojo wich is already integrated in XPages so you dont have much overhead.
There are other ways to get an element with javascrip:
document.getElementById
dcoument.getElementsBy ClassName, Name, TagName, TagNameNs
with dojo or like Steve used in his code with jQuery:
<xp:button value="ChangeColor" id="button1">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script><![CDATA[var placebar = document.getElementsByClassName("lotusPlaceBar")[0]; //place bar should be unique
placebar.style.backgroundColor = "green";
placebar.style.backgroundImage = "none";
//.. more styling;]]></xp:this.script>
</xp:eventHandler>
</xp:button>
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다