I have some PhoneTextBox and their values can't be null. So are REQUIRED. Is There a simple method to do that like in Android?
Related
I'm trying to make a dropdown list with the code sandbox in the palantir slate, but I can't capture the selected value of the button in a function like the existing dropdown button, is there any way to capture this value with the code sandbox?
This is my code sandbox button
I am trying to capture the selected button value from this function tab
I am new to stack overflow, if you need more information just let me know, I am grateful to everyone who has offered to help me.
I tried to capture the value with selectedValues but apparently this option does not exist. I also tried with javascript for "document.getElementById("standard-select");"
but the console always returns undefined.
You want to get a value from the Code Sandbox to the Slate context.
You can follow this : https://www.palantir.com/docs/foundry/slate/widgets-advanced/#setstate
In short, You need to use the state of the Code Sandbox widget :
In the "Interaction" tab of the Code Sandbox, you need to specify an arbitrary state's variable, for instance : {"dropdownValue": "default_value"}
In your custom JS in Code Sandbox, you will store the value of interest (the value of your dropdown, for instance whenever it changes) in the state of the Code sandbox SlateFunctions.setState("dropdownValue", 4)
In your Slate's function, you can access the Code Sandbox state as any other variable : return {{w_mycodesandbox.state.dropdownValue}}
Whenever you call setState from your custom JS, you update the state, hence the variable the Slate function depends on, and dependencies will run as expected.
We can get a selected value from a Slate code sandbox by using the getSelectedValue() method. This method returns an object containing the currently selected value from the Slate code sandbox. The object contains the value, type, and range for the selection.
https://github.com/primefaces-extensions/primefaces-extensions/blob/master/core/src/main/java/org/primefaces/extensions/renderer/CommandButtonSingleClickRenderer.java
This appears to be an elegant solution to disable and enable PrimeFaces CommandButton and available in version 8 and up of PrimeFaces.
Unfortunately, I'm unable to compile it in PrimeFaces 6.1, Java 8.
It now compiles with the suggested update, Thanks, but the method doesn't return the correct type - String.
It could be related to the structure of our DOM, we have multiple layers of xhtml, the first loaded index.xhtml doesn't have any buttons. But the CommandButtonSingleClickRenderer.java is being called. The properties of the CommandButton are all default values.
protected String getAttributeValue(final FacesContext context, final CommandButton button, final String attribute)
returns null
Added a check for null prior to the call to getToggleJS to get the pages with buttons loaded.
What is required in the commandButton ?
How do you call the CommandButtonSingleClickRenderer from xhtml ?
In PrimeFaces 8, the default String resolveWidgetVar(FacesContext context) method was introduced in the Widget interface.
Before that, so in PrimeFaces 6.1, you should use button.resolveWidgetVar().
See also the source of CommandButtonRenderer in PrimeFaces 6.1.
I've injected some silly binding error in a large legacy project and am having trouble finding it.
This is the error output to the console:
warning: unable to bind to property 'length' on class 'String' (class
is not an IEventDispatcher)
I've tried stepping through with the debugger try to track down where this is happening but there are many thousands of lines of code and with event messaging, a very non-linear program execution.
Question: Is there any way to make Flash Builder break on a warning like this? If not, is there some other method, trick or hack for tracking this down?
This is caused by (wait for it...) trying to bind to a property that isn't marked as [Bindable]. In this case, you have a string variable whose length property is being used for data binding.
This is most likely caused by adding "myvar.length" as a property in the MXML tag for a component -- something like
<s:TextInput maxChars="{myInputString.length}" ...>
Flex will create the data binding for you automatically, but it doesn't realize at runtime that the property isn't Bindable - meaning, if there are changes to the property value the notification won't propagate to update the listeners.
Data binding uses mx.binding.PropertyWatcher to do the binding, and PropertyWatcher.updateParent is where the warning is output.
I'm using primefaces 3.5, and i have a DataTable component in my form.
When i try to use filters like this primefaces showcase, I'm getting this warning message:
WARNING: DataTable j_idt7:j_idt8:someList has filtering enabled but no filteredValue model reference is defined, for backward compatibility falling back to page viewstate method to keep filteredValue. It is highly suggested to use filtering with a filteredValue model reference as viewstate method is deprecated and will be removed in future.
Can anyone help?
From here :
See the user guide on page 133 'Data Filtering' in the chapter
dataTable. There is a new attribute filteredValue that should point to
a List in a ViewScoped managed bean to store the filtered values the
user typed in.
My good friend, Wikipedia, didn't give me a very good response to that question. So:
What are language bindings?
How do they work?
Specifically accessing functions from code written in language X of a library written in language Y.
Let's say you create a C library to post stuff to stackoverflow. Now you want to be able to use the same library from Python. In this case, you will write Python bindings for your library.
Also see SWIG: http://www.swig.org
In the context of code libraries, bindings are wrapper libraries that bridge between two programming languages so that a library that was written for one language can also be implicitly used in another language.
For example, libsvn is the API for Subversion and was written in C. If you want to access Subversion from within Java code you can use libsvn-java. libsvn-java depends on libsvn being installed because libsvn-java is a mere bridge between the Java programming language and libsvn, providing an API that merely calls functions of libsvn to do the real work.
Okay, now the question has been clarified, this isn't really relevant so I'm moving it to a new question
Binding generally refers to a mapping of one thing to another - i.e. a datasource to a presentation object. It can typically refer to binding data from a database, or similar source (XML file, web service etc) to a presentation control or element - think list or table in HTML, combo box or data grid in desktop software.
...If that's the kind of binding you're interested in, read on...
You generally have to bind the presentation element to the datasource, not the other way around. This would involve some kind of mapping - i.e. which fields from the datasource do you want to appear in the output.
For more information in a couple of environments see:
Data binding in .Net using Windows Forms
http://www.codeproject.com/KB/database/databindingconcepts.aspx
http://www.akadia.com/services/dotnet_databinding.html
ASP.NET data binding
http://support.microsoft.com/kb/307860
http://www.15seconds.com/issue/040630.htm
http://www.w3schools.com/ASPNET/aspnet_databinding.asp
Java data binding
http://www.xml.com/pub/a/2003/09/03/binding.html
Python data binding
http://www.xml.com/pub/a/2005/07/27/py-xml.html
General XML data binding
http://www.rpbourret.com/xml/XMLDataBinding.htm
In Flex (Actionscript 3). Source
A data binding copies the value of a property in one object to a property in another object. You can bind the properties of following objects: Flex components, Flex data models, and Flex data services.
The object property that provides the data is known as the source property. The object property that receives the data is known as the destination property.
The following example binds the text property of a TextInput component (the source property) to the text property of a Label component (the destination property) so that text entered in the TextInput component is displayed by the Label component:
<mx:TextInput id="LNameInput"></mx:TextInput>
...
<mx:Label text="{LNameInput.text}"></mx:Label>
Data binding is usually a simple way to bind a model to user interface components. For example, you have a class with a FirstName property. In flex you could easily bind that property to a textbox by setting the value of the textbox to {Object.FirstName}. Then, every time that FirstName property changes, the textbox will be updated without requiring you to write any code to monitor that property for changes.
Hope that helps.
Matt