Hello, I think there is an issue in the nightly build of 13-12-2010 Power edition. A testcase is pasted below.
The method...
...in the code below is returning null. I've checked that a successive call to HiddenItem.setValue and HiddenItem.getValue gives the correct result. Also, the getValueAsString("aTextItem") works okay, it is just the HiddenItem.
This used to work in the officially 2.3 release of the Power edition.
Some details about my tested situation:
1. it occurs in Hosted mode, haven't tried deployment mode.
2. it only seems to occur with HiddenItem
3. nightly build of 13-12-2010 Power:
Usage: paste the private class, extending a DynamicForm below in a class with an entrypoint method, and start it up using it's constructor. You can use the empty string as constructor argument. After clicking the 'Login' button, you can debug to the issue. Observe the params HashMap, to be specific, after the getValueAsString() method has been called.
The method...
Code:
aDynamicForm.getValueAsString("aHiddenItem");
This used to work in the officially 2.3 release of the Power edition.
Some details about my tested situation:
1. it occurs in Hosted mode, haven't tried deployment mode.
2. it only seems to occur with HiddenItem
3. nightly build of 13-12-2010 Power:
Code:
INFO ISCInit - Isomorphic SmartClient Framework (SC_SNAPSHOT-2010-12-13/PowerEdition Deployment 2010-12-13) - Initialization Complete
Code:
private class LoginForm extends DynamicForm { private String credentialsURL; public LoginForm(String credentialsURL) { this.credentialsURL = credentialsURL; HiddenItem hostname = new HiddenItem("hostname"); String s = "someHostname"; hostname.setValue(s); String x = (String) hostname.getValue(); TextItem textItem = new TextItem("username"); textItem.setTitle("Username"); textItem.setTitleOrientation(TitleOrientation.LEFT); PasswordItem passwordItem = new PasswordItem("password"); passwordItem.setTitle("Password"); passwordItem.setTitleOrientation(TitleOrientation.LEFT); ButtonItem buttonItem = new ButtonItem("Login"); buttonItem.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { doLogin(); } }); setFields(hostname, textItem, passwordItem, buttonItem); } public void doLogin() { RPCRequest request = new RPCRequest(); request.setContainsCredentials(true); request.setActionURL(credentialsURL); request.setUseSimpleHttp(true); request.setShowPrompt(false); Map<String, String> params = new HashMap<String,String>(); params.put("j_username", getValueAsString("username")); params.put("j_password", getValueAsString("password")); params.put("j_hostname", getValueAsString("hostname")); request.setParams(params); //submitting code of RPCmanager omitted... } }
Comment