"Create New" text box in GWT radio button group - gwt

In my GWT app I have a radio button group of choices. The last choice is to add a new item. What I want is that the words "create new xyz" to disappear, and to be replaced with a text box to take the input. What is the best way to do this? I have thought about using a disclosure panel, but that seems unnatural and I don't have it working properly yet.

Is it possible to write an onClickHandler for that radio button? If so, then inside that onClickHandler, add code to generate the textbox.

Related

How to create a form allowing multiple checkbox selection in Wix?

Does anyone know if there's a possibility to create a form where users can select multiple checkbox options instead of just one? I need users to be able to check multiple boxes. Any help for a newbie would be greatly appreciated.
I know I'm late, but if you're using Wix Forms, you can click on the form, click the plus sign, then click "Selection" in the left column, then click "Multi Checkbox Field" to get checkboxes where users can select more than one. Right now you're probably using Radio Buttons, which are often used as the default in most form templates but only allow for one box to be selected.

Should I provide new GWT place?

I have a general question for GWT Activity and Places paradigm realization
For example, I have a place "productList" and appropriate view ProductListView. A have a table with some Product entity in each row. I wanna to double click on row and got popup window which allow me to edit Product in doubleclicked row. How to implement it? Should I provide new place "editProduct" for this activity?
A popup dialog is not a place - users would not expect to see it when they press the back button. So there is no need to create a special EditProduct place.
You can think of "places" as something that users may want to see when they click on Back or Forward buttons, or something they want to bookmark.

Is there a way to uncheck all radio buttons in a group? (PyGTK)

Is there a way to uncheck all radio buttons in a group with PyGTK? No radio buttons are checked on startup, so I think there must be a way to return them all to that unchecked state.
I agree with Michael, but for the record this can be done.
One way to do this would be to have a hidden radio button that you could activate, which would then cause all the visible ones to be inactive. Quick n' Dirty example:
import gtk
window = gtk.Window()
window.set_default_size(200, 200)
rb1 = gtk.RadioButton()
rb2 = gtk.RadioButton()
rb3 = gtk.RadioButton()
rb2.set_group(rb1)
rb3.set_group(rb2)
rb3.set_active(True)
hbox = gtk.HBox()
hbox.add(rb1)
hbox.add(rb2)
hbox.add(rb3)
button = gtk.Button("Click me")
button.connect("clicked", lambda x: rb3.set_active(True))
hbox.add(button)
window.add(hbox)
window.show_all()
rb3.hide()
gtk.main()
There shouldn't be. By their nature, a radio button group is a 'pick one of many' type of control. From a human perspective, the idea is that one of them is always selected. The framework really should enforce that, so there really shouldn't be a 'none selected' state for the group. The none-selected state of a radio button group (in frameworks where it's possible) is very confusing to users, because that's not a state that they can get the control into.
If you want a 'none selected' state, I'd say you should add a 'none' element to the group, OR chose a different control type that conforms to what you want to do with it.
Looked it up in the source code and set_active simply simulates a click on the button if the new state is different from the old one. The radio button code then checks to see if there is another radio button in the group active and if not, it refuses to change as you noticed.
From what it looks the first radio button should always be set to active when you create the group (as expected). If it doesn't show it is likely a bug, it would be interested to see if radio_button.get_active is True for the first button you create (even if it doesn't show up in the UI).
I agree with Michael Kohne though that you should look into another UI element if you want to make all the radio buttons unselected.
My solution, which is notably not encouraged, Is to have a radio button in the same group that isn't shown on screen.
In Glade you can 'add widget as toplevel' in the context menu of the widget add button. In code I would imaging it's basically just don't add the widget to any displayed gui, or carefully don't .show() it (including .showall() on a parent)

Dynamic GWT Menu

How can I modify a GWT menu - grey out some entries, put a checkmark next to others, according to my application state?
My app has a menu bar across the top - File, Edit, View, Insert, Format, etc. I have a number of paragraphs, each of which could have a different format. When the user clicks on Format, I want the format menu to show a checkmark next to the menuItem that corresponds to the format of the currently selected paragraph. If some formats are inappropriate for the currently selected paragraph, I want to grey those menuItems out.
The main issue is when to do the update: (a) when the Format menu button is clicked, or (b) each time my user selects a new paragraph?
I find option (a) more appealing. But how can I detect this? A MenuItem doesn't have any facility for adding event listeners. It could be a mouseClick that I need, but it might be a mouseOver: if the user clicks on the Insert menuItem the Insert menu will appear, but then if the mouse is moved over Format, then the Format menu will appear.
Option (b) sounds simpler, but wastes more processor time.
For my contextMenu (right click on the paragraph), it's much easier, because the menu is only constructed when the right click happens.
I've resorted to using the square-root symbol (&#8730) for a tick. Does anyone know a nicer way? Do I need to use HTML and use " Plain-Format" for my menu item?
Finally, is there a way to disable (grey-out) a menu item so that it can't be selected?
Option (a) sounds better from a conserving resources point of view.
Instead of using the square-root symbol, why don't you use an image (using the com.google.gwt.user.client.ui.Image class)?
I think a more elegant/simple solution might be to use the checkbox class for your menu items. That way you could have automatic ticks/checks instead of having to use an image or the square-root symbol. Also, you will be able to "grey-out" items with setEnabled(false). Otherwise, you will have to write your own widget or add your own functionality to your menu labels in order to "grey-out" items.

MS Access 2003 - Simple value input into a text box from clicking label boxes

Ok so could anyone please help me out with the VB for auto entering information into a text box, by clicking certian label boxes on a form in access 2003.
I built this thing using label boxes as "sort of links" instead of button for navigation/commands etc, and I have this power point presentation viewer on one of the forms.
The client has numerous briefings and this will be great for me to provide a little something for them to be able to get their briefings from one spot.
So if I list the choices for the month out on the form as label boxes (with little mouse move events to resemble a web link) and they click on it to select, then the only way I know how this may become functional is if I add a text box to the form, and make it not visible, that way I can name it, and add it to the file path string and it works.
But how do I create the action of clicking the "link" result in "NVOWEFDJHF" into text box?
Anyone know a better way?
Yeah I am an amateur, so I am ALWAYS willing to learn a better way.
Thanks very much!
I would recommend using a transparent button instead of a label.
The main reason is that you can set the mouse cursor to become a small hand when you hover over the button, so it gives back information to the user that this can be clicked.
With a label, the user cannot make the difference between a normal label and one that can be clicked since there is no visual cue.
To create a button that resemble a label:
Add the button to the form
In the properties for the button, set the following:
Format > Back-Style: Transparent
Other > Cursor on Hover: Hyperlink Hand
Other > Name: btAutoFill (or whatever name you want)
If you want the button to resemble a link a bit more, you can change it's caption's format, making it blue and underlined if you wish.
Now if you view the form, you will see that the mouse cursor will change when you move over the 'button label'.
To automatically fill-in other controls when you click your button, add the code to handle its OnClick event (in the button's properties, under Events > On Click, choose [Event Procedure]):
Public Sub btAutoFill_Click()
myTextBox = "NVOWEFDJHF"
End Sub
Quick air code here...
Private Sub MyLabel_OnClick()
Me.MyTextBox = "NVOWEGDJHF"
End Sub
Don't forget your error handling.
You're making this as difficult as possible by using an approach that is not Access-native. The simplest way to make the labels "clickable" is to put a transparent command button over them. But that means the MouseMove events will go to the command button, so you'll have to have its events do the MouseOver actions.