Display logic in Openbravo - openbravo

I just wanna know, if it is possible to use sql/hql statements for a field's Display Logic in Openbravo? I have a field, as check box in a window say, position. In another window, I have a field say manager. Now I need to display the manager field only if position is checked. For some reasons, position is not stored in the session. How can I achieve this ? Share your ideas.

You can use Auxiliary Inputs to "inject" new session variables into a screen and to defined the value for these you can use SQL.

1) You can have position field within window where manager field present, but displayed = no
(with same name or different name, used to carry value)
2) When position field checked on 'Position' window, update position field on other window i.e where manager field present
(You may try with eventhandler or trigger, since in position window once position field is checked, it triggers save action)
3) Use #position# = 'Y' syntax (within manager field contained window)

Related

Browser Based Application on IE a spying issue on blue prism. Element gets off screen and bp can't highlight

I am using citrix vdi to read an element on webpage. It is able to highlight and read the value in open vdi but in close vdi layout of webpage messes up and element i need went out of bound/off screen from webpage. I have tried minimize and maximize before reading value but invain. I also tried html mode and AA still cannot read it. In html mode i kept only path attribute for element, value remains exactly same on close and open vdi. The only difference i have notice is width of div in which element resides. Div width changes in open 1921and close 1203 which i assume push element out of screen bounds. Any help will be appreciated.
When working with Blue Prism don’t rely on initial attribute set. You need to choose as few attributes as possible to uniquely identify element. You should always untick attributes that are empty or it’s value it’s “Self” (for example Element ID attribute tends to have such value which doesn’t mean anything). Generally, attributes connected with elements position on the screen or its size are not helpful, because it may be easily affected.
When working with HTML spy mode your elements don’t need to be visible on screen to interact with them (unless you are using surface automation techniques), HTML elements don’t have any Visible or Screen Visible attributes.
Try to use attributes like:
Tag Name
Class Name
ID
If Value has always particular text, use wildcard type of match: text
Path attribute is not always the best choice as it might change because web page is dynamic or application update mess up the layout. If you won’t be able to identify element any other way, make sure you use Path as Dynamic match type & store it as environmental variable, so it could be easily adjusted if needed.
If you have problems reading value using “Get Current Value”, try “Get HTML Attribute” in Read stage options & try “Value” or “Title” as an Input.

How can I force read updates in all Smart Panel fields before reading it after a user updates and closes it?

I have a smart panel where I preset a default value for a field within it. If the user changes the value of that field, when the popup is closed, the value remains the old, preset value. I've had this happen in two separate instances: one regarding setting a time and one regarding selectors. The fields are set to commit changes = true. Is there any way to force the code to grab the new value set by the user instead of keeping the value set before displaying the smart panel popup?
Example:
Smart panel has a view called Option. OptionA will be set to something before the popup is executed. After the popup is closed by the user, even if the user changed the selector's value, the code will see the originally set value to OptionA set programmatically before the popup was executed.
Option.Current.AOption = 10;
if (Option.AskExt(true) == WebDialogResult.OK)
{
//This will display the original value
Document.Ask(Option.Current.OptionA, MessageButtons.OK)
}
Initial popup:
User changed:
Popup after closing and executing Document.Ask():

Blue Prism Write to Web Client

Has anyone had any problems writing data to a web client data field?
Having spied the field to be written in, the write action correctly writes the value from the data item into the web field. We then "Save" the value in the field by clicking the Save button. This is when the value reverts back to the value that was previously in the field and does not save the new value.
Copying the value from the data item and pasting it directly into the web field and hitting save works fine, but for some reason when Blue Prism does the write action and then save, the new value is not saved.
Any suggestions?
This is probably due to the way the web application is coded - specifically, the data in the box is not acknowledged until a keydown event (or similar) is fired. When you copy/paste the data into the field, it fires a similar event where it believes the user to have interacted with the field.
The solution for this type of field is to use the Send Keys or Global Send Keys functionalities of Blue Prism to send the desired text.
It happens when the target application uses java script events to sense the changes in the element. To handle this , you have to use the send keys in following format.
1. Focus the application / Control
2. Send Global mouse click centre to the element
3. Send "Sendkeys" to the application now.
4. Focus a dummy element in the page to let the page sense your input.
If the old value is already higlighted when the spied field is selected, try getting BP to delete it first, then paste in the new value, then click on the field again, then save. If this doesn't work, then uncheck the URL attribute of the application model you are using for the spied field and try this again.

How do I add or rename $Comment property for xpage or custom control

In version 9.0.1fp4, when creating a new XPage or Custom Control you have the option of adding a comment. It then creates a Properties field, "$Comment" which is attached to the element. I can't find a way, using Designer, to modify that field after creating it. I'm pretty sure there's a programmatic way to get to the field, but I'm just looking for a simple way of changing. Rename will change the element name, but not give access to $Comment.
It's awkward, but you can edit it from the XPage or CC list. Position the cursor at the start of the non-demarcated Comments column (just below the left edge of the "C" in the header), click, and wait a few seconds.

Automatically open document when only one document is listed in repeat control

I have a repeat control for a domino view which displays the results from a search field.
As you type more characters into the search field the number of items in the list is reduced. If/When the the list only contains a single item I would like to open item automatically, without having to click the link.
Any ideas are appreciated.
Edit: after some very interesting responses, here are some screenshots
I have 3 elements on the page, a searchbar, a repeat control and a form:
When I start typing in the search bar, the repeat is refreshed with every keystroke:
the list is reduced, typing the next character ...
again the list is reduced, only 2 left, typing again....
Only one left, now it would be time to open the document in the form ..... without clicking the link.
I've tried several events on the page, but it seems that I could not find the one that will allow me to "select" the document and display the data in the form.
It seems that it's not as simple as I thought
Since you want to open the link automatically I don't know if I would try to base it on the getRowCount() of the repeat itself. You don't want to even get that far right? you just want to go to the single document.
I would put a function in beforePageLoad event maybe. Not totally sure which event but I'd try that first. Use SSJS and do a lookup that would basically return a collection of what the repeat would show. If the collection count = 1 then get your destination from that entry and do your redirection from there.
That what I would try at least. Interesting scenario!
Now that I see the screenshots this might be easier then you think and I have already implemented something similar on an internal application that I have built. It does rely on the fact that each entry in the list is 100% unique.
First of all you will need to bind the search field to a scoped variable and the onchange/onkeypress event will need to perform a partial refresh of a panel that contains both the list and the document portion of the page.
For the list the link on each item should set the value of the same scoped variable used in the search box and clicking the link should be set to run a partial refresh of the document area.
For the document area you will need two panels, the first panel will only display if there is no matching document and the second panel will only display if there is a matching document, you can do this in the rendered section by writing some ssjs that grabs a handle to the db/view and does a dblookup and returns either true or false if the document exists depending on panel your dealing with.
With this setup, when somebody clicks a link or fills out the searchbox the scoped variable will contain a value, the document panels will then check to see if this is a unique value in the view in the db and update themselves to either display the 'no document' panel or the 'document' panel accordingly.
You could add a evaluation script to the entry of your repeat control which checks the size of your repeat control using the method getRowCount() from the component. If this is 1 you could execute a context.redirectToPage("yourpage.xsp?id=yourid",true) this forces the current page to send a redirect request back to the browser and therefore redirects you to the correct page.
All you need to know is which xpage you need to open and which parameters you should use. But these could be retrieved from the content you are iterating over.

Resources