This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 155678 - Object part of EL Read and EL Write expression should be preset and not editable
Summary: Object part of EL Read and EL Write expression should be preset and not editable
Status: NEW
Alias: None
Product: javame
Classification: Unclassified
Component: Visual Designer (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Karol Harezlak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-17 15:45 UTC by Andrei Chistiakov
Modified: 2009-02-19 22:45 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Chistiakov 2008-12-17 15:46:01 UTC
Product Version: NetBeans IDE Dev (Build 200812170242)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb)

To reproduce:
- create Visual MIDlet with HelloMIDlet;
- in Navigator, add a new DataSet;
- switch to Screen, select stringItem element;
- in Properties, open Text custom property editor;
- select dataSet value in Datasets combobox;
- enter mydata.string in EL read entry field, press OK;
- switch to Screen, select stringItem element;
- invoke Go To Source popup menu command;

stringItem getter looks like follows:

    public StringItem getStringItem() {
        if (stringItem == null) {
            // write pre-init user code here
            stringItem = new StringItem("Hello", null);
            DataBinder.registerDataSet(getDataSet(), "dataSet");
            DataBinder.bind("mydata.string", new StringItemBindingProvider(), getStringItem(),
StringItemBindingProvider.FEATURE_TEXT);
            // write post-init user code here
        }
        return stringItem;
    }

The generated code is incorrect because DataBinder.bind method uses "mydata" object name while the registered name of
the dataset is "dataSet". Both names should be the same.

I think user should be restricted somehow while setting up EL Read and EL Write expressions.
Comment 1 Karol Harezlak 2009-01-12 13:08:44 UTC
I agree it could be a problem special for less advanced users. To be honest Expression Language could be sometime very
complex and I'm not able to parse EL Read/Write to check it if it's correct in Runtime. Solution for this problem is to
limit functionality of the EL field just to the simplest use case (like is describe in this issue). I think it'd be the
best to leave current functionality as it is and leave decision about EL fields completely up to user. Anyway this
feature needs to be closely evaluate it. 
Comment 2 Karol Harezlak 2009-01-12 13:10:22 UTC
I made mistake in previous comment instead if "to check it if it's correct in Runtime." should be "to check it if it's
correct in Design Time" I'm sorry.