FastReport "CheckBox" - fastreport

I am having a hard time trying to understand how to work with checkboxes in FastReport Editor. I simply try to change the checkbox from "Checked" to "Unchecked", but it seems to ignore my expression. I tried a variety of things to put inside the expression, but it always seem to ignore it and "Checked" is always true. Funny enough, if I change the binding to another database, "Checked" becomes false, no matter the expression.. How can I change the "checked" state using the expression? Maybe I got my spelling wrong or Idk.

i see the question is a little bit older now, so i don't know how relevant this still is for you.
but from first glance it seems you want your checkbox with the name CheckBox2 to not be checked, right?
in that case you just write down false in your expression. To show an empty box you also have to set a border in the border property. Otherwise there will be nothing to see.
if you want it to be checked if some other condition is met you write in your expression SomeCondition == someValue
Basically the expression is what you would write inside the brackets after an if in c#
if that is true your checkbox will be checked if not it won't.

Related

How to display ipywidgets.Dropdown without a value selected

No question anymore. The problem is older ipywidgets version behaviour that looks to be fixed in version 7.
The ipywidgets.Dropdown on its own picks up the first value out of the options list.I would like to display the widget without a value selected.The first value in the list is a pointless default that still needs to be reflected down the workflow path. I read a discussion where a developer went as far as adding empty string item into the list. That fixes the dropdown look (to some extent though as the placeholder attribute is still ignored) but adds a silly selectable empty item to the dropdown list. Adding dummy "None" item to the list is not much better solution.Setting value to None results in the "Invalid selection" exception.I do not understand why the ipywidgets.Dropdown does not follow approach of the simpler widgets where empty value is allowed and placeholder text is dispalyed to prompt the user to select something.Is there a way to make the widget selection not required? Some attribute setting I am not aware of? If that is impossible then what is the simplest possible workaround?
You can just set the dropdown value to None:
import ipywidgets as widgets
d = widgets.Dropdown(options=['hello', 'world'], value=None)
d
in 'ipywidgets' version 7.2.1 you will need to disable user changes to be able to display the widget by setting it to False like this:
d = widgets.Dropdown(options=['hello', 'world'], value=None, disabled=False)

How to control cursor (carat) position in TextInput in Flex 4.5

I need to handle diagraphs and then convert them on the fly to the proper unicode representation. For example when the user types in:
Sx
My app needs to replace it with:
Ŝ
Now, I've been able to do the replacement no problem. The issue though is that once I've done the replacement, the cursor goes to the beginning of the textbox rather than the end. As I'm trying to update the user's text on the fly, this obvious doesn't work.
How can I get it so that once I replace the text in the TextInput box, the cursor is on the right hand side rather than the left?
Found a solution.
All you have to do is instead of updating the whole text, wipe the current content and then use:
textInput.appendText()
Hopefully this will help someone else :)
The setSelection method is how you set the cursor
textInput.setSelection(textInput.text.length, textInput.text.length);
You can get the current beginning of the selection with TextInput.selectionAnchorPosition and the end of the selection with TextInput.selectionAnchorPosition
Take a look at this SO Question: How do you programmatically move the caret of a Flex TextArea to the end?
If you are using a textArea then this will work (from the selected answer):
textArea.selectionBeginIndex = textArea.length;
textArea.selectionEndIndex = textArea.length;
For the people coming here for the solution for the Spark textInput, this is the way:
textInput.selectRange(textInput.text.length, textInput.text.length);

ASP.NET Checkbox doesn't know what state it should be in

One interesting phenomenon I've noted today is that if a checkbox input is not checked, it is not included in the postback variables; no "_xyzcheckbox : off" corresponds with the "_xyzcheckbox: on" alternative (when 'checked').
This leads to an issue of storing check state if the checkbox is hidden on the server and then revealed later; the Checkbox does not know whether or not it is simply hidden (not in the DOM) or if it is being unchecked based on the postback that the browser sends back to the server, as the postback includes no reference to the checkbox if it is unchecked.
I am having an issue where I need to hide a checkbox (using .Visible = false on a parent of the checkbox) and show it depending on the users input, but the state cannot be persisted because of the aforementioned issue.
Has anyone else come across this issue? How have you solved it or gotten around it?
Note: The most obvious answer his hiding the checkbox on the client (setting display: none), this isn't an option though as we're trying to reduce the markup on the page so that postbacks are smaller.
Thanks for the feedback thus far.
Thanks :)
Rather than use .Visible (which removes the checkbox from the emitted markup, and therefore no chance of it being in a POST back), why not apply a CSS class to it?
The CSS could be as follows:
input.hidden {
display: none;
}
In your ASP.NET page simply set the CssClass property:
MyCheckbox.CssClass = "hidden";
And you should be fine.
In the mark-up, you can default selected = "false".
In the code-behind, you can determine the state by mycheckbox.checked, which will either return true or false.

Textfield value empty when I fill it with javascript

I am using modalpopup to enter some value in a textfield. After the value is selected in the modalpopup view, the modalpopup is closed and the value takes the appropriate value. Even if the value is displayed in the textfield, the textfield1.text returns an empty string. When I see the source code (html), I see that even the textfield isn't displaying anything; it hasn't really had this value input, because the appropriate html input field hasn't got a value yet.
This is the code I use to fill this textfield:
function CloseRequestModal(s)
{
document.getElementById('<%=txtRequest.ClientID%>').value = s;
var mpu = $find('<%=ModalPopupExtender3.ClientID%>');
mpu.hide();
}
Please help.
I would need to see source HTML cause it looks like you have template language mixed into your javascript but perhaps instead of "textfield1.text" you use "textfield1.value"?
Additionally, you would need to view "generated" source (with a browser plugin) or inspect the node with web inspector on safari/chrome or firebug on firefox in order to see the change that you made with javascript.
i fixed this problem in an alternate way.
even if the value is there (in the textfield), none of the events is fired, to let know the browser / compilator that the value really exists.
so i decided, despite editing the value of the textfield, i store this value in the session too. in this case, the value is displayed for user needed in the interface, and on the other hand i use the value that i stored in the session.

ASP.NET 3.5 - Making a field readonly/unmodifiable without "disabling" it

I have a web application with a form that has disabled fields in it. It allows a "Save As" function which basically means the settings can be copied into a new configuration (without being modified) and in the new configuration they can be changed to something else. The problem I am running into with this is that since the fields are disabled, they are not getting posted through and do not appear in the context object on the server side.
When I removed the logic to disable the fields, that part works fine. So the remaining problem is, how to "disable" the fields (not allow any change of the data in any of the entry fields) without really "disabling" them (so that the data gets posted through when saving)?
I was originally looking for a way to do this in CSS but not sure if it exists. The best solution is of course, the simplest one. Thanks in advance!
(Note: by 'disabled' I mean "The textboxes display but none of the text inside of them can be modified at all". It does not matter to me whether the cursor appears when you click inside it, though if I had a preference it would be no cursor...)
http://www.w3schools.com/TAGS/att_input_readonly.asp
readonly attribute is what you want.
i would suggest that instead of using the non-updateable field values from the page's inputs, you retrieve the original object from the DB and copy them from there. It's pretty trivial using something like Firebug to modify the contents of the page whose form will be posted back to modify the values, even if they are marked as readonly. Since you really want the values from the original, I would simply reget the object and copy them. Then you don't need to worry about whether the original (and non-updateable) properties get posted back at all.

Resources