Click here to Skip to main content
15,906,106 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Guys I have following radio button on a page i am trying to parse, below is the cde for getDF that is suppose to parse it and display but it is not working any ideas??

Following is supposet to parse rdusa1 radio button
<input title="" NAME="vv" value="lT1m6J0zdWek" id="rdusa1" type="radio" data-ms="7:1:1" data-md="tt" >

<label for id="rdusa1">TF NOW</label>




Following code is suppose to parse the above code for radio utton

public static void getdf(Vector deliveryElements, String pageHTML, monitorSite msObj)
    {
       
 
            Matcher mDel = Pattern.compile("<input title=\"\" NAME=\"vv_delivery_choice\" value=\"(.*?)\" id=\"rdusa(.*?)\"<\\/label>", 2).matcher(pageHTML);
            do
            {
              
Basically trying to find out which radiobitton is selected like rdusa1, or rdusa2 etc
Posted
Updated 19-Dec-11 18:19pm
v2
Comments
Sergey Alexandrovich Kryukov 20-Dec-11 0:07am    
What do you mean by "parsing a button"?
--SA
EricThe 20-Dec-11 0:10am    
like on a web page there is a radio button and reading than parsing that radio button value
Sergey Alexandrovich Kryukov 20-Dec-11 0:12am    
It's value is Selected or not Selected. What to parse?
--SA
Sergey Alexandrovich Kryukov 20-Dec-11 0:11am    
I suggest you read my (preliminary) answer, rethink your question and try to re-formulate it in some sensible way. Please use "Improve question".
--SA

For your information, buttons or any other controls do not need parsing. I don't understand what exactly wrong with this question, but right now, as of first version, it does not look like making much sense. Maybe this can give you an idea: http://en.wikipedia.org/wiki/Parsing[^].

—SA
 
Share this answer
 
You need to create an Actionlistener. it can be the GUI-Class itself ( button.setSelectionListener(this) ), or better a class beside the GUI-Element to do the logical part ( button.setSelectionListener(getGUIController()); )
Benefit: if you change the GUI Layout afterwards, the pogic remains untouched.

For Radiobutton you'll most likely need a SelectionListener or SelectionAdapter - I prefer the Listener-Pattern.

Tutorial on ActionListener[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900