How do i use set_focus_child to set focus to a text entry in gtkmm? - gtkmm

I have a dialog in which i ask the user to enter username and password. I match them with database. If the user field is empty, i show a message box telling the user that user id is blank. I want the focus to set to user id field. How do i do that in gtkmm? Is it possible to clear the existing contents of the user id?
l_user_id=m_user_id->get_text();
l_password=m_password->get_text();
if(l_user_id=="")
throw_dialog("Empty Field","Please enter a user name");
// i want to clear the user id field
// i want to set focus to user id field

Use Gtk::Widget::grab_focus() and Gtk::Entry::set_text.
l_user_id.set_text("");
l_user_id.grab_focus();

Related

When the user clicks a text box on my form, I need to assign an ID to the current record if there isn't one already

I have a form, frmEvent, for editing and creating records. Each record represents an Event. I have a pop-up form that displays the many-to-many relationships that associate one or more Persons to the current Event. This pop-up form is opened when the user clicks a text box on frmEvent.
The pop-up form displays all of the records in tblEventPersons where EventID = the ID of the Event record that is currently open. This normally works great. However, when my form is used to create a new Event record, Access does not assign an ID for the new Event record until at least one field has been changed. If a user creates a new Event record and tries to immediately open the frmEventPersons form, they get an error because the new Event record does not yet have an ID assigned.
I'm sure there's a very simple solution to this, but my searches have not yielded anything useful.
Well it is assumed that the main form has a record, and has some data and has a "ID" as you well asked.
However, if the form is moved to a new record, and you want to launch that next form that requires and needs the current forms ID that as you WELL note has not yet been generated?
Well, keep in mind that you current form WILL IN FACT generate the ID (assuming a auto number PK id column) if the current record has been "dirtied". We thus assume that the current record had SOME data editing. If it has NO EDITING done, then it actauly turns out is a bit of a trick to get Access force feed and generate that ID.
About the MOST easy way?
Dirty some field/column in the current form.
eg:
if isnull(me!ID) then
' this record does not yet have the PK id
' dirty some bound control.
me.MyEditDate = date()
end if
me.Dirty = false ' this will force a recrod save - gereate the "ID" you want.
docmd.Open "frmDetails",,,"FKColumn = " & me!id

Beginner Oracle APEX - Using ITEMS for a query

So I'm trying to select some names from a table where their set dates are between two dates that I enter via keyboard.
If it was for a single input, where I only use something like (:x) in the region source, I could just create a Text Field Item X where I enter something and press ENTER.
What if I need multiple inputs? like (:x) and (:y).
Upon creating 2 items and entering their values nothing happens when I press ENTER.
The Region Source is this:
SELECT * FROM TOYS WHERE SALE_DATE BETWEEN upper(:x) AND upper(:y);
What am I supposed to do in order to enter two inputs?
If you need to initiate an action (submit the page, for example) by changing value, you have to find a property Submit when Enter pressed in item's settings and set it to Yes. For select lists, the same property is Page Action on Selection, and desired value for it - Submit Page.
Or, you can just create a button. Button's action by default is also "submit page".

Need to Delete current password (if Prepopulated) in reset popup window using selenium

After clicking reset password link I need to verify whether password (i.e testdemo)is prepopulating in current password text box, if so then I need to clear those values.
As far I understood your scenario, you are checking that your password is auto populated in password field and If so then you need to clear that
You can do this - First you need to check is there any value in password field if so then do clear
int passLength = driver.findElement(By.id("Password")).getAttribute("value").length();
if(passLength>0)
{
driver.findElement(By.id("Password")).clear();
}

Validate button must be clicked before closing workbook

If user changes/writes into excel sheet then he must click the validate button.If he changes data and tries to save/close excel,pop up must be show to the user. Simply I want to check whether used clicks validate button before closing the workbook. If a single letter is changed by user, user needs to click on validate button. After clicking on validate button ,if user again changes any data ,then too user must get warning that validate before saving/closing.
I don't want to write out all the code for you but what you'll need to do is create an on-change worksheet(Or workbook if you'd prefer) process that sets a custom worksheet attribute or your preferred method of storing a value persisting between sessions. That process will run when anything in the worksheet changes and will be able to set the value of your value so that you know "there has been a change, I am now not validated"
Then you need to create a before save process that checks to see if that value is "not validated" or "validated" (false or true or what have you). You set that process to break the save event and present an error message when the value is "not validated" and allow it when it is "validated".
Then you create a validate button/whatever and a process that sets the value to "validated" (may want to check and only change when the value is not already "validated" but that's up to you).
Then you'll have a set of processes where when the sheet/book changes, the value becomes invalid and saving is prevented. When the validate button is selected, the validate process changes the value to validated and saving is allowed again.

How can retrieve email address from the Infopath people/Group picker

How can retrieve email address from the Infopath people/Group picker?When I add the people/Group picker into the infopath form, I only get 3 fields DisplayName,AccountId,AccountType.Can anyone show me how can I get the email either by configurations or by code.
In SharePoint Designer, when setting up a workflow to respond to an InfoPath people picker field, I simply map the "TO:" field of my "Send Email" action to whatever people picker field I have (even if it's set to pull the Display Name)... and the email will successfully send out regardless. Now, your mileage may vary and perhaps it's due to our Exchange server settings and small company size which allows this to work.
Anyways, try it out. Maybe extracting an email address from the people picker is a superflous step.
I have a simpler solution.
Assume you are using the connection wizard to send an email to a person selected from a people picker.
in the to field -
concat(substring-after(AccountId, "\"), "#domain.com")
assuming your companies mail accounts have an entry for username # domain.
because AccountId = domain\username
so we end up with username#domain.com
Worked for me
Create a button and the following rules for that button.
Create a data Connection to retrieve from GetUserProfileByName.
Create a field to store the email you are retrieving.
Rules for the button
Rule 1 Set a fields value. Set the value of the AccountName of GetUserProfileByName to equal the AccountID from the people picker.
Rule 2 Add an Action to to Query the Data Connection GetUserProfileByName
Rule 3 set a fields value to the email address of the query you just performed
Filter Data
Change value to name
If you simply want to populate a field with the email address from your domain this works perfectly. I have been banging my head on the double eval trick for two days. I got it to work but the form rendering in SharePoint took 2 minutes and 46 seconds.
I know this is too late for the answer but still i am writing this so that someone can get help in future.
When we keep People picker it gives us three values which you specified (AccountId, DisplayName and AccountType).
Now if some one wants to retrieve the email address, there may be so many requirement but i guess most of the person want to send mail to the user which are selected into people picker.
If you want to send mail to selected user then you can just use AccountId field into your workflow item. SharePoint designer automatically detect the email address from the AccountId and sends the mail.
I hope this might save someone's time.