Jump to content
Sign in to follow this  
jason_erkie

Java Form help for a (newbie)

Recommended Posts

jason_erkie

I am trying to move my scripting to the next level (read: not clicking on coordinates with the mouse) my latest project is for a report I have to pull 2X a day extracting 4 views.

I am stuck at the extract part of my project. I am presented with a box in my browser with a checkbox for exporting column headers and then radio buttons for the delimiter type. I want to check the checkbox and select the radio button for Comma seperated value csv.

I have failed with:

$oForm = _IEFormGetObjByName ($oIE,"topaz")

$oDiv = _IEGetObjById ($oIE, "X2")

_IEFormElementCheckboxSelect ($oDiv, "Export Column Headers?", "", 1, "byValue",1)

I have tried and failed with _IELinkClickByText too

I realize that I am probably making rookie mistakes, any help / gudiance would really be apperciated. Even if you have an easy to grasp example... (I have poured over the help file and when I try to apply it to this code nothing seems to work)

Here is the java? code snippet

<form name="topaz" id="topaz" method="post" action="detail.do" onsubmit="enableAll();return verify(this,true);">
<input type="hidden" name="row" id="row" value=""><input type="hidden" name="__x" id="tpz_x"><input type="hidden" name="essuser" id="essuser" value="false"><input type="hidden" name="thread" id="thread" value="1"><input type="hidden" name="event" id="event" value=""><input type="hidden" name="transaction" id="transaction" value="2"><input type="hidden" name="type" id="type" value="detail"><input type="hidden" name="focus" id="focus" value=""><input type="hidden" name="focusContents" id="focusContents" value=""><input type="hidden" name="focusId" id="focusId" value=""><input type="hidden" name="focusReadOnly" id="focusReadOnly" value=""><input type="hidden" name="start" id="start" value=""><input type="hidden" name="count" id="count" value=""><input type="hidden" name="window" id="window" value=""><input type="hidden" name="close" id="close" value=""><input type="hidden" name="_blankFields" id="tpz_blankFields" value=""><input type="hidden" name="_uncheckedBoxes" id="tpz_uncheckedBoxes" value=""><input type="hidden" name="formchanged" id="formchanged" value=""><input type="hidden" name="formname" id="formname" value="ask.export2"><input type="hidden" id="hdnactivenotes" value="false"><input type="hidden" id="hdnrefreshmessages" value="true"><input type="hidden" id="hdnrefreshmessinterval" value="15000"><input type="hidden" id="validoptions" value="3;"><script type="text/javascript">
      function printThisView(){
          tpzPrintDetail();
      }
  </script><input type="hidden" id="favorites_add" value="ctx=docEngine&amp;file=&amp;query=&amp;queryHash=&amp;action=&amp;title=-">
<div id="X1" style="position:absolute; top:4px; left:0px; width:469px; height:287px; border:solid #000000 1px;">
<div id="X2OutsideBorder" style="position:absolute;
                
            top:12px;
                                
            height:19px;
            left:14px;
            width:203px;
            ">
<div id="X2Border">
<span class="FormatLabel" style="
            position:absolute; white-space:nowrap;top:0;
            left:32px;
            width:167px;
            height:18px;
                "><label id="X2Label" for="X2" style=" 
            color:
            #000000;
        ">Export Column Headers?</label></span><input type="checkbox" id="X2" name="var/L.export.headers" ref="var/L.export.headers" dvdVar="" buttonid="" scType="CheckBox" value="true" style="position:absolute;top:0;left:0" onfocus="handleonfocus(this, event);" onchange="handleonchange(this, event);" onclick="handleonclick(this, event);">
</div>
</div>
<div style="position:absolute; top:44px; left:14px; width:450px; height:187px; ">
<fieldset id="X4" widgetType="group" style="width:450px; height:187px; ">
<legend id="X4Legend" style="">Delimiter</legend>
<div id="X6OutsideBorder" style="position:absolute;
                
            top:22px;
                                
            height:19px;
            left:9px;
            width:275px;
            ">
<div id="X6Border">
<input type="radio" id="X6" name="var/L.delim" dvdVar="var/L.delim" ref="var/L.delim" value="csv" tabindex="2" style="position:absolute;top:0;left:0" onfocus="handleonfocus(this, event);" onchange="handleonchange(this, event);" onclick="handleonclick(this, event);">
<div id="X6Label" class="FormatLabel" style="
            position:absolute; white-space:nowrap;top:0;
            left:32px;
            width:239px;
            height:18px;
                ">
<label for="X6" style="">Comma Separated Value (CSV)</label>
</div>
</div>
</div>
<div id="X8OutsideBorder" style="position:absolute;
                
            top:44px;
                                
            height:19px;
            left:9px;
            width:275px;
            ">
<div id="X8Border">
<input type="radio" id="X8" name="var/L.delim" dvdVar="var/L.delim" ref="var/L.delim" value="ssv" tabindex="3" style="position:absolute;top:0;left:0" onfocus="handleonfocus(this, event);" onchange="handleonchange(this, event);" onclick="handleonclick(this, event);">
<div id="X8Label" class="FormatLabel" style="
            position:absolute; white-space:nowrap;top:0;
            left:32px;
            width:239px;
            height:18px;
                ">
<label for="X8" style="">Semicolon Separated CSV</label>
</div>
</div>
</div>
<div id="X10OutsideBorder" style="position:absolute;
                
            top:66px;
                                
            height:19px;
            left:9px;
            width:90px;
            ">
<div id="X10Border">
<input type="radio" id="X10" name="var/L.delim" dvdVar="var/L.delim" ref="var/L.delim" value="tab" tabindex="4" checked style="position:absolute;top:0;left:0" onfocus="handleonfocus(this, event);" onchange="handleonchange(this, event);" onclick="handleonclick(this, event);">
<div id="X10Label" class="FormatLabel" style="
            position:absolute; white-space:nowrap;top:0;
            left:32px;
            width:54px;
            height:18px;
                ">
<label for="X10" style="">Tab</label>
</div>
</div>
</div>
<div id="X12OutsideBorder" style="position:absolute;
                
            top:88px;
                                
            height:19px;
            left:9px;
            width:90px;
            ">
<div id="X12Border">
<input type="radio" id="X12" name="var/L.delim" dvdVar="var/L.delim" ref="var/L.delim" value="comma" tabindex="5" style="position:absolute;top:0;left:0" onfocus="handleonfocus(this, event);" onchange="handleonchange(this, event);" onclick="handleonclick(this, event);">
<div id="X12Label" class="FormatLabel" style="
            position:absolute; white-space:nowrap;top:0;
            left:32px;
            width:54px;
            height:18px;
                ">
<label for="X12" style="">Comma</label>
</div>
</div>
</div>
<div id="X14OutsideBorder" style="position:absolute;
                
            top:110px;
                                
            height:19px;
            left:9px;
            width:90px;
            ">
<div id="X14Border">
<input type="radio" id="X14" name="var/L.delim" dvdVar="var/L.delim" ref="var/L.delim" value="asterix" tabindex="6" style="position:absolute;top:0;left:0" onfocus="handleonfocus(this, event);" onchange="handleonchange(this, event);" onclick="handleonclick(this, event);">
<div id="X14Label" class="FormatLabel" style="
            position:absolute; white-space:nowrap;top:0;
            left:32px;
            width:54px;
            height:18px;
                ">
<label for="X14" style="">Asterisk</label>
</div>
</div>
</div>
<div id="X16OutsideBorder" style="position:absolute;
                
            top:132px;
                                
            height:19px;
            left:9px;
            width:90px;
            ">
<div id="X16Border">
<input type="radio" id="X16" name="var/L.delim" dvdVar="var/L.delim" ref="var/L.delim" value="caret" tabindex="7" style="position:absolute;top:0;left:0" onfocus="handleonfocus(this, event);" onchange="handleonchange(this, event);" onclick="handleonclick(this, event);">
<div id="X16Label" class="FormatLabel" style="
            position:absolute; white-space:nowrap;top:0;
            left:32px;
            width:54px;
            height:18px;
                ">
<label for="X16" style="">Caret</label>
</div>
</div>
</div>
<div id="X18OutsideBorder" style="position:absolute;
                
            top:154px;
                                
            height:19px;
            left:9px;
            width:90px;
            ">
<div id="X18Border">
<input type="radio" id="X18" name="var/L.delim" dvdVar="var/L.delim" ref="var/L.delim" value="other" tabindex="8" style="position:absolute;top:0;left:0" onfocus="handleonfocus(this, event);" onchange="handleonchange(this, event);" onclick="handleonclick(this, event);">
<div id="X18Label" class="FormatLabel" style="
            position:absolute; white-space:nowrap;top:0;
            left:32px;
            width:54px;
            height:18px;
                ">
<label for="X18" style="">Other</label>
</div>
</div>
</div>
<div id="X20Border" MyAttrib="EditBorder" style="position:absolute;
                
                        top:154px;
                    
                
                left:131px; 
                width:144px; 
                height:19px;
                
                
                    visibility:hidden;
                ">
<input type="text" id="X20" name="var/L.other" dvdVar="" ButtonId="Text9" dataType="" scType="Text" tabindex="9" style="width:144px; height:19px;" maxlength="" onkeydown="lockForm();void(0);" onkeyup="checkLastRow(this);" onfocus="handleonfocus(this, event);" onchange="handleonchange(this, event);" onclick="handleonclick(this, event);" value="" scripttype="text">
</div>
</fieldset>
</div>
<a ButtonID="0" id="X21Border" href="java script:tpzDrillTable('', 'OK', '0')" title="OK" tabindex="10" content="OK" style="position:absolute; top:247px; left:95px; width:108px; height:29px; "><img class="HoverImage" id="X21" onmouseover="if(top.is_ie)this.className='HoverImageHover'" onmouseout="if(top.is_ie)this.className='HoverImage'" widgetType="linklabel" src="images/obj16/tok.gif" alt="OK" title="OK" enabled="1" style="
                                filter:alpha(opacity:100); 
                            "></a><input type="hidden" id="" name=""><a ButtonID="3" id="X22Border" href="java script:tpzDrillTable('', 'Cancel', '3')" title="Cancel" tabindex="11" content="Cancel" style="position:absolute; top:247px; left:275px; width:108px; height:29px; "><img class="HoverImage" id="X22" onmouseover="if(top.is_ie)this.className='HoverImageHover'" onmouseout="if(top.is_ie)this.className='HoverImage'" widgetType="linklabel" src="images/obj16/tcancel.gif" alt="Cancel" title="Cancel" enabled="1" style="
                                filter:alpha(opacity:100); 
                            "></a><input type="hidden" id="" name="">
</div>
</form>
</div>
<div id="popHelp" class="helpinfo" style="display:none; z-index:200; padding:2px;">
<img id="popHelpImg" src="images/obj16/btnhelp.gif" style="padding:2px; float:left;" alt="Help contents" title="Help contents"><a id="popHelpClose" href="java script:hideHelpInfo();void(0);" title="Close help contents"><img id="popHelpCloseImg" src="images/close.gif" alt="Close help contents" title="Close help contents" style="padding:2px; float:right;"></a>
</div>
<!--************************************************************************************************-->
<!--The following are the popup selects which get positioned when the users selects the popup button-->
<!--************************************************************************************************-->
<script type="text/javascript"></script>
</body>
<xml id="commandMessages" style="display:none"></xml>
</html>

Share this post


Link to post
Share on other sites
PsaltyDS

I am trying to move my scripting to the next level (read: not clicking on coordinates with the mouse) my latest project is for a report I have to pull 2X a day extracting 4 views.

I am stuck at the extract part of my project. I am presented with a box in my browser with a checkbox for exporting column headers and then radio buttons for the delimiter type. I want to check the checkbox and select the radio button for Comma seperated value csv.

I have failed with:

$oForm = _IEFormGetObjByName ($oIE,"topaz")

$oDiv = _IEGetObjById ($oIE, "X2")

_IEFormElementCheckboxSelect ($oDiv, "Export Column Headers?", "", 1, "byValue",1)

I have tried and failed with _IELinkClickByText too

I realize that I am probably making rookie mistakes, any help / gudiance would really be apperciated. Even if you have an easy to grasp example... (I have poured over the help file and when I try to apply it to this code nothing seems to work)

Here is the java? code snippet

Use codebox vice code tags for long stuff like that please.

The object is inside the form. So try $oDiv = _IEGetObjById ($oForm, "X2")

If it is not working, then figure out exactly where it fails: Is $oForm valid? Is $oDiv valid? Were there any errors to the console? Do you have _IEErrorHandlerRegister() in there so you get all the info? Exactly how does it fail?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×