Error in XAF: Requires a single object selected - xaf

I'm using XAF to create some applications.
I have a problem with this scenario:
In some ViewController I'm creating a new object (not saving it) and opening it in
edit mode.
After object is created using
var newObject = ObjectSpace.CreateObject<MasterType>()
I fill its details using:
newObject.Details = new List<Details>() {new Detail(), new Detail, new Detail()};
When the form opens in te web everything seems greate, but when I click one of detail items on the grid to open for edit, this error appears:
Message: An error with number 1007 has occurred. Error message:
Unable to execute disabled or inactive action ListViewShowObject.
Disable reasons: Requires a single object selected.

Related

Second Android Native Page focus Issue

While trying to automate android native application , Appium is not identify or focus on any single element on second page of native application after automating first page login functionality successfully .I have tried with all wait method and driver. context method but it is now working .I have tried to debug the code with so many wait time but it is not working .When i put a break point after automating first page and tried to debug the application then i observed that if i put any manual action on second page (open window and close same window )then appium is allowing to identify the second page also but i didn't understand why it is happening .By automation script, i am unable to do anything on second page .Could any team help me for the same? Page source code for second page :- "
i have tried with below method for identify the second page..
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(30));
ICapabilities caps = driver.Capabilities;
String context = driver.Context;
Console.WriteLine("Current context", context);
driver.Context = ("NATIVE_APP");
String afterloginsource = driver.PageSource;
Console.WriteLine("After loginv page source :- ", afterloginsource);
TouchAction t = new TouchAction(driver);
t.Tap(100, 100).Perform();
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(2400));
String loginsource = driver.PageSource;
Console.WriteLine("Befor login page source :- ",loginsource);
driver.HideKeyboard();
//enter valid account
driver.FindElementById("com.Testing:id/userid").SendKeys("00229715");//uat02
// driver.HideKeyboard();
/////driver.FindElement(By.XPath("//android.widget.EditText[#index='1']")).SendKeys("17765919"); ////upn02
///enter valid password
driver.FindElementById("com.Testing:id/password").SendKeys("1");
///click login button
driver.FindElementById("com.Testing:id/login").Click();
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(30));
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(200));
ICapabilities caps = driver.Capabilities;
String context = driver.Context;
Console.WriteLine("Current context", context);
driver.Context = ("NATIVE_APP");
String afterloginsource = driver.PageSource;
Console.WriteLine("After loginv page source :- ", afterloginsource);
TouchAction t = new TouchAction(driver);
t.Tap(100, 100).Perform();
AndroidElement expandList = driver.FindElementById("com.Testing:id/btn_more_options");
expandList.Click(); Or //((IJavaScriptExecutor)driver).ExecuteScript("mobile: scroll", scrollObject);
//IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
//IWebElement hiddenButton = driver.FindElementById("com.Testing:id/enableNotify");
//String script = "arguments[0].click();";
//js.ExecuteScript(script, hiddenButton);
it is giving error as nosuchelement exception for any element on second page.
NoSuchElement states for inability to find the element. It strongly seems for me that xpath locators to webelements on the page are incorrect.
I do recommend to try out remote debugging just to ensure the locators are organized correctly. And using remote debugging tool - You may also check the locators on-the-fly there.
As an option B) - I could also recommend to take a quick glance towards SeeTest automation tool. The link above guide on how to set up project from scratch, and here is public documentation for SeeTest.

Box::info showing "refreshEx"

I have a method that displays a validation result using the syntax
Box::info(message,title);
However, the first time I run the code it displays the correct title, but the message refreshEx.
Debugging the code the message that is being used is correct, Valid Account Number, but what displays is refreshEx. If I rerun the process the correct message is displayed, this only happens the first time.
Just in case it matters the flow is
Form - DoValidation method creates Class to call...
Class - public AccountValidation method that calls...
- private displayValidation method that contains this code
Thanks...
I have seen this error (unfortunately), in an AX 2009 installation, launched from code behind a button in a form:
if(HIEItemOrderSetup.RMAvailable < HIEItemOrderSetup.RMQuantity)
{
ok = DialogButton::Ok == box::okCancel("#HIE848",DialogButton::Ok,"#HIE849");
}
As far as I can tell it only occurs when you have a breakpoint on your form, when you are updating it. Removing the breakpoint will show the original message or at least this is what I have found.
If the message contains some fields from the database, try to execute a reread() or refresh() or refreshEx() method (depending on the context) to the datasource before showing the value through the info box.
May be the cached data is not refreshed after an update or insert.
EDIT:
If you are specting a return parameter from an Event, don't forget that this is an async process. An example on MSDN:
http://msdn.microsoft.com/en-us/library/gg843664.aspx

Google App Script ListBox - Reading items

I can not find a way to read the items in a UI ListBox object. I have search and found some methods like getItemCount() and getItemText() in the Google Web Toolkit but they are not available when using the object in a javascript.....
Any ideas?
You will have to pass the list-box widget trough a Server Side call to get the selected data out of it:
function doGet(){
var app = UiApp.createApplication();
var lb = app.createListBox();
lb.setName("calName") //name used to fetch selected result
.addItem("Text Option One", "1")//options for selection
.addItem("Text Option Two","");//first peram display text and second peram value
app.add(lb); // adds listbox to display
app.add(app.createButton("Click Me")//create button
.addClickHandler(app.createServerHandler("showResult") // Create server side execution to handel click
.addCallbackElement(lb))); // add list-boxas element to be passed to server as parameter
return app;
}
function showResult(e){
var app = UiApp.getActiveApplication();
var res = e.parameter.calName;//parameter name same as list-box name given
app.add(app.createLabel("Selected option is " + res));//displays selected option
return app;
}
just create test app and save a version, Use this code for application and view latest code after deploying it.

New Object not triggering createRecord in DataSource

In my responder I have:
Spanish.ADDWORD = SC.Responder.create({
didBecomeFirstResponder: function(responder) {
var store = this._store = Spanish.store.chain(); //buffer changes
var word = store.createRecord(Spanish.Word, {word: "", english: ""});
Spanish.addWordController.set("content",word);
//show the dialog
var pane = Spanish.getPath('addWordPage.mainPane');
pane.append();
pane.makeFirstResponder();
},
submit: function(){
this._store.commitChanges().destroy();
Spanish.makeFirstResponder(Spanish.READY);
}
}
Before I had the DataSource hooked-up, and I was using local, everything worked. When I click submit now no new object is created and createRecord is not being called.
A possible problem is that you are calling .destroy() immediately. This shouldn't be an issue, but as you said it was working while using fixtures (which are synchronous). Now that you are using a dataSource (which is usually asynchronous), it may be getting interrupted. Try removing the .destory(), and see if that resolves your issue.
Another option to try, is that there may be a bug in the nested store, in that if you create a new record (rather than edit an existing one), the 'did it change' test may fail (as there is nothing to compair it too), so calling commitChanges(YES) will force a commit, without the check.

SPListItem.Update and SPFile.Update fail

We are running one MOSS application as below:-
1. user use InfoPath request form to trigger workflow attached to SharePoint document library
2. all sub-sequent tasks are performed by users by InfoPath task form within SharePoint site through "Workflow Task" list (open, checkout, approve or reject) till the task completed.
3. all request form submitted could be viewed as xml file in the document library through "Explorer View"
My quesiton is why I cannot update the item located in the document library, basically open the SPListItem:-
SPSite thisSite = new SPSite("http://server")
{
SPWeb thisWeb = thisSite.OpenWeb("/web")
{
thisSite.AllowUnsafeUpdates = true;
thisWeb.AllowUnsafeUpdates = true;
SPDocumentLibrary library = (SPDocumentLibrary)thisWeb.Lists["DocLib"];
foreach (SPListItem item in library.Items)
{
SPFile file = item.File;
I tried almost all ways I could find:-
item["Customer Name"] = "123456";
item.Update();
// or item.SystemUpdate();
file.Item["Customer Name"] = "123456";
file.Update();
After each update, the value resumed when reopen or visit through the same code lines!
but when I view item properties, the "Last modified" is changed
Last modified at 6/8/2010 12:27 AM by Administrator
This do drive me cray, any help, please.
Thanks & best regards,
Leon
When you publish your form to a list, it asks you to choose the fields to be shown on that list. As you choose the item you want to update, click "Modify". Check the checkbox
at the bottom saying "Allow user to edit data in this field by using a datasheet or property page". This works for me.

Resources