Yeah, may be the IDE cache issue because IDE needs to compile Groovy classes to Java class first.
Please vote the dzone link for us. Our project really needs your support to get more exposure. Thanks, Jian On Wed, May 27, 2009 at 10:32 AM, Harihara Vinayakaram <[email protected]>wrote: > Very strange. My code now works on my machine too. :-) > > Regards > Hari > > > On Wed, May 27, 2009 at 7:20 PM, Jian Fang <[email protected]>wrote: > >> I create UI module based on your code sample, >> >> public class CustomUIExample extends DslContext { >> >> public void defineUi() { >> ui.Container(uid: "switch", clocator: [id: "switch1", tag: "switch"], >> namespace: "xforms", group: "true") { >> Container(uid: "case1", clocator: [id: "case-1", tag: "case"], >> namespace: "xforms") >> Container(uid: "case2", clocator: [id: "case-2", tag: "case"], >> namespace: "xforms") >> Container(uid: "case3", clocator: [id: "case-3", tag: "case"], >> namespace: "xforms") >> >> } >> } >> >> public String getXCaseStatus(int tabnum){ >> String caseId = "switch.case"+tabnum; >> String status = (String)customUiCall(caseId,"getXCaseStatus"); >> return status; >> } >> >> and the test class >> >> >> public class CustomUIExample_UT extends GroovyTestCase { >> public void testDump(){ >> CustomUIExample cue = new CustomUIExample(); >> cue.defineUi(); >> cue.dump("switch"); >> } >> >> public void testCustomUICall(){ >> CustomUIExample cue = new CustomUIExample(); >> cue.defineUi(); >> int tabnum = 1; >> String status = cue.getXCaseStatus(tabnum); >> } >> } >> >> The dump() method output is as follows, >> Dump locator information for switch >> ------------------------------------------------------- >> switch: //descendant-or-self::xforms:swit...@id="switch1"] >> switch.case1: >> //descendant-or-self::xforms:switch[descendant::xforms:ca...@id="case-1"] >> and descendant::xforms:ca...@id="case-2"] and >> descendant::xforms:ca...@id="case-3"] and >> @id="switch1"]/descendant-or-self::xforms:ca...@id="case-1"] >> switch.case2: >> //descendant-or-self::xforms:switch[descendant::xforms:ca...@id="case-1"] >> and descendant::xforms:ca...@id="case-2"] and >> descendant::xforms:ca...@id="case-3"] and >> @id="switch1"]/descendant-or-self::xforms:ca...@id="case-2"] >> switch.case3: >> //descendant-or-self::xforms:switch[descendant::xforms:ca...@id="case-1"] >> and descendant::xforms:ca...@id="case-2"] and >> descendant::xforms:ca...@id="case-3"] and >> @id="switch1"]/descendant-or-self::xforms:ca...@id="case-3"] >> ------------------------------------------------------- >> >> and the testCustomUICall() method of course will fail, but I did not see >> the same "cannot find Ui object" error. Could you run my code example >> and post the output on your machine? >> >> Thanks, >> >> Jian >> >> >> On Wed, May 27, 2009 at 9:25 AM, John <[email protected]> wrote: >> >>> >>> I will use your UI module to look into it. >>> >>> In the meanwhile, please help us to vote the DZONE link since our >>> project visits come down now. >>> >>> http://www.dzone.com/links/whats_new_in_tellurium_060.html >>> >>> Thanks in advance, >>> >>> Jian >>> >>> On May 27, 8:13 am, Harihara Vinayakaram <[email protected]> wrote: >>> > Hi >>> > My definition looks like >>> > ui.Container(uid:"switch", clocator: [id:"switch1", tag:"switch"], >>> > namespace:"xforms", group:"true") { >>> > Container(uid:"case1",clocator:[id:"case-1", >>> > tag:"case"],namespace:"xforms") >>> > Container(uid:"case2",clocator:[id:"case-2", >>> > tag:"case"],namespace:"xforms") >>> > Container(uid:"case3",clocator:[id:"case-3", >>> > tag:"case"],namespace:"xforms") >>> > >>> > } >>> > >>> > when i try to invoke >>> > String caseId = "switch.case"+tabnum; >>> > String status = (String)customUiCall(caseId,"getXCaseStatus"); >>> > >>> > I get an error message saying >>> > Cannot find UI Object case3 in switch >>> > >>> > But if I change my defintion to be without the other ui.Container and >>> change >>> > the id to be just case3 like >>> > String caseId = "case"+tabnum; >>> > String status = (String)customUiCall(caseId,"getXCaseStatus"); >>> > >>> > Can I not have a group with customUiCall >>> > >>> > Regards >>> > Hari >>> >>> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tellurium-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/tellurium-users?hl=en -~----------~----~----~----~------~----~------~--~---
