Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your problem is that the select named "event.theme" only gets loaded once the select named "event.datapool" has a value of "1" as selected.</p> <p>So you need to change the "event.datapool" select value to "1" :</p> <pre><code>[........] final HtmlSelect selectBase = form.getSelectByName("event.datapool"); final HtmlOption optionBase = selectBase.getOptionByText("Freizeit / Tourismus"); final Page newPage = selectBase.setSelectedAttribute(optionBase, true); [........] </code></pre> <p>But you may have problems because the "HTML" data for the select "event.theme" is loaded via ajax. So I do not think your java "HtmlSelect" class will loaded the select "event.theme" in the form as Javascript does with an actual user interation. </p> <p>A solution to that would be to:</p> <pre><code>1. Load your page "http://www.rce-event.de/modules/meldung/annahme.php?oid=471&amp;pid=1&amp;ac=d98482bbf174f62eaaa4664c&amp;tkey=468&amp;portal=www.dachau.de&amp;ortsbox=1&amp;callpopup=1" 2. Load the page "http://www.rce-event.de/modules/meldung/js/xmlhttp_querys.php?get_kat=1&amp;time=1338409551228&amp;id=1&amp;block=kat" &gt; which will return the "event.theme" select data/values 3. Then use the data loaded in step 2 to update the page loaded in step 1 by inserting a "select list with id and name set to &lt;event.theme&gt;" in the HTML element "kat_content" </code></pre> <p>Then your form/loaded webpage should have the new select named "event.theme" and therfore the following code shouldn't produce errors anymore.</p> <pre><code>final HtmlSelect select = form.getSelectByName("event.theme"); final HtmlOption option = select.getOptionByText("Sport/Freizeit"); final Page newPage = select.setSelectedAttribute(option, false); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload