Hi all,
I've hit a wall.
I know the a4j and rich tags pretty well (I use Seam 2.2.0 and Richfaces 3.3.1). However, I'm trying to do something quite simple, but in a rich:modalPanel.
It seems that rich:modalPanels do not allow Ajax events to be fired. Here's a simple breakdown:
I have a h:selectOneMenu with some items in it and whose value is attached to a backing bean. Attached to that h:selectOneMenu is a a4j:support tag so that whenever the change event is fired, the backing bean should get updated. Truly simple stuff eh?
However, when this h:selectOneMenu is in a rich:modalPanel the onchange event doesn't update the backing bean until the rich:modalPanel closes.
I can confirm this because I'm running it in Eclipse debug mode and I have a breakpoint on the setter of the property that's hooked up to the h:selectOneMenu.
This is driving me mad! This is vanilla stuff for Ajax, but rich:modalPanels don't seem to allow it.
So, the question is: can I do Ajax stuff within a rich:modalPanel? I'm basically trying to use the rich:modalPanel as a form (I've tried a4j:form and h:form to no avail) that reacts to changes to the drop down (e.g. when the user changes the drop down, a certain part of the form should get reRendered). Am I trying to do something that's not possible?
Here's a simplified version of the modalPanel:
<rich:modalPanel id="quickAddPanel">
<div>
<a4j:form id="quickAddPaymentForm" ajaxSubmit="true">
<s:decorate id="paymentTypeDecorator">
<a4j:region>
<h:selectOneMenu
id="paymentType"
required="true"
value="#{backingBean.paymentType}"
tabindex="1">
<s:selectItems
label="#{type.description}"
noSelectionLabel="Please select..."
value="#{incomingPaymentTypes}"
var="type"/>
<s:convertEnum/>
<a4j:support
ajaxSingle="true"
event="onchange"
eventsQueue="paymentQueue"
immediate="true"
limitToList="true"
reRender="paymentTypeDecorator, paymentDetailsOutputPanel, quickAddPaymentForm"/>
</h:selectOneMenu>
</a4j:region>
</s:decorate>
</fieldset>
<fieldset class="standard-form">
<div class="form-title">Payment details</div>
<a4j:outputPanel id="paymentDetailsOutputPanel">
<h:outputText value="This should change whenever dropdown changes: #{backingBean.paymentType}"/>
</a4j:outputPanel>
</fieldset>
</a4j:form>
</div>
</rich:modalPanel>
Regards,
Andy
I'm running into an issue upgrading a project to .Net 4.0...and having trouble finding any reason for the issue (or at least, the change causing it). Given the freshness of 4.0, not a lot of blogs out there for issues yet, so I'm hoping someone here has an idea. Preface: this is a Web Forms application, coming from 3.5 SP1 to 4.0.
In the Application_Start event we're iterating through the SiteMap and constructing routes based off data there (prettifying URLs mostly with some utility added), that part isn't failing though...or at least isn't not getting that far.
It seems that calling the SiteMap.RootNode (inside application_start) causes 4.0 to eat it, since the XmlSiteMapProvider.GetNodeFromXmlNode method has been changed, looking in reflector you can see it's hitting HttpResponse.ApplyAppPathModifier here:
str2 = HttpContext.Current.Response.ApplyAppPathModifier(str2);
HttpResponse wasn't used at all in this method in the 2.0 CLR, so what we had worked fine, in 4.0 though, that method is called as a result of this stack:
[HttpException (0x80004005): Response is not available in this context.]
System.Web.XmlSiteMapProvider.GetNodeFromXmlNode(XmlNode xmlNode, Queue queue)
System.Web.XmlSiteMapProvider.ConvertFromXmlNode(Queue queue)
System.Web.XmlSiteMapProvider.BuildSiteMap()
System.Web.XmlSiteMapProvider.get_RootNode()
System.Web.SiteMap.get_RootNode()
Since Response isn't available here in 4.0, we get an error. To reproduce this, you can narrow the test case down to this in global:
protected void Application_Start(object sender, EventArgs e)
{
var s = SiteMap.RootNode; //Kaboom!
//or just var r = Context.Response;
//or var r = HttpContext.Current.Response;
//all result in the same "not available" error
}
Question: Am I missing something obvious here? Or, is there another event added in 4.0 that's recommended for anything related to SiteMap on startup?
For anyone curious/willing to help, I've created a very minimal project (a default VS 2010 ASP.Net 4.0 site, all the bells & whistles removed and only a blank sitemap and the Application_Start code added). It's a small 10kb zip available here: http://www.ncraver.com/Test/SiteMapTest.zip
Update:
Not a great solution, but the current work-around is to do the work in Application_BeginRequest, like this:
private static bool routesRegistered = false;
protected void Application_BeginRequest(object sender, EventArgs e)
{
if (!routesRegistered)
{
Application.Lock();
if (!routesRegistered) RouteManager.RegisterRoutes(RouteTable.Routes);
routesRegistered = true;
Application.UnLock();
}
}
I don't like this particularly, feels like an abuse of the event to bypass the issue. Does anyone have at least a better work-around, since the .Net 4 behavior with SiteMap is not likely to change?
I just want to open another tab without refreshing and on mouse over like this http://fnagel.github.com/jQuery-Accessible-RIA/Tabs/mouseover.html . Is it possible with these things.
Pages url should be change like as it
now. I want to keep content in separate page
on clicking on another tab it should
open without refreshing
i don't want to open tab content as a
iframe
I liked the idea of this http://jonplante.com/demo/tabs-1-2/?js=on but page url is not changing so other pages cannot be bookmarked
Hi, After the branding of a SharePoint site is done, I mean Site and System masterpages, there are still a few pages that uses the default style. My question is if we can change the master page for that pages too.
Example: http:///_layouts/settings.aspx
always looks like a fresh SharePoint
Hi there. I'm using Qt 4.6.2 and i have problem with QCSS. I have own Q_PROPERTY(QFont myFont READ myFont SET setMyFont). I want to change it with QCSS but it doesn't work. I've tried using normal font syntax but it doesn't work. I've also tried few other combinations like:
qproperty-myFont:
font(serif 20 1 0)
font(serif 20 bold)
QFont(serif 20 1 0)
QFont(serif 20 bold)
QFont(bold 20px serif)
etc.
One way of thinking about this is: if we care about the Design of the code then Easymock is the better choice as it gives feedback to you by its concept of expectations
If we care about the maintainability of tests( easier to read,write and having less brittle tests which are not affected much by change), then Mockito seems a better choice.
My question is:
- If you have used Easymock in large scale projects, do you find that your tests are harder to maintain?
- What are the limitations of Mockito( other than endo testing)
I have only JTabbedPane inside JFrame. JTabbedPane sets its dimensions to biggest page width/height.
As pages has different size is it possible to force JTabbedPane to change its dimensions when selecting other page?
http://grab.by/3hIg
Top one is how it behave now and bottom one is how i want it to behave (i resized frame by hand)
The authlogic rails gem is doing a LOWER in the sql query.
SELECT * FROM `users` WHERE (LOWER(`users`.email) = '[email protected]') LIMIT 1
I want to get rid of the LOWER part since it seems to be slowing down the query by quite a bit.
I'd prefer to just lower the case in the code since this query seems to be expensive.
I'm not sure where to change this behavior in authlogic.
Thanks!
Start with these simple classes...
Let's say I have a simple set of classes like this:
class Bus
{
Driver busDriver = new Driver();
}
class Driver
{
Shoe[] shoes = { new Shoe(), new Shoe() };
}
class Shoe
{
Shoelace lace = new Shoelace();
}
class Shoelace
{
bool tied = false;
}
A Bus has a Driver, the Driver has two Shoes, each Shoe has a Shoelace. All very silly.
Add an IDisposable object to Shoelace
Later I decide that some operation on the Shoelace could be multi-threaded, so I add an EventWaitHandle for the threads to communicate with. So Shoelace now looks like this:
class Shoelace
{
private AutoResetEvent waitHandle = new AutoResetEvent(false);
bool tied = false;
// ... other stuff ..
}
Implement IDisposable on Shoelace
Buit now FxCop will complain: "Implement IDisposable on 'Shoelace' because it creates members of the following IDisposable types: 'EventWaitHandle'."
Okay, I implement IDisposable on Shoelace and my neat little class becomes this horrible mess:
class Shoelace : IDisposable
{
private AutoResetEvent waitHandle = new AutoResetEvent(false);
bool tied = false;
private bool disposed = false;
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
~Shoelace()
{
Dispose(false);
}
protected virtual void Dispose(bool disposing)
{
if (!this.disposed)
{
if (disposing)
{
if (waitHandle != null)
{
waitHandle.Close();
waitHandle = null;
}
}
// No unmanaged resources to release otherwise they'd go here.
}
disposed = true;
}
}
Or (as pointed out by commenters) since Shoelace itself has no unmanaged resources, I might use the simpler dispose implementation without needing the Dispose(bool) and Destructor:
class Shoelace : IDisposable
{
private AutoResetEvent waitHandle = new AutoResetEvent(false);
bool tied = false;
public void Dispose()
{
if (waitHandle != null)
{
waitHandle.Close();
waitHandle = null;
}
GC.SuppressFinalize(this);
}
}
Watch in horror as IDisposable spreads
Right that's that fixed. But now FxCop will complain that Shoe creates a Shoelace, so Shoe must be IDisposable too.
And Driver creates Shoe so Driver must be IDisposable.
and Bus creates Driver so Bus must be IDisposable and so on.
Suddenly my small change to Shoelace is causing me a lot of work and my boss is wondering why I need to checkout Bus to make a change to Shoelace.
The Question
How do you prevent this spread of IDisposable, but still ensure that your unmanaged objects are properly disposed?
I'm trying to count the number of times that text is changed in a given RichEdit control. I considered using events like key down, but that gets messy when you consider keys that don't change the text (like arrows, page up, etc). And how do you make sure you get all of those keys?
It seems it would be simpler to register a callback for a onTextChanged event, if one exists. Is there any way to do something like that?
I'm looking for an idea to write an ISI paper.
till now,I'm thinking to write something about Formal Methods but I'm not sure. So What do you suggest I want to change the subject and still looking for new ideas.
What is a good subject for an ISI paper
Is there any facility in Django for doing currency conversions? Obviously, rates change day by day but I'm somewhat hopeful that the locale module has some sort of web-service based converter :P
There's a snippet here that handles the formatting: http://www.djangosnippets.org/snippets/552/ But I need to localize the values first.
in visual studio 2005 how can i save whats written to the out put window to file (i cant change the code writing to the output window and it writes a lot i just want to save the output window content to file)
thank you
Arik
I generate htm files dynamically using php and .htaccess. I read somewhere that I should remove Etags for files of type text/html? Is that correct? I am wondering if I use etags and If i don't change the content, I could save some bandwidth. I would appreciate if you guys could tell me if I can use etags for htm files.
First, I create my database.
create database mydb;
I add "south" to installed Apps. Then, I go to this tutorial: http://south.aeracode.org/docs/tutorial/part1.html
The tutorial tells me to do this:
$ py manage.py schemamigration wall --initial
>>> Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate wall
Great, now I migrate.
$ py manage.py migrate wall
But it gives me this error...
django.db.utils.DatabaseError: (1146, "Table 'fable.south_migrationhistory' doesn't exist")
So I use Google (which never works. hence my 870 questions asked on Stackoverflow), and I get this page: http://groups.google.com/group/south-users/browse_thread/thread/d4c83f821dd2ca1c
Alright, so I follow that instructions
>> Drop database mydb;
>> Create database mydb;
$ rm -rf ./wall/migrations
$ py manage.py syncdb
But when I run syncdb, Django creates a bunch of tables. Yes, it creates the south_migrationhistory table, but it also creates my app's tables.
Synced:
> django.contrib.admin
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.sessions
> django.contrib.sites
> django.contrib.messages
> south
> fable.notification
> pagination
> timezones
> fable.wall
> mediasync
> staticfiles
> debug_toolbar
Not synced (use migrations):
-
(use ./manage.py migrate to migrate these)
Cool....now it tells me to migrate these. So, I do this:
$ py manage.py migrate wall
The app 'wall' does not appear to use migrations.
Alright, so fine. I'll add wall to initial migrations.
$ py manage.py schemamigration wall --initial
Then I migrate:
$ py manage.py migrate wall
You know what? It gives me this BS:
_mysql_exceptions.OperationalError: (1050, "Table 'wall_content' already exists")
Sorry, this is really pissing me off. Can someone help ? thanks.
How do I get South to work and sync correctly with everything?
hello i want to develop AI car(opponent) in car race game what should be my direction to develop them with less complexity because i don't have any idea. because the player car is moving on the scrolling track plz suggest me should i have to use relative motion or way point concept but that should also be change on the scrolling track (i.e. player car movement)
Example:
SELECT id, name FROM user WHERE id IN (1,2,3,4,5)
ORDER BY FIELD(id, 2, 3, 4, 1, 5)
I've seen some examples using FIND_IN_SET() or FIELD() functions. Which one is better? Are there any more efficient approaches?
Order is supposed to change rarely.
Hi,
when upload an image is stored in tmp folder, but because i am in shared hosting i can not change the upload_dir in php.ini.
Is it possible after image store in common tmp folder show it to user
<img src="path to tmp folder" />
(Which is the path to tmp folder)
Thanks
Hello sir I am new to the jsp and ajax world. my problem is
If i select one combo option then it should change the other combo options dynamically without submit button press.
for example if i select the country then it should shows their states in other combo.
I am using servlet & JSP and MS-ACCESS as backend. please reply as soon as possible.
THANKING YOU....
Hello All,
I m not able to change the locale of django -admin when i switch to different locale from browser.But if i mention in my settings.py the language code then it is working but browser locale doesnot have any impact on it
#setting.py
LANGUAGES = (
('ar', gettext_noop('Arabic')),
('ja', gettext_noop('japanese')),
('bg', gettext_noop('Bulgarian')),
LANGUAGE_CODE = ''#
LANGUAGE_COOKIE_NAME = 'django_language'
LOCALE_PATHS = ()
I got two Comboboxes and both of them have binding with the same Source.
<ComboBox ItemsSource="{Binding Source={StaticResource UsersViewSource}}"
And when I change something in the first one, it reflects also to the second one. And I dunno how to keep their SelectedItem values separately, using the same ItemsSource.