Struts how to insert bean:write in bean:message arguments - struts

I try to do that, but it does not work.
<logic:present name="MEMBER" >
<bean:message key="member.registerConfirmation" arg0='<bean:write name="MEMBRE_REGISTER" property="firstname"/>' arg1='<bean:write name="MEMBRE_REGISTER" property="lastname"/>'/>
</logic:present>
and bean:message contain:
member.registerConfirmation = Congratulations {0} {1}, you are in !

Try EL with bean:message
Something like this.
<bean:message key="member.registerConfirmation" arg0='${MEMBRE_REGISTER.firstname}' arg1='${MEMBRE_REGISTER.lastname}'/>

Related

using Regex in gedit for search and replace

I want to replace all occurring characters after comma with );
in a text like this:
mapMessage.getString("obj_file_path", user_ftp_path + app_path);
mapMessage.getString("storeid", storeid+"");
mapMessage.getString("name_farsi", name_farsi);
mapMessage.getString("name_english", name_english);
mapMessage.getString("group", group+"");
mapMessage.getString("price", app_price+"");
mapMessage.getString("icon", icon);
mapMessage.getString("app_path", app_path);
mapMessage.getString("desc_farsi", desc_farsi);
mapMessage.getString("desc_english", desc_english);
mapMessage.getString("isfarsi", isfarsi);
mapMessage.getString("tags", tags);
mapMessage.getString("shot1", shot1);
mapMessage.getString("shot2", shot2);
mapMessage.getString("shot3", shot3);
mapMessage.getString("shot4", shot4);
mapMessage.getString("shot5", shot5);
mapMessage.getString("changes_fa", changes_fa);
mapMessage.getString("changes_en", changes_en);
mapMessage.getString("upload_real_address", upload_real_address);
mapMessage.getString("apk_upload", apk_upload);
mapMessage.getString("app_upload_valid_shot", app_upload_valid_shot);
so after the replace was done for example the first line should looks like:
mapMessage.getString("obj_file_path");
I think all you need is to do a search-and-replace for ,.*$ with );
Make sure the "Regular expression" checkbox is selected.

How to write value to input field

I am getting element with
var nameEl = document.getElementById("<portlet:namespace />kategorijaName");
that is input field.How can i write some text in it ?
Since the question (at this time) is tagged liferay and alloy-ui, I am assuming an answer using/appropriate for those two tags would be beneficial
<aui:input id='textFieldId' name='textFieldName' label='My Text Field'></aui:input>
<script>
AUI().use('node', function(A){
A.one('#<portlet:namespace/>textFieldId').set('value', "A new input value");
});
</script>
if you are using normal javascript then you can use below for setting a value in input text
document.getElementById("<portlet:namespace />kategorijaName").value = 'some value';
in case of Jquery you can use
$("#<portlet:namespace />kategorijaName").val("some value");
If you are using alloy-ui then you can set value like this
<aui:script>
A.one('#<portlet:namespace />kategorijaName').set('value',kategorijaName);
</aui:script>
nameEl.value = "value you need"

Select elements using Selenium Webdriver PHP?

I have a number of page elements that I want to store in a variable and loop through using Selenium Webdriver PHP.
For example:
< cite > Name 1 < /cite >
< cite > Name 2 < /cite >
<cite > Name 3< /cite >
I am using the following code, but it doest give me the results from above(i.e. Name 1) etc. How do I grab the text from the element using Selenium Webdriver.
$users = $driver->findElements(
WebDriverBy::xpath('//cite')
)->getText();
foreach($users as $u)
{
echo $u;
}
I am using Selenium Webdriver Facebook wrapper
I don't really know PHP, but in Java, you'd do something similar to:
List<WebElement> elements = driver.findElements(By.xpath("//cite"));
for (WebElement element: elements) {
System.out.println(element.getText());
}
Given that, I'd assume that the PHP equivalent would be something like this:
$users = $driver->findElements(WebDriverBy::xpath('//cite'));
foreach($users as $u)
{
echo $u->getText();
}
JimEvan's answer is correct. If you're getting a "non-object" type error, you should check to make sure the findElements() call is actually returning something:
$users = $driver->findElements(WebDriverBy::xpath('//cite'));
fwrite(STDOUT, "Number of users: " . count($users));
Perhaps it has something to do with the space characters in your element tags (just a guess)?
Correct Code is.
$users = $driver->findElements(WebDriverBy::xpath('//cite')); foreach($users as $u) {echo $u->getText();}

vb - I am trying to print other form but this happens:

(this is my first post so correct me if I'm doing something wrong.)
Here is a bit of my code:
imp.id.Text = globalvars.mdataset.Tables("table1").Rows(0).Item("id")
imp.date.Text = globalvars.mdataset.Tables("table1").Rows(0).Item("date")
imp.hour.Text = globalvars.mdataset.Tables("table1").Rows(0).Item("hour").ToString
imp.PrintForm1.PrinterSettings.DefaultPageSettings.Margins = New Printing.Margins(10, 10, 10, 10)
imp.Show()
imp.Focus()
imp.PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
imp.PrintForm1.Print()
and what happens is that when it gives me the preview the page is empty... but the weird thing is that when i place a msgbox just before the printing action, the preview goes right and shows me what i want to print....
any tips?
EDIT: imp is the form where the printform is
Try to add this ..
....
Application.DoEvents
imp.PrintForm1.Print()

Silverstripe sql debug

How can I use OR with filter method e.g:
$entries = BookstoreBook::get()
->filter(array(
'Title:PartialMatch' => $searchString
));)
Field:PartialMatch is the way I found to use LIKE for string matching.
what about:
$entries = BookstoreBook::get()
->filter(array(
'Title:PartialMatch' => array($searchString, $anotherString)
));
You can use FilterAny for OR:
$objects = $Object::get()->filterAny(array("Title"=>"Something","ID"=>"SomethingElse"));
You would also use a where if you HAD to:
$objects = $Object::get()->where("Title='Something' OR ID='SomethingElse'");
The relationship call also includes a where in the first parameter:
$objects = $Object::get("Title='Something' OR ID='SomethingElse'");
Any lastly, you can do a filter + a where, if you needed to, in some weird "I dont think youll ever find" situation:
$objects = $Object::get()->filter(array())->where();
;)