From: Jim X. <jx...@cl...> - 2014-01-20 20:03:39
|
I have the following code that changes a form style HtmlForm htmlForm = getForm(); //supposed to get a HtmlForm object. ScriptableObject scriptObject = htmlForm.getScriptObject(); HTMLFormElement formElement = (HTMLFormElement)scriptObject; ComputedCSSStyleDeclaration style = formElement.getCurrentStyle(); style.setBackgroundColor("#FF0000"); style.setBorderColor("blue"); The above code doesn't work. Please help me out. Jim |
From: George D. <li...@iD...> - 2014-01-20 20:30:27
|
Jim, On 1/20/14, 2:44 PM, Jim Xie wrote: > I have the following code that changes a form style > > HtmlForm htmlForm = getForm(); //supposed to get a HtmlForm object. > ScriptableObject scriptObject = htmlForm.getScriptObject(); > HTMLFormElement formElement = (HTMLFormElement)scriptObject; > ComputedCSSStyleDeclaration style = formElement.getCurrentStyle(); > style.setBackgroundColor("#FF0000"); > style.setBorderColor("blue"); > > The above code doesn't work. Please help me out. What were you expecting it to do? - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- |
From: Jim X. <jx...@cl...> - 2014-01-20 20:51:59
|
George, Here is what I want to do: 1. display url in JWebBrowser (JWebBrowser.navigate(url)) 2. final HtmlPage page = WebClient.getPage(url); 3. parse HtmlPage to get a list of HtmlElement. 4. change some style on HtmlElemnt using first email of code. 5. New change of style should be seen in JWebBrowser. At this point, I cannot see new change in JWebBrowser. Jim ----- Original Message ----- From: "George Dinwiddie" <li...@iD...> To: htm...@li... Sent: Monday, January 20, 2014 3:13:40 PM Subject: Re: [Htmlunit-user] How to change a form background color Jim, On 1/20/14, 2:44 PM, Jim Xie wrote: > I have the following code that changes a form style > > HtmlForm htmlForm = getForm(); //supposed to get a HtmlForm object. > ScriptableObject scriptObject = htmlForm.getScriptObject(); > HTMLFormElement formElement = (HTMLFormElement)scriptObject; > ComputedCSSStyleDeclaration style = formElement.getCurrentStyle(); > style.setBackgroundColor("#FF0000"); > style.setBorderColor("blue"); > > The above code doesn't work. Please help me out. What were you expecting it to do? - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: George D. <li...@iD...> - 2014-01-20 21:02:39
|
Jim, On 1/20/14, 3:51 PM, Jim Xie wrote: > > George, > > Here is what I want to do: > 1. display url in JWebBrowser (JWebBrowser.navigate(url)) > 2. final HtmlPage page = WebClient.getPage(url); > 3. parse HtmlPage to get a list of HtmlElement. > 4. change some style on HtmlElemnt using first email of code. > 5. New change of style should be seen in JWebBrowser. > > At this point, I cannot see new change in JWebBrowser. How would JWebBrowser see changes made in memory by HtmlUnit? They are two separate browsers. -- George > > Jim > > ----- Original Message ----- > From: "George Dinwiddie" <li...@iD...> > To: htm...@li... > Sent: Monday, January 20, 2014 3:13:40 PM > Subject: Re: [Htmlunit-user] How to change a form background color > > Jim, > > On 1/20/14, 2:44 PM, Jim Xie wrote: >> I have the following code that changes a form style >> >> HtmlForm htmlForm = getForm(); //supposed to get a HtmlForm object. >> ScriptableObject scriptObject = htmlForm.getScriptObject(); >> HTMLFormElement formElement = (HTMLFormElement)scriptObject; >> ComputedCSSStyleDeclaration style = formElement.getCurrentStyle(); >> style.setBackgroundColor("#FF0000"); >> style.setBorderColor("blue"); >> >> The above code doesn't work. Please help me out. > > What were you expecting it to do? > > - George > -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- |