I am trying to connect a radiobutton to a listWidget - python-3.2

I am not an experienced python programmer at all.
I am using an application called PyQt4 to create GUI's.
In this instance, I have to line a radio button (displaying male or female) to a child's name that can be added to a list.
I have been able to do everything else, except add the radio buttons to the list so that each time a child's name is selected, their gender is displayed.
Please help.

Related

Adding multiple dropdown on clicking a link

I have a link which says "add another field". On clicking the link a dropdown should appear on top with let's say 5 custom fields as list in dropdown. Once user selects a field in that dropdown and clicks hyperlink another dropdown should appear below existing dropdown and with only 4 remaining fields as one is already selected.so how to start this?
https://tutorialslink.com/Articles/How-to-add-control-dynamically-in-Aspnet-MVC-using-Javascript/64 . I have tried to use this link which adds text boxes to get started.
I don't have any code expect for the code in above link which is for text box though. Just need an idea of how to do it in asp.net MvC as i cannot move forward now.
Expected results is to do the above requirement, don't have any actual results as of now

UI Testing Multiple UITextFields

I'm trying to create a UITest using the recording function for an app that contains multiple UITextFields per view. When trying to do so I'm having a couple issues.
To simplify the issue I have created an application with two text fields nested inside one subview as shown in the picture.
From here I opened the identity inspector and changed the label of the two UITextFields under the accessibility heading to 'topField' and 'bottomField' (accessibility disabled on the gray UIView). Then I went into the UITest 'testExample' function and click the record button. From here I click the top text field, type something in, then when I click the bottom text field I get this error 'Timestamped Event Matching Error: Failed to find matching element'.
What am I missing here? I know this is a result of Xcode not being able to find the text field in the hierarchy, but I don't know why since I have given labels to each element in accessibility. I am able to manually write the code into the testing method to access the second text field without any errors, but the recording is not working. Any help is greatly appreciated.

Click inside UILabel

I'm working with an iOS application. What I'm trying to accomplish,
Let's say the text for the UILabel is "Rikard bla bla bla Rikard".
So in this text I have tagged two people. And when I click on one of them I display a detailed view about that person. So this is working great if I just have one user named Rikard, and it works with multiple too and I can present the detailed view. But my problem is that I don't know which user I clicked on if I have tagged multiple people with the same name. I know I have to go for the ID. Right now I display by name, so it's not that strange that it's not working.
Should I save information in the database in which order the user entered the two tags or how can I ever know who is who?
Please point me in the right direction. The functionality is working great, it's just the logic for who to display when I click. I want to recreate the tagging system that Facebook have when people comment a photo and tag people in it. You can write multiple names there and Facebook will of course know who is who.
ADDED
So what I do when I'm creating my tags. I choose from a list of available tags or I can write them. I will always know which tag to save the current comment with. But the problem occurs when I display them in to different parts,
The first part is just a UILabel with all the tags in a row, separated by blank space. Here I know where the user tapped and I can display the detailed view for the with the name.
The second part is all of the text, I can find where the tags are located, on which line and between what pixels on that line. And I know when I click on them.
But what I need is the logic for clicking two tags with the same name in the same UILabel. Should I somehow save the order of how I saved the tags?
One option that comes to mind is using an NSAttributedString in the label. You may add arbitrary attributes to ranges of text using that class, and its mutable subclass. Thus, you could add a custom attribute to the range of each user's name, and assign for the corresponding value some unique identifier for the user – possibly an NSNumber or NSString that can be used to retrieve the proper information.

Rails form select from two options with a button - custom form implementation

I have a website where I want users to be able to select what type of user they are during the registration process.
Specifically, the implementation I want is to have two buttons on the signup page, one called "Seller" and one called "Buyer".
The user should be able to select only one button and once clicked, it should stay highlighted (I know this is just jquery so not the issue).
The selection should be stored in a column in my users model called :type.
It seems pretty straightforward, but the "f.select" form method seems to only implement a dropdown menu, so I am wondering how I can achieve this implementation of two buttons.
Since you're already going to use jQuery, you could add a hidden field for type, create 2 links and style them as buttons, and use jQuery to update the value of type when a user clicks one of the "buttons".

How to know which radio button is selected on a view?

I have a created a list view for one of my controller's index action.
I have added a new column "Select This" to this list view, by using the view's source.
The column will contain radio button for each entry in the list. This i have achieved by just placing a radio button control from tool box in the "Select This" column. This i have done in the design of the view and when i run it, i get radio buttons, one for each of the entry. The page also has a link button and i want to call a controller action on this link button click which will receive the index of radio button selected. So if i select 5th radio button, how can receive 5 in the controller action.
How can i do this?
Regards,
kapil
If you used plain HTML, your radio buttons will all have the same name, but different value. You will get one result in the POST, which will contain the selected value.
If you used ASP.net helpers, it's the same, but they will be generated for you: see here: http://msdn.microsoft.com/en-us/library/dd410596.aspx You will pass the same name (first parameter) and different values for each input (second parameter).

Resources