How to get not truncated text from IUITextField - apache-flex

I have created a custom column header renderer for my AdvancedDataGrid which has a text and a little button inside. Everything works just fine, until a moment when I have to return a headerText by the button click.
Since my custom renderer is an extention of AdvancedDataGridHeaderRenderer it has inherited property label which is IUITextField. So, when I call label.text from inside the custom renderer I get only truncated text, but I need the original one.
Any idea how to get not truncated text from IUITextField? Or maybe the original text is stored somewhere else and I am looking in a wrong place?

You can read the header text from the headerText property of the corresponding AdvancedDataGridColumn

Related

Binding column text property to another property with refresh (JavaFX)

Could somebody tell me how shold I approach binding the text property of a column header in a TableView to another property, that can be changed with a combobox selection?
I tried column.textProperty().bind(myProperty) , but the column header doesn't refresh the text when myProperty changes. It only happens after I click on the column header as if I wanted to sort the column. Is there any way to make it refresh automatically when changed ? Or does anybody have other suggestions how to approach this ?
Found out it was because I've accidentally put the method that changes the property into a block that runs in a separate thread.

JavaFX how to show read-only text?

I want to show some text in my program and I tried with TextArea. However, the text shown is changeable. How can I make the text read only?
I did it like this:
#FXML
private TextArea myText;
and then added the following code to initialise():
myText.setEditable(false);
I needed read-only text fields, but setting the disabled property used styling which was not correct in context (in my scenario, the text field was an input to a search function where a value could be fixed in some cases - disabling the text field implied that it was not part of the search, rather than the value was fixed).
In the end I landed up using:
txtInput.setEditable(false);
txtInput.setMouseTransparent(true);
txtInput.setFocusTraversable(false);
This results in a normal looking text field that is non-reactive to the user.
Maybe just a text would serve the purpose.
Or if you want to show the text in a text field, then:
tf.setDisable(true)
In FXML, add editable="false" to your TextField tag.
Or uncheck the "Editable" checkbox in Scene Builder.
I would say just use a Label.
<TextField fx:id="input" disable="true"/>
You can use following statement in order to make text-area object non-editable with auto scrollbar:
textAreaObjectName.setEditable(false);
Hint: After setting the text to that respective textarea object using textAreaObjectName.setText() method.

How to change datagrid cell's itemRenderer dynamically

i have a simple datagrid having 2 columns named as image and place. where image column has mx.controls.Image itemRenderer and place is simple. my requirement is to change itemRenderer of image cell when it will be clicked. i means to say when user click on any image from image column than i want to show that image path in editable mode and when user edit that path then the selected cell will start displayed the updated image.
i dont know how to do this and getting depressed . please anyone help me ! :(
You don't need to change itemRenderer for that - just implement that code in your single item renderer. You can add listeners inside it and change the contents of the current cell.
I suggest when going into editable mode for your DataGrid: Also create an itemEditor for your Image column, make it an extended TextInput class. This extended TextInput class will change the data object's imageAddress/url when you are done editing ("itemEditEnd" event).
Let me know if this helps, thanks!

How to populate long text in dropdownlist in asp.net

In asp.net, am trying to populate a dropdownlist box with very long text. I have fixed the width of list on the page and i don't want to change its size as it would affect my page layout. On clicking the dropdownlist, the text gets truncated to the size of the dropdown. I want to see the entire text without any truncation, without changing the size of the dropdownlist box..Also if there are any third party controls which would solve this problem?Would be very helpful if there's a solution for this.
Update:
Right now am trying a dropdown box in Jquery that will wrap the text if it exceeds the size..but again the problem is it works fine on an independent solution but when i integrate it with my application, it does not read the .css file and it does not do any formatting(style, font, alignment) that it is supposed to do according to the .css file.Any idea why this is happening?
The problem that you're describing is restricted to IE (it might be fixed in the latest version, I haven't tested).
In the past, I've had success with binding javascript methods to the onClick event on the drop down to increase the width, and the onBlur event to set the width back to its original value.
You might be able to use jQuery to create a tooltip like thing that appears when you hover over each option.
something like
// this executes on page load - just like asp.net Page_load()
function pageLoad(){
// attach a mouseover event to each option in your dropdown
$("#myDropdown option").mouseover(function(){
// get the text from that option
var text = $("#"+this.id).text();
// display that text in a small tooltip
showToolTip(text);
});
}
function showToolTip(text){
// display in some way
}
there's a javascript library called wz_tooltip available at walterzorn.com
hope that helps

Passing variables from one form to another in Qt

I've got two forms, the mainform which opens up a dialog box that has a text box in it. How can I pass the text from the textbox back to the mainform? I've tried alot of different methods but I think I'm missing something simple. Thanks for any help.
The dialog box still exists after it closes. So you can, from the main form, do something like this:
QString text = subform->textEdit->text();
This assumes your dialog box is subform and the name you gave to the text edit box is textEdit. Make sure you make textEdit public in the designer.
If you don't want to make textEdit public, then you can add a getter to subform.
If you use the MVC pattern, you create the model object (container for your data) and pass to the text box to fill in the text value itself. When the dialog is closed, just read the value from the model and put it wherever you need it.

Resources