uicomponents

What is the difference between put and add method in statehelper in JSF 2

假如想象 提交于 2021-01-28 22:04:27
问题 What is the difference between: Object put(Serializable key, Object value) void add(Serializable key, Object value) methods in StateHelper in JSF? 回答1: I found the api documentation not that helpful myself and investigated it. Each time add is called it appends another value to a list which is saved under the given key. If you call a get on that key you get back a list. The add method saves you creating that list and watches for corner cases, ex. creating the list when the key is empty. The

Applying gradient coloring with one parameter

我是研究僧i 提交于 2020-01-07 02:01:48
问题 I have differnet boxes that have a certain double parameter. This parameter should determine what color the box has. The coloring should start with one color for the double value 0.0 (perhaps blue) and should end with another color for 1.0 (perhaps red). It is more or less what is done here or Conditional coloring based on a gradient. There are different ways to define a color as stated in Oracle Docs, but it seems quiet difficult to calculate a gradient with these definitions. Does anyone

How to update screen in blackberry?

孤人 提交于 2019-12-24 01:38:09
问题 i am developing one app. and i am facing a problem related to updating the screen,which is already in stack.I tried to use myappscreen.invalidate() on button click,but it doesn't update screen. Please help me to solve this problem. 回答1: Is your screen the active screen? To redraw the active screen, you should just need to call the invalidate() method to cause the screen to refresh. Where are you calling invalidate() from? You cannot call invalidate() from a Timer thread unless you have got an

How to update screen in blackberry?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 01:37:58
问题 i am developing one app. and i am facing a problem related to updating the screen,which is already in stack.I tried to use myappscreen.invalidate() on button click,but it doesn't update screen. Please help me to solve this problem. 回答1: Is your screen the active screen? To redraw the active screen, you should just need to call the invalidate() method to cause the screen to refresh. Where are you calling invalidate() from? You cannot call invalidate() from a Timer thread unless you have got an

JSF 2.0: How to add UIComponents and their contents to view root?

做~自己de王妃 提交于 2019-12-22 11:24:19
问题 I am building a custom UIComponent and adding elements (and other stock UIComponents) inside it. The component renders ok, however it cannot be found from the ViewRoot . Let's say I have: ResponseWriter writer; @Override public void encodeBegin(FacesContext context) throws IOException { writer = context.getResponseWriter(); writer.startElement("div", this); writer.writeText("testing", null); writer.writeAttribute("id", getClientId(context) + ":testDiv", null); } @Override public void

Find component by type in JSF

元气小坏坏 提交于 2019-12-18 13:30:34
问题 My question is related to this one Get all hidden input fields in JSF dynamically but it's not the same as I want to work with JSF and not plain HTML, and assuming that I have the following in my .xhtml file: <h:inputHidden id="name1" value="SomeValue1"/> <h:inputHidden id="name2" value="SomeValue2"/> I developed a small code where I tried to get all the h:inputHidden tags dynamically and print their values to the console, but the problem is that I can't figure out a way how to make

JSF2 + IceFaces 2 - Retrieve UIComponent from ViewRoot

爷,独闯天下 提交于 2019-12-13 06:22:35
问题 I've got hard time resolving the following. My problem is quite simple : I would like to highlight in red the forms fields that triggered validation errors. The error messages are placed correctly in the FacesContext using a context.addMessage(...) line. I'd like my system to be generic. All form fields having a message attached are automatically highlighted. I've found on this site a link to this excellent article : http://www.jroller.com/mert/entry/how_to_find_a_uicomponent With it, I did

ActionScript 3: UIScrollBar bug(?) - width of container returns +85px

社会主义新天地 提交于 2019-12-12 01:07:42
问题 Using Flash CS5 I came across something odd today. The UIScrollBar component has the rigid width of 15px. When you add it to a container such as a Sprite, you'd expect the width of the sprite to return 15, but it returns 100 instead! Here's an example code. import flash.display.Sprite; import fl.controls.UIScrollBar; var spr:Sprite = new Sprite(); addChild(spr); trace('spr.width:',spr.width); var bar:UIScrollBar = new UIScrollBar(); spr.addChild(bar); trace('bar.width',bar.width); trace('spr

get width of dynamically created custom uicomponent

浪尽此生 提交于 2019-12-11 11:19:20
问题 I have some custom components, that derived from UIComponent. I overloaded the updateDisplayList so they have custom look. I've created a layouter that lays out these custom components, but to place them correctly, I have to know the custom componets width, height. They are created dynamically. After all of them created (creationCompleted event fired for every), i try to laying out them, but width/height property is still 0. I am also tried to add them to a canvas, before the layout process.

JSF 2: Change rendered atribute of a component on phase listener

给你一囗甜甜゛ 提交于 2019-12-11 06:24:41
问题 Hy guys, In JSF 2 How can I change the rendered atribute of a h:InputText component using a PhaseListener. Before the jsf page be rendered I have to verify all id of the h:inputtexts, and after that I will change the atribute to be rendered or not. Am I clear? 回答1: On GET requests, the view root is not created yet during the before phase of the render response and during the after phase it's too late because the response is already been rendered and sent to the client. The view root is